summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2001-03-23 01:19:21 +0000
committerJean-François Micouleau <jfm@samba.org>2001-03-23 01:19:21 +0000
commit810ea03f9b1960ca7e9a775cd3582ca6bc080597 (patch)
tree4676a9d0ae4c254eb32c896077a0e6d9831e1f85 /source3
parent81afba28c3fecb5471e1ff03a0b3dda5126f5aa6 (diff)
downloadsamba-810ea03f9b1960ca7e9a775cd3582ca6bc080597.tar.gz
samba-810ea03f9b1960ca7e9a775cd3582ca6bc080597.tar.bz2
samba-810ea03f9b1960ca7e9a775cd3582ca6bc080597.zip
can delete mapping from command line now.
J.F. (This used to be commit 287d9fb06899fe7721fdfcd5ccaa566935d31c4d)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/smbgroupedit.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/source3/utils/smbgroupedit.c b/source3/utils/smbgroupedit.c
index d36e982b51..01ae7091b3 100644
--- a/source3/utils/smbgroupedit.c
+++ b/source3/utils/smbgroupedit.c
@@ -87,9 +87,10 @@ int addgroup(char *group, enum SID_NAME_USE sid_type, char *ntgroup, char *ntcom
else
fstrcpy(comment, ntcomment);
- if(add_initial_entry(gid, string_sid, sid_type, group, comment, se_priv))
- return 0;
+ if(!add_initial_entry(gid, string_sid, sid_type, group, comment, se_priv))
+ return -1;
+ return 0;
}
/*********************************************************
@@ -144,20 +145,22 @@ int changegroup(char *sid_string, char *group, enum SID_NAME_USE sid_type, char
return -1;
}
+ return 0;
}
/*********************************************************
- List the groups.
+ Delete the group.
**********************************************************/
-int deletegroup(char *group)
+BOOL deletegroup(char *group)
{
- uint32 se_priv;
+ DOM_SID sid;
-/* convert_priv(&se_priv, privilege);*/
+ string_to_sid(&sid, group);
-/* if(add_initial_entry(gid, sid, type, ntgroup, "", se_priv))
- return 0;
-*/
+ if(!group_map_remove(sid))
+ return False;
+
+ return True;
}
/*********************************************************
@@ -173,8 +176,8 @@ int listgroup(enum SID_NAME_USE sid_type)
printf("Unix\tSID\ttype\tnt name\tnt comment\tprivilege\n");
- if (enum_group_mapping(sid_type, &map, &entries)==False)
- return 0;
+ if (!enum_group_mapping(sid_type, &map, &entries))
+ return -1;
for (i=0; i<entries; i++) {
decode_sid_name_use(group_type, (map[i]).sid_name_use);
@@ -185,7 +188,7 @@ int listgroup(enum SID_NAME_USE sid_type)
group_type, map[i].comment, priv_text);
}
-
+ return 0;
}
/*********************************************************