diff options
author | Tim Potter <tpot@samba.org> | 2000-08-28 06:46:53 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2000-08-28 06:46:53 +0000 |
commit | d12f3fea7529c03b6a3650e7aa8b4b47a445d548 (patch) | |
tree | 1fa513221c1213d057256b437944c7d99072a0d5 /source3/smbd | |
parent | 9e1f9a5719315aaa9b184fc5b0a750c68fbd8941 (diff) | |
download | samba-d12f3fea7529c03b6a3650e7aa8b4b47a445d548.tar.gz samba-d12f3fea7529c03b6a3650e7aa8b4b47a445d548.tar.bz2 samba-d12f3fea7529c03b6a3650e7aa8b4b47a445d548.zip |
Merge from appliance branch.
(This used to be commit 567b0095b1b8393b3b1e32533aa2860ab3dbfa47)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/password.c | 10 | ||||
-rw-r--r-- | source3/smbd/service.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 2b43f0baf4..3545f41dff 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -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); diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 8b63fe6662..500ba6e626 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -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); |