OSDN Git Service

assign user before use
authorh1618 <h1618@online.de>
Fri, 29 Nov 2013 15:35:22 +0000 (16:35 +0100)
committerh1618 <h1618@online.de>
Fri, 29 Nov 2013 15:35:22 +0000 (16:35 +0100)
sorry, jumped too short on my last commit: the user array has to be initialized before first use ...

Superuser/jni/su/activity.c

index c476a47..a3ef9c7 100644 (file)
@@ -90,6 +90,9 @@ int send_result(struct su_context *ctx, policy_t policy) {
     char desired_uid[256];
     sprintf(desired_uid, "%d", ctx->to.uid);
 
+    char user[64];
+    get_owner_login_user_args(ctx, user, sizeof(user));
+
     if (0 != ctx->user.android_user_id) {
         char android_user_id[256];
         sprintf(android_user_id, "%d", ctx->user.android_user_id);
@@ -125,9 +128,6 @@ int send_result(struct su_context *ctx, policy_t policy) {
         silent_run(user_result_command);
     }
 
-    char user[64];
-    get_owner_login_user_args(ctx, user, sizeof(user));
-
     char *result_command[] = {
         AM_PATH,
         ACTION_RESULT,