diff options
author | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2010-01-13 12:02:31 +0200 |
---|---|---|
committer | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2010-01-13 12:02:31 +0200 |
commit | 9b3871ed293f76e770e572cd6b59f59670f1f6f8 (patch) | |
tree | 2b79286e3a6f7af9e26466393a0b26075a238be8 /source3/passdb/util_unixsids.c | |
parent | 309473f938d18b9993c2c4f120eeff7b4641985a (diff) | |
parent | ca847952054f5bbde1d40ad4260589b6fcc9721d (diff) | |
download | samba-9b3871ed293f76e770e572cd6b59f59670f1f6f8.tar.gz samba-9b3871ed293f76e770e572cd6b59f59670f1f6f8.tar.xz samba-9b3871ed293f76e770e572cd6b59f59670f1f6f8.zip |
Merge branch 'master' of git://git.samba.org/samba
Diffstat (limited to 'source3/passdb/util_unixsids.c')
-rw-r--r-- | source3/passdb/util_unixsids.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/source3/passdb/util_unixsids.c b/source3/passdb/util_unixsids.c index ad51253058..afda253c70 100644 --- a/source3/passdb/util_unixsids.c +++ b/source3/passdb/util_unixsids.c @@ -37,14 +37,12 @@ bool sid_check_is_in_unix_users(const DOM_SID *sid) bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid) { - sid_copy(sid, &global_sid_Unix_Users); - return sid_append_rid(sid, (uint32_t)uid); + return sid_compose(sid, &global_sid_Unix_Users, uid); } bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid) { - sid_copy(sid, &global_sid_Unix_Groups); - return sid_append_rid(sid, (uint32_t)gid); + return sid_compose(sid, &global_sid_Unix_Groups, gid); } const char *unix_users_domain_name(void) @@ -55,17 +53,20 @@ const char *unix_users_domain_name(void) bool lookup_unix_user_name(const char *name, DOM_SID *sid) { struct passwd *pwd; + bool ret; pwd = getpwnam_alloc(talloc_autofree_context(), name); if (pwd == NULL) { return False; } - sid_copy(sid, &global_sid_Unix_Users); - sid_append_rid(sid, (uint32_t)pwd->pw_uid); /* For 64-bit uid's we have enough - * space ... */ + /* + * For 64-bit uid's we have enough space in the whole SID, + * should they become necessary + */ + ret = sid_compose(sid, &global_sid_Unix_Users, pwd->pw_uid); TALLOC_FREE(pwd); - return True; + return ret; } bool sid_check_is_unix_groups(const DOM_SID *sid) @@ -98,8 +99,9 @@ bool lookup_unix_group_name(const char *name, DOM_SID *sid) return False; } - sid_copy(sid, &global_sid_Unix_Groups); - sid_append_rid(sid, (uint32_t)grp->gr_gid); /* For 64-bit uid's we have enough - * space ... */ - return True; + /* + * For 64-bit gid's we have enough space in the whole SID, + * should they become necessary + */ + return sid_compose(sid, &global_sid_Unix_Groups, grp->gr_gid); } |