]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Quiet log messages from usershares for an unknown share.
authorJeremy Allison <jra@samba.org>
Wed, 2 Dec 2020 19:47:02 +0000 (11:47 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 4 Dec 2020 20:54:06 +0000 (20:54 +0000)
No need to log missing shares/sharenames at debug level zero.

Keep the debug level zero for all other usershare problems.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14590

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Rowland penny <rpenny@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  4 20:54:06 UTC 2020 on sn-devel-184

source3/param/loadparm.c

index fbeed6782ad82edb2260f539e422c69e3b65f8ae..3de22b350f11e1db0b137ca98aa18d288e341647 100644 (file)
@@ -3424,6 +3424,11 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
           open and fstat. Ensure this isn't a symlink link. */
 
        if (sys_lstat(fname, &lsbuf, false) != 0) {
+               if (errno == ENOENT) {
+                       /* Unknown share requested. Just ignore. */
+                       goto out;
+               }
+               /* Only log messages for meaningful problems. */
                DEBUG(0,("process_usershare_file: stat of %s failed. %s\n",
                        fname, strerror(errno) ));
                goto out;
@@ -3629,6 +3634,11 @@ int load_usershare_service(const char *servicename)
        int max_user_shares = Globals.usershare_max_shares;
        int snum_template = -1;
 
+       if (servicename[0] == '\0') {
+               /* Invalid service name. */
+               return -1;
+       }
+
        if (*usersharepath == 0 ||  max_user_shares == 0) {
                return -1;
        }