⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isexpired.c

📁 linux-ftpd-0.17.tar.gz linux 嵌入式 tftpd
💻 C
字号:
#ifdef USE_SHADOW#include <shadow.h>#include <time.h>#include "isexpired.h"/* * Check password aging info when using shadow passwords.  Returns: *  3 - after account expiration date *  2 - expired password not changed for too long *  1 - password expired, must be changed *  0 - success, or no shadow password information at all * * Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>, * public domain. */intisexpired(const struct spwd *sp){	long now, change;	if (!sp)		return 0;	now = (time(NULL) / (24L * 3600L));	if (sp->sp_expire > 0 && now >= sp->sp_expire)		return 3;	if (sp->sp_lstchg > 0 && sp->sp_max > 0) {		change = sp->sp_lstchg + sp->sp_max;		if (sp->sp_inact >= 0 && now >= change + sp->sp_inact)			return 2;		if (now >= change)			return 1;	}	if (sp->sp_lstchg == 0)		return 1;	return 0;}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -