Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fd64670 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

installd _delete_dir_contents: add O_NOFOLLOW

Add O_NOFOLLOW to make sure we're not following symlinks.

https://code.google.com/p/android/issues/detail?id=181945

Bug: 23044050
Change-Id: I3408309fd401aefb6ebecb2a052bba198eed7633
parent 2bb9861d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ static int _delete_dir_contents(DIR *d,
                if ((name[1] == '.') && (name[2] == 0)) continue;
            }

            subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY);
            subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY | O_NOFOLLOW);
            if (subfd < 0) {
                ALOGE("Couldn't openat %s: %s\n", name, strerror(errno));
                result = -1;