summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/cmd/dlmgmtd/dlmgmt_door.c5
-rw-r--r--usr/src/lib/libdladm/common/libdlmgmt.c11
2 files changed, 12 insertions, 4 deletions
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_door.c b/usr/src/cmd/dlmgmtd/dlmgmt_door.c
index 2374047078..aa32d7cee5 100644
--- a/usr/src/cmd/dlmgmtd/dlmgmt_door.c
+++ b/usr/src/cmd/dlmgmtd/dlmgmt_door.c
@@ -1036,8 +1036,11 @@ dlmgmt_handler(void *cookie, char *argp, size_t argsz, door_desc_t *dp,
}
eset = ucred_getprivset(cred, PRIV_EFFECTIVE);
- if (eset == NULL || !priv_ismember(eset, PRIV_SYS_DL_CONFIG))
+ if ((eset == NULL) ||
+ (!priv_ismember(eset, PRIV_SYS_DL_CONFIG) &&
+ !priv_ismember(eset, PRIV_SYS_NET_CONFIG))) {
err = EACCES;
+ }
ucred_free(cred);
if (err != 0)
goto fail;
diff --git a/usr/src/lib/libdladm/common/libdlmgmt.c b/usr/src/lib/libdladm/common/libdlmgmt.c
index 79932c7bde..2e7d6c58aa 100644
--- a/usr/src/lib/libdladm/common/libdlmgmt.c
+++ b/usr/src/lib/libdladm/common/libdlmgmt.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <door.h>
#include <errno.h>
#include <assert.h>
@@ -224,8 +222,15 @@ i_dladm_phys_status(datalink_id_t linkid, uint32_t *flagsp)
/*
* No active status, this link was removed. Update its status
* in the daemon and delete all active linkprops.
+ *
+ * Note that the operation could fail. If it does, return
+ * failure now since otherwise dladm_set_linkprop() might
+ * call back to i_dladm_phys_status() recursively.
*/
- (void) dladm_destroy_datalink_id(linkid, DLADM_OPT_ACTIVE);
+ status = dladm_destroy_datalink_id(linkid, DLADM_OPT_ACTIVE);
+ if (status != DLADM_STATUS_OK)
+ return (status);
+
(void) dladm_set_linkprop(linkid, NULL, NULL, 0,
DLADM_OPT_ACTIVE);