summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-04-24 16:48:08 +0000
committerGerald Carter <jerry@samba.org>2003-04-24 16:48:08 +0000
commit467f5457466e3488e60bcab3505bc920822672e6 (patch)
treeb926184e927dbef364d97edd7693295ae56b20f5
parent6adaba284ec82390c8a0e83a1c3399b1be8078e8 (diff)
downloadsamba-467f5457466e3488e60bcab3505bc920822672e6.tar.gz
samba-467f5457466e3488e60bcab3505bc920822672e6.tar.bz2
samba-467f5457466e3488e60bcab3505bc920822672e6.zip
groupmap delete should take a name or a SID
(This used to be commit 4c7ee6e6b82c69ead96bc90c75cbdfab19486bb5)
-rw-r--r--source3/utils/net_groupmap.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c
index 2b88183f22..aaefda2e5c 100644
--- a/source3/utils/net_groupmap.c
+++ b/source3/utils/net_groupmap.c
@@ -115,19 +115,27 @@ int net_groupmap_list(int argc, const char **argv)
BOOL long_list = False;
int i;
fstring ntgroup = "";
+ fstring sid_string = "";
/* get the options */
for ( i=0; i<argc; i++ ) {
if ( !StrCaseCmp(argv[i], "verbose")) {
long_list = True;
}
- else if ( !StrnCaseCmp(argv[i], "name", strlen("name")) ) {
+ else if ( !StrnCaseCmp(argv[i], "ntgroup", strlen("ntgroup")) ) {
fstrcpy( ntgroup, get_string_param( argv[i] ) );
if ( !ntgroup[0] ) {
d_printf("must supply a name\n");
return -1;
}
}
+ else if ( !StrnCaseCmp(argv[i], "sid", strlen("sid")) ) {
+ fstrcpy( sid_string, get_string_param( argv[i] ) );
+ if ( !sid_string[0] ) {
+ d_printf("must supply a SID\n");
+ return -1;
+ }
+ }
else {
d_printf("Bad option: %s\n", argv[i]);
return -1;
@@ -135,9 +143,12 @@ int net_groupmap_list(int argc, const char **argv)
}
/* list a single group is given a name */
- if ( ntgroup[0] ) {
+ if ( ntgroup[0] || sid_string[0] ) {
DOM_SID sid;
GROUP_MAP map;
+
+ if ( sid_string[0] )
+ fstrcpy( ntgroup, sid_string);
if (!get_sid_from_input(&sid, ntgroup)) {
return -1;