From d48e2a056cfaf5e8d7e891a682cec8f562732aad Mon Sep 17 00:00:00 2001 From: Sri Krishna Chaitanya Madireddy Date: Fri, 16 May 2014 17:03:57 -0700 Subject: qcom/common: Added O_NOFOLLOW to avoid follow the symlink open system call is added with NOFOLLOW flag Change-Id: I402643635e3ee11b3ac5df63c3b71a9fd6f0d2db --- cryptfs_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptfs_hw.c b/cryptfs_hw.c index 84e81b4..18486c2 100644 --- a/cryptfs_hw.c +++ b/cryptfs_hw.c @@ -84,7 +84,7 @@ static unsigned char* get_tmp_passwd(const char* passwd) static void wipe_userdata() { mkdir("/cache/recovery", 0700); - int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC, 0600); + int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC|O_NOFOLLOW, 0600); if (fd >= 0) { write(fd, "--wipe_data", strlen("--wipe_data") + 1); close(fd); -- cgit v1.2.3