diff options
author | Simo Sorce <idra@samba.org> | 2004-03-19 14:31:09 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2004-03-19 14:31:09 +0000 |
commit | c8549363f49ac9ea818bd782319e57154764992f (patch) | |
tree | d1bfa900298151662dd669288860624e0998d2fe /source3/utils | |
parent | 9915ded60a1c59528ab6485dc14ac34f19f6153f (diff) | |
download | samba-c8549363f49ac9ea818bd782319e57154764992f.tar.gz samba-c8549363f49ac9ea818bd782319e57154764992f.tar.bz2 samba-c8549363f49ac9ea818bd782319e57154764992f.zip |
add privileges support to ldapsam too
(This used to be commit d940a2f77377dd1560cea4c782823cf9cd97a3aa)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_privileges.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/source3/utils/net_privileges.c b/source3/utils/net_privileges.c index 2e8bfe0c83..62f2da33ee 100644 --- a/source3/utils/net_privileges.c +++ b/source3/utils/net_privileges.c @@ -69,13 +69,13 @@ static void print_priv_entry(const char *privname, const char *description, cons return; } - if (!description) - d_printf("%s\n", privname); - else { - d_printf("%s\n", privname); + d_printf("%s\n", privname); + + if (description) { d_printf("\tdescription: %s\n", description); - d_printf("\tSIDS: %s\n", sid_list); } + + d_printf("\tSIDS: %s\n", sid_list); } /********************************************************* @@ -83,17 +83,13 @@ static void print_priv_entry(const char *privname, const char *description, cons **********************************************************/ static int net_priv_list(int argc, const char **argv) { - BOOL long_list = False; fstring privname = ""; fstring sid_string = ""; int i; /* get the options */ for ( i=0; i<argc; i++ ) { - if (!StrCaseCmp(argv[i], "verbose")) { - long_list = True; - } - else if (!StrnCaseCmp(argv[i], "privname", strlen("privname"))) { + if (!StrnCaseCmp(argv[i], "privname", strlen("privname"))) { fstrcpy(privname, get_string_param(argv[i])); if (!privname[0]) { d_printf("must supply a name\n"); @@ -122,21 +118,19 @@ static int net_priv_list(int argc, const char **argv) if (*privname) { const char *description = NULL; - if (long_list) { - BOOL found = False; + BOOL found = False; - for (i=0; privs[i].se_priv != SE_ALL_PRIVS; i++) { - if (!StrCaseCmp(privs[i].priv, privname)) { - description = privs[i].description; - found = True; - break; - } - } - if (!found) { - d_printf("No such privilege!\n"); - return -1; + for (i=0; privs[i].se_priv != SE_ALL_PRIVS; i++) { + if (!StrCaseCmp(privs[i].priv, privname)) { + description = privs[i].description; + found = True; + break; } } + if (!found) { + d_printf("No such privilege!\n"); + return -1; + } /* Get the current privilege from the database */ pdb_get_privilege_entry(privname, &sid_list); @@ -148,11 +142,8 @@ static int net_priv_list(int argc, const char **argv) if (!pdb_get_privilege_entry(privs[i].priv, &sid_list)) continue; - if (long_list) { - print_priv_entry(privs[i].priv, privs[i].description, sid_list); - } else { - print_priv_entry(privs[i].priv, NULL, sid_list); - } + + print_priv_entry(privs[i].priv, privs[i].description, sid_list); SAFE_FREE(sid_list); } |