From 67e5ba51d0dda3f3db687e9343c1c9e166a996ca Mon Sep 17 00:00:00 2001 From: jpandre Date: Wed, 7 Nov 2007 09:25:00 +0000 Subject: [PATCH] Deny hard link when source directory is protected --- src/ntfs-3g.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index e2685dea..1109b468 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -1191,9 +1191,10 @@ static int ntfs_fuse_ln(const char *old_path, const char *new_path, int mtime) goto exit; } - /* JPA make sure the parent directory is writeable */ + /* JPA make sure the parent directories are writeable */ if (ntfs_fuse_fill_security_context(&security) - && !ntfs_allowed_access(&security,path,dir_ni,S_IWRITE + S_IEXEC)) + && (!ntfs_allowed_dir_access(&security,old_path,S_IWRITE + S_IEXEC) + || !ntfs_allowed_access(&security,path,dir_ni,S_IWRITE + S_IEXEC))) res = -EACCES; else {