From 1e14a517cf9b52c4d1697467d1c235215b8519cb Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 26 Apr 2020 11:12:59 +0000 Subject: pam_motd: remove redundant prefix from syslog messages pam_syslog already does all the prefixing we need. * modules/pam_motd/pam_motd.c (pam_split_string, try_to_display_directories_with_overrides): Remove "pam_motd: " prefix from strings passed to pam_syslog. Fixes: f9c9c721 ("pam_motd: Support multiple motd paths specified, with filename overrides (#69)") --- modules/pam_motd/pam_motd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/pam_motd') diff --git a/modules/pam_motd/pam_motd.c b/modules/pam_motd/pam_motd.c index 3be129a5..6017bb40 100644 --- a/modules/pam_motd/pam_motd.c +++ b/modules/pam_motd/pam_motd.c @@ -108,7 +108,7 @@ static int pam_split_string(const pam_handle_t *pamh, char *arg, char delim, arg_split = calloc(num_strs, sizeof(char *)); if (arg_split == NULL) { - pam_syslog(pamh, LOG_CRIT, "pam_motd: failed to allocate string array"); + pam_syslog(pamh, LOG_CRIT, "failed to allocate string array"); goto out; } @@ -202,11 +202,11 @@ static void try_to_display_directories_with_overrides(pam_handle_t *pamh, } if ((dirscans = calloc(num_motd_dirs, sizeof(struct dirent **))) == NULL) { - pam_syslog(pamh, LOG_CRIT, "pam_motd: failed to allocate dirent arrays"); + pam_syslog(pamh, LOG_CRIT, "failed to allocate dirent arrays"); goto out; } if ((dirscans_sizes = calloc(num_motd_dirs, sizeof(int))) == NULL) { - pam_syslog(pamh, LOG_CRIT, "pam_motd: failed to allocate dirent array sizes"); + pam_syslog(pamh, LOG_CRIT, "failed to allocate dirent array sizes"); goto out; } @@ -216,7 +216,7 @@ static void try_to_display_directories_with_overrides(pam_handle_t *pamh, filter_dirents, alphasort); if (rv < 0) { if (errno != ENOENT || report_missing) { - pam_syslog(pamh, LOG_ERR, "pam_motd: error scanning directory %s: %m", + pam_syslog(pamh, LOG_ERR, "error scanning directory %s: %m", motd_dir_path_split[i]); } dirscans_sizes[i] = rv; @@ -229,7 +229,7 @@ static void try_to_display_directories_with_overrides(pam_handle_t *pamh, /* Allocate space for all file names found in the directories, including duplicates. */ if ((dirnames_all = calloc(dirscans_size_total, sizeof(char *))) == NULL) { - pam_syslog(pamh, LOG_CRIT, "pam_motd: failed to allocate dirname array"); + pam_syslog(pamh, LOG_CRIT, "failed to allocate dirname array"); goto out; } -- cgit v1.2.3