1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

Merge from appliance branch.

(This used to be commit 567b0095b1b8393b3b1e32533aa2860ab3dbfa47)
This commit is contained in:
Tim Potter 2000-08-28 06:46:53 +00:00
parent 9e1f9a5719
commit d12f3fea75
3 changed files with 12 additions and 0 deletions

View File

@ -462,6 +462,7 @@ failed authentication on named pipe %s.\n", domain, pipe_user_name, wks, p->name
p->pipe_user.gid = pass->pw_gid;
/* Set up pipe user group membership. */
initialise_groups(pipe_user_name, p->pipe_user.uid, p->pipe_user.gid);
initialize_groups(pipe_user_name, p->pipe_user.uid, p->pipe_user.gid);
get_current_groups( &p->pipe_user.ngroups, &p->pipe_user.groups);

View File

@ -188,6 +188,7 @@ NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups)
{
NT_USER_TOKEN *token;
DOM_SID *psids;
int i, psid_ndx = 0;
int i;
if ((token = (NT_USER_TOKEN *)malloc( sizeof(NT_USER_TOKEN) ) ) == NULL)
@ -202,11 +203,19 @@ NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups)
psids = token->user_sids;
token->num_sids = 2;
token->num_sids = ngroups + 2;
uid_to_sid( &psids[0], uid);
gid_to_sid( &psids[1], gid);
for (i = 0; i < ngroups; i++) {
if (groups[i] != gid) {
gid_to_sid( &psids[psid_ndx+2], groups[i]);
psid_ndx++;
token->num_sids++;
}
}
for (i = 0; i < ngroups; i++)
gid_to_sid( &psids[i+2], groups[i]);
@ -254,6 +263,7 @@ uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name,
/* Find all the groups this uid is in and store them.
Used by become_user() */
initialise_groups(unix_name, uid, gid);
initialize_groups(unix_name, uid, gid);
get_current_groups( &vuser->n_groups, &vuser->groups);

View File

@ -454,6 +454,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int
if (!IS_IPC(conn)) {
/* Find all the groups this uid is in and
store them. Used by become_user() */
initialise_groups(conn->user, conn->uid, conn->gid);
initialize_groups(conn->user, conn->uid, conn->gid);
get_current_groups(&conn->ngroups,&conn->groups);