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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? util.c

?? EFI(Extensible Firmware Interface)是下一代BIOS
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*	$Id: util.c,v 1.6 1998/07/19 00:01:24 jmz Exp $	*/
/*	$NetBSD: util.c,v 1.16.2.1 1997/11/18 01:02:33 mellon Exp $	*/

/*
 * Copyright (c) 1985, 1989, 1993, 1994
 *	The Regents of the University of California.  All rights reserved.
 *
 *
 * Portions copyright (c) 1999, 2000
 * Intel Corporation.
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 * 
 *    This product includes software developed by the University of
 *    California, Berkeley, Intel Corporation, and its contributors.
 * 
 * 4. Neither the name of University, Intel Corporation, or their respective
 *    contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS, INTEL CORPORATION AND
 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS,
 * INTEL CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

#include <sys/cdefs.h>
#ifndef lint
__RCSID("$Id: util.c,v 1.6 1998/07/19 00:01:24 jmz Exp $");
__RCSID_SOURCE("$NetBSD: util.c,v 1.16.2.1 1997/11/18 01:02:33 mellon Exp $");
#endif /* not lint */

/*
 * FTP User Program -- Misc support routines
 */
#include <sys/ioctl.h>
#include <sys/time.h>
#include <arpa/ftp.h>

#include <ctype.h>
#include <err.h>
#include <fcntl.h>
#if EFI32 || EFI64
#include "efimisc.h"
#else
#include <pwd.h>	/* EFI port: not used */
#endif /* EFI32 || EFI64 */
#include <glob.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>

#include "ftp_var.h"
#include "pathnames.h"

#ifndef	SECSPERHOUR
#define	SECSPERHOUR	(60*60)
#endif

/*
 * Connect to peer server and
 * auto-login, if possible.
 */
void
setpeer(argc, argv)
	int argc;
	char *argv[];
{
	char *host;
	u_int16_t port;

	if (connected) {
		printf("Already connected to %s, use close first.\n",
		    hostname);
		code = -1;
		return;
	}
	if (argc < 2)
		(void)another(&argc, &argv, "to");
	if (argc < 2 || argc > 3) {
		printf("usage: %s host-name [port]\n", argv[0]);
		code = -1;
		return;
	}
	if (gatemode)
		port = gateport;
	else
		port = ftpport;
	if (argc > 2) {
		char *ep;
		long nport;

		nport = strtol(argv[2], &ep, 10);
		if (nport < 1 || nport > 0xffff || *ep != '\0') {
			printf("%s: bad port number '%s'.\n", argv[1], argv[2]);
			printf("usage: %s host-name [port]\n", argv[0]);
			code = -1;
			return;
		}
		port = htons(nport);
	}

	if (gatemode) {
		if (gateserver == NULL || *gateserver == '\0')
			errx(1, "gateserver not defined (shouldn't happen)");
		host = hookup(gateserver, port);
	} else
		host = hookup(argv[1], port);

	if (host) {
		int overbose;

		if (gatemode) {
			if (command("PASSERVE %s", argv[1]) != COMPLETE)
				return;
			if (verbose)
				printf("Connected via pass-through server %s\n",
				    gateserver);
		}

		connected = 1;
		/*
		 * Set up defaults for FTP.
		 */
		(void)strcpy(typename, "ascii"), type = TYPE_A;
		curtype = TYPE_A;
		(void)strcpy(formname, "non-print"), form = FORM_N;
		(void)strcpy(modename, "stream"), mode = MODE_S;
		(void)strcpy(structname, "file"), stru = STRU_F;
		(void)strcpy(bytename, "8"), bytesize = 8;
		if (autologin)
			(void)login(argv[1], NULL, NULL);

		overbose = verbose;
		if (debug == 0)
			verbose = -1;
		if (command("SYST") == COMPLETE && overbose) {
			char *cp, c;
			c = 0;
			cp = strchr(reply_string+4, ' ');
			if (cp == NULL)
				cp = strchr(reply_string+4, '\r');
			if (cp) {
				if (cp[-1] == '.')
					cp--;
				c = *cp;
				*cp = '\0';
			}

			printf("Remote system type is %s.\n", reply_string + 4);
			if (cp)
				*cp = c;
		}
		if (!strncmp(reply_string, "215 UNIX Type: L8", 17)) {
			if (proxy)
				unix_proxy = 1;
			else
				unix_server = 1;
			/*
			 * Set type to 0 (not specified by user),
			 * meaning binary by default, but don't bother
			 * telling server.  We can use binary
			 * for text files unless changed by the user.
			 */
			type = 0;
			(void)strcpy(typename, "binary");
			if (overbose)
			    printf("Using %s mode to transfer files.\n",
				typename);
		} else {
			if (proxy)
				unix_proxy = 0;
			else
				unix_server = 0;
			if (overbose &&
			    !strncmp(reply_string, "215 TOPS20", 10))
				puts(
"Remember to set tenex mode when transferring binary files from this machine.");
		}
		verbose = overbose;
	}
}


/*
 * login to remote host, using given username & password if supplied
 */
int
login(host, user, pass)
	const char *host;
	char *user, *pass;
{
	char tmp[80];
	char *acct;
	char anonpass[MAXLOGNAME + 1 + MAXHOSTNAMELEN];	/* "user@hostname" */
	char hostname[MAXHOSTNAMELEN];
	struct passwd *pw;
	int n, aflag = 0;

	acct = NULL;
	if (user == NULL) {
		if (ruserpass(host, &user, &pass, &acct) < 0) {
			code = -1;
			return (0);
		}
	}

	/*
	 * Set up arguments for an anonymous FTP session, if necessary.
	 */
	if ((user == NULL || pass == NULL) && anonftp) {
		memset(anonpass, 0, sizeof(anonpass));
		memset(hostname, 0, sizeof(hostname));

		/*
		 * Set up anonymous login password.
		 */
		if ((user = getlogin()) == NULL) {
			if ((pw = getpwuid(getuid())) == NULL)
				user = "anonymous";
			else
				user = pw->pw_name;
		}
		gethostname(hostname, MAXHOSTNAMELEN);
#ifndef DONT_CHEAT_ANONPASS
		/*
		 * Every anonymous FTP server I've encountered
		 * will accept the string "username@", and will
		 * append the hostname itself.  We do this by default
		 * since many servers are picky about not having
		 * a FQDN in the anonymous password. - thorpej@netbsd.org
		 */
		snprintf(anonpass, sizeof(anonpass) - 1, "%s@",
		    user);
#else
		snprintf(anonpass, sizeof(anonpass) - 1, "%s@%s",
		    user, hp->h_name);
#endif
		pass = anonpass;
		user = "anonymous";	/* as per RFC 1635 */
	}

	while (user == NULL) {
		char *myname = getlogin();

		if (myname == NULL && (pw = getpwuid(getuid())) != NULL)
			myname = pw->pw_name;
		if (myname)
			printf("Name (%s:%s): ", host, myname);
		else
			printf("Name (%s): ", host);
		if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL)
			return (0);
		tmp[strlen(tmp) - 1] = '\0';
		if (*tmp == '\0')
			user = myname;
		else
			user = tmp;
	}
	n = command("USER %s", user);
	if (n == CONTINUE) {
		if (pass == NULL)
			pass = getpass("Password:");
		n = command("PASS %s", pass);
	}
	if (n == CONTINUE) {
		aflag++;
		if (acct == NULL)
			acct = getpass("Account:");
		n = command("ACCT %s", acct);
	}
	if ((n != COMPLETE) ||
	    (!aflag && acct != NULL && command("ACCT %s", acct) != COMPLETE)) {
		warnx("Login failed.");
		return (0);
	}
	if (proxy)
		return (1);
	connected = -1;
	for (n = 0; n < macnum; ++n) {
		if (!strcmp("init", macros[n].mac_name)) {
			(void)strcpy(line, "$init");
			makeargv();
			domacro(margc, margv);
			break;
		}
	}
	return (1);
}

/*
 * `another' gets another argument, and stores the new argc and argv.
 * It reverts to the top level (via main.c's intr()) on EOF/error.
 *
 * Returns false if no new arguments have been added.
 */
int
another(pargc, pargv, prompt)
	int *pargc;
	char ***pargv;
	const char *prompt;
{
	int len = (int)strlen(line), ret;

	if (len >= sizeof(line) - 3) {
		puts("sorry, arguments too long.");
		intr();
	}
	printf("(%s) ", prompt);
	line[len++] = ' ';
	if (fgets(&line[len], sizeof(line) - len, stdin) == NULL)
		intr();
	len += (int)strlen(&line[len]);
	if (len > 0 && line[len - 1] == '\n')
		line[len - 1] = '\0';
	makeargv();
	ret = margc > *pargc;
	*pargc = margc;
	*pargv = margv;
	return (ret);
}

/*
 * glob files given in argv[] from the remote server.
 * if errbuf isn't NULL, store error messages there instead
 * of writing to the screen.
 */
char *
remglob(argv, doswitch, errbuf)
        char *argv[];
        int doswitch;
	char **errbuf;
{
        char temp[MAXPATHLEN];
        static char buf[MAXPATHLEN];
        static FILE *ftemp = NULL;
        static char **args;
        int oldverbose, oldhash, fd;
        char *cp, *mode;

        if (!mflag) {
                if (!doglob)
                        args = NULL;
                else {
                        if (ftemp) {
                                (void)fclose(ftemp);
                                ftemp = NULL;
                        }
                }
                return (NULL);
        }
        if (!doglob) {
                if (args == NULL)
                        args = argv;
                if ((cp = *++args) == NULL)
                        args = NULL;
                return (cp);
        }
        if (ftemp == NULL) {
                (void)snprintf(temp, sizeof(temp), "%s/%s", tmpdir, TMPFILE);
                if ((fd = mkstemp(temp)) < 0) {
                        warn("unable to create temporary file %s", temp);
                        return (NULL);
                }
                close(fd);
                oldverbose = verbose;
		verbose = (errbuf != NULL) ? -1 : 0;
                oldhash = hash;
                hash = 0;
                if (doswitch)
                        pswitch(!proxy);
                for (mode = "w"; *++argv != NULL; mode = "a")
                        recvrequest("NLST", temp, *argv, mode, 0, 0);
		if ((code / 100) != COMPLETE) {
			if (errbuf != NULL)
				*errbuf = reply_string;
		}
                if (doswitch)
                        pswitch(!proxy);
                verbose = oldverbose;
		hash = oldhash;
#if EFI32 || EFI64
		/*  EFI can't unlink a file the is currently opened read only */
		ftemp = fopen(temp, "r+");
#else
                ftemp = fopen(temp, "r");
#endif
                (void)unlink(temp);
                if (ftemp == NULL) {
			if (errbuf == NULL)
				puts("can't find list of remote files, oops.");
			else
				*errbuf =
				    "can't find list of remote files, oops.";
                        return (NULL);
                }
        }
        if (fgets(buf, sizeof(buf), ftemp) == NULL) {
                (void)fclose(ftemp);
		ftemp = NULL;
                return (NULL);
        }
        if ((cp = strchr(buf, '\n')) != NULL)
                *cp = '\0';
        return (buf);
}

int
confirm(cmd, file)
	const char *cmd, *file;
{
	char line[BUFSIZ];

	if (!interactive || confirmrest)
		return (1);
	printf("%s %s? ", cmd, file);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99视频在线精品| 337p日本欧洲亚洲大胆精品| 欧美高清视频www夜色资源网| 97se狠狠狠综合亚洲狠狠| 精品视频一区三区九区| 欧美一三区三区四区免费在线看 | 中文字幕二三区不卡| 亚洲综合视频网| 狠狠色狠狠色综合| 337p亚洲精品色噜噜狠狠| 亚洲欧美日韩系列| 国产iv一区二区三区| 欧美一级日韩不卡播放免费| 一区二区三区精品视频在线| 久久99精品久久只有精品| 99免费精品在线观看| 久久久国产午夜精品| 日韩av一二三| 欧美日韩国产另类不卡| 亚洲激情图片小说视频| 亚洲mv在线观看| 久久久不卡影院| 欧美猛男gaygay网站| 中文字幕精品在线不卡| 黄页网站大全一区二区| 91精品久久久久久久久99蜜臂| 99久久免费精品高清特色大片| 国内精品国产成人国产三级粉色| 日本在线不卡视频| 91香蕉视频黄| 中文字幕精品一区二区三区精品| 国产精品成人免费| 成人黄色软件下载| 国产精品青草综合久久久久99| 欧美国产日韩a欧美在线观看| 国产精品久久久久久久久久久免费看 | 国产精品私人自拍| 国内精品在线播放| 欧美一区二区性放荡片| 日韩不卡免费视频| 91麻豆精品国产91| 久久成人综合网| 久久精品亚洲乱码伦伦中文| 精品一区二区三区视频在线观看| 国产成人午夜电影网| 国产精品毛片久久久久久久| 99re视频精品| 亚洲精品国产第一综合99久久| 日韩电影在线观看网站| 欧美中文字幕一区| 日韩高清在线一区| 欧美电影免费观看高清完整版在线| 国产精品久久毛片a| 波波电影院一区二区三区| 亚洲摸摸操操av| 欧美剧情电影在线观看完整版免费励志电影 | 欧洲精品中文字幕| 成人激情图片网| 欧美一二三区精品| 国产一区不卡视频| 国产亚洲综合av| 99久久精品久久久久久清纯| 一区二区三区精品视频在线| 欧美大片一区二区三区| 成人av在线一区二区三区| 亚洲视频在线一区| 日韩欧美一级精品久久| 波波电影院一区二区三区| 日本视频中文字幕一区二区三区| 国产精品99久久久久久久女警 | 日韩欧美国产成人一区二区| 国产精华液一区二区三区| 夜夜夜精品看看| 久久久久久久一区| 91久久精品一区二区三区| 国产一区二区三区不卡在线观看| 欧美专区日韩专区| 韩国v欧美v日本v亚洲v| 亚洲图片欧美视频| 中文字幕免费观看一区| 欧美午夜精品久久久久久超碰 | 亚洲影院在线观看| 欧美电影免费观看高清完整版| 日日骚欧美日韩| 中文字幕不卡一区| 日韩精品一区二区三区视频播放| 亚洲成人久久影院| 18欧美亚洲精品| 久久夜色精品国产欧美乱极品| 亚洲一区二区精品久久av| 国产午夜亚洲精品不卡| 91视频xxxx| 国产成人精品亚洲777人妖 | 国模娜娜一区二区三区| 一区二区三区精品在线| 中文字幕一区二区三区四区| 日韩亚洲欧美在线| 欧美日韩三级一区二区| 91丝袜美腿高跟国产极品老师 | 国产传媒久久文化传媒| 蜜臂av日日欢夜夜爽一区| 亚洲人成精品久久久久久| 国产精品污www在线观看| 久久视频一区二区| 亚洲精品视频一区| 成人做爰69片免费看网站| 青青草精品视频| 日韩精品高清不卡| 日韩高清不卡一区二区| 日日夜夜一区二区| 亚洲123区在线观看| 一区二区三区波多野结衣在线观看| 成人av网址在线观看| 国产成人福利片| 久久久99精品免费观看| 国产精品理论片| 国产欧美中文在线| 国产亚洲欧美在线| 国产欧美日韩久久| 国产婷婷一区二区| 国产亚洲一区二区三区| 久久综合九色综合97婷婷女人| 国产一区二区精品久久91| 麻豆精品在线看| 精品一区二区三区日韩| 蜜臀久久99精品久久久久宅男| 久久久久久久久久看片| 久久综合色8888| 国产色一区二区| 国产精品免费aⅴ片在线观看| 在线视频一区二区三| 欧美日韩在线一区二区| 91精品国产91久久久久久最新毛片| 极品少妇xxxx精品少妇偷拍| 久久精品国产亚洲5555| 国产精品一区一区三区| 99久久99久久综合| 欧美日韩一级片在线观看| 日韩视频免费观看高清完整版| 色综合色狠狠天天综合色| 在线亚洲人成电影网站色www| 激情五月婷婷综合网| 国产精品亚洲午夜一区二区三区| 亚洲一区二区不卡免费| 麻豆精品一二三| 丁香婷婷深情五月亚洲| 欧美性一区二区| 精品国产一区二区精华| 欧美极品美女视频| 亚洲国产视频网站| 国产乱码精品一区二区三区五月婷| 免费看日韩精品| 成人黄色综合网站| 在线不卡的av| 中文字幕一区二区三区乱码在线 | 国产精品第13页| 五月激情丁香一区二区三区| 国产成人午夜精品影院观看视频 | 亚洲精品免费在线观看| 美女视频第一区二区三区免费观看网站 | 亚洲精品日产精品乱码不卡| 日本不卡一区二区三区高清视频| 亚洲一区中文在线| a在线欧美一区| 色综合久久99| 日韩一卡二卡三卡四卡| 亚洲少妇最新在线视频| 五月婷婷激情综合网| 成人丝袜高跟foot| 欧美成人女星排名| 亚洲成人午夜影院| 色8久久人人97超碰香蕉987| 国产日韩av一区| 蜜桃久久久久久| 欧美日韩在线不卡| 一区二区久久久久| av一区二区不卡| 久久久高清一区二区三区| 久久99精品国产91久久来源| 欧美日韩国产高清一区二区三区 | av激情综合网| 亚洲精品在线观看视频| 日韩中文字幕不卡| 欧美三级日韩三级国产三级| 国产精品国产自产拍高清av| 理论片日本一区| 日韩精品自拍偷拍| 蜜桃91丨九色丨蝌蚪91桃色| 欧美一区日本一区韩国一区| 午夜伊人狠狠久久| 欧美日韩aaaaaa| 午夜电影一区二区| 欧美日韩国产综合一区二区| 一区二区日韩av| 欧美在线视频日韩| 亚洲午夜激情网页| 欧美日韩视频在线一区二区| 亚洲r级在线视频| 欧美一区二区三区不卡| 日韩1区2区日韩1区2区|