summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_echo/pam_echo.c6
-rw-r--r--modules/pam_localuser/pam_localuser.c4
-rw-r--r--modules/pam_selinux/pam_selinux.c14
-rw-r--r--modules/pam_selinux/pam_selinux_check.c4
-rw-r--r--modules/pam_unix/pam_unix_passwd.c11
-rw-r--r--modules/pam_unix/support.c2
-rw-r--r--modules/pam_unix/unix_chkpwd.c4
7 files changed, 20 insertions, 25 deletions
diff --git a/modules/pam_echo/pam_echo.c b/modules/pam_echo/pam_echo.c
index e13b8f94..d378f917 100644
--- a/modules/pam_echo/pam_echo.c
+++ b/modules/pam_echo/pam_echo.c
@@ -179,8 +179,7 @@ pam_echo (pam_handle_t *pamh, int flags, int argc, const char **argv)
if (read (fd, mtmp, st.st_size) == -1)
{
- pam_syslog (pamh, LOG_ERR, "Error while reading %s: %s",
- file, strerror (errno));
+ pam_syslog (pamh, LOG_ERR, "Error while reading %s: %m", file);
free (mtmp);
return PAM_IGNORE;
}
@@ -195,8 +194,7 @@ pam_echo (pam_handle_t *pamh, int flags, int argc, const char **argv)
free (mtmp);
}
else
- pam_syslog (pamh, LOG_ERR, "Cannot open %s: %s",
- file, strerror (errno));
+ pam_syslog (pamh, LOG_ERR, "Cannot open %s: %m", file);
return PAM_IGNORE;
}
diff --git a/modules/pam_localuser/pam_localuser.c b/modules/pam_localuser/pam_localuser.c
index df1c22bf..f99f4421 100644
--- a/modules/pam_localuser/pam_localuser.c
+++ b/modules/pam_localuser/pam_localuser.c
@@ -86,8 +86,8 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
/* open the file */
fp = fopen(filename, "r");
if(fp == NULL) {
- pam_syslog (pamh, LOG_ERR, "error opening \"%s\": %s",
- filename, strerror(errno));
+ pam_syslog (pamh, LOG_ERR, "error opening \"%s\": %m",
+ filename);
return PAM_SYSTEM_ERR;
}
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 );
diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c
index 09988816..fb96063e 100644
--- a/modules/pam_unix/pam_unix_passwd.c
+++ b/modules/pam_unix/pam_unix_passwd.c
@@ -481,8 +481,7 @@ static int save_old_password(pam_handle_t *pamh,
}
if (fclose(pwfile)) {
- D(("error writing entries to old passwords file: %s\n",
- strerror(errno)));
+ D(("error writing entries to old passwords file: %m"));
err = 1;
}
@@ -585,7 +584,7 @@ static int _update_passwd(pam_handle_t *pamh,
err = 0;
}
if (putpwent(tmpent, pwfile)) {
- D(("error writing entry to password file: %s\n", strerror(errno)));
+ D(("error writing entry to password file: %m"));
err = 1;
break;
}
@@ -594,7 +593,7 @@ static int _update_passwd(pam_handle_t *pamh,
fclose(opwfile);
if (fclose(pwfile)) {
- D(("error writing entries to password file: %s\n", strerror(errno)));
+ D(("error writing entries to password file: %m"));
err = 1;
}
@@ -700,7 +699,7 @@ static int _update_shadow(pam_handle_t *pamh, const char *forwho, char *towhat)
}
if (putspent(stmpent, pwfile)) {
- D(("error writing entry to shadow file: %s\n", strerror(errno)));
+ D(("error writing entry to shadow file: %m"));
err = 1;
break;
}
@@ -710,7 +709,7 @@ static int _update_shadow(pam_handle_t *pamh, const char *forwho, char *towhat)
fclose(opwfile);
if (fclose(pwfile)) {
- D(("error writing entries to shadow file: %s\n", strerror(errno)));
+ D(("error writing entries to shadow file: %m"));
err = 1;
}
diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
index ad949aab..733c25c2 100644
--- a/modules/pam_unix/support.c
+++ b/modules/pam_unix/support.c
@@ -556,7 +556,7 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
close(fds[1]);
rc=waitpid(child, &retval, 0); /* wait for helper to complete */
if (rc<0) {
- pam_syslog(pamh, LOG_ERR, "unix_chkpwd waitpid returned %d: %s", rc, strerror(errno));
+ pam_syslog(pamh, LOG_ERR, "unix_chkpwd waitpid returned %d: %m", rc);
retval = PAM_AUTH_ERR;
} else {
retval = WEXITSTATUS(retval);
diff --git a/modules/pam_unix/unix_chkpwd.c b/modules/pam_unix/unix_chkpwd.c
index b817f658..d63387b6 100644
--- a/modules/pam_unix/unix_chkpwd.c
+++ b/modules/pam_unix/unix_chkpwd.c
@@ -383,7 +383,7 @@ static int _update_shadow(const char *forwho)
}
if (putspent(stmpent, pwfile)) {
- D(("error writing entry to shadow file: %s\n", strerror(errno)));
+ D(("error writing entry to shadow file: %m"));
err = 1;
break;
}
@@ -393,7 +393,7 @@ static int _update_shadow(const char *forwho)
fclose(opwfile);
if (fclose(pwfile)) {
- D(("error writing entries to shadow file: %s\n", strerror(errno)));
+ D(("error writing entries to shadow file: %m"));
err = 1;
}