diff options
author | Kenny Root <kroot@google.com> | 2012-06-14 13:05:18 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2012-06-14 15:28:37 -0700 |
commit | 4503cf67b57a2a75e86ce4e36ccb69249048c996 (patch) | |
tree | fefc9f47f15765a3bc1511a208def1aaa917f430 /cmds | |
parent | 963218905ab31ccd2cf7ff57d372b185624543a4 (diff) | |
download | frameworks_base-4503cf67b57a2a75e86ce4e36ccb69249048c996.zip frameworks_base-4503cf67b57a2a75e86ce4e36ccb69249048c996.tar.gz frameworks_base-4503cf67b57a2a75e86ce4e36ccb69249048c996.tar.bz2 |
Make lib dir before changing ownership of app dir
Bug: 6668897
Change-Id: I8998a50359892277b15e80b5b5590ff94b125467
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 0bc7371..96a6438 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -53,11 +53,7 @@ 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; - } + if (mkdir(libdir, 0755) < 0) { ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); unlink(pkgdir); @@ -75,6 +71,13 @@ 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(libdir); + unlink(pkgdir); + return -errno; + } return 0; } |