From dd83af65d743f1e57c93b3788e7ab40553547622 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 9 May 2002 04:12:15 +0000 Subject: merge from SAMBA_2_2 (This used to be commit cc241cb240db6956baf3d5c6b6d01a0a165a6ef5) --- source3/script/findsmb | 145 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100755 source3/script/findsmb (limited to 'source3/script') diff --git a/source3/script/findsmb b/source3/script/findsmb new file mode 100755 index 0000000000..04bc608050 --- /dev/null +++ b/source3/script/findsmb @@ -0,0 +1,145 @@ +#!/usr/bin/perl +# +# Prints info on all smb responding machines on a subnet. +# This script needs to be run on a machine without nmbd running and be +# run as root to get correct info from WIN95 clients. +# +# syntax: +# findsmb [subnet broadcast address] +# +# with no agrument it will list machines on the current subnet +# +# There will be a "+" in front of the workgroup name for machines that are +# local master browsers for that workgroup. There will be an "*" in front +# of the workgroup name for machines that are the domain master browser for +# that workgroup. +# + +$SAMBABIN = "/usr/bin"; + +for ($i = 0; $i < 2; $i++) { # test for -d option and broadcast address + $_ = shift; + if (m/-d|-D/) { + $DEBUG = 1; + } else { + if ($_) { + $BCAST = "-B $_"; + } + } +} + +sub ipsort # do numeric sort on last field of IP address +{ + @t1 = split(/\./,$a); + @t2 = split(/\./,$b); + @t1[3] <=> @t2[3]; +} + +# look for all machines that respond to a name lookup + +open(NMBLOOKUP,"$SAMBABIN/nmblookup $BCAST '*'|") || + die("Can't run nmblookup '*'.\n"); + +# get rid of all lines that are not a response IP address, +# strip everything but IP address and sort by last field in address + +@ipaddrs = sort ipsort grep(s/ \*<00>.*$//,); + +# print header info + +print "\nIP ADDR NETBIOS NAME WORKGROUP/OS/VERSION $BCAST\n"; +print "---------------------------------------------------------------------\n"; + +foreach $ip (@ipaddrs) # loop through each IP address found +{ + $ip =~ s/\n//; # strip newline from IP address + +# find the netbios names registered by each machine + + open(NMBLOOKUP,"$SAMBABIN/nmblookup -r -A $ip|") || + die("Can't get nmb name list.\n"); + @nmblookup = ; + close NMBLOOKUP; + +# get the first <00> name + + @name = grep(/<00>/,@nmblookup); + $_ = @name[0]; + if ($_) { # we have a netbios name + if (/GROUP/) { # is it a group name + ($name, $aliases, $type, $length, @addresses) = + gethostbyaddr(pack('C4',split('\.',$ip)),2); + if (! $name) { # could not get name + $name = "unknown nis name"; + } + } else { +# The Netbios name can contain lot of characters also '<' '>' +# and spaces. The follwing cure inside name space but not +# names starting or ending with spaces + /(.{1,15})\s+<00>\s+/; + $name = $1; + } + +# do an smbclient command on the netbios name. + + open(SMB,"$SAMBABIN/smbclient -N -L $name -I $ip -U% |") || + die("Can't do smbclient command.\n"); + @smb = ; + close SMB; + + if ($DEBUG) { # if -d flag print results of nmblookup and smbclient + print "===============================================================\n"; + print @nmblookup; + print @smb; + } + +# look for the OS= string + + @info = grep(/OS=/,@smb); + $_ = @info[0]; + if ($_) { # we found response + s/Domain=|OS=|Server=|\n//g; # strip out descriptions to make line shorter + + } else { # no OS= string in response (WIN95 client) + +# for WIN95 clients get workgroup name from nmblookup response + @name = grep(/<00> - /,@nmblookup); + $_ = @name[0]; + if ($_) { +# Same as before for space and characters + /(.{1,15})\s+<00>\s+/; + $_ = "[$1]"; + } else { + $_ = "Unknown Workgroup"; + } + } + +# see if machine registered a local master browser name + if (grep(/<1d>/,@nmblookup)) { + $master = '+'; # indicate local master browser + if (grep(/<1b>/,@nmblookup)) { # how about domain master browser? + $master = '*'; # indicate domain master browser + } + } else { + $master = ' '; # not a browse master + } + +# line up info in 3 columns + + print "$ip".' 'x(16-length($ip))."$name".' 'x(14-length($name))."$master"."$_\n"; + + } else { # no netbios name found +# try getting the host name + ($name, $aliases, $type, $length, @addresses) = + gethostbyaddr(pack('C4',split('\.',$ip)),2); + if (! $name) { # could not get name + $name = "unknown nis name"; + } + if ($DEBUG) { # if -d flag print results of nmblookup + print "===============================================================\n"; + print @nmblookup; + } + print "$ip".' 'x(16-length($ip))."$name\n"; + } +} + -- cgit From 3de73897e7083520ac123b399cd823ce61a4d475 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 9 May 2002 13:52:06 +0000 Subject: merge from SAMBA_2_2 (This used to be commit 7382c3013d7b630ba7229a1d12104b8f7edfd9ca) --- source3/script/findsmb | 145 ---------------------------------------------- source3/script/findsmb.in | 145 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 145 deletions(-) delete mode 100755 source3/script/findsmb create mode 100755 source3/script/findsmb.in (limited to 'source3/script') diff --git a/source3/script/findsmb b/source3/script/findsmb deleted file mode 100755 index 04bc608050..0000000000 --- a/source3/script/findsmb +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/perl -# -# Prints info on all smb responding machines on a subnet. -# This script needs to be run on a machine without nmbd running and be -# run as root to get correct info from WIN95 clients. -# -# syntax: -# findsmb [subnet broadcast address] -# -# with no agrument it will list machines on the current subnet -# -# There will be a "+" in front of the workgroup name for machines that are -# local master browsers for that workgroup. There will be an "*" in front -# of the workgroup name for machines that are the domain master browser for -# that workgroup. -# - -$SAMBABIN = "/usr/bin"; - -for ($i = 0; $i < 2; $i++) { # test for -d option and broadcast address - $_ = shift; - if (m/-d|-D/) { - $DEBUG = 1; - } else { - if ($_) { - $BCAST = "-B $_"; - } - } -} - -sub ipsort # do numeric sort on last field of IP address -{ - @t1 = split(/\./,$a); - @t2 = split(/\./,$b); - @t1[3] <=> @t2[3]; -} - -# look for all machines that respond to a name lookup - -open(NMBLOOKUP,"$SAMBABIN/nmblookup $BCAST '*'|") || - die("Can't run nmblookup '*'.\n"); - -# get rid of all lines that are not a response IP address, -# strip everything but IP address and sort by last field in address - -@ipaddrs = sort ipsort grep(s/ \*<00>.*$//,); - -# print header info - -print "\nIP ADDR NETBIOS NAME WORKGROUP/OS/VERSION $BCAST\n"; -print "---------------------------------------------------------------------\n"; - -foreach $ip (@ipaddrs) # loop through each IP address found -{ - $ip =~ s/\n//; # strip newline from IP address - -# find the netbios names registered by each machine - - open(NMBLOOKUP,"$SAMBABIN/nmblookup -r -A $ip|") || - die("Can't get nmb name list.\n"); - @nmblookup = ; - close NMBLOOKUP; - -# get the first <00> name - - @name = grep(/<00>/,@nmblookup); - $_ = @name[0]; - if ($_) { # we have a netbios name - if (/GROUP/) { # is it a group name - ($name, $aliases, $type, $length, @addresses) = - gethostbyaddr(pack('C4',split('\.',$ip)),2); - if (! $name) { # could not get name - $name = "unknown nis name"; - } - } else { -# The Netbios name can contain lot of characters also '<' '>' -# and spaces. The follwing cure inside name space but not -# names starting or ending with spaces - /(.{1,15})\s+<00>\s+/; - $name = $1; - } - -# do an smbclient command on the netbios name. - - open(SMB,"$SAMBABIN/smbclient -N -L $name -I $ip -U% |") || - die("Can't do smbclient command.\n"); - @smb = ; - close SMB; - - if ($DEBUG) { # if -d flag print results of nmblookup and smbclient - print "===============================================================\n"; - print @nmblookup; - print @smb; - } - -# look for the OS= string - - @info = grep(/OS=/,@smb); - $_ = @info[0]; - if ($_) { # we found response - s/Domain=|OS=|Server=|\n//g; # strip out descriptions to make line shorter - - } else { # no OS= string in response (WIN95 client) - -# for WIN95 clients get workgroup name from nmblookup response - @name = grep(/<00> - /,@nmblookup); - $_ = @name[0]; - if ($_) { -# Same as before for space and characters - /(.{1,15})\s+<00>\s+/; - $_ = "[$1]"; - } else { - $_ = "Unknown Workgroup"; - } - } - -# see if machine registered a local master browser name - if (grep(/<1d>/,@nmblookup)) { - $master = '+'; # indicate local master browser - if (grep(/<1b>/,@nmblookup)) { # how about domain master browser? - $master = '*'; # indicate domain master browser - } - } else { - $master = ' '; # not a browse master - } - -# line up info in 3 columns - - print "$ip".' 'x(16-length($ip))."$name".' 'x(14-length($name))."$master"."$_\n"; - - } else { # no netbios name found -# try getting the host name - ($name, $aliases, $type, $length, @addresses) = - gethostbyaddr(pack('C4',split('\.',$ip)),2); - if (! $name) { # could not get name - $name = "unknown nis name"; - } - if ($DEBUG) { # if -d flag print results of nmblookup - print "===============================================================\n"; - print @nmblookup; - } - print "$ip".' 'x(16-length($ip))."$name\n"; - } -} - diff --git a/source3/script/findsmb.in b/source3/script/findsmb.in new file mode 100755 index 0000000000..d2aa94591b --- /dev/null +++ b/source3/script/findsmb.in @@ -0,0 +1,145 @@ +#!/usr/bin/perl +# +# Prints info on all smb responding machines on a subnet. +# This script needs to be run on a machine without nmbd running and be +# run as root to get correct info from WIN95 clients. +# +# syntax: +# findsmb [subnet broadcast address] +# +# with no agrument it will list machines on the current subnet +# +# There will be a "+" in front of the workgroup name for machines that are +# local master browsers for that workgroup. There will be an "*" in front +# of the workgroup name for machines that are the domain master browser for +# that workgroup. +# + +$SAMBABIN = "@prefix@/bin"; + +for ($i = 0; $i < 2; $i++) { # test for -d option and broadcast address + $_ = shift; + if (m/-d|-D/) { + $DEBUG = 1; + } else { + if ($_) { + $BCAST = "-B $_"; + } + } +} + +sub ipsort # do numeric sort on last field of IP address +{ + @t1 = split(/\./,$a); + @t2 = split(/\./,$b); + @t1[3] <=> @t2[3]; +} + +# look for all machines that respond to a name lookup + +open(NMBLOOKUP,"$SAMBABIN/nmblookup $BCAST '*'|") || + die("Can't run nmblookup '*'.\n"); + +# get rid of all lines that are not a response IP address, +# strip everything but IP address and sort by last field in address + +@ipaddrs = sort ipsort grep(s/ \*<00>.*$//,); + +# print header info + +print "\nIP ADDR NETBIOS NAME WORKGROUP/OS/VERSION $BCAST\n"; +print "---------------------------------------------------------------------\n"; + +foreach $ip (@ipaddrs) # loop through each IP address found +{ + $ip =~ s/\n//; # strip newline from IP address + +# find the netbios names registered by each machine + + open(NMBLOOKUP,"$SAMBABIN/nmblookup -r -A $ip|") || + die("Can't get nmb name list.\n"); + @nmblookup = ; + close NMBLOOKUP; + +# get the first <00> name + + @name = grep(/<00>/,@nmblookup); + $_ = @name[0]; + if ($_) { # we have a netbios name + if (/GROUP/) { # is it a group name + ($name, $aliases, $type, $length, @addresses) = + gethostbyaddr(pack('C4',split('\.',$ip)),2); + if (! $name) { # could not get name + $name = "unknown nis name"; + } + } else { +# The Netbios name can contain lot of characters also '<' '>' +# and spaces. The follwing cure inside name space but not +# names starting or ending with spaces + /(.{1,15})\s+<00>\s+/; + $name = $1; + } + +# do an smbclient command on the netbios name. + + open(SMB,"$SAMBABIN/smbclient -N -L $name -I $ip -U% |") || + die("Can't do smbclient command.\n"); + @smb = ; + close SMB; + + if ($DEBUG) { # if -d flag print results of nmblookup and smbclient + print "===============================================================\n"; + print @nmblookup; + print @smb; + } + +# look for the OS= string + + @info = grep(/OS=/,@smb); + $_ = @info[0]; + if ($_) { # we found response + s/Domain=|OS=|Server=|\n//g; # strip out descriptions to make line shorter + + } else { # no OS= string in response (WIN95 client) + +# for WIN95 clients get workgroup name from nmblookup response + @name = grep(/<00> - /,@nmblookup); + $_ = @name[0]; + if ($_) { +# Same as before for space and characters + /(.{1,15})\s+<00>\s+/; + $_ = "[$1]"; + } else { + $_ = "Unknown Workgroup"; + } + } + +# see if machine registered a local master browser name + if (grep(/<1d>/,@nmblookup)) { + $master = '+'; # indicate local master browser + if (grep(/<1b>/,@nmblookup)) { # how about domain master browser? + $master = '*'; # indicate domain master browser + } + } else { + $master = ' '; # not a browse master + } + +# line up info in 3 columns + + print "$ip".' 'x(16-length($ip))."$name".' 'x(14-length($name))."$master"."$_\n"; + + } else { # no netbios name found +# try getting the host name + ($name, $aliases, $type, $length, @addresses) = + gethostbyaddr(pack('C4',split('\.',$ip)),2); + if (! $name) { # could not get name + $name = "unknown nis name"; + } + if ($DEBUG) { # if -d flag print results of nmblookup + print "===============================================================\n"; + print @nmblookup; + } + print "$ip".' 'x(16-length($ip))."$name\n"; + } +} + -- cgit From 0502d0ad6b5258dcd2aa84bf969f21592ce52e6f Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 10 May 2002 03:17:44 +0000 Subject: Added findsmb to .cvsignore list. (This used to be commit 5b682b2e04d054a2843269373abddc764c4c0cdd) --- source3/script/.cvsignore | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/script') diff --git a/source3/script/.cvsignore b/source3/script/.cvsignore index e69de29bb2..7a8114ecd7 100644 --- a/source3/script/.cvsignore +++ b/source3/script/.cvsignore @@ -0,0 +1 @@ +findsmb -- cgit From 58e1fe62cc955c6b8449332447a6879c6fab64e7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 18 May 2002 05:52:52 +0000 Subject: A few things in this commit: cleanup some of the code in net_rpc_join re const warnings and fstrings. Passdb: Make the %u and %U substituions in passdb work. This is done by declaring these paramters to be 'const' and doing the substitution manually. I'm told this is us going full circle, but I can't really see a better way. Finally these things actually seem to work properly... Make the lanman code use the pdb's recorded values for homedir etc rather than the values from lp_*() Add code to set the plaintext password in the passdb, where it can decide how to store/set it. For use with a future 'ldap password change' option, or somthing like that... Add pdb_unix, so as to remove the 'not in passdb' special cases from the local_lookup_*() code. Quite small, as it uses the new 'struct passwd -> SAM_ACCOUNT' code that is now in just one place. (also used by pdb_smbpasswd) Other: Fix up the adding of [homes] at session setup time to actually pass the right string, that is the unix homedir, not the UNC path. Fix up [homes] so that for winbind users is picks the correct name. (bad interactions with the default domain code previously) Change the rpc_server/srv_lsa_nt.c code to match NT when for the SATUS_NONE_MAPPED reply: This was only being triggered on no queries, now it is on the 'no mappings' (ie all mappings failed). Checked against Win2k. Policy Question: Should SID -> unix_user.234/unix_group.364 be considered a mapping or not? Currently it isn't. Andrew Bartlett (This used to be commit c28668068b5a3b3cf3c4317e5fb32ec9957f3e34) --- source3/script/mkproto.awk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/script') diff --git a/source3/script/mkproto.awk b/source3/script/mkproto.awk index 9b0aa360bc..c701ed41cd 100644 --- a/source3/script/mkproto.awk +++ b/source3/script/mkproto.awk @@ -72,6 +72,11 @@ END { printf "char *%s(int );\n", a[2] } +/^FN_LOCAL_CONST_STRING/ { + split($0,a,"[,()]") + printf "const char *%s(int );\n", a[2] +} + /^FN_LOCAL_INT/ { split($0,a,"[,()]") printf "int %s(int );\n", a[2] @@ -97,6 +102,11 @@ END { printf "char *%s(void);\n", a[2] } +/^FN_GLOBAL_CONST_STRING/ { + split($0,a,"[,()]") + printf "const char *%s(void);\n", a[2] +} + /^FN_GLOBAL_INT/ { split($0,a,"[,()]") printf "int %s(void);\n", a[2] -- cgit From 2154ebce84c6cf376e7183e8c5f7ad0e17aead97 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 13 Jun 2002 07:06:19 +0000 Subject: a useful script for finding global variables or functions that could be static very very slow ... I leave it as an exercise for the reader to make this O(n) instead of O(n^2) (This used to be commit 7c035d473c7175163ad5db0373ed2fe6c739b968) --- source3/script/findstatic.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 source3/script/findstatic.sh (limited to 'source3/script') diff --git a/source3/script/findstatic.sh b/source3/script/findstatic.sh new file mode 100755 index 0000000000..39c57a46f7 --- /dev/null +++ b/source3/script/findstatic.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# find a list of fns and variables in the code that could be static +# Andrew Tridgell + +# rather linux specific, but that doesn't matter in this case +# also very slow (order is N^2) but fast enough for this project + +declare -a FNS + +for f in $@; do + echo "Checking in $f" + T_FNS=`nm $f | grep ' T ' | cut -d' ' -f3` + C_FNS=`nm $f | egrep ' [DC] ' | cut -d' ' -f3` + if [ "$T_FNS" = "" -a "$C_FNS" = "" ]; then + echo "No public functions or data in $f" + continue + fi + for fn in $T_FNS; do + if [ $fn = "main" ]; then + continue + fi + found=0 + for f2 in $@; do + if [ $f != $f2 ]; then + FNS2=`nm $f2 | egrep ' U ' | awk '{print $2}'` + for fn2 in $FNS2; do + if [ $fn2 = $fn ]; then + found=1 + break + fi + done + fi + done + if [ $found = 0 ]; then + echo "Global function $fn is unique to $f" + fi + done + + for fn in $C_FNS; do + if [ $fn = "main" ]; then + continue + fi + found=0 + for f2 in $@; do + if [ $f != $f2 ]; then + FNS2=`nm $f2 | grep ' U ' | awk '{print $2}'` + for fn2 in $FNS2; do + if [ $fn2 = $fn ]; then + found=1 + break + fi + done + fi + done + if [ $found = 0 ]; then + echo "Global variable $fn is unique to $f" + fi + done +done -- cgit From fe082a8ff518a5e5ce574e6da40c3c05aed99947 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Jun 2002 06:27:30 +0000 Subject: much better findstatic script (This used to be commit 2947b7624f921032bcd2cc5507747b2f7ef190de) --- source3/script/findstatic.pl | 65 ++++++++++++++++++++++++++++++++++++++++++++ source3/script/findstatic.sh | 59 ---------------------------------------- 2 files changed, 65 insertions(+), 59 deletions(-) create mode 100755 source3/script/findstatic.pl delete mode 100755 source3/script/findstatic.sh (limited to 'source3/script') diff --git a/source3/script/findstatic.pl b/source3/script/findstatic.pl new file mode 100755 index 0000000000..d2d1b4d924 --- /dev/null +++ b/source3/script/findstatic.pl @@ -0,0 +1,65 @@ +#!/usr/bin/perl -w +# find a list of fns and variables in the code that could be static +# usually called with something like this: +# findstatic.pl `find . -name "*.o"` +# Andrew Tridgell + +use strict; + +# use nm to find the symbols +my($saved_delim) = $/; +undef $/; +my($syms) = `nm -o @ARGV`; +$/ = $saved_delim; + +my(@lines) = split(/\n/s, $syms); + +my(%def); +my(%undef); +my(%stype); + +my(%typemap) = ( + "T" => "function", + "C" => "uninitialised variable", + "D" => "initialised variable" + ); + + +# parse the symbols into defined and undefined +for (my($i)=0; $i <= $#{@lines}; $i++) { + my($line) = $lines[$i]; + if ($line =~ /(.*):[a-f0-9]* ([TCD]) (.*)/) { + my($fname) = $1; + my($symbol) = $3; + push(@{$def{$fname}}, $symbol); + $stype{$symbol} = $2; + } + if ($line =~ /(.*):\s* U (.*)/) { + my($fname) = $1; + my($symbol) = $2; + push(@{$undef{$fname}}, $symbol); + } +} + +# look for defined symbols that are never referenced outside the place they +# are defined +foreach my $f (keys %def) { + print "Checking $f\n"; + foreach my $s (@{$def{$f}}) { + my($found) = 0; + foreach my $f2 (keys %undef) { + if ($f2 ne $f) { + foreach my $s2 (@{$undef{$f2}}) { + if ($s2 eq $s) { + $found = 1; + } + } + } + } + if ($found == 0) { + my($t) = $typemap{$stype{$s}}; + print " '$s' is unique to $f ($t)\n"; + } + } +} + diff --git a/source3/script/findstatic.sh b/source3/script/findstatic.sh deleted file mode 100755 index 39c57a46f7..0000000000 --- a/source3/script/findstatic.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# find a list of fns and variables in the code that could be static -# Andrew Tridgell - -# rather linux specific, but that doesn't matter in this case -# also very slow (order is N^2) but fast enough for this project - -declare -a FNS - -for f in $@; do - echo "Checking in $f" - T_FNS=`nm $f | grep ' T ' | cut -d' ' -f3` - C_FNS=`nm $f | egrep ' [DC] ' | cut -d' ' -f3` - if [ "$T_FNS" = "" -a "$C_FNS" = "" ]; then - echo "No public functions or data in $f" - continue - fi - for fn in $T_FNS; do - if [ $fn = "main" ]; then - continue - fi - found=0 - for f2 in $@; do - if [ $f != $f2 ]; then - FNS2=`nm $f2 | egrep ' U ' | awk '{print $2}'` - for fn2 in $FNS2; do - if [ $fn2 = $fn ]; then - found=1 - break - fi - done - fi - done - if [ $found = 0 ]; then - echo "Global function $fn is unique to $f" - fi - done - - for fn in $C_FNS; do - if [ $fn = "main" ]; then - continue - fi - found=0 - for f2 in $@; do - if [ $f != $f2 ]; then - FNS2=`nm $f2 | grep ' U ' | awk '{print $2}'` - for fn2 in $FNS2; do - if [ $fn2 = $fn ]; then - found=1 - break - fi - done - fi - done - if [ $found = 0 ]; then - echo "Global variable $fn is unique to $f" - fi - done -done -- cgit From 9930b0b0650ae3e38c033c28672398425dd8228c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Jul 2002 09:12:41 +0000 Subject: used findstatic.pl to make some variables static and remove some dead code (This used to be commit 91ad9041e9507d36eb3f40c23c5d4df61f139ef0) --- source3/script/findstatic.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/script') diff --git a/source3/script/findstatic.pl b/source3/script/findstatic.pl index d2d1b4d924..43a4916435 100755 --- a/source3/script/findstatic.pl +++ b/source3/script/findstatic.pl @@ -45,6 +45,7 @@ for (my($i)=0; $i <= $#{@lines}; $i++) { # are defined foreach my $f (keys %def) { print "Checking $f\n"; + my($found_one) = 0; foreach my $s (@{$def{$f}}) { my($found) = 0; foreach my $f2 (keys %undef) { @@ -52,6 +53,7 @@ foreach my $f (keys %def) { foreach my $s2 (@{$undef{$f2}}) { if ($s2 eq $s) { $found = 1; + $found_one = 1; } } } @@ -61,5 +63,8 @@ foreach my $f (keys %def) { print " '$s' is unique to $f ($t)\n"; } } + if ($found_one == 0) { + print " all symbols in '$f' are unused (main program?)\n"; + } } -- cgit