From 6a70164fe0c12ee8e914ddb934d7ef7e9ff232aa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 7 Jun 2005 12:15:10 +0000 Subject: r7361: fixed the 'file becomes a directory' bug that marc kapland found. Thanks Marc! (This used to be commit d1c5eb3693b77b3eb7527dc2758a6ea75a100376) --- source4/ntvfs/posix/pvfs_util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/pvfs_util.c') diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c index eb0f04728c..7eedc38cf9 100644 --- a/source4/ntvfs/posix/pvfs_util.c +++ b/source4/ntvfs/posix/pvfs_util.c @@ -68,11 +68,16 @@ NTSTATUS pvfs_match_attrib(struct pvfs_state *pvfs, struct pvfs_filename *name, /* normalise a file attribute */ -uint32_t pvfs_attrib_normalise(uint32_t attrib) +uint32_t pvfs_attrib_normalise(uint32_t attrib, mode_t mode) { if (attrib != FILE_ATTRIBUTE_NORMAL) { attrib &= ~FILE_ATTRIBUTE_NORMAL; } + if (S_ISDIR(mode)) { + attrib |= FILE_ATTRIBUTE_DIRECTORY; + } else { + attrib &= ~FILE_ATTRIBUTE_DIRECTORY; + } return attrib; } -- cgit