home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3544 < prev    next >
Encoding:
Internet Message Format  |  1991-06-26  |  9.3 KB

  1. From: iverson@xstor.com (Tim Iverson)
  2. Newsgroups: alt.sources
  3. Subject: Patches for NNTP 1.5.11 under SCO Unix
  4. Message-ID: <1991Jun26.000807.7560@xstor.com>
  5. Date: 26 Jun 91 00:08:07 GMT
  6.  
  7.  
  8. This patch file requires patch-2.0.2.0 patchlevel 12u4.  You might have some
  9. success with unipatch or earlier 12u* versions of patch, but you're on your
  10. own there.  It makes the standard nntp-1.5.11 distribution compile and run
  11. under SCO Unix 3.2.2 with TCP/IP 1.1.1b.
  12.  
  13. What it does:    modify setup (conf.h) and makefiles as used for xstor.com
  14.         modify server/main.c to do a setluid (ugly c2-ism)
  15.         minor mods to several other files (use statfs, etc.)
  16.  
  17. To apply:    cd nntp-1.5.11
  18.         cp common/conf.h.dist common/conf.h
  19.         patch -p < this_file
  20.         edit conf.h (at least change "xstor.com" to something else)
  21.  
  22. To compile:    You must have libcnews.a (created when you built cnews) in
  23.         one of the places searched by ld; e.g. /lib or perhaps
  24.         /usr/local/lib/gcc.
  25.  
  26. N.B.    This patch has only been tested with gcc-1.39-SCO.3 (i.e. 1.39 with
  27.     all of my SCO patches applied).  It will probably work equally well
  28.     with the standard dev-sys.
  29.  
  30. - Tim Iverson
  31.   iverson@xstor.com -/- uunet!xstor!iverson
  32.  
  33. #
  34. ################ patch starts here
  35. ##
  36. Prereq: "1.5.11a (1 April 1991)";
  37. Index: common/version.c
  38. @@ -3,3 +3,3 @@
  39. = */
  40. =
  41. -char    nntp_version[] = "1.5.11a (1 April 1991)";
  42. +char    nntp_version[] = "1.5.11a (1 April 1991) SCO.0";
  43. Index: Makefile
  44. @@ -7,5 +7,5 @@
  45. =CFLAGS= -O 
  46. =# set LIBS to be -lneededlibrary if needed
  47. -LIBS=-ldbm
  48. +LIBS=-lcnews -lsocket -lx -lprot
  49. =
  50. =DISTFILES = Makefile README CHANGES
  51. Index: common/conf.h
  52. @@ -22,5 +22,5 @@
  53. = * at some sites, so it is an option. Please report problems to "nntp@tmc.edu"
  54. = */
  55. -#undef DYNAMIC_ART_ARRAY
  56. +#define DYNAMIC_ART_ARRAY
  57. =
  58. =#undef    BSD_42        /* 4.2 compatability code -- if this is defined, */
  59. @@ -27,9 +27,9 @@
  60. =            /* DBM probably wants to be defined as well. */
  61. =
  62. -#define BSD_43        /* Define if you are running on BSD 4.3 */
  63. +#undef    BSD_43        /* Define if you are running on BSD 4.3 */
  64. =
  65. =#undef CMU_MACH        /* Use CMU's MACH ioctl(FIOCFSPARAM) for dfree(). */
  66. =
  67. -#undef    USG        /* System V support */
  68. +#define    USG        /* System V support */
  69. =
  70. =#undef TLI        /* Define this if you want to use TLI instead of */
  71. @@ -36,5 +36,5 @@
  72. =            /* sockets */
  73. =
  74. -#define NDBM        /* Use new-style (4.3) ndbm(3x) libraries */
  75. +#undef    NDBM        /* Use new-style (4.3) ndbm(3x) libraries */
  76. =
  77. =#undef    DBM        /* True if we want to use the old dbm(3x) libraries */
  78. @@ -42,5 +42,5 @@
  79. =            /* be -ldbm */
  80. =
  81. -#undef    DBZ        /* True if we want to use dbz libraries */
  82. +#define    DBZ        /* True if we want to use dbz libraries */
  83. =            /* IF YOU DEFINE THIS, change CFLAGS in makefile to */
  84. =            /* be /usr/lib/dbz.o and install dbz.h */
  85. @@ -49,6 +49,6 @@
  86. =            /* IF YOU DO NOT DEFINE NDBM or DBM, this is DEFAULT!*/
  87. =
  88. -#undef CNEWS        /* define this if you are running C-NEWS */
  89. -#undef BATCHED_INPUT    /* define if you want to support C-NEWS style 
  90. +#define    CNEWS        /* define this if you are running C-NEWS */
  91. +#undef    BATCHED_INPUT    /* define if you want to support C-NEWS style 
  92. =                batched input (not supported by B-NEWS,yet)  */
  93. =
  94. @@ -63,6 +63,6 @@
  95. =#define SIGRET void    /* Newfangled signal() returns void, old returns int */
  96. =
  97. -#define    GHNAME        /* Define if you have gethostname() */
  98. -#undef    UUNAME        /* Define to use /etc/uucpname */
  99. +#undef    GHNAME        /* Define if you have gethostname() */
  100. +#define    UUNAME        /* Define to use /etc/uucpname */
  101. =            /* If neither of these are defined, */
  102. =            /* inews will use the contents of */
  103. @@ -76,10 +76,10 @@
  104. = */
  105. =
  106. -/* #define    vfork fork */
  107. +#define    vfork fork
  108. =
  109. =/* Controlling disk and inode consumption */
  110. -#define MINFREE 4000    /* NNTP will not allow an XFER if there is less */
  111. +#define MINFREE 500    /* NNTP will not allow an XFER if there is less */
  112. =            /* than this much diskspace (in blocks or kbytes) */
  113. -#define POSTBUFFER 1000 /* NNTP will allow local posting until */
  114. +#define POSTBUFFER 100    /* NNTP will allow local posting until */
  115. =            /* MINFREE-POSTBUFFER blocks or kbytes are left */
  116. =#undef MINFILES  MINFREE/4
  117. @@ -112,5 +112,5 @@
  118. = */
  119. =
  120. -/* #define UMASK 022 */
  121. +#define UMASK 022
  122. =
  123. =/*
  124. @@ -134,6 +134,6 @@
  125. = */
  126. =
  127. -#undef    FAKESYSLOG    "/usr/lib/news/nntplog"
  128. -#undef    FAKEAPPEND
  129. +#define    FAKESYSLOG    "/usr/lib/news/nntplog"
  130. +#define    FAKEAPPEND
  131. =
  132. =#define    SYSLOG    LOG_NEWS
  133. @@ -140,5 +140,5 @@
  134. =
  135. =#ifdef SYSLOG        /* Define LOG if you want copious logging info */
  136. -#undef     LOG        /* undef it if you don't */
  137. +# undef    LOG        /* undef it if you don't */
  138. =#endif            /* but you can only have LOG if you have SYSLOG */
  139. =
  140. @@ -182,6 +182,6 @@
  141. = */
  142. =
  143. -#define    DOMAIN    "uucp"
  144. -#undef HIDDENNET
  145. +#define    DOMAIN    "xstor.com"
  146. +#define    HIDDENNET
  147. =
  148. =/*
  149. @@ -201,5 +201,5 @@
  150. =/* Things that relate to authentication and access */
  151. =/* Define AUTH to use the proposed NNTP Version 2 authentication protocol. */
  152. -#define    AUTH    
  153. +#undef    AUTH    
  154. =/*
  155. = * A file containing the name of the host which is running
  156. @@ -208,5 +208,5 @@
  157. = */
  158. =
  159. -#define    SERVER_FILE    "/usr/local/lib/rn/server"
  160. +#define    SERVER_FILE    "/usr/local/lib/trn/server"
  161. =
  162. =/*
  163. @@ -214,5 +214,5 @@
  164. = */
  165. =
  166. -#define    POSTER        "usenet"
  167. +#define POSTER        "news"
  168. =
  169. =/*
  170. @@ -340,13 +340,13 @@
  171. =
  172. =#ifdef USG
  173. -# define    FCNTL            /* If O_etc is defined in <fcntl.h> */
  174. -#ifdef dgux
  175. -#define        FTRUNCATE
  176. -#else
  177. -# define    NDIR            /* If you  need ndir library support */
  178. -#ifdef hpux
  179. -#define        DIRSIZ_MACRO
  180. -#endif
  181. -#endif
  182. +# define    FCNTL        /* If O_etc is defined in <fcntl.h> */
  183. +# ifdef dgux
  184. +#  define    FTRUNCATE
  185. +# else
  186. +#  define    NDIR        /* If you  need ndir library support */
  187. +#  ifdef hpux
  188. +#   define    DIRSIZ_MACRO
  189. +#  endif
  190. +# endif
  191. =# define    index    strchr
  192. =# define    rindex    strrchr
  193. @@ -365,4 +365,2 @@
  194. =#define    MAX_ARTICLES    4096        /* Maximum number of articles/group */
  195. =#define READINTVL    60 * 10        /* 10 minutes b/n chking active file */
  196. -
  197. -
  198. Index: doc/Makefile
  199. @@ -29,7 +29,7 @@
  200. =
  201. =install: $(MANPAGES)
  202. -    mv nntpd.8c $(MANDIR)/man8/nntpd.8c
  203. -    mv mkgrdates.8c $(MANDIR)/man8/mkgrdates.8c
  204. -    mv nntpxmit.1 $(MANDIR)/man1/nntpxmit.1
  205. +    mv nntpd.8c $(MANDIR)/man.N/nntpd.N
  206. +    mv mkgrdates.8c $(MANDIR)/man.N/mkgrdates.N
  207. +    mv nntpxmit.1 $(MANDIR)/man.N/nntpxmit.N
  208. =
  209. =print: $(MANPAGES)
  210. Index: inews/Makefile
  211. @@ -14,5 +14,5 @@
  212. =
  213. =inews:  $(OBJS) $(HFILES)
  214. -    $(CC) $(CFLAGS) $(OBJS) -o inews $(LIBS)
  215. +    $(CC) -s $(CFLAGS) $(OBJS) -o inews $(LIBS)
  216. =
  217. =uname.o: uname.c ../common/conf.h
  218. Index: inews/uname.c
  219. @@ -57,4 +57,6 @@
  220. =    FILE *uucpf;
  221. =    register char *p;
  222. +    extern    char *index();
  223. +
  224. =    /* uucp name is stored in /etc/uucpname or /local/uucpname */
  225. =
  226. Index: server/Makefile
  227. @@ -31,5 +31,5 @@
  228. =
  229. =nntpd: ${SRVROBJ} ${SRVRINC} ${THREADS}
  230. -    ${CC} ${CFLAGS} -o nntpd ${SRVROBJ} ${THREADS} ${LIBS}
  231. +    ${CC} -s ${CFLAGS} -o nntpd ${SRVROBJ} ${THREADS} ${LIBS}
  232. =
  233. =${SRVROBJ}: ${SRVRINC}
  234. Index: server/main.c
  235. @@ -36,5 +36,33 @@
  236. =char **argv, **envp;
  237. ={
  238. +#ifdef    M_UNIX
  239. +    extern int    errno;
  240. +    extern char    *sys_errlist[];
  241. +    register int    luid, lgid;
  242. =
  243. +# ifdef    POSTER    /* try to get the desired luid */
  244. +    {
  245. +        struct passwd *p = getpwnam(POSTER);
  246. +
  247. +        if (p)
  248. +            luid = p->pw_uid, lgid = p->pw_gid;
  249. +        else
  250. +            luid = lgid = 0;
  251. +
  252. +        if (setluid(luid))
  253. +            setluid(luid = lgid = 0);
  254. +    }
  255. +# else
  256. +    setluid(luid = lgid = 0);
  257. +# endif
  258. +
  259. +    if (setgid(lgid) || setuid(luid))
  260. +    {
  261. +        printf("LUID not set! syserr[%d]=%s\n",
  262. +            errno, sys_errlist[errno]);
  263. +        exit(1);
  264. +    }
  265. +#endif
  266. +
  267. =#ifdef ALONE    /* If no inetd */
  268. =
  269. Index: server/misc.c
  270. @@ -615,5 +615,5 @@
  271. =}
  272. =#endif USGHIST
  273. -#ifdef USG
  274. +#if defined(USG) && !defined(M_UNIX)
  275. =#ifndef GAZETTE
  276. =bcopy(s, d, l)
  277. @@ -724,5 +724,5 @@
  278. =#endif 
  279. =
  280. -#if defined(apollo)
  281. +#if defined(apollo) || defined(M_UNIX)
  282. =#include <sys/types.h>
  283. =#include <sys/statfs.h>
  284. @@ -753,5 +753,5 @@
  285. =#endif 
  286. =
  287. -#if defined(USG) && !defined(hpux)
  288. +#if defined(USG) && !defined(hpux) && !defined(M_UNIX)
  289. =#include <ustat.h>
  290. =typedef struct ustat statfs_type;
  291. Index: server/spawn.c
  292. @@ -62,5 +62,5 @@
  293. =#endif
  294. =#ifdef XFER_TIMEOUT
  295. -    int        xfer_timeout();
  296. +    SIGRET        xfer_timeout();
  297. =#endif
  298. =#ifdef USG
  299. @@ -260,5 +260,5 @@
  300. =                if (errbuf) {
  301. =                    if (cp = index(line, '\n'))
  302. -                        *cp = '\0';
  303. +                        *cp = '\\';
  304. =                    (void) strcat(errbuf, line);
  305. =                }
  306. @@ -317,4 +317,5 @@
  307. =#ifdef XFER_TIMEOUT
  308. =
  309. +SIGRET
  310. =xfer_timeout()
  311. ={
  312. Index: server/timer.c
  313. @@ -70,5 +70,5 @@
  314. =    register struct timer *tp;
  315. =    register long secs;
  316. -#ifdef USG
  317. +#if defined(USG) && !defined(FD_SET)
  318. =    long timeout;
  319. =    long readfds;
  320. @@ -84,5 +84,5 @@
  321. =
  322. =    /* Length of next timeout is minimum of all "timers" */
  323. -#ifdef USG
  324. +#if defined(USG) && !defined(FD_SET)
  325. =    timeout = -1;
  326. =    for (i = ntimer, tp = timers; i > 0; --i, ++tp)
  327. Index: support/Makefile
  328. @@ -18,5 +18,5 @@
  329. =
  330. =mkgrdates: mkgrdates.o
  331. -    $(CC) ${CFLAGS} -o mkgrdates mkgrdates.o
  332. +    $(CC) -s ${CFLAGS} -o mkgrdates mkgrdates.o
  333. =
  334. =install: mkgrdates
  335. Index: xfer/Makefile
  336. @@ -11,5 +11,5 @@
  337. =
  338. =nntpxfer: ${SRVROBJ}
  339. -    ${CC} ${LDFLAGS} ${SRVROBJ} -o nntpxfer ${LIBS}
  340. +    ${CC} -s ${LDFLAGS} ${SRVROBJ} -o nntpxfer ${LIBS}
  341. =
  342. =get_tcp_conn.o: ../xmit/get_tcp_conn.c ../xmit/get_tcp_conn.h
  343. Index: xmit/Makefile
  344. @@ -23,8 +23,8 @@
  345. =
  346. =nntpxmit: ${SRVROBJ} ${SRVRINC}
  347. -    ${CC} ${CFLAGS} -o nntpxmit ${SRVROBJ} ${LIBS}
  348. +    ${CC} -s ${CFLAGS} -o nntpxmit ${SRVROBJ} ${LIBS}
  349. =
  350. =shlock: shlock.c
  351. -    cc ${CFLAGS} -DNNTPSRC -o shlock shlock.c
  352. +    $(CC) -s ${CFLAGS} -DNNTPSRC -o shlock shlock.c
  353. =
  354. =${SRVROBJ}: ${SRVRINC}
  355. Index: xmit/get_tcp_conn.c
  356. @@ -143,5 +143,5 @@
  357. =#endif    NONETDB
  358. =
  359. -#ifdef    USG
  360. +#if defined(USG) && !defined(M_UNIX)
  361. =void
  362. =bcopy(s, d, l)
  363. Index: xmit/nntpxmit.c
  364. @@ -156,5 +156,5 @@
  365. =extern    char    *strcat();
  366. =
  367. -#ifdef    USG
  368. +#if defined(USG) && !defined(M_UNIX)
  369. =void
  370. =bzero(s, l)
  371. ##
  372. ################ patch ends here
  373. #
  374.