Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!im4u!rutgers!sri-spam!mordor!styx!lll-lcc!ptsfa!ihnp4!inuxc!pur-ee!j.cc.purdue.edu!i.cc.purdue.edu!arthur.cs.purdue.edu!trinkle From: trinkle@arthur.cs.purdue.edu.UUCP Newsgroups: news.admin Subject: Re: using NFS to read news Message-ID: <1054@arthur.cs.purdue.edu> Date: Mon, 16-Mar-87 11:06:56 EST Article-I.D.: arthur.1054 Posted: Mon Mar 16 11:06:56 1987 Date-Received: Tue, 17-Mar-87 03:38:51 EST Organization: Department of Computer Science, Purdue University Lines: 112 We successfully use news via NFS allowing posting from all machines. We mount /usr/spool/news on all machines (I encourage read-only mount option) that want news access. The trick is to have a version of inews on the non-server machines that is setuid news and does an rsh to the "real" news machine. This is how I have things set up. Arthur is the main news server (VAX 8600), Bors is a typical client (Sun). /* the spool directory */ arthur 51: ls /usr/spool/news batch/ junk/ maps/ news/ sci/ comp/ lib/ misc/ purdue/ soc/ control/ lost+found/ mod/ rec/ talk/ /* the local lib directory */ arthur 52: ls -l /usr/local/lib/news ls -l /usr/local/lib/news lrwxrwxrwx 1 root 19 Nov 19 12:11 /usr/local/lib/news@ -> /usr/spool/news/lib /* the remote lib directory */ arthur 53: rsh bors ls -Flg /usr/local/lib/news total 146 lrwxrwxrwx 1 root staff 26 Mar 12 16:25 active -> /usr/spool/news/lib/active lrwxrwxrwx 1 root staff 27 Mar 12 16:25 aliases -> /usr/spool/news/lib/aliases -rwxrwxr-x 1 root staff 90112 Mar 12 16:29 caesar* lrwxrwxrwx 1 root staff 33 Mar 12 17:07 distributions -> /usr/spool/news/lib/distributions -r--r--r-- 1 root staff 1077 Mar 12 16:27 help -rwsr-sr-x 1 news daemon 49152 Mar 12 16:27 inews* lrwxrwxrwx 1 root staff 24 Mar 12 16:25 maps -> /usr/spool/news/lib/maps/ lrwxrwxrwx 1 root staff 30 Mar 12 16:25 moderators -> /usr/spool/news/lib/moderators lrwxrwxrwx 1 root staff 30 Mar 12 16:25 newsgroups -> /usr/spool/news/lib/newsgroups -r--r--r-- 1 root staff 1300 Mar 12 16:27 vnews.help arthur 54: Notice that /usr/spool/news/lib can be shared with everyone. I then install the normal {check,post,read,v}news utilities in /usr/local/bin. Here is the source for the remote inews ------------------------------inews.c------------------------------ #include #include #include #include #include #ifdef sun #define MAXHOSTNAMELEN 64 #endif char *sbProgName; main(csbArg, rgsbArg) int csbArg; char *rgsbArg[]; { char *sbLogin, *pch; char sbCmd[2048], sbThisHost[MAXHOSTNAMELEN + 1]; int status; struct passwd *ppwe; sbProgName = rgsbArg[0]; if (pch = rindex(rgsbArg[0], '/')) sbProgName = pch + 1; /* get the name of this host */ if (gethostname(sbThisHost, MAXHOSTNAMELEN)) ErrorExit("this machine does not have a name"); /* get /etc/passwd entry for this user */ if ((ppwe = getpwuid(getuid())) == NULL) ErrorExit("you do not exist on this machine"); /* some bogosities to get rid of phone numbers, etc */ if (pch = index(ppwe->pw_gecos, ',')) *pch = '\0'; if (pch = index(ppwe->pw_gecos, ';')) *pch = '\0'; /* do the rsh as news */ if (setuid(geteuid())) ErrorExit("cannot set userid"); if (setgid(getegid())) ErrorExit("cannot set groupid"); sprintf(sbCmd, "/usr/ucb/rsh %s %s/inews -h -f \\\"%s@%s \\(%s\\)\\\"", NEWSHOST, LIBDIR, ppwe->pw_name, sbThisHost, ppwe->pw_gecos); exit(system(sbCmd) ? 1 : 0); } ErrorExit(sb) char *sb; { fflush(stdout); fprintf(stderr, "%s: %s\n", sbProgName, sb); exit(1); } ------------------------------inews.c------------------------------ It is not very secure, but then we are not too concerned with the security of news articles. Daniel Trinkle trinkle@cs.purdue.edu ARPA Computer Science Department trinkle%purdue.edu@relay.cs.net CSNET Purdue University {ucbvax,decvax,ihnp4}!purdue!trinkle UUCP West Lafayette, IN 47907 (317) 494-7832 PHONE -- Daniel Trinkle trinkle@cs.purdue.edu ARPA Computer Science Department trinkle%purdue.edu@relay.cs.net CSNET Purdue University {ucbvax,decvax,ihnp4}!purdue!trinkle UUCP West Lafayette, IN 47907 (317) 494-7832 PHONE