]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/exec-invoke: drop unnecessary casts
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Feb 2025 05:28:41 +0000 (14:28 +0900)
committerMike Yuan <me@yhndnzj.com>
Fri, 7 Feb 2025 08:18:49 +0000 (09:18 +0100)
Follow-up for c554acd11d4dc778df1393c3a7e829a24de0455e.

src/core/exec-invoke.c

index 265fe648a6ee31d831e55acab21003dc93a45728..10111a81868bed5a818bfef49f284a19d7d83874 100644 (file)
@@ -3620,7 +3620,7 @@ static int apply_working_directory(
                 const ExecParameters *params,
                 ExecRuntime *runtime,
                 const char *pwent_home,
-                const char *const *env) {
+                char * const *env) {
 
         const char *wd;
         int r;
@@ -3629,7 +3629,7 @@ static int apply_working_directory(
 
         if (context->working_directory_home) {
                 /* Preferably use the data from $HOME, in case it was updated by a PAM module */
-                wd = strv_env_get((char**) env, "HOME");
+                wd = strv_env_get(env, "HOME");
                 if (!wd) {
                         /* If that's not available, use the data from the struct passwd entry: */
                         if (!pwent_home)
@@ -5511,7 +5511,7 @@ int exec_invoke(
          * running this service might have the correct privilege to change to the working directory. Also, it
          * is absolutely ðŸ’£ crucial ðŸ’£ we applied all mount namespacing rearrangements before this, so that
          * the cwd cannot be used to pin directories outside of the sandbox. */
-        r = apply_working_directory(context, params, runtime, pwent_home, (const char* const*) accum_env);
+        r = apply_working_directory(context, params, runtime, pwent_home, accum_env);
         if (r < 0) {
                 *exit_status = EXIT_CHDIR;
                 return log_exec_error_errno(context, params, r, "Changing to the requested working directory failed: %m");