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:
parent
cd55e1f10a
commit
9e9930f883
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue