summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/security/privilege.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c
index c21e1cbb6f..9fd7192883 100644
--- a/source4/libcli/security/privilege.c
+++ b/source4/libcli/security/privilege.c
@@ -235,6 +235,17 @@ enum sec_privilege sec_privilege_from_mask(uint64_t mask)
return -1;
}
+/*
+ map a privilege name to a privilege id. Return -1 if not found
+*/
+enum sec_privilege sec_privilege_from_index(int idx)
+{
+ if (idx >= 0 && idx<ARRAY_SIZE(privilege_names)) {
+ return privilege_names[idx].privilege;
+ }
+ return -1;
+}
+
/*
return a privilege mask given a privilege id