corrects pledge code for fsck_ffs and fsck_ext2fs
authorsemarie <semarie@openbsd.org>
Thu, 15 Oct 2015 15:11:10 +0000 (15:11 +0000)
committersemarie <semarie@openbsd.org>
Thu, 15 Oct 2015 15:11:10 +0000 (15:11 +0000)
on filesystem error, fsck will try to display username of inode, resulting need
of "getpw" for not SMALL version.

add a missed (?) -DSMALL in distrib/special/ for fsck_ffs and fsck_ext2fs

found by hard way by ajacoutot@

OK millert@

distrib/special/fsck_ext2fs/Makefile
distrib/special/fsck_ffs/Makefile
sbin/fsck_ext2fs/setup.c
sbin/fsck_ffs/setup.c

index 1720ac6..62384f1 100644 (file)
@@ -1,10 +1,10 @@
-#      $OpenBSD: Makefile,v 1.1 2014/12/23 17:16:02 deraadt Exp $
+#      $OpenBSD: Makefile,v 1.2 2015/10/15 15:11:10 semarie Exp $
 
 PROG=  fsck_ext2fs
 MAN=    fsck_ext2fs.8
 SRCS=  dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
        pass5.c fsutil.c setup.c utilities.c ext2fs_bswap.c
-CFLAGS+= -I${.CURDIR}/../../../sbin/fsck
+CFLAGS+= -I${.CURDIR}/../../../sbin/fsck -DSMALL
 
 .PATH: ${.CURDIR}/../../../sbin/fsck_ext2fs
 .PATH: ${.CURDIR}/../../../sbin/fsck
index 6fb49e0..588e03a 100644 (file)
@@ -1,10 +1,10 @@
-#      $OpenBSD: Makefile,v 1.1 2014/12/23 17:16:02 deraadt Exp $
+#      $OpenBSD: Makefile,v 1.2 2015/10/15 15:11:10 semarie Exp $
 
 PROG=  fsck_ffs
 MAN=   fsck_ffs.8
 SRCS=  dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
        pass5.c fsutil.c setup.c utilities.c ffs_subr.c ffs_tables.c
-CFLAGS+= -I${.CURDIR}/../../../sbin/fsck
+CFLAGS+= -I${.CURDIR}/../../../sbin/fsck -DSMALL
 DPADD+=        ${LIBUTIL}
 LDADD+=        -lutil
 
index b709fc0..69800d6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: setup.c,v 1.28 2015/10/14 16:58:55 deraadt Exp $      */
+/*     $OpenBSD: setup.c,v 1.29 2015/10/15 15:11:10 semarie Exp $      */
 /*     $NetBSD: setup.c,v 1.1 1997/06/11 11:22:01 bouyer Exp $ */
 
 /*
@@ -113,8 +113,13 @@ setup(char *dev)
                secsize = DEV_BSIZE;
 
        if (!hotroot()) {
+#ifndef SMALL
+               if (pledge("stdio getpw", NULL) == -1)
+                       err(1, "pledge");
+#else
                if (pledge("stdio", NULL) == -1)
                        err(1, "pledge");
+#endif
        }
 
        /*
index 9c0e40c..1a81f60 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: setup.c,v 1.58 2015/10/14 16:58:55 deraadt Exp $      */
+/*     $OpenBSD: setup.c,v 1.59 2015/10/15 15:11:10 semarie Exp $      */
 /*     $NetBSD: setup.c,v 1.27 1996/09/27 22:45:19 christos Exp $      */
 
 /*
@@ -141,8 +141,13 @@ setup(char *dev)
                secsize = DEV_BSIZE;
 
        if (!hotroot()) {
+#ifndef SMALL
+               if (pledge("stdio getpw", NULL) == -1)
+                       err(1, "pledge");
+#else
                if (pledge("stdio", NULL) == -1)
                        err(1, "pledge");
+#endif
        }
 
        /*