diff options
author | Gerald Carter <jerry@samba.org> | 2003-04-21 19:43:25 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-04-21 19:43:25 +0000 |
commit | 79d3731d98836e6a502eb21d3d50df381b67600c (patch) | |
tree | fe7daf249a07907cf058a440012ae01008b53d40 /source3/utils/net_groupmap.c | |
parent | efc8dac53869b87d9a18cb3f7943bae9f1e8c306 (diff) | |
download | samba-79d3731d98836e6a502eb21d3d50df381b67600c.tar.gz samba-79d3731d98836e6a502eb21d3d50df381b67600c.tar.bz2 samba-79d3731d98836e6a502eb21d3d50df381b67600c.zip |
* fix segfault when no vfs objects defined
* add "sid=..." to 'net groupmap add'
(This used to be commit e5f6676639b5552f7dec90091c53cf14e78088ee)
Diffstat (limited to 'source3/utils/net_groupmap.c')
-rw-r--r-- | source3/utils/net_groupmap.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index df49b7c219..76c153498a 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -200,6 +200,13 @@ int net_groupmap_add(int argc, const char **argv) 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 if ( !StrnCaseCmp(argv[i], "comment", strlen("comment")) ) { fstrcpy( ntcomment, get_string_param( argv[i] ) ); if ( !ntcomment[0] ) { @@ -230,14 +237,17 @@ int net_groupmap_add(int argc, const char **argv) } } - if ( !ntgroup[0] || !rid || sid_type==SID_NAME_UNKNOWN ) { - d_printf("Usage: net groupmap add rid=<int> name=<string> type=<domain|local|builtin> [comment=<string>]\n"); + if ( !ntgroup[0] || (!rid && !sid_string[0]} || sid_type==SID_NAME_UNKNOWN ) { + d_printf("Usage: net groupmap add {rid=<int>|sid=<string>} name=<string>| type=<domain|local|builtin> [comment=<string>]\n"); return -1; } - sid_copy(&sid, get_global_sam_sid()); - sid_append_rid(&sid, rid); - sid_to_string(string_sid, &sid); + /* append the rid to our own domain/machine SID if we don't have a full SID */ + if ( !sid_string[0] ) { + sid_copy(&sid, get_global_sam_sid()); + sid_append_rid(&sid, rid); + sid_to_string(string_sid, &sid); + } if (ntcomment[0]) fstrcpy(ntcomment, "Local Unix group"); |