From 5318e73e93295cbdd2e50c4291b58a317cb09ea6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 18 Dec 2008 18:01:55 +0100 Subject: [PATCH] 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) --- source3/smbd/service.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 0dea615fb580..e90098fed066 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; } -- 2.34.1