From eff91556a32fb932b6c753a14be8e3e8e52a0be5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 22 Aug 2003 18:00:17 +0000 Subject: * Fix for bug 290: smbadduser must obeys the paths from configure options * Try to get libsmbclient files installed during 'make install' Still one outstanding problem with static lib. INSTALLCLIENTCMD_A is not getting set correctly. (This used to be commit 50ab28bd2524187b851732176553382fb811a051) --- source3/Makefile.in | 2 +- source3/configure.in | 6 +++- source3/smbadduser | 73 ----------------------------------------------- source3/smbadduser.in | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 75 deletions(-) delete mode 100755 source3/smbadduser create mode 100644 source3/smbadduser.in (limited to 'source3') diff --git a/source3/Makefile.in b/source3/Makefile.in index c08dacaaad..940c431ed0 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -1137,7 +1137,7 @@ bin/t_push_ucs2@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_push_ucs2.o bin/t_snprintf@EXEEXT@: lib/snprintf.c $(CC) $(FLAGS) -o $@ -DTEST_SNPRINTF lib/snprintf.c -lm -install: installbin installman installscripts installdat installswat installmodules +install: installbin installman installscripts installdat installswat installmodules @INSTALLCLIENT@ install-everything: install installmodules diff --git a/source3/configure.in b/source3/configure.in index a94f7d9e86..241c6ec76f 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -145,6 +145,7 @@ AC_SUBST(PICFLAG) AC_SUBST(PICSUFFIX) AC_SUBST(POBAD_CC) AC_SUBST(SHLIBEXT) +AC_SUBST(INSTALLCLIENT) AC_SUBST(INSTALLCLIENTCMD_SH) AC_SUBST(INSTALLCLIENTCMD_A) AC_SUBST(LIBSMBCLIENT_SHARED) @@ -3144,6 +3145,7 @@ AC_ARG_WITH(manpages-langs, INSTALLCLIENTCMD_SH=: INSTALLCLIENTCMD_A=: +INSTALLCLIENT= LIBSMBCLIENT_SHARED= LIBSMBCLIENT= AC_MSG_CHECKING(whether to build the libsmbclient shared library) @@ -3167,6 +3169,7 @@ AC_ARG_WITH(libsmbclient, INSTALLCLIENTCMD_A="\$(INSTALLCMD)" LIBSMBCLIENT=libsmbclient fi + INSTALLCLIENT=installclietlib ;; esac ], [ @@ -3184,6 +3187,7 @@ AC_ARG_WITH(libsmbclient, INSTALLCLIENTCMD_A="\$(INSTALLCMD)" LIBSMBCLIENT=libsmbclient fi] + INSTALLCLIENT=installclientlib ) @@ -4061,7 +4065,7 @@ dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS CFLAGS_REMOVE_USR_INCLUDE(CFLAGS) CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS) -AC_OUTPUT(include/stamp-h Makefile script/findsmb) +AC_OUTPUT(include/stamp-h Makefile script/findsmb smbadduser) ################################################# # Print very concise instructions on building/use diff --git a/source3/smbadduser b/source3/smbadduser deleted file mode 100755 index 9837413aeb..0000000000 --- a/source3/smbadduser +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/csh -# -# smbadduser - Written by Mike Zakharoff -# -unalias * -set path = ($path /usr/local/samba/bin) - -set smbpasswd = /usr/local/samba/private/smbpasswd -#set smbpasswd = /etc/samba/smbpasswd -set user_map = /usr/local/samba/lib/users.map -#set user_map = /etc/samba/smbusers -# -# Set to site specific passwd command -# -set passwd = "cat /etc/passwd" -#set passwd = "niscat passwd.org_dir" -#set passwd = "ypcat passwd" - -set line = "----------------------------------------------------------" -if ($#argv == 0) then - echo $line - echo "Written: Mike Zakharoff email: michael.j.zakharoff@boeing.com" - echo "" - echo " 1) Updates $smbpasswd" - echo " 2) Updates $user_map" - echo " 3) Executes smbpasswd for each new user" - echo "" - echo "smbadduser unixid:ntid unixid:ntid ..." - echo "" - echo "Example: smbadduser zak:zakharoffm johns:smithj" - echo $line - exit 1 -endif - -touch $smbpasswd $user_map -set new = () -foreach one ($argv) - echo $one | grep ':' >& /dev/null - if ($status != 0) then - echo "ERROR: Must use unixid:ntid like -> zak:zakharoffm" - continue - endif - set unix = `echo $one | awk -F: '{print $1}'` - set ntid = `echo $one | awk -F: '{print $2}'` - - set usr = `eval $passwd | awk -F: '$1==USR {print $1}' USR=$unix` - if ($#usr != 1) then - echo "ERROR: $unix Not in passwd database SKIPPING..." - continue - endif - set tmp = `cat $smbpasswd | awk -F: '$1==USR {print $1}' USR=$unix` - if ($#tmp != 0) then - echo "ERROR: $unix is already in $smbpasswd SKIPPING..." - continue - endif - - echo "Adding: $unix to $smbpasswd" - /usr/bin/smbpasswd -a -n $unix - if ($unix != $ntid) then - echo "Adding: {$unix = $ntid} to $user_map" - echo "$unix = $ntid" >> $user_map - endif - set new = ($new $unix) -end - -# -# Enter password for new users -# -foreach one ($new) - echo $line - echo "ENTER password for $one" - smbpasswd $one -end diff --git a/source3/smbadduser.in b/source3/smbadduser.in new file mode 100644 index 0000000000..05da7de08e --- /dev/null +++ b/source3/smbadduser.in @@ -0,0 +1,79 @@ +#!/bin/csh +# +# smbadduser - Written by Mike Zakharoff +# + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +LIBDIR=@libdir@ +PRIVATEDIR=@privatedir@ +CONFIGDIR=@configdir@ + +unalias * +set path = ($path /usr/local/samba/bin) + +set smbpasswd = $PRIVATEDIR/smbpasswd +set user_map = $CONFIGDIR/users.map + +# +# Set to site specific passwd command +# +set passwd = "cat /etc/passwd" +#set passwd = "niscat passwd.org_dir" +#set passwd = "ypcat passwd" + +set line = "----------------------------------------------------------" +if ($#argv == 0) then + echo $line + echo "Written: Mike Zakharoff email: michael.j.zakharoff@boeing.com" + echo "" + echo " 1) Updates $smbpasswd" + echo " 2) Updates $user_map" + echo " 3) Executes smbpasswd for each new user" + echo "" + echo "smbadduser unixid:ntid unixid:ntid ..." + echo "" + echo "Example: smbadduser zak:zakharoffm johns:smithj" + echo $line + exit 1 +endif + +touch $smbpasswd $user_map +set new = () +foreach one ($argv) + echo $one | grep ':' >& /dev/null + if ($status != 0) then + echo "ERROR: Must use unixid:ntid like -> zak:zakharoffm" + continue + endif + set unix = `echo $one | awk -F: '{print $1}'` + set ntid = `echo $one | awk -F: '{print $2}'` + + set usr = `eval $passwd | awk -F: '$1==USR {print $1}' USR=$unix` + if ($#usr != 1) then + echo "ERROR: $unix Not in passwd database SKIPPING..." + continue + endif + set tmp = `cat $smbpasswd | awk -F: '$1==USR {print $1}' USR=$unix` + if ($#tmp != 0) then + echo "ERROR: $unix is already in $smbpasswd SKIPPING..." + continue + endif + + echo "Adding: $unix to $smbpasswd" + /usr/bin/smbpasswd -a -n $unix + if ($unix != $ntid) then + echo "Adding: {$unix = $ntid} to $user_map" + echo "$unix = $ntid" >> $user_map + endif + set new = ($new $unix) +end + +# +# Enter password for new users +# +foreach one ($new) + echo $line + echo "ENTER password for $one" + smbpasswd $one +end -- cgit