[SCM] Samba Shared Repository - branch master updated

Pavel Filipensky pfilipensky at samba.org
Fri Jul 8 10:00:01 UTC 2022


The branch, master has been updated
       via  c4c086ecc00 s4:utils: Reformat shell scripts
       via  beaac6bb2bf s4:torture: Reformat shell scripts
       via  8e2f5020cdd s4:scripting: Reformat shell scripts
       via  d82c0991b92 s4:script: Reformat shell scripts
       via  bf9b2d7ae1c s4:librpc: Reformat shell scripts
       via  20f63b79665 s4:client: Reformat shell scripts
      from  b8f3d8d052c smbd: if close fails just log it, don't crash

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c4c086ecc00899741d114e6dc51b5cfcfd1d0707
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 23 12:04:57 2022 +0100

    s4:utils: Reformat shell scripts
    
    shfmt -f source4/utils/ | xargs shfmt -w -p -i 0 -fn
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>
    
    Autobuild-User(master): Pavel Filipensky <pfilipensky at samba.org>
    Autobuild-Date(master): Fri Jul  8 09:59:19 UTC 2022 on sn-devel-184

commit beaac6bb2bf8a45b7b9ef951f54710be948318f4
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 23 12:04:28 2022 +0100

    s4:torture: Reformat shell scripts
    
    shfmt -f source4/torture/ | xargs shfmt -w -p -i 0 -fn
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 8e2f5020cdd3d84b60f0362f57f2bd30ad21a865
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 23 12:01:51 2022 +0100

    s4:scripting: Reformat shell scripts
    
    shfmt -f source4/scripting/ | xargs shfmt -w -p -i 0 -fn
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit d82c0991b9272f95c3e0a94995e77654e96ab612
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 23 12:01:32 2022 +0100

    s4:script: Reformat shell scripts
    
    shfmt -f source4/script/ | xargs shfmt -w -p -i 0 -fn
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit bf9b2d7ae1c3fd1d56c52c776d1bc0002e325e7e
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 23 12:01:11 2022 +0100

    s4:librpc: Reformat shell scripts
    
    shfmt -f source4/librpc/ | xargs shfmt -w -p -i 0 -fn
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 20f63b7966538694263c74e8e1184f8347b66979
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 23 11:59:24 2022 +0100

    s4:client: Reformat shell scripts
    
    shfmt -f source4/client/ | xargs shfmt -w -p -i 0 -fn
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source4/client/tests/test_cifsdd.sh         |  66 ++++++++--------
 source4/client/tests/test_smbclient.sh      | 113 ++++++++++++++-------------
 source4/librpc/scripts/build_idl.sh         |  28 +++----
 source4/script/find_unused_options.sh       |  26 +++----
 source4/scripting/bin/ktpass.sh             | 117 +++++++++++++++++-----------
 source4/scripting/bin/setup_dns.sh          |  16 ++--
 source4/scripting/devel/drs/revampire_ad.sh |  10 +--
 source4/scripting/devel/drs/unvampire_ad.sh |   4 +-
 source4/scripting/devel/drs/vampire_ad.sh   |  10 +--
 source4/scripting/devel/nmfind              |  10 +--
 source4/scripting/devel/rebuild_zone.sh     |  66 ++++++++--------
 source4/scripting/devel/tmpfs.sh            |   6 +-
 source4/scripting/devel/watch_servers.sh    |   4 +-
 source4/torture/tests/test_gentest.sh       |  10 +--
 source4/torture/tests/test_locktest.sh      |   8 +-
 source4/torture/tests/test_masktest.sh      |   8 +-
 source4/utils/tests/test_nmblookup.sh       |   5 +-
 source4/utils/tests/test_samba_tool.sh      |   7 +-
 source4/utils/tests/test_smbclient.sh       |   5 +-
 19 files changed, 276 insertions(+), 243 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/client/tests/test_cifsdd.sh b/source4/client/tests/test_cifsdd.sh
index 404cb4688fa..21a884061bf 100755
--- a/source4/client/tests/test_cifsdd.sh
+++ b/source4/client/tests/test_cifsdd.sh
@@ -3,10 +3,10 @@
 # Basic script to make sure that cifsdd can do both local and remote I/O.
 
 if [ $# -lt 4 ]; then
-cat <<EOF
+	cat <<EOF
 Usage: test_cifsdd.sh SERVER USERNAME PASSWORD DOMAIN
 EOF
-exit 1;
+	exit 1
 fi
 
 SERVER=$1
@@ -14,7 +14,7 @@ USERNAME=$2
 PASSWORD=$3
 DOMAIN=$4
 
-. `dirname $0`/../../../testprogs/blackbox/subunit.sh
+. $(dirname $0)/../../../testprogs/blackbox/subunit.sh
 
 samba4bindir="$BINDIR"
 DD="$samba4bindir/cifsdd"
@@ -22,16 +22,18 @@ DD="$samba4bindir/cifsdd"
 SHARE=tmp
 DEBUGLEVEL=1
 
-runcopy() {
+runcopy()
+{
 	message="$1"
 	shift
-	
+
 	testit "$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \
-	    "$@" || failed=`expr $failed + 1`
+		"$@" || failed=$(expr $failed + 1)
 }
 
-compare() {
-    testit "$1" cmp "$2" "$3" || failed=`expr $failed + 1`
+compare()
+{
+	testit "$1" cmp "$2" "$3" || failed=$(expr $failed + 1)
 }
 
 sourcefile=tempfile.src.$$
@@ -40,33 +42,33 @@ destfile=tempfile.dst.$$
 destpath=${SELFTEST_TMPDIR}/$destfile
 
 # Create a source file with arbitrary contents
-dd if=$DD of=$sourcepath bs=1024 count=50 > /dev/null
+dd if=$DD of=$sourcepath bs=1024 count=50 >/dev/null
 
 ls -l $sourcepath
 
-for bs in 512 4k 48k ; do
-
-echo "Testing $bs block size ..."
-
-# Check whether we can do local IO
-runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs
-compare "Checking local differences" $sourcepath $destpath
-
-# Check whether we can do a round trip
-runcopy "Testing local -> remote copy" \
-	    if=$sourcepath of=//$SERVER/$SHARE/$sourcefile bs=$bs
-runcopy "Testing remote -> local copy" \
-	    if=//$SERVER/$SHARE/$sourcefile of=$destpath bs=$bs
-compare "Checking differences" $sourcepath $destpath 
-
-# Check that copying within the remote server works
-runcopy "Testing local -> remote copy" \
-	    if=//$SERVER/$SHARE/$sourcefile of=//$SERVER/$SHARE/$sourcefile bs=$bs
-runcopy "Testing remote -> remote copy" \
-	    if=//$SERVER/$SHARE/$sourcefile of=//$SERVER/$SHARE/$destfile bs=$bs
-runcopy "Testing remote -> local copy" \
-	    if=//$SERVER/$SHARE/$destfile of=$destpath bs=$bs
-compare "Checking differences" $sourcepath $destpath
+for bs in 512 4k 48k; do
+
+	echo "Testing $bs block size ..."
+
+	# Check whether we can do local IO
+	runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs
+	compare "Checking local differences" $sourcepath $destpath
+
+	# Check whether we can do a round trip
+	runcopy "Testing local -> remote copy" \
+		if=$sourcepath of=//$SERVER/$SHARE/$sourcefile bs=$bs
+	runcopy "Testing remote -> local copy" \
+		if=//$SERVER/$SHARE/$sourcefile of=$destpath bs=$bs
+	compare "Checking differences" $sourcepath $destpath
+
+	# Check that copying within the remote server works
+	runcopy "Testing local -> remote copy" \
+		if=//$SERVER/$SHARE/$sourcefile of=//$SERVER/$SHARE/$sourcefile bs=$bs
+	runcopy "Testing remote -> remote copy" \
+		if=//$SERVER/$SHARE/$sourcefile of=//$SERVER/$SHARE/$destfile bs=$bs
+	runcopy "Testing remote -> local copy" \
+		if=//$SERVER/$SHARE/$destfile of=$destpath bs=$bs
+	compare "Checking differences" $sourcepath $destpath
 
 done
 
diff --git a/source4/client/tests/test_smbclient.sh b/source4/client/tests/test_smbclient.sh
index 5560c55d90b..1d87f90e601 100755
--- a/source4/client/tests/test_smbclient.sh
+++ b/source4/client/tests/test_smbclient.sh
@@ -4,10 +4,10 @@
 # Copyright (C) 2006-2007 Andrew Bartlett <abartlet at samba.org>
 
 if [ $# -lt 5 ]; then
-cat <<EOF
+	cat <<EOF
 Usage: test_smbclient.sh SERVER USERNAME PASSWORD DOMAIN PREFIX SMBCLIENT
 EOF
-exit 1;
+	exit 1
 fi
 
 SERVER=$1
@@ -19,9 +19,10 @@ smbclient=$6
 shift 6
 failed=0
 
-. `dirname $0`/../../../testprogs/blackbox/subunit.sh
+. $(dirname $0)/../../../testprogs/blackbox/subunit.sh
 
-runcmd() {
+runcmd()
+{
 	name="$1"
 	cmd="$2"
 	shift
@@ -37,112 +38,112 @@ runcmd() {
 	return $status
 }
 
-testit "share and server list" $VALGRIND $smbclient -L $SERVER $CONFIGURATION  -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`
+testit "share and server list" $VALGRIND $smbclient -L $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=$(expr $failed + 1)
 
-testit "share and server list anonymously" $VALGRIND $smbclient -N -L $SERVER $CONFIGURATION $@ || failed=`expr $failed + 1`
+testit "share and server list anonymously" $VALGRIND $smbclient -N -L $SERVER $CONFIGURATION $@ || failed=$(expr $failed + 1)
 
 # Use the smbclient binary as our test file
 cat $smbclient >$PREFIX/tmpfile
 
 # put that file
-runcmd "MPutting file" "lcd $PREFIX; mput tmpfile" || failed=`expr $failed + 1`
+runcmd "MPutting file" "lcd $PREFIX; mput tmpfile" || failed=$(expr $failed + 1)
 # check file info
-runcmd "Getting alternative name" 'altname tmpfile'|| failed=`expr $failed + 1`
+runcmd "Getting alternative name" 'altname tmpfile' || failed=$(expr $failed + 1)
 # run allinfo on that file
-runcmd "Checking info on file" 'allinfo tmpfile'|| failed=`expr $failed + 1`
+runcmd "Checking info on file" 'allinfo tmpfile' || failed=$(expr $failed + 1)
 # get that file
 mv $PREFIX/tmpfile $PREFIX/tmpfile-old
-runcmd "MGetting file" "lcd $PREFIX; mget tmpfile" || failed=`expr $failed + 1`
+runcmd "MGetting file" "lcd $PREFIX; mget tmpfile" || failed=$(expr $failed + 1)
 # remove that file
-runcmd "Removing file" 'rm tmpfile' || failed=`expr $failed + 1`
+runcmd "Removing file" 'rm tmpfile' || failed=$(expr $failed + 1)
 # compare locally
-testit "Comparing files" diff $PREFIX/tmpfile-old $PREFIX/tmpfile || failed=`expr $failed + 1`
+testit "Comparing files" diff $PREFIX/tmpfile-old $PREFIX/tmpfile || failed=$(expr $failed + 1)
 # create directory
 # cd to directory
 # cd to top level directory
 # remove directory
-runcmd "Creating directory, Changing directory, Going back" 'mkdir bla; cd bla; cd ..; rmdir bla' || failed=`expr $failed + 1`
+runcmd "Creating directory, Changing directory, Going back" 'mkdir bla; cd bla; cd ..; rmdir bla' || failed=$(expr $failed + 1)
 # enable recurse, create nested directory
-runcmd "Creating nested directory" 'mkdir bla/bloe' || failed=`expr $failed + 1`
+runcmd "Creating nested directory" 'mkdir bla/bloe' || failed=$(expr $failed + 1)
 # remove child directory
-runcmd "Removing directory" 'rmdir bla/bloe' || failed=`expr $failed + 1`
+runcmd "Removing directory" 'rmdir bla/bloe' || failed=$(expr $failed + 1)
 # remove parent directory
-runcmd "Removing directory" 'rmdir bla'|| failed=`expr $failed + 1`
+runcmd "Removing directory" 'rmdir bla' || failed=$(expr $failed + 1)
 # enable recurse, create nested directory
-runcmd "Creating nested directory" 'mkdir bla' || failed=`expr $failed + 1`
+runcmd "Creating nested directory" 'mkdir bla' || failed=$(expr $failed + 1)
 # rename bla to bla2
-runcmd "rename of nested directory" 'rename bla bla2' || failed=`expr $failed + 1`
+runcmd "rename of nested directory" 'rename bla bla2' || failed=$(expr $failed + 1)
 # deltree
-runcmd "deltree of nested directory" 'deltree bla2' || failed=`expr $failed + 1`
+runcmd "deltree of nested directory" 'deltree bla2' || failed=$(expr $failed + 1)
 # run fsinfo
-runcmd "Getting file system info" 'fsinfo allocation'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo volume'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo volumeinfo'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo sizeinfo'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo deviceinfo'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo attributeinfo'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo volume-information'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo size-information'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo device-information'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo attribute-information'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo quota-information'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo fullsize-information'|| failed=`expr $failed + 1`
-runcmd "Getting file system info" 'fsinfo objectid'|| failed=`expr $failed + 1`
+runcmd "Getting file system info" 'fsinfo allocation' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo volume' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo volumeinfo' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo sizeinfo' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo deviceinfo' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo attributeinfo' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo volume-information' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo size-information' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo device-information' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo attribute-information' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo quota-information' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo fullsize-information' || failed=$(expr $failed + 1)
+runcmd "Getting file system info" 'fsinfo objectid' || failed=$(expr $failed + 1)
 
 # put that file
-runcmd "Putting file" "lcd $PREFIX; put tmpfile" || failed=`expr $failed + 1`
+runcmd "Putting file" "lcd $PREFIX; put tmpfile" || failed=$(expr $failed + 1)
 # get that file
 mv $PREFIX/tmpfile $PREFIX/tmpfile-old
-runcmd "Getting file" "lcd $PREFIX; get tmpfile" || failed=`expr $failed + 1`
-runcmd "Getting file EA info" 'eainfo tmpfile'|| failed=`expr $failed + 1`
+runcmd "Getting file" "lcd $PREFIX; get tmpfile" || failed=$(expr $failed + 1)
+runcmd "Getting file EA info" 'eainfo tmpfile' || failed=$(expr $failed + 1)
 # remove that file
-runcmd "Removing file" 'rm tmpfile' || failed=`expr $failed + 1`
+runcmd "Removing file" 'rm tmpfile' || failed=$(expr $failed + 1)
 # compare locally
-testit "Comparing files" diff $PREFIX/tmpfile-old $PREFIX/tmpfile || failed=`expr $failed + 1`
+testit "Comparing files" diff $PREFIX/tmpfile-old $PREFIX/tmpfile || failed=$(expr $failed + 1)
 # put that file
-runcmd "Putting file with different name" "lcd $PREFIX; put tmpfile tmpfilex" || failed=`expr $failed + 1`
+runcmd "Putting file with different name" "lcd $PREFIX; put tmpfile tmpfilex" || failed=$(expr $failed + 1)
 # get that file
-runcmd "Getting file again" "lcd $PREFIX; get tmpfilex" || failed=`expr $failed + 1`
+runcmd "Getting file again" "lcd $PREFIX; get tmpfilex" || failed=$(expr $failed + 1)
 # compare locally
-testit "Comparing files" diff $PREFIX/tmpfilex $PREFIX/tmpfile || failed=`expr $failed + 1`
+testit "Comparing files" diff $PREFIX/tmpfilex $PREFIX/tmpfile || failed=$(expr $failed + 1)
 # remove that file
-runcmd "Removing file" 'rm tmpfilex'|| failed=`expr $failed + 1`
+runcmd "Removing file" 'rm tmpfilex' || failed=$(expr $failed + 1)
 
-runcmd "Lookup name" "lookup $DOMAIN\\$USERNAME" || failed=`expr $failed + 1`
+runcmd "Lookup name" "lookup $DOMAIN\\$USERNAME" || failed=$(expr $failed + 1)
 
 #Fails unless there are privileges
 #runcmd "Lookup privs of name" "privileges $DOMAIN\\$USERNAME" || failed=`expr $failed + 1`
 
 # do some simple operations using old protocol versions
-runcmd "List directory with LANMAN1" 'ls' -m LANMAN1 --option=clientntlmv2auth=no || failed=`expr $failed + 1`
-runcmd "List directory with LANMAN2" 'ls' -m LANMAN2 --option=clientntlmv2auth=no || failed=`expr $failed + 1`
+runcmd "List directory with LANMAN1" 'ls' -m LANMAN1 --option=clientntlmv2auth=no || failed=$(expr $failed + 1)
+runcmd "List directory with LANMAN2" 'ls' -m LANMAN2 --option=clientntlmv2auth=no || failed=$(expr $failed + 1)
 
-runcmd "Print current working directory" 'pwd'|| failed=`expr $failed + 1`
+runcmd "Print current working directory" 'pwd' || failed=$(expr $failed + 1)
 
 (
-    echo "password=$PASSWORD"
-    echo "username=$USERNAME"
-    echo "domain=$DOMAIN"
-) > $PREFIX/tmpauthfile
+	echo "password=$PASSWORD"
+	echo "username=$USERNAME"
+	echo "domain=$DOMAIN"
+) >$PREFIX/tmpauthfile
 
-testit "Test login with --authentication-file" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --authentication-file=$PREFIX/tmpauthfile  || failed=`expr $failed + 1`
+testit "Test login with --authentication-file" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --authentication-file=$PREFIX/tmpauthfile || failed=$(expr $failed + 1)
 
 PASSWD_FILE="$PREFIX/tmppassfile"
-echo "$PASSWORD" > $PASSWD_FILE
+echo "$PASSWORD" >$PASSWD_FILE
 export PASSWD_FILE
-testit "Test login with PASSWD_FILE" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1`
+testit "Test login with PASSWD_FILE" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=$(expr $failed + 1)
 PASSWD_FILE=""
 export PASSWD_FILE
 unset PASSWD_FILE
 
-PASSWD="$PASSWORD" 
+PASSWD="$PASSWORD"
 export PASSWD
-testit "Test login with PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1`
+testit "Test login with PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=$(expr $failed + 1)
 
 oldUSER=$USER
-USER="$USERNAME" 
+USER="$USERNAME"
 export USER
-testit "Test login with USER and PASSWD" $VALGRIND $smbclient --use-kerberos=disabled -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1`
+testit "Test login with USER and PASSWD" $VALGRIND $smbclient --use-kerberos=disabled -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=$(expr $failed + 1)
 PASSWD=
 export PASSWD
 unset PASSWD
diff --git a/source4/librpc/scripts/build_idl.sh b/source4/librpc/scripts/build_idl.sh
index 714f6d1f6ad..dde80f75bc8 100755
--- a/source4/librpc/scripts/build_idl.sh
+++ b/source4/librpc/scripts/build_idl.sh
@@ -10,28 +10,28 @@ IDL_FILES="$*"
 PIDL="$PIDL --outputdir $OUTDIR --header --ndr-parser --server --client --python --dcom-proxy --com-header --includedir ../librpc/idl -- "
 
 if [ x$FULLBUILD = xFULL ]; then
-      echo Rebuilding all idl files in $IDLDIR
-      $PIDL $IDL_FILES || exit 1
-      exit 0
+	echo Rebuilding all idl files in $IDLDIR
+	$PIDL $IDL_FILES || exit 1
+	exit 0
 fi
 
 list=""
 
-for f in $IDL_FILES ; do
-    basename=`basename $f .idl`
-    ndr="$OUTDIR/ndr_$basename.c"
-    # blergh - most shells don't have the -nt function
-    if [ -f $ndr ]; then
-	if [ x`find $f -newer $ndr -print` = x$f ]; then
-	    list="$list $f"
+for f in $IDL_FILES; do
+	basename=$(basename $f .idl)
+	ndr="$OUTDIR/ndr_$basename.c"
+	# blergh - most shells don't have the -nt function
+	if [ -f $ndr ]; then
+		if [ x$(find $f -newer $ndr -print) = x$f ]; then
+			list="$list $f"
+		fi
+	else
+		list="$list $f"
 	fi
-    else 
-        list="$list $f"
-    fi
 done
 
 if [ "x$list" != x ]; then
-    $PIDL $list || exit 1
+	$PIDL $list || exit 1
 fi
 
 exit 0
diff --git a/source4/script/find_unused_options.sh b/source4/script/find_unused_options.sh
index d5545809597..36e97710488 100755
--- a/source4/script/find_unused_options.sh
+++ b/source4/script/find_unused_options.sh
@@ -7,29 +7,29 @@
 #   user at host:~/samba/source>./script/find_unused_options.sh
 #
 
-LIST_GLOBAL=`grep '^FN_GLOBAL' param/loadparm.c |sed -e's/^FN_GLOBAL.*(\(.*\).*,.*\(&Globals\..*\)).*/\1:\2/'`
+LIST_GLOBAL=$(grep '^FN_GLOBAL' param/loadparm.c | sed -e's/^FN_GLOBAL.*(\(.*\).*,.*\(&Globals\..*\)).*/\1:\2/')
 
-LIST_LOCAL=`grep '^FN_LOCAL' param/loadparm.c |sed -e's/^FN_LOCAL.*(\(.*\).*,[ ]*\(.*\)).*/\1:\2/'`
+LIST_LOCAL=$(grep '^FN_LOCAL' param/loadparm.c | sed -e's/^FN_LOCAL.*(\(.*\).*,[ ]*\(.*\)).*/\1:\2/')
 
-CFILES=`find . -name "*.c"`
+CFILES=$(find . -name "*.c")
 
-for i in $LIST_GLOBAL;do
-	key=`echo $i|cut -d ':' -f1`
-	val=`echo $i|cut -d ':' -f2`
+for i in $LIST_GLOBAL; do
+	key=$(echo $i | cut -d ':' -f1)
+	val=$(echo $i | cut -d ':' -f2)
 
-	found=`grep "$key[ ]*()" $CFILES`
-    if test -z "$found"; then
+	found=$(grep "$key[ ]*()" $CFILES)
+	if test -z "$found"; then
 		echo "Not Used Global: $key() -> $val"
 	fi
 done
 
-for i in $LIST_LOCAL;do
-	key=`echo $i|cut -d ':' -f1`
-	val=`echo $i|cut -d ':' -f2`
+for i in $LIST_LOCAL; do
+	key=$(echo $i | cut -d ':' -f1)
+	val=$(echo $i | cut -d ':' -f2)
 
-	found=`grep "$key[ ]*(" $CFILES`
+	found=$(grep "$key[ ]*(" $CFILES)
 
-    if test -z "$found"; then
+	if test -z "$found"; then
 		echo "Not Used LOCAL: $key() -> $val"
 	fi
 done
diff --git a/source4/scripting/bin/ktpass.sh b/source4/scripting/bin/ktpass.sh
index e758eb3bfb7..a165816b1c3 100755
--- a/source4/scripting/bin/ktpass.sh
+++ b/source4/scripting/bin/ktpass.sh
@@ -19,69 +19,94 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 name="ktpass.sh"
-TEMP=`getopt -o h --long princ:,pass:,out:,host:,ptype:,enc:,path-to-ldbsearch: \
-     -n "$name" -- "$@"`
+TEMP=$(getopt -o h --long princ:,pass:,out:,host:,ptype:,enc:,path-to-ldbsearch: \
+	-n "$name" -- "$@")
 eval set -- "$TEMP"
 
-usage () {
-  echo -ne "$name --out <keytabfile> --princ <principal> --pass <password>|*\n"
-  echo -ne "      [--host hostname] [--enc <encryption>]\n"
-  echo -ne "      [--ptype <type>] [--path-to-ldbsearch <path>]\n"
-  echo -ne "\nEncoding should be one of:\n"
-  echo -ne " * des-cbc-crc\n"
-  echo -ne " * des-cbc-md5\n"
-  echo -ne " * rc4-hmac (default)\n"
-  echo -ne " * aes128-cts\n"
-  echo -ne " * aes256-cts\n"
-  exit 0
+usage()
+{
+	echo -ne "$name --out <keytabfile> --princ <principal> --pass <password>|*\n"
+	echo -ne "      [--host hostname] [--enc <encryption>]\n"
+	echo -ne "      [--ptype <type>] [--path-to-ldbsearch <path>]\n"
+	echo -ne "\nEncoding should be one of:\n"
+	echo -ne " * des-cbc-crc\n"
+	echo -ne " * des-cbc-md5\n"
+	echo -ne " * rc4-hmac (default)\n"
+	echo -ne " * aes128-cts\n"
+	echo -ne " * aes256-cts\n"
+	exit 0
 }
-while true ; do
-  case "$1" in
-    --out) outfile=$2 ; shift 2 ;;
-    --princ) princ=$2 ; shift 2 ;;
-    --pass) pass=$2 ; shift 2 ;;
-    --host) host=$2 ; shift 2 ;;
-    --ptype) shift 2 ;;
-    --enc) enc=$2; shift 2;;
-    --path-to-ldbsearch) path="$2/"; shift 2;;
-    -h) usage;;
-    --) shift ; break ;;
-    *) echo "Internal error!" ; exit 1 ;;
-  esac
+while true; do
+	case "$1" in
+	--out)
+		outfile=$2
+		shift 2
+		;;
+	--princ)
+		princ=$2
+		shift 2
+		;;
+	--pass)
+		pass=$2
+		shift 2
+		;;
+	--host)
+		host=$2
+		shift 2
+		;;
+	--ptype) shift 2 ;;
+	--enc)
+		enc=$2
+		shift 2
+		;;
+	--path-to-ldbsearch)
+		path="$2/"
+		shift 2
+		;;
+	-h) usage ;;
+	--)
+		shift
+		break
+		;;
+	*)
+		echo "Internal error!"
+		exit 1
+		;;
+	esac
 done
 #RC4-HMAC-NT|AES256-SHA1|AES128-SHA
 if [ -z "$enc" ]; then
-    enc="rc4-hmac"
+	enc="rc4-hmac"
 fi
 if [ -z "$path" ]; then
-  path=`dirname $0`/../bin/
-  if [ ! -f ${path}ldbsearch ]; then
-    path=`dirname $0`/../../bin/
-  fi
+	path=$(dirname $0)/../bin/
+	if [ ! -f ${path}ldbsearch ]; then
+		path=$(dirname $0)/../../bin/
+	fi


-- 
Samba Shared Repository



More information about the samba-cvs mailing list