#
# Password syncronization for samba servers acting as PDC
# in NIS (YELLOW PAGES) environment
#
# IMPORTANT: The primary domain controler (PDC) host must be
#            also the NIS server.
#
# This program should be called from samba, to do so you
# must set some options on Global section of you smb.conf:
# 
# unix password sync = yes
# passwd program = smb2nis %u
#
# IMPORTANT: the "passwd program" option requires a full path
#
# When a user tries to change the password on the windows 
# environment samba will call first this program, only after
# success in this step samba will change the password in file
# smbpasswd.
#
# This program is called as root by samba and will read twice
# the new password, the new password is then encrypted (hashed)
# and placed in the YP passwd source file. Finaly a special 
# pwupdate is called to update the NIS database.
# A semaphore is used to grant mutual exclusion of these process.
#
# COMPILING: On some systems you may have to switch the comment on 
# the gcc lines bellow
#
all: smb2nis

smb2nis : smb2nis.c
#	gcc -Wall -o smb2nis smb2nis.c
	gcc -Wall -lcrypt -o smb2nis smb2nis.c
	@strip smb2nis

clean:
	@rm -f core *.o

realclean:
	@rm -f core *.o smb2nis
	
