net: groupmap cleanup should not delete BUILTIN mappings
authorRalph Boehme <slow@samba.org>
Sat, 30 Sep 2017 06:45:41 +0000 (08:45 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 2 Oct 2017 13:17:00 +0000 (15:17 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13065

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct  2 15:17:00 CEST 2017 on sn-devel-144

source3/utils/net_groupmap.c

index b8c81de5bf13fb2dc80f8d8ffd60e4a15fe23790..2b75dd21a90b9aca004b33b4825f874035d4a19f 100644 (file)
@@ -764,7 +764,9 @@ static int net_groupmap_cleanup(struct net_context *c, int argc, const char **ar
                        printf(_("Group %s is not mapped\n"),
                                maps[i]->nt_name);
 
-               if (!sid_check_is_in_our_sam(&maps[i]->sid)) {
+               if (!sid_check_is_in_our_sam(&maps[i]->sid) &&
+                   !sid_check_is_in_builtin(&maps[i]->sid))
+               {
                        printf(_("Deleting mapping for NT Group %s, sid %s\n"),
                                maps[i]->nt_name,
                                sid_string_tos(&maps[i]->sid));