From owner-p4-projects Tue Dec 24 15:33:42 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 55CB137B405; Tue, 24 Dec 2002 15:33:40 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E274237B401 for ; Tue, 24 Dec 2002 15:33:39 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9235143EB2 for ; Tue, 24 Dec 2002 15:33:39 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBONXdfh029629 for ; Tue, 24 Dec 2002 15:33:39 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBONXdwa029626 for perforce@freebsd.org; Tue, 24 Dec 2002 15:33:39 -0800 (PST) Date: Tue, 24 Dec 2002 15:33:39 -0800 (PST) Message-Id: <200212242333.gBONXdwa029626@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 22725 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=22725 Change 22725 by rwatson@rwatson_paprika on 2002/12/24 15:33:31 Adapt gzip to maintain ACLs before/after gzip and gunzip. Patches submitted by Chris Faulhaber. Affected files ... .. //depot/projects/trustedbsd/acl/gnu/usr.bin/gzip/Makefile#2 edit .. //depot/projects/trustedbsd/acl/gnu/usr.bin/gzip/gzip.c#2 edit Differences ... ==== //depot/projects/trustedbsd/acl/gnu/usr.bin/gzip/Makefile#2 (text+ko) ==== @@ -4,7 +4,7 @@ PROG= gzip SRCS= gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c \ crypt.c lzw.c unlzw.c unlzh.c unpack.c getopt.c -CFLAGS+=-DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1 +CFLAGS+=-DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1 -DWITH_ACL_SUPPORT .if ${MACHINE_ARCH} == "i386" SRCS+= match.S CFLAGS+=-DASMV ==== //depot/projects/trustedbsd/acl/gnu/usr.bin/gzip/gzip.c#2 (text+ko) ==== @@ -50,6 +50,9 @@ #include #include +#ifdef WITH_ACL_SUPPORT +#include +#endif #include #include #include @@ -1626,6 +1629,9 @@ local void copy_stat(ifstat) struct stat *ifstat; { +#ifdef WITH_ACL_SUPPORT + acl_t acl; +#endif #ifndef NO_UTIME if (decompress && time_stamp != 0 && ifstat->st_mtime != time_stamp) { ifstat->st_mtime = time_stamp; @@ -1643,6 +1649,16 @@ #ifndef NO_CHOWN chown(ofname, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */ #endif +#ifdef WITH_ACL_SUPPORT + /* Copy the ACL */ + acl = acl_get_file(ifname, ACL_TYPE_ACCESS); + if (acl != NULL) { + if (acl_set_file(ofname, ACL_TYPE_ACCESS, acl) == -1 && + errno != EOPNOTSUPP && !quiet) + warn("failed to set the ACL on %s", ofname); + acl_free(acl); + } +#endif remove_ofname = 0; /* It's now safe to remove the input file: */ if (unlink(ifname)) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message