*BSD News Article 44358


Return to BSD News archive

Newsgroups: comp.bugs.2bsd
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!news.ecn.uoknor.edu!paladin.american.edu!gatech!news.mathworks.com!solaris.cc.vt.edu!spcuna!wlbr!sms
From: sms@wlv.iipo.gtegsc.com (Steven M. Schultz)
Subject: missing arguments in rdist/server.c (#245)
Sender: news@wlbr.iipo.gtegsc.com (System Administrator)
Organization: GTE Government Systems, Westlake Village
Message-ID: <D8wyH7.Cw1@wlbr.iipo.gtegsc.com>
X-Nntp-Posting-Host: wlv.iipo.gtegsc.com
Date: Sun, 21 May 1995 05:41:30 GMT
Lines: 89

Subject: missing arguments in rdist/server.c (#245)
Index:	rdist/server.c 2.11BSD

Description:
	If rdist encounters a file with a group id not in /etc/group
	an incorrect (and probably negative) number is printed.

Repeat-By:
	Use rdist when files are present that do not have their group
	ids in /etc/group.

Fix:
	A printf() call was missing the st_gid argument causing whatever
	was present on the stack to be printed instead.

	The uid was missing from its printf() - you'd get a message about
	"no password entry for uid" but no indication which uid was missing.

	Cut where indicated and save to a file (/tmp/245 for example).

	patch -p0 < /tmp/245
	cd /usr/src/ucb/rdist
	make
	make install
	make clean
==================cut here=================
*** /usr/src/ucb/rdist/server.c.old	Wed May 10 09:28:09 1995
--- /usr/src/ucb/rdist/server.c	Tue May 16 22:58:38 1995
***************
*** 5,11 ****
   */
  
  #if	!defined(lint) && defined(DOSCCS)
! static char sccsid[] = "@(#)server.c	5.3.1 (2.11BSD) 1995/05/09";
  #endif
  
  #include "defs.h"
--- 5,11 ----
   */
  
  #if	!defined(lint) && defined(DOSCCS)
! static char sccsid[] = "@(#)server.c	5.3.2 (2.11BSD) 1995/05/16";
  #endif
  
  #include "defs.h"
***************
*** 289,301 ****
  
  	if (pw == NULL || pw->pw_uid != stb.st_uid)
  		if ((pw = getpwuid(stb.st_uid)) == NULL) {
! 			log(lfp, "%s: no password entry for uid \n", target);
  			pw = NULL;
  			sprintf(user, ":%d", stb.st_uid);
  		}
  	if (gr == NULL || gr->gr_gid != stb.st_gid)
  		if ((gr = getgrgid(stb.st_gid)) == NULL) {
! 			log(lfp, "%s: no name for group %d\n", target);
  			gr = NULL;
  			sprintf(group, ":%d", stb.st_gid);
  		}
--- 289,303 ----
  
  	if (pw == NULL || pw->pw_uid != stb.st_uid)
  		if ((pw = getpwuid(stb.st_uid)) == NULL) {
! 			log(lfp, "%s: no password entry for uid %d\n",
! 				target, stb.st_uid);
  			pw = NULL;
  			sprintf(user, ":%d", stb.st_uid);
  		}
  	if (gr == NULL || gr->gr_gid != stb.st_gid)
  		if ((gr = getgrgid(stb.st_gid)) == NULL) {
! 			log(lfp, "%s: no name for group %d\n",
! 				target, stb.st_gid);
  			gr = NULL;
  			sprintf(group, ":%d", stb.st_gid);
  		}
*** /VERSION.old	Sat May 20 21:04:08 1995
--- /VERSION	Sat May 20 21:04:02 1995
***************
*** 1,4 ****
! Current Patch Level: 244
  
  2.11 BSD
  ============
--- 1,4 ----
! Current Patch Level: 245
  
  2.11 BSD
  ============