qcom/common: Added O_NOFOLLOW to avoid follow the symlink

open system call is added with NOFOLLOW flag

Change-Id: I402643635e3ee11b3ac5df63c3b71a9fd6f0d2db
This commit is contained in:
Sri Krishna Chaitanya Madireddy 2014-05-16 17:03:57 -07:00 committed by thecrazyskull
parent cd55e1f10a
commit 9e9930f883
1 changed files with 1 additions and 1 deletions

View File

@ -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);