diff options
author | Kenny Root <kroot@google.com> | 2012-06-18 10:26:36 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2012-06-18 10:26:36 -0700 |
commit | 33ef4ee71277888304a3c67fdd8dfddd728b4c88 (patch) | |
tree | 801ef4c7dd0c1aad76254717e10d4d2d0c4c99da /cmds | |
parent | 98e955d295441636ba19688e18a8223691256d2c (diff) | |
parent | 4de60b26091b269c22803297c88b66ca5e3aed5f (diff) | |
download | frameworks_base-33ef4ee71277888304a3c67fdd8dfddd728b4c88.zip frameworks_base-33ef4ee71277888304a3c67fdd8dfddd728b4c88.tar.gz frameworks_base-33ef4ee71277888304a3c67fdd8dfddd728b4c88.tar.bz2 |
resolved conflicts for merge of 4de60b26 to jb-dev-plus-aosp
Change-Id: Id1b1847a3ab5c0f51ac8a732fce5ba12e5810259
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index b8a78de..1bb4935 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -57,19 +57,6 @@ int install(const char *pkgname, uid_t uid, gid_t gid) unlink(pkgdir); return -errno; } - if (chown(pkgdir, uid, gid) < 0) { - ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); - unlink(pkgdir); - return -errno; - } - -#ifdef HAVE_SELINUX - if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { - LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); - unlink(pkgdir); - return -errno; - } -#endif if (mkdir(libdir, 0755) < 0) { ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); @@ -98,6 +85,22 @@ int install(const char *pkgname, uid_t uid, gid_t gid) } #endif + if (chown(pkgdir, uid, gid) < 0) { + ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); + unlink(libdir); + unlink(pkgdir); + return -errno; + } + +#ifdef HAVE_SELINUX + if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { + LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); + unlink(libdir); + unlink(pkgdir); + return -errno; + } +#endif + return 0; } |