Revert "bionic: prevent root processes from calling __system_property_add"

This reverts commit fb9b7b436f.
This commit is contained in:
Greg Hackmann
2013-06-24 18:05:14 -07:00
parent 982463d99b
commit b938756eb3

View File

@@ -128,13 +128,11 @@ static int map_prop_area_rw()
{ {
prop_area *pa; prop_area *pa;
int fd; int fd;
int ret;
/* dev is a tmpfs that we can use to carve a shared workspace /* dev is a tmpfs that we can use to carve a shared workspace
* out of, so let's do that... * out of, so let's do that...
*/ */
fd = open(property_filename, O_RDWR | O_CREAT | O_NOFOLLOW | O_CLOEXEC | fd = open(property_filename, O_RDWR | O_CREAT | O_NOFOLLOW, 0644);
O_EXCL, 0444);
if (fd < 0) { if (fd < 0) {
if (errno == EACCES) { if (errno == EACCES) {
/* for consistency with the case where the process has already /* for consistency with the case where the process has already
@@ -145,10 +143,6 @@ static int map_prop_area_rw()
return -1; return -1;
} }
ret = fcntl(fd, F_SETFD, FD_CLOEXEC);
if (ret < 0)
goto out;
if (ftruncate(fd, PA_SIZE) < 0) if (ftruncate(fd, PA_SIZE) < 0)
goto out; goto out;
@@ -192,16 +186,8 @@ static int map_prop_area()
{ {
bool fromFile = true; bool fromFile = true;
int result = -1; int result = -1;
int fd;
int ret;
fd = open(property_filename, O_RDONLY | O_NOFOLLOW | O_CLOEXEC); int fd = open(property_filename, O_RDONLY | O_NOFOLLOW);
if (fd >= 0) {
/* For old kernels that don't support O_CLOEXEC */
ret = fcntl(fd, F_SETFD, FD_CLOEXEC);
if (ret < 0)
goto cleanup;
}
if ((fd < 0) && (errno == ENOENT)) { if ((fd < 0) && (errno == ENOENT)) {
/* /*