]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/exec-invoke: drop unused param for acquire_home, prefix out param with ret_
authorMike Yuan <me@yhndnzj.com>
Sat, 25 May 2024 17:36:45 +0000 (01:36 +0800)
committerMike Yuan <me@yhndnzj.com>
Sun, 26 May 2024 05:40:48 +0000 (13:40 +0800)
src/core/exec-invoke.c

index 86bd7978968b715d6e45ac94e915fa37c422d7e8..e719976daa4fca45be64d83a839c6444cdbc48e7 100644 (file)
@@ -3585,12 +3585,12 @@ static int send_user_lookup(
         return 0;
 }
 
-static int acquire_home(const ExecContext *c, uid_t uid, const char** home, char **buf) {
+static int acquire_home(const ExecContext *c, const char **home, char **ret_buf) {
         int r;
 
         assert(c);
         assert(home);
-        assert(buf);
+        assert(ret_buf);
 
         /* If WorkingDirectory=~ is set, try to acquire a usable home directory. */
 
@@ -3600,11 +3600,11 @@ static int acquire_home(const ExecContext *c, uid_t uid, const char** home, char
         if (!c->working_directory_home)
                 return 0;
 
-        r = get_home_dir(buf);
+        r = get_home_dir(ret_buf);
         if (r < 0)
                 return r;
 
-        *home = *buf;
+        *home = *ret_buf;
         return 1;
 }
 
@@ -4291,7 +4291,7 @@ int exec_invoke(
 
         params->user_lookup_fd = safe_close(params->user_lookup_fd);
 
-        r = acquire_home(context, uid, &home, &home_buffer);
+        r = acquire_home(context, &home, &home_buffer);
         if (r < 0) {
                 *exit_status = EXIT_CHDIR;
                 return log_exec_error_errno(context, params, r, "Failed to determine $HOME for user: %m");