From 2ae6d093e28cab99518fb2eea0893360024843fa Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 25 Jun 2006 05:49:11 -0700 Subject: [PATCH] --- yaml --- r: 29803 b: refs/heads/master c: 45c9b11a1d07770cabb48cb0f7960a77650ffc64 h: refs/heads/master i: 29801: effef18e33f2b93d0c869cceede3ea2f3a019af5 29799: 49bdde7dd6145e67ed538f25ff3e4ce9b6a44683 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 6 ++++-- trunk/include/linux/fcntl.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index cfdbfe523662..f23744a7f3b3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 584e1236bbcdfec3f64c751908b8b4fe868c2d20 +refs/heads/master: 45c9b11a1d07770cabb48cb0f7960a77650ffc64 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index bb4a3e40e432..c784e8bb57a3 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2243,14 +2243,16 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname, int error; char * to; - if (flags != 0) + if ((flags & ~AT_SYMLINK_FOLLOW) != 0) return -EINVAL; to = getname(newname); if (IS_ERR(to)) return PTR_ERR(to); - error = __user_walk_fd(olddfd, oldname, 0, &old_nd); + error = __user_walk_fd(olddfd, oldname, + flags & AT_SYMLINK_FOLLOW ? LOOKUP_FOLLOW : 0, + &old_nd); if (error) goto exit; error = do_path_lookup(newdfd, to, LOOKUP_PARENT, &nd); diff --git a/trunk/include/linux/fcntl.h b/trunk/include/linux/fcntl.h index c52a63755fdd..996f5611cd59 100644 --- a/trunk/include/linux/fcntl.h +++ b/trunk/include/linux/fcntl.h @@ -29,6 +29,7 @@ #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ #define AT_REMOVEDIR 0x200 /* Remove directory instead of unlinking file. */ +#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ #ifdef __KERNEL__