From d53c91db3c7daac7ae7a1622bd00ddef43f6e8ec Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 4 Sep 2020 13:24:41 -0400 Subject: [PATCH] s3:util:net_conf - allow empty path for [homes] MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Validation for "net conf addshare" is overly strict. Empty string for path for homes share is valid. Signed-off-by: Andrew Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Sep 24 21:41:12 UTC 2020 on sn-devel-184 --- source3/utils/net_conf.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 267c4c802df..c16f240634c 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -648,10 +648,18 @@ static int net_conf_addshare(struct net_context *c, /* validate path */ if (path[0] != '/') { - d_fprintf(stderr, - _("Error: path '%s' is not an absolute path.\n"), - path); - goto done; + bool ok = false; + + if (strequal(sharename, HOMES_NAME) && path[0] == '\0') { + /* The homes share can be an empty path. */ + ok = true; + } + if (!ok) { + d_fprintf(stderr, + _("Error: path '%s' is not an absolute path.\n"), + path); + goto done; + } } /* -- 2.47.3