diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-02-01 16:22:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:39 -0500 |
commit | aebd5170755d638aa0e4429dfb7dce9b4c405d06 (patch) | |
tree | c6349762c06d59861f16a0070733ee719d367ead | |
parent | f6a3c284c25c7aaaa789c1479f48b3604ab5336a (diff) | |
download | samba-aebd5170755d638aa0e4429dfb7dce9b4c405d06.tar.gz samba-aebd5170755d638aa0e4429dfb7dce9b4c405d06.tar.bz2 samba-aebd5170755d638aa0e4429dfb7dce9b4c405d06.zip |
r21114: Fix 'net usershare': Adding "guest_ok=y" required a correct acl. Set the
default if "" is set. And fix the calculation for too man shares.
Thanks to Karolin Seeger <ks@sernet.de>
Volker
(This used to be commit 5b12eb873f8f603a6143342c282014af76ec7752)
-rw-r--r-- | source3/utils/net_usershare.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index a41f9ec562..e867f4c940 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -568,6 +568,9 @@ static int net_usershare_add(int argc, const char **argv) us_path = argv[1]; us_comment = argv[2]; arg_acl = argv[3]; + if (strlen(arg_acl) == 0) { + arg_acl = "S-1-1-0:R"; + } if (!strnequal(argv[4], "guest_ok=", 9)) { return net_usershare_add_usage(argc, argv); } @@ -588,10 +591,9 @@ static int net_usershare_add(int argc, const char **argv) /* Ensure we're under the "usershare max shares" number. Advisory only. */ num_usershares = count_num_usershares(); - if (num_usershares > lp_usershare_max_shares()) { - d_fprintf(stderr, "net usershare add: too many usershares already defined (%d), " - "maximum number allowed is %d.\n", - num_usershares, lp_usershare_max_shares() ); + if (num_usershares >= lp_usershare_max_shares()) { + d_fprintf(stderr, "net usershare add: maximum number of allowed usershares (%d) reached\n", + lp_usershare_max_shares() ); SAFE_FREE(sharename); return -1; } |