summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2002-09-21 14:14:40 +0000
committerVolker Lendecke <vlendec@samba.org>2002-09-21 14:14:40 +0000
commit9251be2afc79b0500e839fd6220c7a03a89eb169 (patch)
tree3f2144f91d37ac8d453cf19be361f4bb040d8f9c /source3/groupdb
parent515c1d42eec8d7c0a5eabeb72b274f5446012945 (diff)
downloadsamba-9251be2afc79b0500e839fd6220c7a03a89eb169.tar.gz
samba-9251be2afc79b0500e839fd6220c7a03a89eb169.tar.bz2
samba-9251be2afc79b0500e839fd6220c7a03a89eb169.zip
Sorry for the new parameter, but I think to really reflect what's coming
in via deltas, we need a way to set a user's primary group. Volker (This used to be commit 9f7a16acf1b1f3b100b85339aad8268254512e68)
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/mapping.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 70d6317a77..2c9c7f47ea 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -434,7 +434,7 @@ BOOL check_priv_in_privilege(PRIVILEGE_SET *priv_set, LUID_ATTR set)
}
/****************************************************************************
-remove a privilege to a privilege array
+remove a privilege from a privilege array
****************************************************************************/
BOOL remove_privilege(PRIVILEGE_SET *priv_set, LUID_ATTR set)
{
@@ -1187,7 +1187,25 @@ int smb_delete_group(char *unix_group)
}
/****************************************************************************
- Create a UNIX group on demand.
+ Set a user's primary UNIX group.
+****************************************************************************/
+int smb_set_primary_group(const char *unix_group, const char* unix_user)
+{
+ pstring add_script;
+ int ret;
+
+ pstrcpy(add_script, lp_setprimarygroup_script());
+ if (! *add_script) return -1;
+ all_string_sub(add_script, "%g", unix_group, sizeof(add_script));
+ all_string_sub(add_script, "%u", unix_user, sizeof(add_script));
+ ret = smbrun(add_script,NULL);
+ DEBUG(3,("smb_set_primary_group: "
+ "Running the command `%s' gave %d\n",add_script,ret));
+ return ret;
+}
+
+/****************************************************************************
+ Add a user to a UNIX group.
****************************************************************************/
int smb_add_user_group(char *unix_group, char *unix_user)
@@ -1205,7 +1223,7 @@ int smb_add_user_group(char *unix_group, char *unix_user)
}
/****************************************************************************
- Delete a UNIX group on demand.
+ Delete a user from a UNIX group
****************************************************************************/
int smb_delete_user_group(const char *unix_group, const char *unix_user)