smbd: prevent access to root filesystem when connecting with empty service name
authorMichael Adam <obnox@samba.org>
Thu, 18 Dec 2008 17:01:55 +0000 (18:01 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 5 Jan 2009 10:07:59 +0000 (11:07 +0100)
This only applies to a setup with "registry shares = yes"

Michael
(cherry picked from commit 288fa94ac7cfdf7457b5098c33fc840bed3d5410)
(cherry picked from commit e85526b184e66f86b7faa9d0a37288a09c12c19e)

source3/smbd/service.c

index 0dea615fb58026f60a1e1e267939b7cfe1dc3f8c..e90098fed066b5f7ecdfa3a3428c7d5b7a9e6ea7 100644 (file)
@@ -235,6 +235,10 @@ static int load_registry_service(const char *servicename)
                return -1;
        }
 
+       if ((servicename == NULL) || (*servicename == '\0')) {
+               return -1;
+       }
+
        if (strequal(servicename, GLOBAL_NAME)) {
                return -2;
        }