lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.9-5-gd8b1640

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd branch master updated. 0.9.9-5-gd8b1640



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".

The branch, master has been updated
       via  d8b16407408ae2caef46ffef3abbc59266f476ba (commit)
      from  84676ab4a6a4821e8dbd8c340216b68c24aeeea7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/nss-pam-ldapd/commit/?id=d8b16407408ae2caef46ffef3abbc59266f476ba

commit d8b16407408ae2caef46ffef3abbc59266f476ba
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Mon Aug 6 19:36:10 2018 +0200

    Make password expiry messages correct and consistent
    
    Thanks to Têko Mihinto.
    See https://bugzilla.redhat.com/show_bug.cgi?id=1612543

diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 6b98a21..a07be36 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -435,36 +435,36 @@ static void print_ppolicy_expiry(MYLDAP_SESSION *session, 
unsigned int sec)
   }
   if (days > 1)
     mysnprintf(session->policy_message, sizeof(session->policy_message),
-               "Password will expires in %u days", days);
+               "Password will expire in %u days", days);
   else if (days > 0)
     mysnprintf(session->policy_message, sizeof(session->policy_message),
-               "Password will expires in %u hours", hours + 24);
+               "Password will expire in %u hours", hours + 24);
   else if (hours > 1)
   {
     if (minutes > 1)
       mysnprintf(session->policy_message, sizeof(session->policy_message),
-                 "Password will expires in %u hours and %u minutes",
+                 "Password will expire in %u hours and %u minutes",
                  hours, minutes);
     else
       mysnprintf(session->policy_message, sizeof(session->policy_message),
-                 "Password will expires in %u hours", hours);
+                 "Password will expire in %u hours", hours);
   }
   else if (hours > 0)
     mysnprintf(session->policy_message, sizeof(session->policy_message),
-               "Password will expires in %u minutes", minutes + 60);
+               "Password will expire in %u minutes", minutes + 60);
   else if (minutes > 1)
   {
     if (sec > 1)
       mysnprintf(session->policy_message, sizeof(session->policy_message),
-                 "Password will expires in %u minutes and %u seconds",
+                 "Password will expire in %u minutes and %u seconds",
                  minutes, sec);
     else
       mysnprintf(session->policy_message, sizeof(session->policy_message),
-                 "Password will expires in %u minutes", minutes);
+                 "Password will expire in %u minutes", minutes);
   }
   else
     mysnprintf(session->policy_message, sizeof(session->policy_message),
-               "Password will expires in %u seconds", sec);
+               "Password will expire in %u seconds", sec);
 }
 
 static void handle_ppolicy_controls(MYLDAP_SESSION *session, LDAP *ld, 
LDAPControl **ctrls)
diff --git a/nslcd/pam.c b/nslcd/pam.c
index 2132107..e7e994a 100644
--- a/nslcd/pam.c
+++ b/nslcd/pam.c
@@ -329,7 +329,7 @@ static int check_shadow(MYLDAP_SESSION *session, const char 
*username,
   if ((expiredate != -1) && (today >= expiredate))
   {
     daysleft = today - expiredate;
-    mysnprintf(authzmsg, authzmsgsz - 1, "account expired %ld days ago",
+    mysnprintf(authzmsg, authzmsgsz - 1, "Account expired %ld days ago",
                daysleft);
     log_log(LOG_WARNING, "%s: %s: %s",
             myldap_get_dn(entry), attmap_shadow_shadowExpire, authzmsg);
@@ -343,7 +343,7 @@ static int check_shadow(MYLDAP_SESSION *session, const char 
*username,
     /* check lastchanged */
     if (lastchangedate == 0)
     {
-      mysnprintf(authzmsg, authzmsgsz - 1, "need a new password");
+      mysnprintf(authzmsg, authzmsgsz - 1, "Need a new password");
       log_log(LOG_WARNING, "%s: %s: %s",
               myldap_get_dn(entry), attmap_shadow_shadowLastChange, authzmsg);
       return NSLCD_PAM_NEW_AUTHTOK_REQD;
@@ -356,9 +356,9 @@ static int check_shadow(MYLDAP_SESSION *session, const char 
*username,
       /* check maxdays */
       daysleft = lastchangedate + maxdays - today;
       if (daysleft == 0)
-        mysnprintf(authzmsg, authzmsgsz - 1, "password will expire today");
+        mysnprintf(authzmsg, authzmsgsz - 1, "Password will expire today");
       else if (daysleft < 0)
-        mysnprintf(authzmsg, authzmsgsz - 1, "password expired %ld days ago",
+        mysnprintf(authzmsg, authzmsgsz - 1, "Password expired %ld days ago",
                    -daysleft);
       /* check inactdays */
       if ((daysleft <= 0) && (inactdays != -1))
@@ -390,7 +390,7 @@ static int check_shadow(MYLDAP_SESSION *session, const char 
*username,
       if ((warndays > 0) && (daysleft <= warndays))
       {
         mysnprintf(authzmsg, authzmsgsz - 1,
-                   "password will expire in %ld days", daysleft);
+                   "Password will expire in %ld days", daysleft);
         log_log(LOG_WARNING, "%s: %s: %s",
                 myldap_get_dn(entry), attmap_shadow_shadowWarning, authzmsg);
       }
@@ -402,7 +402,7 @@ static int check_shadow(MYLDAP_SESSION *session, const char 
*username,
     if ((mindays != -1) && (daysleft > 0))
     {
       mysnprintf(authzmsg, authzmsgsz - 1,
-                 "password cannot be changed for another %ld days", daysleft);
+                 "Password cannot be changed for another %ld days", daysleft);
       log_log(LOG_WARNING, "%s: %s: %s",
               myldap_get_dn(entry), attmap_shadow_shadowMin, authzmsg);
       return NSLCD_PAM_AUTHTOK_ERR;

-----------------------------------------------------------------------

Summary of changes:
 nslcd/myldap.c | 16 ++++++++--------
 nslcd/pam.c    | 12 ++++++------
 2 files changed, 14 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
nss-pam-ldapd
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/nss-pam-ldapd-commits/