summaryrefslogtreecommitdiff
path: root/modules/pam_stress/pam_stress.c
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2020-08-11 14:54:29 -0700
committerSteve Langasek <steve.langasek@canonical.com>2020-08-11 14:54:29 -0700
commitf6d08ed47a3da3c08345bce2ca366e961c52ad7c (patch)
treedcbd0efb229b17f696f7195671f05b354b4f70fc /modules/pam_stress/pam_stress.c
parent668b13da8f830c38388cecac45539972e80cb246 (diff)
parent9e5bea9e146dee574796259ca464ad2435be3590 (diff)
New upstream version 1.4.0
Diffstat (limited to 'modules/pam_stress/pam_stress.c')
-rw-r--r--modules/pam_stress/pam_stress.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/modules/pam_stress/pam_stress.c b/modules/pam_stress/pam_stress.c
index 87a6e7c6..6c7a6251 100644
--- a/modules/pam_stress/pam_stress.c
+++ b/modules/pam_stress/pam_stress.c
@@ -15,18 +15,6 @@
#include <string.h>
#include <unistd.h>
-/*
- * here, we make definitions for the externally accessible functions
- * in this file (these definitions are required for static modules
- * but strongly encouraged generally) they are used to instruct the
- * modules include file to define their prototypes.
- */
-
-#define PAM_SM_AUTH
-#define PAM_SM_ACCOUNT
-#define PAM_SM_SESSION
-#define PAM_SM_PASSWORD
-
#include <security/pam_modules.h>
#include <security/_pam_macros.h>
#include <security/pam_ext.h>
@@ -229,11 +217,10 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* try to get the username */
retval = pam_get_user(pamh, &username, "username: ");
- if (retval != PAM_SUCCESS || !username) {
- pam_syslog(pamh, LOG_WARNING,
- "pam_sm_authenticate: failed to get username");
- if (retval == PAM_SUCCESS)
- retval = PAM_USER_UNKNOWN; /* username was null */
+ if (retval != PAM_SUCCESS) {
+ pam_syslog(pamh, LOG_NOTICE,
+ "pam_sm_authenticate: cannot determine user name: %s",
+ pam_strerror(pamh, retval));
return retval;
}
else if (ctrl & PAM_ST_DEBUG) {
@@ -467,7 +454,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
}
pmsg[0] = &msg[0];
msg[0].msg_style = PAM_TEXT_INFO;
- if (asprintf(&txt, _("Changing STRESS password for %s."),
+ if (asprintf(&txt, "Changing STRESS password for %s.",
(const char *)username) < 0) {
pam_syslog(pamh, LOG_CRIT, "out of memory");
return PAM_BUF_ERR;
@@ -481,10 +468,10 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
pmsg[i] = &msg[i];
msg[i].msg_style = PAM_PROMPT_ECHO_OFF;
- msg[i++].msg = _("Enter new STRESS password: ");
+ msg[i++].msg = "Enter new STRESS password: ";
pmsg[i] = &msg[i];
msg[i].msg_style = PAM_PROMPT_ECHO_OFF;
- msg[i++].msg = _("Retype new STRESS password: ");
+ msg[i++].msg = "Retype new STRESS password: ";
resp = NULL;
retval = converse(pamh,i,pmsg,&resp);
@@ -513,8 +500,8 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
if (!(flags & PAM_SILENT) && !(ctrl & PAM_ST_NO_WARN)) {
pmsg[0] = &msg[0];
msg[0].msg_style = PAM_ERROR_MSG;
- msg[0].msg = _("Verification mis-typed; "
- "password unchanged");
+ msg[0].msg = "Verification mis-typed; "
+ "password unchanged";
resp = NULL;
(void) converse(pamh,1,pmsg,&resp);
if (resp) {