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

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

?? remote.c

?? 操作系統SunOS 4.1.3版本的源碼
?? C
字號:
# ifndef lintstatic char sccsid[] = "@(#)remote.c 1.1 92/07/30 Copyright Sun Micro";# endif lint/* * remote - interface program for remote execution service, based on *          the program "on." * * Copyright (c) 1985 Sun Microsystems, Inc. * * Compilation:  cc -o remote remote.c -lrpcsvc */#include <stdio.h>#include <signal.h>#include <sys/param.h>#include <sys/time.h>#include <sys/socket.h>#include <sys/stat.h>#include <sys/ioctl.h>#include <fcntl.h>#include <rpc/rpc.h>#include <netdb.h>#include <errno.h>#include <mntent.h>#include <rpcsvc/rex.h>#include "sundiag_rpcnums.h"extern int errno;/* * Note - the following must be long enough for at least two portmap * timeouts on the other side. *  * The following value is 360 seconds to allow for net problems. */struct timeval LongTimeout = { 360, 0 };int Debug = 0;			/* print extra debugging information */int Only2 = 0;			/* stdout and stderr are the same */int InOut;			/* socket for stdin/stdout */int Err;			/* socket for stderr */char *rhost;			/* remote host name (made global: NY) */CLIENT *Client;			/* RPC client handle */struct ttysize WindowSize;	/* saved window size */  /* * oob -- called when the command invoked by the rexd server is stopped *	  with a SIGTSTP or SIGSTOP signal. */oob(){	int atmark;	char waste[BUFSIZ], mark;	for (;;) {		if (ioctl(InOut, SIOCATMARK, &atmark) < 0) {			perror("ioctl");			break;		}		if (atmark)			break;		(void) read(InOut, waste, sizeof (waste));	}	(void) recv(InOut, &mark, 1, MSG_OOB);	kill(getpid(), SIGSTOP);}cont(){}connect_timeout(){	fprintf(stderr, "remote: cannot connect to server on %s\n", rhost);	exit(1);}main(argc, argv)	int argc;	char **argv;{/*	char *rhost, **cmdp; */	char **cmdp;	char curdir[MAXPATHLEN];	char wdhost[MAXPATHLEN];	char fsname[MAXPATHLEN];	char dirwithin[MAXPATHLEN];	struct rex_start rst;	struct rex_result result;	extern char **environ, *rindex();	enum clnt_stat clstat;	struct hostent *hp;	struct sockaddr_in server_addr;	int sock = RPC_ANYSOCK;	int selmask, zmask, remmask;	int nfds, cc;	static char buf[4096];	int attempted_con = 0;	    /*	     * we check the invoked command name to see if it should	     * really be a host name.	     */	if ( (rhost = rindex(argv[0],'/')) == NULL) {		rhost = argv[0];	}	else {		rhost++;	}	signal(SIGALRM, connect_timeout);	while (argc > 1 && argv[1][0] == '-') {	    switch (argv[1][1]) {	      case 'd': Debug = 1;	      		break;	      default:	      		printf("Unknown option %s\n",argv[1]);	    }	    argv++;	    argc--;	}	if (argc < 2)		usage();	rhost = argv[1];	cmdp = &argv[2];	/*	 * Can only have one of these	 */	if ((hp = gethostbyname(rhost)) == NULL) {		fprintf(stderr, "remote: unknown host %s\n", rhost);		exit(1);	}	bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr, hp->h_length);	server_addr.sin_family = AF_INET;	server_addr.sin_port = 0;	/* use pmapper */	if (Debug) printf("Got the host named %s (%s)\n",			rhost,inet_ntoa(server_addr.sin_addr));	alarm(300);  /* allow 5 minutes to create a rpc connection */	while ((Client = clnttcp_create(&server_addr,					SD_REXPROG, SD_REXVERS,					&sock, 0, 0)) == NULL) {		if (attempted_con == 0) {		  fprintf(stderr,		    "remote: cannot connect to server on %s.  still trying.\n",		    rhost);		  attempted_con++;		}	}	alarm(0);    /* turn off alarm */	attempted_con = 0;	if (Debug) printf("TCP RPC connection created\n");	Client->cl_auth = authunix_create_default();	  /*	   * Now that we have created the TCP connection, we do some	   * work while the server daemon is being swapped in.	   */	  /* tell rexd on remote machine we're in root directory regardless	   * of where we really are.	   */	strcpy(curdir, "/");	if (findmount(curdir,wdhost,fsname,dirwithin) == 0) {	      fprintf(stderr,"remote: can't locate mount point for %s (%s)\n",		      curdir, dirwithin);		exit(1);	}	if (Debug) printf("wd host %s, fs %s, dir within %s\n",		wdhost, fsname, dirwithin);	Only2 = samefd(1,2);	rst.rst_cmd = cmdp;	rst.rst_env = environ;	rst.rst_host = wdhost;	rst.rst_fsname = fsname;	rst.rst_dirwithin = dirwithin;	rst.rst_port0 = makeport(&InOut);	rst.rst_port1 =  rst.rst_port0;		/* same port for stdin */	rst.rst_flags = 0;	if (Debug)		printf("environ is %s\n", *environ);	if (Only2) {		rst.rst_port2 = rst.rst_port1;	} else {		rst.rst_port2 = makeport(&Err);	}	if (Debug)	  printf("rst.rst_port0 = %d; rst.rst_port1 = %d; rst.rst_port2 = %d\n",        	  rst.rst_port0, rst.rst_port1, rst.rst_port2);	if (clstat = clnt_call(Client, REXPROC_START,	    xdr_rex_start, &rst, xdr_rex_result, &result, LongTimeout)) {		fprintf(stderr, "remote %s: ", rhost);		clnt_perrno(clstat);		fprintf(stderr, "\n");		exit(1);	}	if (result.rlt_stat != 0) {		fprintf(stderr, "remote %s: %s\r",rhost,result.rlt_message);		exit(1);	}	if (Debug) printf("Client call was made\r\n"); 	signal(SIGCONT, cont);	signal(SIGURG, oob);	doaccept(&InOut);	(void) fcntl(InOut, F_SETOWN, getpid());	remmask = (1 << InOut);	if (Debug) printf("accept on stdout\r\n");	if (!Only2) {		doaccept(&Err);		shutdown(Err, 1);		if (Debug) printf("accept on stderr\r\n");		remmask |= (1 << Err);	}	zmask = 1;	if (Debug) printf("remmask = %d\n", remmask);	while (remmask) {		selmask = remmask | zmask;		nfds = select(32, &selmask, 0, 0, 0);		if (nfds <= 0) {			if (errno == EINTR) continue;			perror("remote: select");			exit(1);		}		if (selmask & (1<<InOut)) {			cc = read(InOut, buf, sizeof buf);			if (cc > 0)				write(1, buf, cc);			else				remmask &= ~(1<<InOut);		}		if (!Only2 && selmask & (1<<Err)) {			cc = read(Err, buf, sizeof buf);			if (cc > 0)				write(2, buf, cc);			else				remmask &= ~(1<<Err);		}		if (selmask & (1<<0)) {			cc = read(0, buf, sizeof buf);			if (cc > 0)				write(InOut, buf, cc);			else {				/*				 * End of standard input - shutdown outgoing				 * direction of the TCP connection.				 */				if (Debug)			printf("Got EOF - shutting down connection\n");				zmask = 0;				shutdown(InOut, 1);			}		}	}	close(InOut);	if (!Only2)	    close(Err);	if (Debug) printf("last clnt_call of main()\n");	if (clstat = clnt_call(Client, REXPROC_WAIT,	    xdr_void, 0, xdr_rex_result, &result, LongTimeout)) {		fprintf(stderr, "remote: ");		clnt_perrno(clstat);		fprintf(stderr, "\r\n");		exit(1);	}	exit(result.rlt_stat);}remstop(){	exit(23);}  /*   * returns true if we can safely say that the two file descriptors   * are the "same" (both are same file).   */samefd(a,b){    struct stat astat, bstat;    if (fstat(a,&astat) || fstat(b,&bstat)) return(0);    if (astat.st_ino == 0 || bstat.st_ino == 0) return(0);    return( !bcmp( &astat, &bstat, sizeof(astat)) );}/* * accept the incoming connection on the given * file descriptor, and return the new file descritpor */doaccept(fdp)	int *fdp;{	int fd;	fd = accept(*fdp, 0, 0);	if (fd < 0) {		perror("accept");		remstop();		exit(1);	}	close(*fdp);	*fdp = fd;}/* * create a socket, and return its the port number. */makeport(fdp)	int *fdp;{	struct sockaddr_in sin;	int fd, len;	fd = socket(AF_INET, SOCK_STREAM, 0);	if (fd < 0) {		perror("socket");		exit(1);	}	bzero((char *)&sin, sizeof sin);	sin.sin_family = AF_INET;	bind(fd, &sin, sizeof sin);	len = sizeof sin;	getsockname(fd, &sin, &len);	listen(fd, 1);	*fdp = fd;	return (htons(sin.sin_port));}usage(){    fprintf(stderr, "Usage: remote [-i|-n] [-d] machine cmd [args]...\n");    exit(1);}/* * findmount(qualpn, host, fsname, within) * * Searches the mount table to find the appropriate file system * for a given absolute path name. * host gets the name of the host owning the file system, * fsname gets the file system name on the host, * within gets whatever is left from the pathname * * Returns: 0 on failure, 1 on success. */findmount(qualpn, host, fsname, within)	char *qualpn;	char *host;	char *fsname;	char *within;{	FILE *mfp;	char bestname[MAXPATHLEN];	int bestlen = 0;	struct mntent *mnt;   	char *endhost;			/* points past the colon in name */	extern char *index();	int i, len;	for (i = 0; i < 10; i++) {		mfp = setmntent("/etc/mtab", "r");		if (mfp != NULL)			break;		sleep(1);	}	if (mfp == NULL) {		sprintf(within, "mount table problem");		return (0);	}	while ((mnt = getmntent(mfp)) != NULL) {		len = preflen(qualpn, mnt->mnt_dir);		if (qualpn[len] != '/' && qualpn[len] != '\0' && len > 1)		   /*		    * If the last matching character is neither / nor 		    * the end of the pathname, not a real match		    * (except for matching root, len==1)		    */			continue;		if (len > bestlen) {			bestlen = len;			strcpy(bestname, mnt->mnt_fsname);		}	}	endmntent(mfp);	endhost = index(bestname,':');	  /*	   * If the file system was of type NFS, then there should already	   * be a host name, otherwise, use ours.	   */	if (endhost) {		*endhost++ = 0;		strcpy(host,bestname);		strcpy(fsname,endhost);		  /*		   * special case to keep the "/" when we match root		   */		if (bestlen == 1)			bestlen = 0;	} else {		gethostname(host, 255);		strncpy(fsname,qualpn,bestlen);		fsname[bestlen] = 0;	}	strcpy(within,qualpn+bestlen);	return 1;}/* * Returns: length of second argument if it is a prefix of the * first argument, otherwise zero. */preflen(str, pref)	char *str, *pref;{	int len; 	len = strlen(pref);	if (strncmp(str, pref, len) == 0)		return (len);	return (0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av午夜精品一区二区三区| 国产日韩欧美一区二区三区乱码| 国产精品小仙女| 秋霞午夜鲁丝一区二区老狼| 最新欧美精品一区二区三区| 国产日产欧美一区二区视频| 一本大道久久精品懂色aⅴ| 国精产品一区一区三区mba视频 | 日本亚洲天堂网| 亚洲女与黑人做爰| 国产精品午夜在线| 精品免费国产二区三区| 欧美一区二区三区男人的天堂| 91香蕉国产在线观看软件| 成人午夜视频在线| 黑人精品欧美一区二区蜜桃 | 蜜臀av一区二区| 亚洲高清视频的网址| 亚洲精品一卡二卡| 国产精品毛片高清在线完整版| www成人在线观看| 精品国产1区2区3区| 日韩一区二区三区精品视频| 日韩一区和二区| 3751色影院一区二区三区| 精品久久久久久久久久久久久久久久久 | 亚洲一区二区美女| 亚洲综合在线第一页| 亚洲三级久久久| 亚洲一区二区3| 性久久久久久久| 麻豆成人免费电影| 精品亚洲成a人在线观看| 国产麻豆精品在线| 成人免费观看av| 一本大道久久a久久综合| 91高清视频在线| 日韩一区二区免费视频| 精品国产99国产精品| 国产三级久久久| 亚洲精品一线二线三线| 久久久亚洲高清| ㊣最新国产の精品bt伙计久久| 亚洲乱码国产乱码精品精98午夜 | 国产精品天干天干在观线| 国产日韩欧美精品在线| 国产视频一区二区在线观看| 国产精品私人自拍| 亚洲综合在线第一页| 亚洲资源在线观看| 日本91福利区| 成人综合婷婷国产精品久久免费| 欧美中文字幕久久| 久久午夜国产精品| 一区二区三区av电影 | www.色精品| 欧美男人的天堂一二区| 国产亚洲一区二区三区在线观看| 亚洲免费在线观看视频| 日本vs亚洲vs韩国一区三区二区 | 久久婷婷国产综合精品青草| 亚洲品质自拍视频网站| 毛片av中文字幕一区二区| av亚洲产国偷v产偷v自拍| 欧美一区二区久久| 亚洲日本欧美天堂| 国产一区视频在线看| 欧美性极品少妇| 中文字幕高清一区| 日韩中文字幕一区二区三区| 处破女av一区二区| 欧美一二区视频| 艳妇臀荡乳欲伦亚洲一区| 国模套图日韩精品一区二区 | 国产一区二区三区综合 | 欧美精品电影在线播放| 国产精品传媒视频| 久久99精品久久只有精品| 欧美亚洲图片小说| 高潮精品一区videoshd| 欧美三级韩国三级日本一级| 国产精品久久久久一区二区三区共| 欧美日本一道本| 国产精品亚洲午夜一区二区三区| 久久久久久免费毛片精品| 色诱亚洲精品久久久久久| 天天影视网天天综合色在线播放| 欧美大尺度电影在线| 94色蜜桃网一区二区三区| 丝袜诱惑亚洲看片| 国产视频亚洲色图| 欧美性猛交一区二区三区精品| 美女网站色91| 亚洲麻豆国产自偷在线| 欧美日韩亚洲综合一区| 激情综合网av| 午夜欧美在线一二页| 欧美国产日韩一二三区| 欧美日韩成人综合| 成人激情免费电影网址| 日本一不卡视频| 亚洲精品国产成人久久av盗摄 | 久久国产成人午夜av影院| 中文字幕亚洲电影| 精品久久久久久无| 欧美日韩视频在线第一区| 国内外精品视频| 日韩二区在线观看| 又紧又大又爽精品一区二区| 26uuu精品一区二区三区四区在线| 欧美在线免费观看亚洲| 国产成人午夜视频| 毛片av一区二区| 一区二区三区日韩欧美| 日韩免费视频线观看| 欧美中文字幕一区二区三区 | 国产精品国产精品国产专区不蜜| 日韩视频免费直播| 欧美自拍丝袜亚洲| 99精品热视频| eeuss鲁片一区二区三区| 国产·精品毛片| 国内久久精品视频| 免费日本视频一区| 丝袜亚洲另类欧美综合| 亚洲自拍偷拍av| 一区二区三区在线看| 国产精品福利在线播放| 国产欧美精品一区aⅴ影院| 精品国产乱码久久久久久老虎| 欧美精品成人一区二区三区四区| 91蝌蚪porny成人天涯| av电影在线不卡| av在线这里只有精品| 国产成人av影院| 国产不卡视频一区| 狠狠色丁香久久婷婷综合丁香| 日本成人在线网站| 日韩高清在线电影| 九色综合狠狠综合久久| 精品在线观看视频| 久久91精品国产91久久小草| 麻豆成人在线观看| 国产在线播放一区| 国产精品一区在线| 成人sese在线| 色综合天天综合在线视频| 91久久香蕉国产日韩欧美9色| 色欧美乱欧美15图片| 在线一区二区视频| 69堂亚洲精品首页| 日韩精品中文字幕在线一区| 欧美一级理论片| 日韩免费电影一区| www国产精品av| 亚洲精品视频在线观看网站| 亚洲第一二三四区| 懂色av中文字幕一区二区三区 | 欧美三级视频在线播放| 91精品欧美久久久久久动漫| 日韩视频一区二区在线观看| 久久久久久97三级| 亚洲欧美日韩久久精品| 日韩精品视频网| 国产一区激情在线| 91女厕偷拍女厕偷拍高清| 欧美日韩三级视频| 久久久久国产精品厨房| 18涩涩午夜精品.www| 日本在线不卡视频| 国产精品66部| 欧美性色黄大片| 精品国内二区三区| 国产精品视频第一区| 玉米视频成人免费看| 午夜激情综合网| 韩国女主播一区| 国产一区二区三区久久久| 成人av在线一区二区三区| 欧美日韩一级二级| 欧美精彩视频一区二区三区| 亚洲国产人成综合网站| 国产麻豆欧美日韩一区| 欧美日韩在线直播| 久久久噜噜噜久久中文字幕色伊伊 | 成人国产一区二区三区精品| 欧美精品视频www在线观看| 日本一区二区不卡视频| 五月天激情小说综合| 成人免费av资源| 日韩视频免费观看高清完整版在线观看 | 欧美写真视频网站| 久久久久国产免费免费| 日韩综合在线视频| 色噜噜狠狠色综合中国| 久久久久久久久久久久电影| 日韩高清在线一区| 欧美在线观看视频一区二区 | 国产精品情趣视频| 久88久久88久久久|