summaryrefslogtreecommitdiff
path: root/usr/src/cmd/fs.d/mount.c
diff options
context:
space:
mode:
authorGordon Ross <gwr@nexenta.com>2019-08-24 14:16:06 -0400
committerGordon Ross <gwr@nexenta.com>2019-08-27 15:49:40 -0400
commit0463c8009260e445fd1885cfaf98e04a586d495b (patch)
tree7d111c1498e5edada5df8b7f30f053221548f9e5 /usr/src/cmd/fs.d/mount.c
parentefe44a0312f417787c2d6992582ad06b1b98cd8d (diff)
downloadillumos-joyent-0463c8009260e445fd1885cfaf98e04a586d495b.tar.gz
11618 Use exec_attr instead of suid for smbfs mount and unmount
Reviewed by: Jason King <jason.king@joyent.com> Reviewed by: Joshua M. Clulow <josh@sysmgr.org> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/cmd/fs.d/mount.c')
-rw-r--r--usr/src/cmd/fs.d/mount.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr/src/cmd/fs.d/mount.c b/usr/src/cmd/fs.d/mount.c
index 3fdb498f2c..8c8d7034fe 100644
--- a/usr/src/cmd/fs.d/mount.c
+++ b/usr/src/cmd/fs.d/mount.c
@@ -18,11 +18,6 @@
*
* CDDL HEADER END
*/
-
-/*
- * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- */
-
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
@@ -30,6 +25,8 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2019 Nexenta by DDN, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -55,6 +52,7 @@
#include <stropts.h>
#include <sys/conf.h>
#include <locale.h>
+#include <priv.h>
#include "fslib.h"
#define VFS_PATH "/usr/lib/fs"
@@ -822,6 +820,17 @@ doexec(char *fstype, char *newargv[])
}
/*
+ * Some file system types need pfexec.
+ */
+ if (strcmp(fstype, "smbfs") == 0 &&
+ setpflags(PRIV_PFEXEC, 1) != 0) {
+ (void) fprintf(stderr,
+ gettext("mount: unable to set PFEXEC flag: %s\n"),
+ strerror(errno));
+ exit(1);
+ }
+
+ /*
* Try to exec the fstype dependent portion of the mount.
* See if the directory is there before trying to exec dependent
* portion. This is only useful for eliminating the