From: Michael Adam Date: Thu, 18 Dec 2008 17:01:55 +0000 (+0100) Subject: smbd: prevent access to root filesystem when connecting with empty service name X-Git-Tag: samba-4.0.0alpha6~281^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5318e73e93295cbdd2e50c4291b58a317cb09ea6;p=thirdparty%2Fsamba.git smbd: prevent access to root filesystem when connecting with empty service name This only applies to a setup with "registry shares = yes" Michael (cherry picked from commit 288fa94ac7cfdf7457b5098c33fc840bed3d5410) (cherry picked from commit e85526b184e66f86b7faa9d0a37288a09c12c19e) --- diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 0dea615fb58..e90098fed06 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -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; }