diff options
Diffstat (limited to 'modules/pam_selinux')
-rw-r--r-- | modules/pam_selinux/pam_selinux.c | 14 | ||||
-rw-r--r-- | modules/pam_selinux/pam_selinux_check.c | 4 |
2 files changed, 8 insertions, 10 deletions
diff --git a/modules/pam_selinux/pam_selinux.c b/modules/pam_selinux/pam_selinux.c index 373a38f3..a6ea3e1d 100644 --- a/modules/pam_selinux/pam_selinux.c +++ b/modules/pam_selinux/pam_selinux.c @@ -231,7 +231,7 @@ security_restorelabel_tty(const pam_handle_t *pamh, if (setfilecon(ptr, context) && errno != ENOENT) { pam_syslog(pamh, LOG_NOTICE, - "Warning! Could not relabel %s with %s, not relabeling.\n", + "Warning! Could not relabel %s with %s, not relabeling: %m", ptr, context); } } @@ -257,18 +257,18 @@ security_label_tty(pam_handle_t *pamh, char *tty, if (getfilecon(ptr, &prev_context) < 0) { pam_syslog(pamh, LOG_NOTICE, - "Warning! Could not get current context for %s, not relabeling.", + "Warning! Could not get current context for %s, not relabeling: %m", ptr); return NULL; } if( security_compute_relabel(usercon,prev_context,SECCLASS_CHR_FILE, &newdev_context)!=0) { - pam_syslog(pamh,LOG_NOTICE, - "Warning! Could not get new context for %s, not relabeling.", + pam_syslog(pamh, LOG_NOTICE, + "Warning! Could not get new context for %s, not relabeling: %m", ptr); pam_syslog(pamh, LOG_NOTICE, - "usercon=%s, prev_context=%s\n", usercon, prev_context); + "usercon=%s, prev_context=%s", usercon, prev_context); freecon(prev_context); return NULL; } @@ -276,8 +276,8 @@ security_label_tty(pam_handle_t *pamh, char *tty, if (status) { pam_syslog(pamh, LOG_NOTICE, - "Warning! Could not relabel %s with %s, not relabeling.%s", - ptr,newdev_context,strerror(errno)); + "Warning! Could not relabel %s with %s, not relabeling: %m", + ptr,newdev_context); freecon(prev_context); prev_context=NULL; } diff --git a/modules/pam_selinux/pam_selinux_check.c b/modules/pam_selinux/pam_selinux_check.c index 73c77fa0..30526d37 100644 --- a/modules/pam_selinux/pam_selinux_check.c +++ b/modules/pam_selinux/pam_selinux_check.c @@ -129,10 +129,8 @@ main (int argc, char **argv) childPid = fork(); if (childPid < 0) { - int errsv = errno; - /* error in fork() */ - fprintf(stderr, _("login: failure forking: %s"), strerror(errsv)); + fprintf(stderr, _("login: failure forking: %m")); pam_close_session(pamh, 0); /* We're done with PAM. Free `pam_handle'. */ pam_end( pamh, PAM_SUCCESS ); |