diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-08-14 22:41:37 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-08-14 22:41:37 +0300 |
commit | 5de7f2e6c31c59942d9e1b410c9436a21d2a0e7b (patch) | |
tree | 1b8a0bda86494de7ae514e5a5a912ae8656edf4c /winsup/cygwin/security.cc | |
parent | c19f1b9f8ef50a4498dd8de89399cf4382d1ebd7 (diff) |
Don't perform RFC2307 account mapping without account DB
* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Only try
to map user and group info per RFC2307 if account info is fetched
from Windows account DB.
(convert_samba_sd): Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r-- | winsup/cygwin/security.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 462506028..939dc35e0 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -1122,19 +1122,19 @@ convert_samba_sd (security_descriptor &sd_ret) return; group = sid; - if (sid_id_auth (owner) == 22) + if (sid_id_auth (owner) == 22 && cygheap->pg.nss_pwd_db ()) { struct passwd *pwd; uid_t uid = owner.get_uid (&cldap); if (uid < UNIX_POSIX_OFFSET && (pwd = internal_getpwuid (uid))) - owner.getfrompw (pwd); + owner.getfrompw (pwd); } - if (sid_id_auth (group) == 22) + if (sid_id_auth (group) == 22 && cygheap->pg.nss_grp_db ()) { struct group *grp; gid_t gid = group.get_gid (&cldap); if (gid < UNIX_POSIX_OFFSET && (grp = internal_getgrgid (gid))) - group.getfromgr (grp); + group.getfromgr (grp); } if (!NT_SUCCESS (RtlGetDaclSecurityDescriptor (sd_ret, &dummy, @@ -1150,14 +1150,16 @@ convert_samba_sd (security_descriptor &sd_ret) cygsid ace_sid ((PSID) &ace->SidStart); if (sid_id_auth (ace_sid) == 22) { - if (sid_sub_auth (ace_sid, 0) == 1) /* user */ + if (sid_sub_auth (ace_sid, 0) == 1 /* user */ + && cygheap->pg.nss_pwd_db ()) { struct passwd *pwd; uid_t uid = ace_sid.get_uid (&cldap); if (uid < UNIX_POSIX_OFFSET && (pwd = internal_getpwuid (uid))) ace_sid.getfrompw (pwd); } - else /* group */ + else if (sid_sub_auth (ace_sid, 0) == 1 /* group */ + && cygheap->pg.nss_grp_db ()) { struct group *grp; gid_t gid = ace_sid.get_gid (&cldap); |