1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

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 commit is contained in:
Jelmer Vernooij -
parent 47ad635d5d
commit 2690c185f0

View File

@ -227,6 +227,11 @@ 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);
}
@ -347,7 +352,8 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
/* 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 (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 {