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-3.3.0~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e0ca23f3a485f45a5464c9e659d0df732b691b9;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) (cherry picked from commit 5dfa403498c4f4a0eb05a5331b81326832ddd63f) --- diff --git a/source/smbd/service.c b/source/smbd/service.c index 0b851f1e481..c39584ab4a6 100644 --- a/source/smbd/service.c +++ b/source/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; }