summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1995-08-28 21:30:59 +0000
committermpp <mpp@FreeBSD.org>1995-08-28 21:30:59 +0000
commit684146e8cecf2a925a3b2281a218c99678a04171 (patch)
tree67278d75d3abf5f6772c71401cc931a0c8700dee /libexec
parent3e1e7bcd42e9e4ca3c52ddefa6bc62b4df57add2 (diff)
downloadFreeBSD-src-684146e8cecf2a925a3b2281a218c99678a04171.zip
FreeBSD-src-684146e8cecf2a925a3b2281a218c99678a04171.tar.gz
Check for expired passwords before allowing access to the system.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/atrun/atrun.c11
-rw-r--r--libexec/ftpd/ftpd.c3
-rw-r--r--libexec/rexecd/rexecd.c3
-rw-r--r--libexec/rshd/rshd.c5
-rw-r--r--libexec/uucpd/uucpd.c2
5 files changed, 19 insertions, 5 deletions
diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c
index 9bd7aca..8ff1bfa 100644
--- a/libexec/atrun/atrun.c
+++ b/libexec/atrun/atrun.c
@@ -71,7 +71,7 @@
/* File scope variables */
static char *namep;
-static char rcsid[] = "$Id: atrun.c,v 1.5 1995/08/10 04:06:53 ache Exp $";
+static char rcsid[] = "$Id: atrun.c,v 1.5 1995/08/21 12:34:17 ache Exp $";
static debug = 0;
void perr(const char *a);
@@ -154,6 +154,15 @@ run_file(const char *filename, uid_t uid, gid_t gid)
PRIV_END
+#ifdef __FreeBSD__
+ if (pentry->pw_expire && time(NULL) >= pentry->pw_expire)
+ {
+ syslog(LOG_ERR, "Userid %lu is expired - aborting job %s",
+ (unsigned long) uid, filename);
+ exit(EXIT_FAILURE);
+ }
+#endif
+
if (stream == NULL)
perr("Cannot open input file");
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 8776124..832f175 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ftpd.c,v 1.10 1995/05/30 05:45:58 rgrimes Exp $
+ * $Id: ftpd.c,v 1.11 1995/08/05 19:12:05 pst Exp $
*/
#ifndef lint
@@ -579,6 +579,7 @@ pass(passwd)
#endif
/* The strcmp does not catch null passwords! */
if (pw == NULL || *pw->pw_passwd == '\0' ||
+ (pw->pw_expire && time(NULL) >= pw->pw_expire) ||
strcmp(xpasswd, pw->pw_passwd)) {
reply(530, "Login incorrect.");
if (logging)
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c
index 5fc3617..9c6d029 100644
--- a/libexec/rexecd/rexecd.c
+++ b/libexec/rexecd/rexecd.c
@@ -188,7 +188,8 @@ doit(f, fromp)
}
}
- if (pwd->pw_uid == 0 || *pwd->pw_passwd == '\0') {
+ if (pwd->pw_uid == 0 || *pwd->pw_passwd == '\0' ||
+ (pwd->pw_expire && time(NULL) >= pwd->pw_expire)) {
syslog(LOG_ERR, "%s LOGIN REFUSED from %s", user, remote);
error("Login incorrect.\n");
exit(1);
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c
index 1b9eea9..7763601 100644
--- a/libexec/rshd/rshd.c
+++ b/libexec/rshd/rshd.c
@@ -445,9 +445,10 @@ doit(fromp)
#endif
if (errorstr ||
- pwd->pw_passwd != 0 && *pwd->pw_passwd != '\0' &&
+ (pwd->pw_expire && time(NULL) >= pwd->pw_expire) ||
+ (pwd->pw_passwd != 0 && *pwd->pw_passwd != '\0' &&
iruserok(fromp->sin_addr.s_addr, pwd->pw_uid == 0,
- remuser, locuser) < 0) {
+ remuser, locuser) < 0)) {
if (__rcmd_errstr)
syslog(LOG_INFO|LOG_AUTH,
"%s@%s as %s: permission denied (%s). cmd='%.80s'",
diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c
index 490e4c5..f645eea 100644
--- a/libexec/uucpd/uucpd.c
+++ b/libexec/uucpd/uucpd.c
@@ -159,6 +159,8 @@ void doit(struct sockaddr_in *sinp)
login_incorrect(user, sinp);
if (strcmp(pw->pw_shell, _PATH_UUCICO))
login_incorrect(user, sinp);
+ if (pw->pw_expire && time(NULL) >= pw->pw_expire)
+ login_incorrect(user, sinp);
if (pw->pw_passwd && *pw->pw_passwd != '\0') {
printf("Password: "); fflush(stdout);
if (readline(passwd, sizeof passwd, 1) < 0) {
OpenPOWER on IntegriCloud