Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-107465 / 20.10 / Ease netconf validation #803

Merged
merged 2 commits into from Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion net/samba/Makefile
Expand Up @@ -3,7 +3,7 @@

PORTNAME= ${SAMBA4_BASENAME}
PORTVERSION= ${SAMBA4_VERSION}
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES?= net
MASTER_SITES= SAMBA/samba/stable SAMBA/samba/rc
DISTNAME= ${SAMBA4_DISTNAME}
Expand Down Expand Up @@ -36,6 +36,7 @@ EXTRA_PATCHES+= ${PATCHDIR}/debug.patch:-p1
EXTRA_PATCHES+= ${PATCHDIR}/tevent_kqueue.patch:-p1
EXTRA_PATCHES+= ${PATCHDIR}/allow_vfs_set_sparse.patch:-p1
EXTRA_PATCHES+= ${PATCHDIR}/dns-fixes.patch:-p1
EXTRA_PATCHES+= ${PATCHDIR}/ease-netconf-validation.patch:-p1

SAMBA4_BASENAME= samba
SAMBA4_PORTNAME= ${SAMBA4_BASENAME}4
Expand Down
33 changes: 33 additions & 0 deletions net/samba/files/ease-netconf-validation.patch
@@ -0,0 +1,33 @@
commit 437d1baaf80a2fd3c8e90957087cecc85ba9aa3d
Author: Andrew <awalker@ixsystems.com>
Date: Fri Sep 4 13:24:41 2020 -0400

s3:util:net_conf - allow empty path for [homes]

Validation for "net conf addshare" is overly strict. Empty string for
path for homes share is valid.

Signed-off-by: Andrew <awalker@ixsystems.com>

diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 267c4c802df..b2d5ebd242a 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -648,10 +648,13 @@ 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;
+ if (!strequal(sharename, HOMES_NAME) ||
+ strlen(path) != 0) {
+ d_fprintf(stderr,
+ _("Error: path '%s' is not an absolute path.\n"),
+ path);
+ goto done;
+ }
}

/*