Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!ukma!nrl-cmf!ames!sdcsvax!telesoft!souza From: souza@telesoft.UUCP (Steve Souza @eldest) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Network Software Bug Message-ID: <126@telesoft.UUCP> Date: Tue, 24-Nov-87 13:18:08 EST Article-I.D.: telesoft.126 Posted: Tue Nov 24 13:18:08 1987 Date-Received: Sat, 28-Nov-87 11:15:21 EST Organization: TeleSoft Inc., San Diego, CA Lines: 57 Keywords: SunOS, 3.4, /etc/group Xref: mnetor comp.lang.c:5575 comp.unix.wizards:5607 We've seen a strange symptom in a network software package that, until SunOS version 3.4 (on a Sun 160), functioned normally. The basic scenario is a server process that accepts network socket connection requests from a client process, executes a specified command, and sends the output back to the client process, not unlike the r-shell software. Under 3.4, huge pieces of /etc/group randomly appear in the output of the client process, often in a repeating pattern of usernames. Here are excerpts from the code [pardon the crudity of the i/o -- I'm still working on it!]: ----------------------------------------------------------------Server: write_output(s, cmd) int s; /* `s' is a socket of type AF_INET */ char *cmd; /* `cmd' is the command line */ { FILE *pp; char buf[BUFSIZ]; pp = popen(cmd, "r"); ... while (fgets(buf, BUFSIZ, pp) != NULL) if (write(s, buf, BUFSIZ) < 0) { pclose(pp); return(1<<8); } return(pclose(pp)); } ----------------------------------------------------------------Client: read_output() { /* `sock' is the other end of the AF_INET socket */ extern int sock; char obuf[BUFSIZ]; while (1) { if (read(sock, obuf, BUFSIZ) > 0) write(1, obuf, strlen(obuf)); else break; } } ----------------------------------------------------------------------- Anybody know of changes in 3.4 that might cause this? We don't run YP, BTW. Also, the server process calls initgroups(). Could that be related? Any suggestions would be m u c h appreciated... Thanks! Steve Souza ...sdcsvax!telesoft!souza TELESOFT Inc., San Diego, CA (619)457-2700 x277