1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

groupmap delet should take a name or a SID

(This used to be commit d9277bd06401cb040390739ae730c8991736c886)
This commit is contained in:
Gerald Carter 2003-04-24 16:47:32 +00:00
parent 7041e295eb
commit 9530bbe2ad

View File

@ -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;