X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fexecute.c;h=ea745aa198334051c611b2d817c15248966d9f40;hb=a2c0e528b8b5ba370527db279605e4e4135689c1;hp=0f5152fb81d8c5343e01321c01d28a006b9a2f10;hpb=da927ba997d68401563b927f92e6e40e021a8e5c;p=elogind.git diff --git a/src/core/execute.c b/src/core/execute.c index 0f5152fb8..ea745aa19 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -885,7 +885,7 @@ fail: log_error("PAM failed: %s", pam_strerror(handle, pam_code)); err = -EPERM; /* PAM errors do not map to errno */ } else { - log_error("PAM failed: %m"); + log_error_errno(errno, "PAM failed: %m"); err = -errno; } @@ -1241,8 +1241,8 @@ static int exec_child(ExecCommand *command, const char *username = NULL, *home = NULL, *shell = NULL; unsigned n_dont_close = 0; int dont_close[n_fds + 4]; - uid_t uid = (uid_t) -1; - gid_t gid = (gid_t) -1; + uid_t uid = UID_INVALID; + gid_t gid = GID_INVALID; int i, err; assert(command); @@ -1436,7 +1436,7 @@ static int exec_child(ExecCommand *command, #ifdef ENABLE_KDBUS if (params->bus_endpoint_fd >= 0 && context->bus_endpoint) { - uid_t ep_uid = (uid == (uid_t) -1) ? 0 : uid; + uid_t ep_uid = (uid == UID_INVALID) ? 0 : uid; err = bus_kernel_set_endpoint_policy(params->bus_endpoint_fd, ep_uid, context->bus_endpoint); if (err < 0) { @@ -1550,7 +1550,7 @@ static int exec_child(ExecCommand *command, context->mount_flags); if (err == -EPERM) - log_unit_warning(params->unit_id, "Failed to set up file system namespace due to lack of privileges. Execution sandbox will not be in effect: %s", strerror(-err)); + log_unit_warning_errno(params->unit_id, err, "Failed to set up file system namespace due to lack of privileges. Execution sandbox will not be in effect: %m"); else if (err < 0) { *error = EXIT_NAMESPACE; return err;