commit | 7fd646708c4248b0ee2bb35176b58b298a7b8ae0 | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Mon Aug 10 12:28:22 2015 -0700 |
committer | Nick Kralevich <nnk@google.com> | Mon Aug 10 12:28:22 2015 -0700 |
tree | d6c2aa616a2ce826c051455b5ee65449f0b86a6f | |
parent | 2bb9861d481b9a7e5e3001ebb9592f382d53b5e4 [diff] |
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
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp index ba411cd..4fcb1f5 100644 --- a/cmds/installd/utils.cpp +++ b/cmds/installd/utils.cpp
@@ -234,7 +234,7 @@ 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;