char mode[12];
FILE *fp;
if ((fp = fopen(REQUESTOR_MULTIUSER_MODE, "r"))) {
+ fgets(mode, sizeof(mode), fp);
int last = strlen(mode) - 1;
if (mode[last] == '\n')
mode[last] = '\0';
- fgets(mode, sizeof(mode), fp);
if (strcmp(mode, MULTIUSER_VALUE_USER) == 0) {
ret = MULTIUSER_MODE_USER;
} else if (strcmp(mode, MULTIUSER_VALUE_OWNER_MANAGED) == 0) {
read_options(&ctx);
user_init(&ctx);
+ // TODO: customizable behavior for shell? It can currently be toggled via settings.
+ if (ctx.from.uid == AID_ROOT || ctx.from.uid == AID_SHELL) {
+ LOGD("Allowing root/shell.");
+ allow(&ctx);
+ }
+
// verify superuser is installed
if (stat(ctx.user.base_path, &st) < 0) {
// send to market
- silent_run("am start -d market://details?id=" JAVA_PACKAGE_NAME);
+ if (0 == strcmp(JAVA_PACKAGE_NAME, REQUESTOR))
+ silent_run("am start -d http://www.clockworkmod.com/superuser/install.html -a android.intent.action.VIEW");
PLOGE("stat %s", ctx.user.base_path);
deny(&ctx);
}
ctx.umask = umask(027);
- // TODO: customizable behavior for shell? It can currently be toggled via settings.
- if (ctx.from.uid == AID_ROOT || ctx.from.uid == AID_SHELL) {
- LOGD("Allowing root/shell.");
- allow(&ctx);
- }
-
int ret = mkdir(REQUESTOR_CACHE_PATH, 0770);
if (chown(REQUESTOR_CACHE_PATH, st.st_uid, st.st_gid)) {
PLOGE("chown (%s, %ld, %ld)", REQUESTOR_CACHE_PATH, st.st_uid, st.st_gid);