summaryrefslogtreecommitdiff
path: root/auth-sia.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2009-08-28 10:16:44 +1000
committerDarren Tucker <dtucker@zip.com.au>2009-08-28 10:16:44 +1000
commit28b973ea267e790e566da7a11bd36d5c90ed5841 (patch)
tree935a75b66d97793a784056b2f146c48320ae2463 /auth-sia.c
parent82edf23fffc4accf7686da08367e9fd5b5baa487 (diff)
- dtucker [auth-sia.c] Roll back the change for bug #1241 as it apparently
causes problems in some Tru64 configurations.
Diffstat (limited to 'auth-sia.c')
-rw-r--r--auth-sia.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/auth-sia.c b/auth-sia.c
index debf30201..a9e1c258c 100644
--- a/auth-sia.c
+++ b/auth-sia.c
@@ -34,10 +34,6 @@
34#include <unistd.h> 34#include <unistd.h>
35#include <stdarg.h> 35#include <stdarg.h>
36#include <string.h> 36#include <string.h>
37#include <sys/types.h>
38#include <sys/security.h>
39#include <prot.h>
40#include <time.h>
41 37
42#include "ssh.h" 38#include "ssh.h"
43#include "key.h" 39#include "key.h"
@@ -53,52 +49,6 @@ extern ServerOptions options;
53extern int saved_argc; 49extern int saved_argc;
54extern char **saved_argv; 50extern char **saved_argv;
55 51
56static int
57sia_password_change_required(const char *user)
58{
59 struct es_passwd *acct;
60 time_t pw_life;
61 time_t pw_date;
62
63 set_auth_parameters(saved_argc, saved_argv);
64
65 if ((acct = getespwnam(user)) == NULL) {
66 error("Couldn't access protected database entry for %s", user);
67 endprpwent();
68 return (0);
69 }
70
71 /* If forced password change flag is set, honor it */
72 if (acct->uflg->fg_psw_chg_reqd && acct->ufld->fd_psw_chg_reqd) {
73 endprpwent();
74 return (1);
75 }
76
77 /* Obtain password lifetime; if none, it can't have expired */
78 if (acct->uflg->fg_expire)
79 pw_life = acct->ufld->fd_expire;
80 else if (acct->sflg->fg_expire)
81 pw_life = acct->sfld->fd_expire;
82 else {
83 endprpwent();
84 return (0);
85 }
86
87 /* Offset from last change; if none, it must be expired */
88 if (acct->uflg->fg_schange)
89 pw_date = acct->ufld->fd_schange + pw_life;
90 else {
91 endprpwent();
92 return (1);
93 }
94
95 endprpwent();
96
97 /* If expiration date is prior to now, change password */
98
99 return (pw_date <= time((time_t *) NULL));
100}
101
102int 52int
103sys_auth_passwd(Authctxt *authctxt, const char *pass) 53sys_auth_passwd(Authctxt *authctxt, const char *pass)
104{ 54{
@@ -126,9 +76,6 @@ sys_auth_passwd(Authctxt *authctxt, const char *pass)
126 76
127 sia_ses_release(&ent); 77 sia_ses_release(&ent);
128 78
129 authctxt->force_pwchange = sia_password_change_required(
130 authctxt->user);
131
132 return (1); 79 return (1);
133} 80}
134 81