亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? test.c~

?? QQ2440 linux刷卡后用戶名自動登錄getty文件,包含IC讀卡器驅動和Makefile文件.
?? C~
字號:
/*  mingetty.c * *  Copyright (C) 1996 Florian La Roche  <laroche@redhat.com> *  Copyright (C) 2002, 2003 Red Hat, Inc * *  This getty can only be used as a small console getty. Look at mgetty *  for a real modem getty. * *  This program is free software; you can redistribute it and/or *  modify it under the terms of the GNU General Public License *  as published by the Free Software Foundation; either version *  2 of the License, or (at your option) any later version. *//* TODO: * - autologin only at first login * - /etc/mingetty.conf that can be used instead of /etc/inittab for *   command line options * - Can UTF-8 setup be done within mingetty? * - Also add /bin/login-type functionality in here? */#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <termios.h>#include <string.h>#include <sys/ioctl.h>#include <errno.h>#include <sys/stat.h>#include <sys/file.h>#include <signal.h>#include <fcntl.h>#include <stdarg.h>#include <ctype.h>#include <utmp.h>#include <getopt.h>#include <sys/param.h>#include <syslog.h>#include <sys/utsname.h>#include <time.h>#include <string.h>#include "ftcard.h"/* name of this program (argv[0]) */static char *progname;/* on which tty line are we sitting? (e.g. tty1) */static char *tty;/* some information about this host */static struct utsname uts;/* the hostname */static char hn[MAXHOSTNAMELEN + 1];/* process and session ID of this program */static pid_t pid, sid;/* login program invoked */static char *loginprog = "/bin/login";/* Do not send a reset string to the terminal. */static int noclear = 0;/* Do not print a newline. */static int nonewline = 0;/* Do not print /etc/issue. */static int noissue = 0;/* Do not call vhangup() on the tty. */static int nohangup = 0;/* Do not print any hostname. */static int nohostname = 0;/* Print the whole string of gethostname() instead of just until the next "." */static int longhostname = 0;/* time to wait, seconds */static int delay = 0;/* chroot directory */static char *ch_root = NULL;/* working directory to change into */static char *ch_dir = NULL;/* 'nice' level of the program */static int priority = 0;/* automatic login with this user */static char *autologin = NULL;/* error() - output error messages */static void error (const char *fmt, ...){	va_list va_alist;	va_start (va_alist, fmt);	openlog (progname, LOG_PID, LOG_AUTH);	vsyslog (LOG_ERR, fmt, va_alist);	/* no need, we exit anyway: closelog (); */	va_end (va_alist);	sleep (5);	exit (EXIT_FAILURE);}/* update_utmp() - update our utmp entry */static void update_utmp (void){	struct utmp ut;	struct utmp *utp;	time_t cur_time;	setutent ();	while ((utp = getutent ()))		if (utp->ut_type == INIT_PROCESS && utp->ut_pid == pid)			break;	if (utp) {		memcpy (&ut, utp, sizeof (ut));	} else {		/* some inits don't initialize utmp... */		const char *x = tty;		memset (&ut, 0, sizeof (ut));		if (strncmp (x, "tty", 3) == 0)			x += 3;		if (strlen (x) > sizeof (ut.ut_id))			x += strlen (x) - sizeof (ut.ut_id);		strncpy (ut.ut_id, x, sizeof (ut.ut_id));	}	strncpy (ut.ut_user, "LOGIN", sizeof (ut.ut_user));	strncpy (ut.ut_line, tty, sizeof (ut.ut_line));	time (&cur_time);	ut.ut_time = cur_time;	ut.ut_type = LOGIN_PROCESS;	ut.ut_pid = pid;	ut.ut_session = sid;	pututline (&ut);	endutent ();	updwtmp (_PATH_WTMP, &ut);}/* open_tty - set up tty as standard { input, output, error } */static void open_tty (void){	struct sigaction sa, sa_old;	char buf[40];	int fd;	/* Set up new standard input. */	if (tty[0] == '/')		strcpy (buf, tty);	else {		strcpy (buf, "/dev/");		strcat (buf, tty);	}	/* There is always a race between this reset and the call to	   vhangup() that s.o. can use to get access to your tty. */	if (chown (buf, 0, 0) || chmod (buf, 0600))		if (errno != EROFS)			error ("%s: %s", tty, strerror (errno));	sa.sa_handler = SIG_IGN;	sa.sa_flags = 0;	sigemptyset (&sa.sa_mask);	sigaction (SIGHUP, &sa, &sa_old);	/* vhangup() will replace all open file descriptors in the kernel	   that point to our controlling tty by a dummy that will deny	   further reading/writing to our device. It will also reset the	   tty to sane defaults, so we don't have to modify the tty device	   for sane settings. We also get a SIGHUP/SIGCONT.	 */	if ((fd = open (buf, O_RDWR, 0)) < 0)		error ("%s: cannot open tty: %s", tty, strerror (errno));	if (ioctl (fd, TIOCSCTTY, (void *) 1) == -1)		error ("%s: no controlling tty: %s", tty, strerror (errno));	if (!isatty (fd))		error ("%s: not a tty", tty);	if (nohangup == 0) {		if (vhangup ())			error ("%s: vhangup() failed", tty);		/* Get rid of the present stdout/stderr. */		close (2);		close (1);		close (0);		close (fd);		if ((fd = open (buf, O_RDWR, 0)) != 0)			error ("%s: cannot open tty: %s", tty,				strerror (errno));		if (ioctl (fd, TIOCSCTTY, (void *) 1) == -1)			error ("%s: no controlling tty: %s", tty,				strerror (errno));	}	/* Set up stdin/stdout/stderr. */	if (dup2 (fd, 0) != 0 || dup2 (fd, 1) != 1 || dup2 (fd, 2) != 2)		error ("%s: dup2(): %s", tty, strerror (errno));	if (fd > 2)		close (fd);	/* Write a reset string to the terminal. This is very linux-specific	   and should be checked for other systems. */	if (noclear == 0)		write (0, "\033c", 2);	sigaction (SIGHUP, &sa_old, NULL);}static void output_special_char (unsigned char c){	switch (c) {	case 's':		printf ("%s", uts.sysname);		break;	case 'n':		printf ("%s", uts.nodename);		break;	case 'r':		printf ("%s", uts.release);		break;	case 'v':		printf ("%s", uts.version);		break;	case 'm':		printf ("%s", uts.machine);		break;	case 'o':		printf ("%s", uts.domainname);		break;	case 'd':	case 't':		{			time_t cur_time;			struct tm *tm;#if	0			char buff[20];			time (&cur_time);			tm = localtime (&cur_time);			strftime (buff, sizeof (buff),				c == 'd'? "%a %b %d %Y" : "%X", tm);			fputs (buff, stdout);			break;#else			time (&cur_time);			tm = localtime (&cur_time);			if (c == 'd') /* ISO 8601 */				printf ("%d-%02d-%02d", 1900 + tm->tm_year,					tm->tm_mon + 1, tm->tm_mday);			else				printf ("%02d:%02d:%02d", tm->tm_hour,					tm->tm_min, tm->tm_sec);			break;#endif		}	case 'l':		printf ("%s", tty);		break;	case 'u':	case 'U':		{			int users = 0;			struct utmp *ut;			setutent ();			while ((ut = getutent ()))				if (ut->ut_type == USER_PROCESS)					users++;			endutent ();			printf ("%d", users);			if (c == 'U')				printf (" user%s", users == 1 ? "" : "s");			break;		}	default:		putchar (c);	}}/* do_prompt - show login prompt, optionally preceded by /etc/issue contents */static void do_prompt (int showlogin){	FILE *fd;	int c;	if (nonewline == 0)		putchar ('\n');	if (noissue == 0 && (fd = fopen ("/etc/issue", "r"))) {		while ((c = getc (fd)) != EOF) {			if (c == '\\')				output_special_char (getc (fd));			else				putchar (c);		}		fclose (fd);	}	if (nohostname == 0)		printf ("%s ", hn);	if (showlogin)		printf ("login: ");	fflush (stdout);}static char *get_logname (void){	static char logname[40];	char *bp;	unsigned char c;	tcflush (0, TCIFLUSH);		/* flush pending input */	for (*logname = 0; *logname == 0;) {		do_prompt (1);		for (bp = logname;;) {			if (read (0, &c, 1) < 1) {				if (errno == EINTR || errno == EIO					|| errno == ENOENT)					exit (EXIT_SUCCESS);				error ("%s: read: %s", tty, strerror (errno));			}			if (c == '\n' || c == '\r') {				*bp = 0;				break;			} else if (!isprint (c))				error ("%s: invalid character 0x%x in login"					" name", tty, c);			else if ((size_t)(bp - logname) >= sizeof (logname) - 1)				error ("%s: too long login name", tty);			else				*bp++ = c;		}	}	return logname;}static void usage (void){	error ("usage: '%s [--noclear] [--nonewline] [--noissue] "		"[--nohangup] [--nohostname] [--long-hostname] "		"[--loginprog=/bin/login] [--nice=10] [--delay=10] "		"[--chdir=/home] [--chroot=/chroot] [--autologin=user] "		"tty' with e.g. tty=tty1", progname);}static struct option const long_options[] = {	{ "autologin", required_argument, NULL, 'a' },	{ "chdir", required_argument, NULL, 'w' },	{ "chroot", required_argument, NULL, 'r' },	{ "delay", required_argument, NULL, 'd' },	{ "noclear", no_argument, &noclear, 1 },	{ "nonewline", no_argument, &nonewline, 1 },	{ "noissue", no_argument, &noissue, 1 },	{ "nohangup", no_argument, &nohangup, 1 },	{ "no-hostname", no_argument, &nohostname, 1 }, /* compat option */	{ "nohostname", no_argument, &nohostname, 1 },	{ "loginprog", required_argument, NULL, 'l' },	{ "long-hostname", no_argument, &longhostname, 1 },	{ "nice", required_argument, NULL, 'n' },	{ 0, 0, 0, 0 }};int main (int argc, char **argv){	char *logname, *s;	int c;        int           fd;   /* the handle of rockey200 */	progname = argv[0];        char          ATRString[ 36 ];  /* save atr info */	if (!progname)		progname = "mingetty";	uname (&uts);        fputs(" ftcoard driver read data form card ",stdout);        fd = openepass( 0 );	while( fd >=0 ){                 memset( ATRString, 0, sizeof( ATRString ) );	fd = GetAtr( fd, ATRString );	if( fd == 0 ) {		printf(" Get Atr : %s\n", ATRString + 5 );                               break;	}         printf(" read fault,please insert again \n" );       }	gethostname (hn, MAXHOSTNAMELEN);	hn[MAXHOSTNAMELEN] = '\0';	pid = getpid ();	sid = getsid (0);#if	defined(s390) || defined(__s390__)	putenv ("TERM=dumb");#else	putenv ("TERM=linux");#endif	while ((c = getopt_long (argc, argv, "a:d:l:n:w:r:", long_options,		(int *) 0)) != EOF) {		switch (c) {		case 0:			break;		case 'a':			autologin = optarg;			break;		case 'd':			delay = atoi (optarg);			break;		case 'l':			loginprog = optarg;			break;		case 'n':			priority = atoi (optarg);			break;		case 'r':			ch_root = optarg;			break;		case 'w':			ch_dir = optarg;			break;		default:			usage ();		}	}	if (longhostname == 0 && (s = strchr (hn, '.')))		*s = '\0';	tty = argv[optind];	if (!tty)		usage ();	if (strncmp (tty, "/dev/", 5) == 0) /* ignore leading "/dev/" */		tty += 5;	update_utmp ();	if (delay)		sleep (delay);	open_tty ();	if (autologin) {		do_prompt (0);		printf ("login: %s (automatic login)\n", autologin);		logname = autologin;	} else         /*		while ((logname = get_logname ()) == 0)			 do nothing         */        logname ="csb"  ;	if (ch_root)		chroot (ch_root);	if (ch_dir)		chdir (ch_dir);	if (priority)		nice (priority);	execl (loginprog, loginprog,"-f",logname, NULL);	error ("%s: can't exec %s: %s", tty, loginprog, strerror (errno));	sleep (5);	exit (EXIT_FAILURE);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜伦理一区二区| 97se亚洲国产综合自在线不卡| 国产一区二区三区日韩| 成人国产精品免费观看| 欧美撒尿777hd撒尿| 中文字幕欧美日本乱码一线二线| 亚洲aaa精品| 一本一道久久a久久精品| 久久久久国产精品麻豆| 日韩影视精彩在线| 欧美综合亚洲图片综合区| 国产精品进线69影院| 国产一区二区三区日韩| 欧美人xxxx| 亚洲最大成人综合| 日韩免费一区二区| 伊人婷婷欧美激情| 久久久三级国产网站| 亚洲福利视频一区二区| www.欧美日韩国产在线| 久久久亚洲午夜电影| 亚洲成人激情av| 欧美亚洲动漫另类| 亚洲精品国产精华液| www.日韩精品| 国产精品白丝在线| 成人激情午夜影院| 欧美激情在线看| 成人小视频免费在线观看| 国产蜜臀av在线一区二区三区| 麻豆国产精品777777在线| 欧美一卡在线观看| 免费观看一级欧美片| 精品粉嫩超白一线天av| 天天操天天色综合| 精品伊人久久久久7777人| 欧美天堂一区二区三区| 欧美一卡二卡三卡| 久久99精品国产麻豆婷婷洗澡| 91精品国产综合久久久久| 视频一区在线视频| 欧美一区二区三区人| 免费久久99精品国产| 久久久五月婷婷| 成人激情综合网站| 亚洲最大色网站| 宅男在线国产精品| 国精品**一区二区三区在线蜜桃| 欧美精品一区二区久久久| 国产福利91精品| 中文字幕av不卡| 色八戒一区二区三区| 婷婷中文字幕一区三区| 欧美成人综合网站| proumb性欧美在线观看| 亚洲精品亚洲人成人网| 日韩欧美中文字幕一区| 国产麻豆精品在线| 亚洲欧美偷拍三级| 在线不卡一区二区| 国产精品18久久久久久vr| 亚洲私人影院在线观看| 欧美日韩国产综合一区二区三区| 美国av一区二区| 国产精品美女久久久久久久久久久 | 欧美做爰猛烈大尺度电影无法无天| 夜夜爽夜夜爽精品视频| 精品久久久久久久久久久久久久久久久| 国产99久久久精品| 午夜视频一区二区三区| 中文字幕欧美三区| 欧美一区二区三区成人| 91麻豆123| 国产在线视频不卡二| 亚洲精品日韩综合观看成人91| 日韩欧美在线1卡| 色综合色狠狠综合色| 国产在线一区二区综合免费视频| 亚洲蜜臀av乱码久久精品| 久久亚洲影视婷婷| 欧美日韩一区二区三区在线看| 国产福利精品导航| 日韩成人dvd| 亚洲资源中文字幕| 国产精品二区一区二区aⅴ污介绍| 制服丝袜亚洲精品中文字幕| av中文字幕不卡| 国产一区激情在线| 热久久免费视频| 亚洲国产成人va在线观看天堂| 欧美国产综合色视频| 精品粉嫩超白一线天av| 欧美精品亚洲一区二区在线播放| av中文字幕不卡| 国产成人av网站| 国产一区二区三区四区五区入口 | 国产精品久久久久久久浪潮网站| 日韩一区二区免费在线观看| 在线观看日韩国产| 不卡在线观看av| 丁香天五香天堂综合| 裸体在线国模精品偷拍| 丝袜美腿成人在线| 亚洲国产精品久久久久婷婷884 | 亚洲天堂成人网| 国产精品美女久久久久aⅴ| 欧美精品一区二区三区蜜桃 | 老司机午夜精品| 五月综合激情婷婷六月色窝| 一区二区免费视频| 亚洲男女毛片无遮挡| 国产精品护士白丝一区av| 国产日韩欧美不卡| 国产欧美一二三区| 国产精品午夜久久| 成人欧美一区二区三区黑人麻豆 | k8久久久一区二区三区 | 亚洲视频你懂的| 亚洲欧洲精品成人久久奇米网| 国产欧美一区二区在线观看| 中文字幕国产精品一区二区| 国产精品视频九色porn| 亚洲婷婷综合久久一本伊一区| 国产精品沙发午睡系列990531| 国产欧美精品一区二区色综合朱莉| 国产日韩av一区| 综合自拍亚洲综合图不卡区| 一区二区三区日韩精品| 自拍av一区二区三区| 亚洲国产日韩在线一区模特| 日韩影视精彩在线| 国产精品资源在线观看| kk眼镜猥琐国模调教系列一区二区| 99久久精品国产网站| 欧美日韩午夜精品| 337p日本欧洲亚洲大胆精品| 国产欧美一区二区精品忘忧草 | 在线视频你懂得一区| 91精品国产一区二区三区蜜臀| www久久精品| 国产精品黄色在线观看| 日韩激情av在线| 成人黄色综合网站| 3d成人动漫网站| 中文字幕欧美激情| 香蕉影视欧美成人| 丁香婷婷综合色啪| 欧美日韩成人一区| 国产精品美日韩| 日韩国产欧美三级| 99久久婷婷国产综合精品电影| 欧洲精品在线观看| 久久久久国产免费免费| 一区二区三区国产豹纹内裤在线| 日本视频中文字幕一区二区三区| 国产大陆a不卡| 91精品在线免费| 一区二区中文视频| 国产一区二区三区在线观看精品 | 欧美在线不卡视频| 久久久久久久久久久99999| 亚洲已满18点击进入久久| 精品亚洲成a人| 欧美中文字幕一区二区三区 | www.日韩大片| 欧美成人猛片aaaaaaa| 亚洲欧美成aⅴ人在线观看| 精品一区二区在线视频| 欧美日韩国产高清一区二区 | 国产精品水嫩水嫩| 免费的国产精品| 欧美视频在线一区| 中文字幕在线一区免费| 久久福利视频一区二区| 欧美性欧美巨大黑白大战| 国产精品青草综合久久久久99| 日日夜夜免费精品| 欧洲色大大久久| 自拍偷拍亚洲综合| 国产精品一区在线观看你懂的| 在线电影院国产精品| 亚洲大片一区二区三区| av在线一区二区| 国产精品久久久久久久久久久免费看 | www.在线成人| 国产欧美视频一区二区| 国产一区二区视频在线| 欧美电影免费观看完整版| 视频一区欧美日韩| 欧美色国产精品| 亚洲国产aⅴ成人精品无吗| 一本大道av伊人久久综合| 亚洲天堂免费看| 99久久99久久精品免费看蜜桃 | 91美女片黄在线观看| 国产精品国产a级| 96av麻豆蜜桃一区二区| 亚洲三级理论片| 在线观看日韩av先锋影音电影院| 一区二区三区资源|