add new flag AT_SYMLINK_NOFOLLOW for fchownat(2)

Signed-off-by: Zeng Linggang <[email protected]>
---
 testcases/kernel/syscalls/fchownat/fchownat01.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c 
b/testcases/kernel/syscalls/fchownat/fchownat01.c
index b46a721..97bb9da 100644
--- a/testcases/kernel/syscalls/fchownat/fchownat01.c
+++ b/testcases/kernel/syscalls/fchownat/fchownat01.c
@@ -66,6 +66,8 @@ static char pathname[PATH_MAX+1];
 static char testfile[PATH_MAX+1];
 static char testfile2[PATH_MAX+1];
 static char testfile3[PATH_MAX+1];
+static char testfile7[PATH_MAX+1];
+static char testfile7_tmp[PATH_MAX+1];
 static int dirfd;
 static int fd;
 static int no_fd;
@@ -83,6 +85,7 @@ static struct test_case_t {
        {EBADF, 0, &no_fd, testfile},
        {EINVAL, 9999, &dirfd, testfile},
        {0, 0, &cu_fd, testfile},
+       {0, AT_SYMLINK_NOFOLLOW, &dirfd, testfile7},
 };
 
 char *TCID = "fchownat01";
@@ -155,6 +158,13 @@ void setup()
        no_fd = 100;
 
        cu_fd = AT_FDCWD;
+
+       sprintf(testfile7, "fchownattestfile7%d.txt", getpid());
+
+       sprintf(testfile7_tmp, "fchownattestdir%d/fchownattestfile7%d.txt",
+               getpid(), getpid());
+
+       SAFE_SYMLINK(cleanup, testfile3, testfile7_tmp);
 }
 
 void cleanup()
@@ -167,6 +177,8 @@ void cleanup()
 
        SAFE_UNLINK(NULL, testfile3);
 
+       SAFE_UNLINK(NULL, testfile7_tmp);
+
        rmdir(pathname);
 
        TEST_CLEANUP;
-- 
1.8.2.1




------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to