Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin No ACL support for install media (SMALLPROG)



details:   https://anonhg.NetBSD.org/src/rev/fb79df7a77ff
branches:  trunk
changeset: 932931:fb79df7a77ff
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 17 23:34:11 2020 +0000

description:
No ACL support for install media (SMALLPROG)

diffstat:

 bin/cp/Makefile |   6 +++++-
 bin/cp/cp.c     |   6 ++++--
 bin/cp/utils.c  |  10 ++++++++--
 bin/ls/Makefile |   6 +++++-
 bin/ls/print.c  |  12 ++++++++++--
 5 files changed, 32 insertions(+), 8 deletions(-)

diffs (178 lines):

diff -r a0f32f57e022 -r fb79df7a77ff bin/cp/Makefile
--- a/bin/cp/Makefile   Sun May 17 21:50:47 2020 +0000
+++ b/bin/cp/Makefile   Sun May 17 23:34:11 2020 +0000
@@ -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>
diff -r a0f32f57e022 -r fb79df7a77ff bin/cp/cp.c
--- a/bin/cp/cp.c       Sun May 17 21:50:47 2020 +0000
+++ b/bin/cp/cp.c       Sun May 17 23:34:11 2020 +0000
@@ -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 @@
 #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 @@
                                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, 
diff -r a0f32f57e022 -r fb79df7a77ff bin/cp/utils.c
--- a/bin/cp/utils.c    Sun May 17 21:50:47 2020 +0000
+++ b/bin/cp/utils.c    Sun May 17 23:34:11 2020 +0000
@@ -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 @@
 #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 @@
        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 @@
        return (rval);
 }
 
+#ifndef SMALL
 int
 preserve_fd_acls(int source_fd, int dest_fd)
 {
@@ -546,6 +551,7 @@
        acl_free(acl);
        return (0);
 }
+#endif
 
 void
 usage(void)
diff -r a0f32f57e022 -r fb79df7a77ff bin/ls/Makefile
--- a/bin/ls/Makefile   Sun May 17 21:50:47 2020 +0000
+++ b/bin/ls/Makefile   Sun May 17 23:34:11 2020 +0000
@@ -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 @@
 LDADD+=        -lutil
 DPADD+=        ${LIBUTIL}
 
+.ifdef SMALLPROG
+CPPFLAGS+= -DSMALL
+.endif
+
 .include <bsd.prog.mk>
diff -r a0f32f57e022 -r fb79df7a77ff bin/ls/print.c
--- a/bin/ls/print.c    Sun May 17 21:50:47 2020 +0000
+++ b/bin/ls/print.c    Sun May 17 23:34:11 2020 +0000
@@ -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    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 @@
                        }
                }
                (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 @@
                (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 @@
                buf[10] = '+';
        acl_free(facl);
 }
+#endif



Home | Main Index | Thread Index | Old Index