don't reset the group type unless specified
authorGerald Carter <jerry@samba.org>
Tue, 22 Apr 2003 18:03:55 +0000 (18:03 +0000)
committerGerald Carter <jerry@samba.org>
Tue, 22 Apr 2003 18:03:55 +0000 (18:03 +0000)
(This used to be commit 541f40a144461ca139ac53837d3f31ce6972d18c)

source3/utils/net_groupmap.c

index 2436fffc6df775a5906a27a29e88c366e5ebb237..63e69fa7cff630e8ad3077630cabd149fbbda2b0 100644 (file)
@@ -370,20 +370,14 @@ int net_groupmap_modify(int argc, const char **argv)
         * Allow changing of group type only between domain and local
         * We disallow changing Builtin groups !!! (SID problem)
         */ 
-       if (sid_type==SID_NAME_ALIAS 
-           || sid_type==SID_NAME_DOM_GRP 
-           || sid_type==SID_NAME_UNKNOWN) 
-       {
-               if (map.sid_name_use==SID_NAME_ALIAS 
-                   || map.sid_name_use==SID_NAME_DOM_GRP
-                   || map.sid_name_use==SID_NAME_UNKNOWN) 
-               {
-                       map.sid_name_use=sid_type;
-               } else {
-                       printf("cannot change group type to builtin\n");
-               };
-       } else {
-               printf("cannot change group type from builtin\n");
+       if ( sid_type != SID_NAME_UNKNOWN ) 
+       { 
+               if ( map.sid_name_use == SID_NAME_WKN_GRP ) {
+                       d_printf("You can only change between domain and local groups.\n");
+                       return -1;
+               }
+               
+               map.sid_name_use=sid_type;
        }
 
        /* Change comment if new one */