From 79d3731d98836e6a502eb21d3d50df381b67600c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 21 Apr 2003 19:43:25 +0000 Subject: * fix segfault when no vfs objects defined * add "sid=..." to 'net groupmap add' (This used to be commit e5f6676639b5552f7dec90091c53cf14e78088ee) --- source3/Makefile.in | 2 +- source3/smbd/vfs.c | 4 ++-- source3/utils/net_groupmap.c | 20 +++++++++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/source3/Makefile.in b/source3/Makefile.in index f5f4aa1ed9..17519b44d7 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -124,7 +124,7 @@ SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ bin/swat@EXEEXT@ \ BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \ bin/testparm@EXEEXT@ bin/testprns@EXEEXT@ bin/smbstatus@EXEEXT@ BIN_PROGS2 = bin/smbcontrol@EXEEXT@ bin/smbtree@EXEEXT@ bin/tdbbackup@EXEEXT@ \ - bin/nmblookup@EXEEXT@ bin/pdbedit@EXEEXT@ bin/smbgroupedit@EXEEXT@ + bin/nmblookup@EXEEXT@ bin/pdbedit@EXEEXT@ BIN_PROGS3 = bin/smbpasswd@EXEEXT@ bin/rpcclient@EXEEXT@ bin/smbcacls@EXEEXT@ \ bin/profiles@EXEEXT@ bin/ntlm_auth@EXEEXT@ \ bin/smbcquotas@EXEEXT@ diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 06aca51322..75bcb09917 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -322,8 +322,8 @@ BOOL smbd_vfs_init(connection_struct *conn) vfs_init_default(conn); vfs_objects = lp_vfsobj(SNUM(conn)); - /* Override VFS functions if 'vfs object' was specified*/ - if (!vfs_objects) + /* Override VFS functions if 'vfs object' was not specified*/ + if (!vfs_objects || !vfs_objects[0]) return True; for(i=0; i name= type= [comment=]\n"); + if ( !ntgroup[0] || (!rid && !sid_string[0]} || sid_type==SID_NAME_UNKNOWN ) { + d_printf("Usage: net groupmap add {rid=|sid=} name=| type= [comment=]\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"); -- cgit