From owner-freebsd-bugs Sun Oct 6 0:50: 8 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C0C737B404 for ; Sun, 6 Oct 2002 00:50:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38EDF43E3B for ; Sun, 6 Oct 2002 00:50:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g967o4Co046412 for ; Sun, 6 Oct 2002 00:50:04 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g967o45l046411; Sun, 6 Oct 2002 00:50:04 -0700 (PDT) Date: Sun, 6 Oct 2002 00:50:04 -0700 (PDT) Message-Id: <200210060750.g967o45l046411@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Lyndon Nerenberg Subject: Re: bin/4672 rdist botches hardlink counts (take 2) Reply-To: Lyndon Nerenberg Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/4672; it has been noted by GNATS. From: Lyndon Nerenberg To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/4672 rdist botches hardlink counts (take 2) Date: Sun, 06 Oct 2002 01:42:59 -0600 Of course, my tests had pathname and src reversed, so remotename appeared to be a noop. In fact, it's needed, and the bug is remotename not just returning pathname if it contains no '/' characters. Index: defs.h =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/defs.h,v retrieving revision 1.6 diff -u -r1.6 defs.h --- defs.h 1998/04/20 06:20:19 1.6 +++ defs.h 2002/10/06 07:40:52 @@ -137,7 +137,7 @@ struct linkbuf { ino_t inum; dev_t devnum; - int count; + u_int count; char pathname[BUFSIZ]; char src[BUFSIZ]; char target[BUFSIZ]; Index: docmd.c =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/docmd.c,v retrieving revision 1.12 diff -u -r1.12 docmd.c --- docmd.c 1999/08/28 01:05:06 1.12 +++ docmd.c 2002/10/06 07:40:52 @@ -194,8 +194,8 @@ nextihead = ihead->nextp; if ((opts & IGNLNKS) || ihead->count == 0) continue; - log(lfp, "%s: Warning: missing links\n", - ihead->pathname); + log(lfp, "%s: Warning: missing links (%u)\n", + ihead->pathname, ihead->count); free(ihead); } } Index: server.c =================================================================== RCS file: /home/ncvs/src/usr.bin/rdist/Attic/server.c,v retrieving revision 1.10 diff -u -r1.10 server.c --- server.c 1999/08/28 01:05:09 1.10 +++ server.c 2002/10/06 07:40:53 @@ -315,6 +315,8 @@ int len; cp = pathname; + if (strchr(cp, '/') == NULL) + return cp; len = strlen(src); if (0 == strncmp(pathname, src, len)) cp += len; @@ -389,14 +391,16 @@ log(lfp, "%s: no password entry for uid %d \n", target, stb.st_uid); pw = NULL; - (void)snprintf(user, sizeof(user), ":%lu", stb.st_uid); + (void)snprintf(user, sizeof(user), ":%lu", + (unsigned long)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); + target, (unsigned long)stb.st_gid); gr = NULL; - (void)snprintf(group, sizeof(group), ":%lu", stb.st_gid); + (void)snprintf(group, sizeof(group), ":%lu", + (unsigned long)stb.st_gid); } if (u == 1) { if (opts & VERIFY) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message