📄 diffs
字号:
+ + if (remaining == 0) {+ base = (struct ServerTie *) malloc(32 * sizeof (*base));+ remaining = 32;+ }+ result = base; base++; remaining--;+ if (last)+ last->st_next = result;+ else+ ServerList = result;+ last = result;+ return (result);+ }+ _exit() {abort();}Only in xns.newer/daemon: xnscourierd.c.orgCommon subdirectories: xns/examples/archive and xns.newer/examples/archiveCommon subdirectories: xns/examples/auth and xns.newer/examples/authCommon subdirectories: xns/examples/authchtest and xns.newer/examples/authchtestCommon subdirectories: xns/examples/ch and xns.newer/examples/chCommon subdirectories: xns/examples/filing and xns.newer/examples/filingCommon subdirectories: xns/examples/filing_client and xns.newer/examples/filing_clientCommon subdirectories: xns/examples/filing_common and xns.newer/examples/filing_commonCommon subdirectories: xns/examples/filing_servers and xns.newer/examples/filing_serversCommon subdirectories: xns/examples/gap and xns.newer/examples/gapCommon subdirectories: xns/examples/passwd and xns.newer/examples/passwdCommon subdirectories: xns/examples/print and xns.newer/examples/printCommon subdirectories: xns/examples/remotetool and xns.newer/examples/remotetoolCommon subdirectories: xns/examples/retrieve and xns.newer/examples/retrieveCommon subdirectories: xns/examples/vpfile and xns.newer/examples/vpfileCommon subdirectories: xns/examples/xnscreds and xns.newer/examples/xnscredsOnly in xns/examples/filing: SCCSdiff -c -r xns/examples/filing/errmsg.c xns.newer/examples/filing/errmsg.c*** xns/examples/filing/errmsg.c Tue May 24 10:02:07 1988--- xns.newer/examples/filing/errmsg.c Sat Mar 7 11:45:01 1987****************** 130,139 **** case ScopeValueError: /* the following fails because "type" is defined as "Filing4_type". Argh!! /* problem = (int) (((ScopeTypeErrorArgs *) Message)->problem);! /* (void)sprintf(tempbuf,"problem: %s; type: %d", /* argproblems[problem], /* ((ScopeTypeErrorArgs *) Message)->type);- /* problemstr = tempbuf; /* break; */ case RangeError:--- 130,138 ---- case ScopeValueError: /* the following fails because "type" is defined as "Filing4_type". Argh!! /* problem = (int) (((ScopeTypeErrorArgs *) Message)->problem);! /* problemstr = sprintf(tempbuf,"problem: %s; type: %d", /* argproblems[problem], /* ((ScopeTypeErrorArgs *) Message)->type); /* break; */ case RangeError:Only in xns.newer/examples/filing: errmsg.c.fixOnly in xns/examples/filing_common: SCCSdiff -c -r xns/examples/filing_common/errmsg.c xns.newer/examples/filing_common/errmsg.c*** xns/examples/filing_common/errmsg.c Tue May 24 10:01:14 1988--- xns.newer/examples/filing_common/errmsg.c Tue May 12 08:46:59 1987****************** 136,145 **** case ScopeValueError: /* the following fails because "type" is defined as "Filing4_type". Argh!! /* problem = (int) (((ScopeTypeErrorArgs *) Message)->problem);! /* (void)sprintf(tempbuf,"problem: %s; type: %d", /* argproblems[problem], /* ((ScopeTypeErrorArgs *) Message)->type);- /* problemstr = tempbuf; /* break; */ case RangeError:--- 136,144 ---- case ScopeValueError: /* the following fails because "type" is defined as "Filing4_type". Argh!! /* problem = (int) (((ScopeTypeErrorArgs *) Message)->problem);! /* problemstr = sprintf(tempbuf,"problem: %s; type: %d", /* argproblems[problem], /* ((ScopeTypeErrorArgs *) Message)->type); /* break; */ case RangeError:Only in xns/examples/gap: SCCSdiff -c -r xns/examples/gap/gap2d.c xns.newer/examples/gap/gap2d.c*** xns/examples/gap/gap2d.c Tue May 24 10:03:27 1988--- xns.newer/examples/gap/gap2d.c Mon Jan 5 08:47:30 1987****************** 254,261 **** dup2(t, 2); if (t > 2) close(t); envinit[0] = "TERM=network";! (void)sprintf(wsenv, "WORKSTATION=%s", xntoa(who.sns_addr));! envinit[1] = wsenv; envinit[2] = (char*) 0; #ifdef DEBUG BUGOUT("about to exec /bin/login");--- 254,261 ---- dup2(t, 2); if (t > 2) close(t); envinit[0] = "TERM=network";! envinit[1] = sprintf(wsenv, "WORKSTATION=%s",! xntoa(who.sns_addr)); envinit[2] = (char*) 0; #ifdef DEBUG BUGOUT("about to exec /bin/login");Common subdirectories: xns/include/xnscourier and xns.newer/include/xnscourierOnly in xns/man: MakefileCommon subdirectories: xns/morexnslib/auth and xns.newer/morexnslib/authCommon subdirectories: xns/morexnslib/ch and xns.newer/morexnslib/chCommon subdirectories: xns/morexnslib/xnsbfs and xns.newer/morexnslib/xnsbfsCommon subdirectories: xns/morexnslib/auth/profiled and xns.newer/morexnslib/auth/profiledCommon subdirectories: xns/morexnslib/ch/profiled and xns.newer/morexnslib/ch/profiledOnly in xns.newer/xnslib: M.kdiff -c -r xns/xnslib/courierdb.h xns.newer/xnslib/courierdb.h*** xns/xnslib/courierdb.h Mon Jan 5 09:11:09 1987--- xns.newer/xnslib/courierdb.h Mon Nov 23 18:30:12 1987****************** 5,16 **** */ struct courierdbent {! char *cr_programname; /* the name of the Courier program */ unsigned long cr_programnumber; /* official number of program */ unsigned short cr_version; /* version number of this server */ char *cr_description; /* file containing the Courier description */ char *cr_serverbin; /* file containing the server binary */ }; extern struct courierdbent *getcourierdbent(); extern struct courierdbent *getcourierservice();--- 5,35 ---- */ struct courierdbent {! char *cr_programname; /* the name of the Courier program */ unsigned long cr_programnumber; /* official number of program */ unsigned short cr_version; /* version number of this server */ char *cr_description; /* file containing the Courier description */ char *cr_serverbin; /* file containing the server binary */+ unsigned short cr_threading; /* method to contact this server */ };+ #define CR_EXEC 0 /* Normal Fork and Exec */+ #define CR_NOWAIT 1 /* Return Transport to xnscourierd+ master daemon will fork */+ #define CR_WAIT 2 /* Return Transport to xnscourierd+ master daemon won't fork */ extern struct courierdbent *getcourierdbent(); extern struct courierdbent *getcourierservice();+ + /*+ * misc structures for master daemon for associating+ * offered services with unix domain socketpairs for passing connections.+ * This should probably be elsewhere.+ */+ + struct ServerTie {+ struct ServerTie *st_next;+ int st_fd;+ int st_pid;+ struct courierdbent st_db;+ };Only in xns.newer/xnslib: courierdb.h.orgCommon subdirectories: xns/xnslib/except and xns.newer/xnslib/exceptdiff -c -r xns/xnslib/getcourierent.c xns.newer/xnslib/getcourierent.c*** xns/xnslib/getcourierent.c Mon Jan 5 09:11:11 1987--- xns.newer/xnslib/getcourierent.c Wed Dec 9 18:42:24 1987****************** 75,80 ****--- 75,91 ---- cp = skipitem(cp); if (*cp != '\0') { *cp = '\0';+ cp = skipspace(++cp);+ }+ if (*cp == 0)+ service.cr_threading = CR_EXEC;+ else if (strcmp(cp, "wait") == 0)+ service.cr_threading = CR_WAIT;+ else if (strcmp(cp, "nowait") == 0)+ service.cr_threading = CR_NOWAIT;+ cp = skipitem(cp);+ if (*cp != '\0') {+ *cp = '\0'; /* etc. for more fields */ } return (&service);Only in xns.newer/xnslib: getcourierent.c.orgOnly in xns.newer/xnslib: libxns.adiff -c -r xns/xnslib/lookahead.c xns.newer/xnslib/lookahead.c*** xns/xnslib/lookahead.c Mon May 11 06:32:18 1987--- xns.newer/xnslib/lookahead.c Tue Dec 22 17:06:21 1987****************** 41,49 **** #define MAKEVEC(idx, addr, len) our_iovec[idx].iov_base = (caddr_t)addr;\ our_iovec[idx].iov_len = len; ! #if DEBUG! extern int CourierServerDebuggingFlag;! #endif extern CourierConnection *_serverConnection; extern Unspecified tid;--- 41,48 ---- #define MAKEVEC(idx, addr, len) our_iovec[idx].iov_base = (caddr_t)addr;\ our_iovec[idx].iov_len = len; ! int _fd_for_passing;! int CourierServerDebuggingFlag; extern CourierConnection *_serverConnection; extern Unspecified tid;****************** 170,175 ****--- 169,175 ---- int i, argc; extern char *malloc(); char tmpbuf[1024];+ Unspecified databuf[12] , *dp = databuf; cdbent = getcourierservice(programnum, versionnum); if (cdbent != NULL &&****************** 197,208 **** if (curval > 0) SendRejectMessage(noSuchVersionNumber, 2, range); else SendRejectMessage(noSuchProgramNumber, 0, NULL);! #if DEBUG! (void) fprintf(stderr, "xnscourierd: no program %d(%d)\n", programnum, versionnum);- #endif return; /* can't find server */ } argc = 0; argv[argc] = malloc(4); /* allow 3 digits per file descriptor */ sprintf(argv[argc++],"%d",(int)_serverConnection->fd);--- 197,218 ---- if (curval > 0) SendRejectMessage(noSuchVersionNumber, 2, range); else SendRejectMessage(noSuchProgramNumber, 0, NULL);! if (CourierServerDebuggingFlag)! (void) fprintf(stderr, "xnscourierd: no program %d(%d)\n", programnum, versionnum); return; /* can't find server */ }+ if (_fd_for_passing >= 0) { /* return call to master server */+ Unspecified databuf[12] , *dp; register int i;+ dp += externalize_LongCardinal(dp, &programnum);+ dp += externalize_Cardinal(dp, &versionnum);+ *(unsigned short *) dp = skipcount; dp++;+ for (i = 0; i++; i < skipcount)+ *dp++ = skippedwords[i];+ pass_fd_rights(_fd_for_passing, _serverConnection->fd, databuf,+ (dp - databuf) * sizeof(Unspecified));+ exit (0);+ } argc = 0; argv[argc] = malloc(4); /* allow 3 digits per file descriptor */ sprintf(argv[argc++],"%d",(int)_serverConnection->fd);****************** 214,223 **** execv(cdbent->cr_serverbin, argv); Deallocate(ReadMessage(_serverConnection, NULL, 0));/* flush message */ SendRejectMessage(unspecifiedError, 0, NULL);! #if DEBUG (void) fprintf(stderr, "xnscourierd: can't exec %s\n", cdbent->cr_serverbin);- #endif return; } --- 224,232 ---- execv(cdbent->cr_serverbin, argv); Deallocate(ReadMessage(_serverConnection, NULL, 0));/* flush message */ SendRejectMessage(unspecifiedError, 0, NULL);! if (CourierServerDebuggingFlag) (void) fprintf(stderr, "xnscourierd: can't exec %s\n", cdbent->cr_serverbin); return; } ****************** 231,241 **** static Cardinal msgtype = REJECT; Unspecified *bp, buf[REJECTHDRLEN]; - #if DEBUG if (CourierServerDebuggingFlag) fprintf(stderr, "[SendRejectMessage %d, length %d]\n", rejecttype, nwords);- #endif bp = buf; bp += externalize_Cardinal(&msgtype, bp); bp += externalize_Unspecified(&tid, bp);--- 240,248 ----****************** 255,265 **** static Cardinal msgtype = ABORT; Unspecified *bp, buf[ABORTHDRLEN]; - #if DEBUG if (CourierServerDebuggingFlag) fprintf(stderr, "[SendAbortMessage %d %d]\n", errorvalue, nwords);- #endif bp = buf; bp += externalize_Cardinal(&msgtype, bp); bp += externalize_Unspecified(&tid, bp);--- 262,270 ----****************** 274,282 **** Cardinal proc; { SendRejectMessage(noSuchProcedureValue, 0, (Unspecified*) NULL);- #if DEBUG if (CourierServerDebuggingFlag) fprintf(stderr, "[NoSuchProcedureValue %d in %s]\n", proc, prog_name);- #endif }--- 279,329 ---- Cardinal proc; { SendRejectMessage(noSuchProcedureValue, 0, (Unspecified*) NULL); if (CourierServerDebuggingFlag) fprintf(stderr, "[NoSuchProcedureValue %d in %s]\n", proc, prog_name); }+ + garner_fd(s, fd, buf, buflen)+ int s, *fd, *buflen;+ char *buf;+ {+ static struct msghdr msg;+ static struct iovec iov[1];+ + iov->iov_base = buf;+ iov->iov_len = *buflen;+ msg.msg_iov = iov;+ msg.msg_iovlen = 1;+ msg.msg_accrights = (caddr_t)fd;+ msg.msg_accrightslen = sizeof (*fd);+ if (recvmsg(s, &msg, 0) < 0) {+ perror("garner_fd: recvmsg");+ return (-1);+ }+ *buflen = iov->iov_len;+ return (0);+ }+ + pass_fd_rights(s, fd, buf, buflen)+ int s, fd, buflen;+ char *buf;+ {+ static struct msghdr msg;+ static struct iovec iov[1];+ + iov->iov_base = buf;+ iov->iov_len = buflen;+ msg.msg_iov = iov;+ msg.msg_iovlen = 1;+ msg.msg_accrights = (caddr_t)&fd;+ msg.msg_accrightslen = sizeof (fd);+ if (sendmsg(s, &msg, 0) < 0) {+ perror("pass_fd_rights: sendmsg");+ exit (0);+ }+ }+ + int _fd_for_passing = -1;+ int _fd_for_getting = -1;+ Only in xns.newer/xnslib: lookahead.c.orgCommon subdirectories: xns/xnslib/profiled and xns.newer/xnslib/profileddiff -c -r xns/xnslib/readwrite.c xns.newer/xnslib/readwrite.c*** xns/xnslib/readwrite.c Mon May 11 06:33:14 1987--- xns.newer/xnslib/readwrite.c Tue Dec 22 16:00:47 1987****************** 328,334 **** openSPPConnection(dst) struct sockaddr_ns *dst; {! int s; extern int errno; if ((s = socket(dst->sns_family, SOCK_SEQPACKET, 0)) < 0) {--- 328,334 ---- openSPPConnection(dst) struct sockaddr_ns *dst; {! int s, on = 1; extern int errno; if ((s = socket(dst->sns_family, SOCK_SEQPACKET, 0)) < 0) {****************** 341,346 ****--- 341,349 ---- perror("(Courier) connect"); return(-1); /*NOTREACHED*/+ }+ if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof on) < 0) {+ perror("(Courier) Keep-Alive"); } return(s); }diff -c -r xns/xnslib/server.c xns.newer/xnslib/server.c*** xns/xnslib/server.c Mon Jan 5 09:11:26 1987--- xns.newer/xnslib/server.c Tue Dec 22 17:05:46 1987****************** 34,39 ****--- 34,40 ---- #include <sys/time.h> #include <sys/types.h> /* for ns.h */ #include <sys/socket.h>+ #include <sys/uio.h> #include <netns/ns.h> /* for XNS addresses and courierconnectin.h */ #include <netns/sp.h> /* for spphdr */ #include "courier.h"****************** 48,54 **** /* * Message stream handle. */! CourierConnection *_serverConnection = 0; Unspecified tid; /* transaction ID */ --- 49,55 ---- /* * Message stream handle. */! CourierConnection *_serverConnection; Unspecified tid; /* transaction ID */ ****************** 118,125 **** CourierWrite(_serverConnection, (bp-buf), buf, nwords, results); _serverConnection->bdtstate = wantdata; } - static int ServerInit(argc, argv, skippedwords) int argc;--- 119,127 ---- CourierWrite(_serverConnection, (bp-buf), buf, nwords, results); _serverConnection->bdtstate = wantdata; }+ int _fd_for_getting;+ int _fd_for_passing; static int ServerInit(argc, argv, skippedwords) int argc;****************** 153,158 ****--- 155,173 ---- CourierServerDebuggingFlag = 1; else #endif+ if (*argv[0] == '*' && skipcount < 0) {+ Unspecified databuf[512];+ int buflen = sizeof(databuf); register int i;+ sscanf(1 + argv[0], "%d,%d", &_fd_for_getting,+ &_fd_for_passing);+ if (garner_fd(_fd_for_getting, &_serverConnection->fd,+ databuf, &buflen) < 0)+ exit(1);+ skipcount = *(unsigned short *)(databuf+3);+ for (i = 0; i < skipcount; i++)+ skippedwords[i] = databuf[i+4];+ break;+ } if (isdigit(*argv[0])) { if (skipcount < 0) { _serverConnection->fd = atoi(argv[0]);****************** 200,202 ****--- 215,218 ---- Server(skipcount, skippedwords); exit(0); }+ Only in xns.newer/xnslib: server.c.org
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -