From owner-freebsd-current@FreeBSD.ORG Fri Sep 17 04:09:51 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72D6016A4CF; Fri, 17 Sep 2004 04:09:51 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2345643D53; Fri, 17 Sep 2004 04:09:51 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i8H49oaE078574; Thu, 16 Sep 2004 23:09:50 -0500 (CDT) (envelope-from dan) Date: Thu, 16 Sep 2004 23:09:50 -0500 From: Dan Nelson To: freebsd-current@freebsd.org Message-ID: <20040917040950.GA52634@dan.emsphone.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline X-OS: FreeBSD 5.3-BETA3 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: kientzle@freebsd.org Subject: bsdtar errors storing uid/gids > 16777214 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2004 04:09:51 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline It looks like bsdtar will create extended header entries for attributes that would overflow the regular file header, but for the gid and uid cases, it doesn't zero out the regular fields, and __archive_write_format_header_ustar() ends up failing. This bit me when portupgrading kdebase, which installs kdesud with a group name of "nogroup", which is -2 (aka 4294967294) on my system. Also, there's a formatting error in tar/read.c that ends up misaligning the date column. %Y is 4 chars wide, but %R is 5, so the format string with %R in it needs to lose a space. -- Dan Nelson dnelson@allantgroup.com --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p1 Index: archive_write_set_format_pax.c =================================================================== RCS file: /home/ncvs/src/lib/libarchive/archive_write_set_format_pax.c,v retrieving revision 1.17 diff -u -p -r1.17 archive_write_set_format_pax.c --- archive_write_set_format_pax.c 8 Aug 2004 02:22:48 -0000 1.17 +++ archive_write_set_format_pax.c 17 Sep 2004 04:03:19 -0000 @@ -416,6 +416,7 @@ archive_write_pax_header(struct archive /* If numeric GID is too large, add 'gid' to pax extended attrs. */ if (st_main->st_gid >= (1 << 20)) { add_pax_attr_int(&(pax->pax_header), "gid", st_main->st_gid); + archive_entry_set_gid(entry_main, 0); need_extension = 1; } @@ -431,6 +432,7 @@ archive_write_pax_header(struct archive /* If numeric UID is too large, add 'uid' to pax extended attrs. */ if (st_main->st_uid >= (1 << 20)) { add_pax_attr_int(&(pax->pax_header), "uid", st_main->st_uid); + archive_entry_set_uid(entry_main, 0); need_extension = 1; } --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p2 Index: read.c =================================================================== RCS file: /home/ncvs/src/usr.bin/tar/read.c,v retrieving revision 1.19.2.1 diff -u -p -r1.19.2.1 read.c --- read.c 2 Sep 2004 04:09:46 -0000 1.19.2.1 +++ read.c 16 Sep 2004 15:13:53 -0000 @@ -282,7 +282,7 @@ list_item_verbose(struct bsdtar *bsdtar, if (abs(tim - now) > (365/2)*86400) fmt = bsdtar->day_first ? "%e %b %Y" : "%b %e %Y"; else - fmt = bsdtar->day_first ? "%e %b %R" : "%b %e %R"; + fmt = bsdtar->day_first ? "%e %b %R" : "%b %e %R"; strftime(tmp, sizeof(tmp), fmt, localtime(&tim)); fprintf(out, " %s ", tmp); safe_fprintf(out, "%s", archive_entry_pathname(entry)); --cNdxnHkX5QqsyA0e--