Validation for "net conf addshare" is overly strict. Empty string for
path for homes share is valid.
Signed-off-by: Andrew <awalker@ixsystems.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 24 21:41:12 UTC 2020 on sn-devel-184
/* 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;
+ }
}
/*