summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2003-09-29 02:39:41 +0000
committerJelmer Vernooij <jelmer@samba.org>2003-09-29 02:39:41 +0000
commitcda8fc29152016c10e2a481b8ba57fc1aad8af7d (patch)
tree6e4134e12be64135e28620b46a02596391d7d979 /source3/utils
parent24718868a4dacbd7e64c89383d3ef47b468bd740 (diff)
downloadsamba-cda8fc29152016c10e2a481b8ba57fc1aad8af7d.tar.gz
samba-cda8fc29152016c10e2a481b8ba57fc1aad8af7d.tar.bz2
samba-cda8fc29152016c10e2a481b8ba57fc1aad8af7d.zip
Testparm fixes:
- Also check global 'hosts allow'/'hosts deny' when checking access to share - Warn when user specifies 2 arguments instead of 1 or 3. Patch from Jay Fenlason <fenlason@redhat.com> (This used to be commit 2690c185f01b8fb4307dc803fb90c00400f2da69)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/testparm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 34c25480d9..085156305b 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -226,7 +226,12 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
cname = poptGetArg(pc);
caddr = poptGetArg(pc);
-
+
+ if ( cname && ! caddr ) {
+ printf ( "ERROR: You must specify both a machine name and an IP address.\n" );
+ return(1);
+ }
+
if (new_local_machine) {
set_local_machine_name(new_local_machine, True);
}
@@ -346,8 +351,9 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
if(cname && caddr){
/* this is totally ugly, a real `quick' hack */
for (s=0;s<1000;s++) {
- if (VALID_SNUM(s)) {
- if (allow_access(lp_hostsdeny(s), lp_hostsallow(s), cname, caddr)) {
+ if (VALID_SNUM(s)) {
+ if (allow_access(lp_hostsdeny(-1), lp_hostsallow(-1), cname, caddr)
+ && allow_access(lp_hostsdeny(s), lp_hostsallow(s), cname, caddr)) {
printf("Allow connection from %s (%s) to %s\n",
cname,caddr,lp_servicename(s));
} else {