summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSri Krishna Chaitanya Madireddy <smadir@codeaurora.org>2014-05-17 00:03:57 (GMT)
committerZhao Wei Liew <zhaoweiliew@gmail.com>2017-02-12 12:42:46 (GMT)
commitd48e2a056cfaf5e8d7e891a682cec8f562732aad (patch)
treea8ded7ad443cbebf45561b726089d25ae932729a
parent9cccca7472e8b2b7c13a06e69bc1350e6a1a9294 (diff)
downloadandroid_vendor_qcom_opensource_cryptfs_hw-d48e2a056cfaf5e8d7e891a682cec8f562732aad.zip
android_vendor_qcom_opensource_cryptfs_hw-d48e2a056cfaf5e8d7e891a682cec8f562732aad.tar.gz
android_vendor_qcom_opensource_cryptfs_hw-d48e2a056cfaf5e8d7e891a682cec8f562732aad.tar.bz2
qcom/common: Added O_NOFOLLOW to avoid follow the symlink
open system call is added with NOFOLLOW flag Change-Id: I402643635e3ee11b3ac5df63c3b71a9fd6f0d2db
-rw-r--r--cryptfs_hw.c2
1 files changed, 1 insertions, 1 deletions
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);