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>
This commit is contained in:
Corinna Vinschen
2015-08-14 21:41:37 +02:00
parent c19f1b9f8e
commit 5de7f2e6c3
4 changed files with 21 additions and 8 deletions

View File

@@ -349,7 +349,7 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf)
add it to the mapping cache. */
buf->st_uid = cygheap->ugid_cache.get_uid (nfs_attr->uid);
buf->st_gid = cygheap->ugid_cache.get_gid (nfs_attr->gid);
if (buf->st_uid == ILLEGAL_UID)
if (buf->st_uid == ILLEGAL_UID && cygheap->pg.nss_pwd_db ())
{
uid_t map_uid = ILLEGAL_UID;
@@ -361,7 +361,7 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf)
cygheap->ugid_cache.add_uid (nfs_attr->uid, map_uid);
buf->st_uid = map_uid;
}
if (buf->st_gid == ILLEGAL_GID)
if (buf->st_gid == ILLEGAL_GID && cygheap->pg.nss_grp_db ())
{
gid_t map_gid = ILLEGAL_GID;