summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
Diffstat (limited to 'cmds')
-rw-r--r--cmds/installd/commands.c4
-rw-r--r--cmds/installd/installd.c5
-rw-r--r--cmds/installd/installd.h2
-rw-r--r--cmds/screenshot/Android.mk2
-rw-r--r--cmds/screenshot/screenshot.c2
5 files changed, 8 insertions, 7 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 84ad204..e9d6b15 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -184,7 +184,7 @@ int delete_user_data(const char *pkgname, userid_t userid)
return delete_dir_contents(pkgdir, 0, "lib");
}
-int make_user_data(const char *pkgname, uid_t uid, userid_t userid)
+int make_user_data(const char *pkgname, uid_t uid, userid_t userid, const char* seinfo)
{
char pkgdir[PKG_PATH_MAX];
char applibdir[PKG_PATH_MAX];
@@ -245,7 +245,7 @@ int make_user_data(const char *pkgname, uid_t uid, userid_t userid)
return -1;
}
- if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) {
+ if (selinux_android_setfilecon2(pkgdir, pkgname, seinfo, uid) < 0) {
ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
unlink(libsymlink);
unlink(pkgdir);
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 1904408..a2cbccc 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -103,7 +103,8 @@ static int do_rm_user_data(char **arg, char reply[REPLY_MAX])
static int do_mk_user_data(char **arg, char reply[REPLY_MAX])
{
- return make_user_data(arg[0], atoi(arg[1]), atoi(arg[2])); /* pkgname, uid, userid */
+ return make_user_data(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3]);
+ /* pkgname, uid, userid, seinfo */
}
static int do_rm_user(char **arg, char reply[REPLY_MAX])
@@ -142,7 +143,7 @@ struct cmdinfo cmds[] = {
{ "rmuserdata", 2, do_rm_user_data },
{ "movefiles", 0, do_movefiles },
{ "linklib", 3, do_linklib },
- { "mkuserdata", 3, do_mk_user_data },
+ { "mkuserdata", 4, do_mk_user_data },
{ "rmuser", 1, do_rm_user },
};
diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h
index 635b07c..9ca2f86 100644
--- a/cmds/installd/installd.h
+++ b/cmds/installd/installd.h
@@ -194,7 +194,7 @@ int uninstall(const char *pkgname, userid_t userid);
int renamepkg(const char *oldpkgname, const char *newpkgname);
int fix_uid(const char *pkgname, uid_t uid, gid_t gid);
int delete_user_data(const char *pkgname, userid_t userid);
-int make_user_data(const char *pkgname, uid_t uid, userid_t userid);
+int make_user_data(const char *pkgname, uid_t uid, userid_t userid, const char* seinfo);
int delete_user(userid_t userid);
int delete_cache(const char *pkgname, userid_t userid);
int move_dex(const char *src, const char *dst);
diff --git a/cmds/screenshot/Android.mk b/cmds/screenshot/Android.mk
index 0afb2c5..1ee7807 100644
--- a/cmds/screenshot/Android.mk
+++ b/cmds/screenshot/Android.mk
@@ -7,6 +7,6 @@ LOCAL_MODULE := screenshot
LOCAL_SHARED_LIBRARIES := libcutils libz liblog
LOCAL_STATIC_LIBRARIES := libpng
-LOCAL_C_INCLUDES += external/zlib
+LOCAL_C_INCLUDES += external/zlib external/libpng
include $(BUILD_EXECUTABLE)
diff --git a/cmds/screenshot/screenshot.c b/cmds/screenshot/screenshot.c
index cca80c3..be1ecd4 100644
--- a/cmds/screenshot/screenshot.c
+++ b/cmds/screenshot/screenshot.c
@@ -8,7 +8,7 @@
#include <linux/fb.h>
#include <zlib.h>
-#include <libpng/png.h>
+#include <png.h>
#include "private/android_filesystem_config.h"