summaryrefslogtreecommitdiff
path: root/source3/utils/net_sam.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-30 15:27:40 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:11 +1000
commitad5ec58a714aba1f6c0894ca4e7207f1c5072949 (patch)
treea175fa95ba3251c95650addccb06ee3ca7ee64e3 /source3/utils/net_sam.c
parent4080ff7af5eec946a01c52f8d9ba01f1ef81fe71 (diff)
downloadsamba-ad5ec58a714aba1f6c0894ca4e7207f1c5072949.tar.gz
s3-privs Hide the bitmap-based grant_privilege and revoke_privilege
The new wrappers avoid anything but the core privileges code dealing with the bitmap values directly. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/utils/net_sam.c')
-rw-r--r--source3/utils/net_sam.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 53e8c96f63a..a5be7146311 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -692,7 +692,6 @@ static int net_sam_rights_grant(struct net_context *c, int argc,
struct dom_sid sid;
enum lsa_SidType type;
const char *dom, *name;
- uint64_t mask;
int i;
if (argc < 2 || c->display_usage) {
@@ -709,12 +708,13 @@ static int net_sam_rights_grant(struct net_context *c, int argc,
}
for (i=1; i < argc; i++) {
- if (!se_priv_from_name(argv[i], &mask)) {
+ enum sec_privilege privilege = sec_privilege_id(argv[i]);
+ if (privilege == SEC_PRIV_INVALID) {
d_fprintf(stderr, _("%s unknown\n"), argv[i]);
return -1;
}
- if (!grant_privilege(&sid, mask)) {
+ if (!grant_privilege_by_name(&sid, argv[i])) {
d_fprintf(stderr, _("Could not grant privilege\n"));
return -1;
}
@@ -731,7 +731,6 @@ static int net_sam_rights_revoke(struct net_context *c, int argc,
struct dom_sid sid;
enum lsa_SidType type;
const char *dom, *name;
- uint64_t mask;
int i;
if (argc < 2 || c->display_usage) {
@@ -748,13 +747,13 @@ static int net_sam_rights_revoke(struct net_context *c, int argc,
}
for (i=1; i < argc; i++) {
-
- if (!se_priv_from_name(argv[i], &mask)) {
+ enum sec_privilege privilege = sec_privilege_id(argv[i]);
+ if (privilege == SEC_PRIV_INVALID) {
d_fprintf(stderr, _("%s unknown\n"), argv[i]);
return -1;
}
- if (!revoke_privilege(&sid, mask)) {
+ if (!revoke_privilege_by_name(&sid, argv[i])) {
d_fprintf(stderr, _("Could not revoke privilege\n"));
return -1;
}