Module Name: src Committed By: christos Date: Sun May 17 23:34:11 UTC 2020
Modified Files: src/bin/cp: Makefile cp.c utils.c src/bin/ls: Makefile print.c Log Message: No ACL support for install media (SMALLPROG) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/bin/cp/Makefile cvs rdiff -u -r1.60 -r1.61 src/bin/cp/cp.c cvs rdiff -u -r1.48 -r1.49 src/bin/cp/utils.c cvs rdiff -u -r1.14 -r1.15 src/bin/ls/Makefile cvs rdiff -u -r1.56 -r1.57 src/bin/ls/print.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/cp/Makefile diff -u src/bin/cp/Makefile:1.9 src/bin/cp/Makefile:1.10 --- src/bin/cp/Makefile:1.9 Sun Jul 20 18:36:37 1997 +++ src/bin/cp/Makefile Sun May 17 19:34:11 2020 @@ -1,7 +1,11 @@ -# $NetBSD: Makefile,v 1.9 1997/07/20 22:36:37 christos Exp $ +# $NetBSD: Makefile,v 1.10 2020/05/17 23:34:11 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 PROG= cp SRCS= cp.c utils.c +.ifdef SMALLPROG +CPPFLAGS+=-DSMALL +.endif + .include <bsd.prog.mk> Index: src/bin/cp/cp.c diff -u src/bin/cp/cp.c:1.60 src/bin/cp/cp.c:1.61 --- src/bin/cp/cp.c:1.60 Sat May 16 14:31:45 2020 +++ src/bin/cp/cp.c Sun May 17 19:34:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cp.c,v 1.60 2020/05/16 18:31:45 christos Exp $ */ +/* $NetBSD: cp.c,v 1.61 2020/05/17 23:34:11 christos Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -43,7 +43,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95"; #else -__RCSID("$NetBSD: cp.c,v 1.60 2020/05/16 18:31:45 christos Exp $"); +__RCSID("$NetBSD: cp.c,v 1.61 2020/05/17 23:34:11 christos Exp $"); #endif #endif /* not lint */ @@ -511,9 +511,11 @@ copy(char *argv[], enum op type, int fts if (pflag) { if (setfile(curr->fts_statp, 0)) this_failed = any_failed = 1; +#ifndef SMALL if (preserve_dir_acls(curr->fts_statp, curr->fts_accpath, to.p_path) != 0) this_failed = any_failed = 1; +#endif } if (this_failed && (dne = popdne())) (void)chmod(to.p_path, Index: src/bin/cp/utils.c diff -u src/bin/cp/utils.c:1.48 src/bin/cp/utils.c:1.49 --- src/bin/cp/utils.c:1.48 Sat May 16 14:31:45 2020 +++ src/bin/cp/utils.c Sun May 17 19:34:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: utils.c,v 1.48 2020/05/16 18:31:45 christos Exp $ */ +/* $NetBSD: utils.c,v 1.49 2020/05/17 23:34:11 christos Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; #else -__RCSID("$NetBSD: utils.c,v 1.48 2020/05/16 18:31:45 christos Exp $"); +__RCSID("$NetBSD: utils.c,v 1.49 2020/05/17 23:34:11 christos Exp $"); #endif #endif /* not lint */ @@ -43,7 +43,9 @@ __RCSID("$NetBSD: utils.c,v 1.48 2020/05 #include <sys/param.h> #include <sys/stat.h> #include <sys/time.h> +#ifndef SMALL #include <sys/acl.h> +#endif #include <sys/extattr.h> #include <err.h> @@ -256,8 +258,10 @@ copy_file(FTSENT *entp, int dne) if (pflag && (fcpxattr(from_fd, to_fd) != 0)) warn("%s: error copying extended attributes", to.p_path); +#ifndef SMALL if (pflag && preserve_fd_acls(from_fd, to_fd) != 0) rval = 1; +#endif (void)close(from_fd); @@ -408,6 +412,7 @@ setfile(struct stat *fs, int fd) return (rval); } +#ifndef SMALL int preserve_fd_acls(int source_fd, int dest_fd) { @@ -546,6 +551,7 @@ preserve_dir_acls(struct stat *fs, char acl_free(acl); return (0); } +#endif void usage(void) Index: src/bin/ls/Makefile diff -u src/bin/ls/Makefile:1.14 src/bin/ls/Makefile:1.15 --- src/bin/ls/Makefile:1.14 Thu Dec 14 15:09:36 2006 +++ src/bin/ls/Makefile Sun May 17 19:34:11 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2006/12/14 20:09:36 he Exp $ +# $NetBSD: Makefile,v 1.15 2020/05/17 23:34:11 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/2/93 PROG= ls @@ -7,4 +7,8 @@ SRCS= cmp.c ls.c main.c print.c util.c LDADD+= -lutil DPADD+= ${LIBUTIL} +.ifdef SMALLPROG +CPPFLAGS+= -DSMALL +.endif + .include <bsd.prog.mk> Index: src/bin/ls/print.c diff -u src/bin/ls/print.c:1.56 src/bin/ls/print.c:1.57 --- src/bin/ls/print.c:1.56 Sat May 16 14:31:45 2020 +++ src/bin/ls/print.c Sun May 17 19:34:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.56 2020/05/16 18:31:45 christos Exp $ */ +/* $NetBSD: print.c,v 1.57 2020/05/17 23:34:11 christos Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -37,13 +37,15 @@ #if 0 static char sccsid[] = "@(#)print.c 8.5 (Berkeley) 7/28/94"; #else -__RCSID("$NetBSD: print.c,v 1.56 2020/05/16 18:31:45 christos Exp $"); +__RCSID("$NetBSD: print.c,v 1.57 2020/05/17 23:34:11 christos Exp $"); #endif #endif /* not lint */ #include <sys/param.h> #include <sys/stat.h> +#ifndef SMALL #include <sys/acl.h> +#endif #include <err.h> #include <errno.h> @@ -69,7 +71,9 @@ static void printlink(FTSENT *); static void printtime(time_t); static void printtotal(DISPLAY *dp); static int printtype(u_int); +#ifndef SMALL static void aclmode(char *, const FTSENT *); +#endif static time_t now; @@ -156,7 +160,9 @@ printlong(DISPLAY *dp) } } (void)strmode(sp->st_mode, buf); +#ifndef SMALL aclmode(buf, p); +#endif np = p->fts_pointer; (void)printf("%s %*lu ", buf, dp->s_nlink, (unsigned long)sp->st_nlink); @@ -499,6 +505,7 @@ printlink(FTSENT *p) (void)printf("%s", path); } +#ifndef SMALL /* * Add a + after the standard rwxrwxrwx mode if the file has an * ACL. strmode() reserves space at the end of the string. @@ -569,3 +576,4 @@ aclmode(char *buf, const FTSENT *p) buf[10] = '+'; acl_free(facl); } +#endif