From 1da530956da685c85997f34cbdea29a58a7756b3 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Apr 2003 00:34:59 +0000 Subject: allow the unix group in a mapping to be changed; doesn't work with LDAP right now but should be ok with tdb's (This used to be commit 039e77e1d5b6e68cf85bdcc71ff309ebe6528728) --- source3/utils/net_groupmap.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index 63e69fa7cf..2b88183f22 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -294,9 +294,11 @@ int net_groupmap_modify(int argc, const char **argv) fstring ntcomment = ""; fstring type = ""; fstring ntgroup = ""; + fstring unixgrp = ""; fstring sid_string = ""; enum SID_NAME_USE sid_type = SID_NAME_UNKNOWN; int i; + gid_t gid; /* get the options */ for ( i=0; i|sid=} [comment=] [type=\n"); + d_printf("Usage: net groupmap modify {ntgroup=|sid=} [comment=] [unixgroup=] [type=]\n"); return -1; } @@ -386,6 +395,17 @@ int net_groupmap_modify(int argc, const char **argv) if ( ntgroup[0] ) fstrcpy( map.nt_name, ntgroup ); + + if ( unixgrp[0] ) { + gid = nametogid( unixgrp ); + if ( gid == -1 ) { + d_printf("Unable to lookup UNIX group %s. Make sure the group exists.\n", + unixgrp); + return -1; + } + + map.gid = gid; + } #if 0 /* Change the privilege if new one */ -- cgit