[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] login: permit change expired password
From:       Mario Abajo <marioabajo () gmail ! com>
Date:       2021-05-06 0:15:18
Message-ID: CAErzmWykK4WuwcO2+icNF-=Wp3kNxTP2LY_8yWp=FLU=tHV9tQ () mail ! gmail ! com
[Download RAW message or body]

Thanks Denys, here it is. Hope that it is much better now.

El dom, 2 may 2021 a las 10:19, Denys Vlasenko
(<vda.linux@googlemail.com>) escribió:
>
> Your patch is whitespace-damaged, please resend as attachment.
> Also, please add Signed-off-by.
>
> On Thu, Apr 29, 2021 at 12:55 AM Mario Abajo <marioabajo@gmail.com> wrote:
> >
> > Add support in login command to change password in case it is expired:
> > ---
> >
> > --- a/loginutils/login.c    2021-03-22 01:34:05.628165667 +0100
> > +++ b/loginutils/login.c    2021-03-22 01:36:22.719612349 +0100
> > @@ -434,6 +434,9 @@
> >          }
> >          /* check that the account is healthy */
> >          pamret = pam_acct_mgmt(pamh, 0);
> > +        if (pamret == PAM_NEW_AUTHTOK_REQD) {
> > +            pamret = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
> > +        }
> >          if (pamret != PAM_SUCCESS) {
> >              failed_msg = "acct_mgmt";
> >              goto pam_auth_failed;
> > _______________________________________________
> > busybox mailing list
> > busybox@busybox.net
> > http://lists.busybox.net/mailman/listinfo/busybox

["login.patch" (text/x-patch)]

commit 6b98c032493a6185d2bfb1bfb6dfc414614d7ddf
Author: Mario Abajo <marioabajo@gmail.com>
Date:   Thu May 6 02:10:47 2021 +0200

    login: permit change expired password wit PAM
    
    Signed-off-by: Mario Abajo <marioabajo@gmail.com>

diff --git a/loginutils/login.c b/loginutils/login.c
index 66ac7cf4c..95f45970b 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -442,6 +442,9 @@ int login_main(int argc UNUSED_PARAM, char **argv)
 		}
 		/* check that the account is healthy */
 		pamret = pam_acct_mgmt(pamh, 0);
+		if (pamret == PAM_NEW_AUTHTOK_REQD) {
+			pamret = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
+		}
 		if (pamret != PAM_SUCCESS) {
 			failed_msg = "acct_mgmt";
 			goto pam_auth_failed;


_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic