aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorkrion <krion@FreeBSD.org>2004-03-26 16:43:20 +0800
committerkrion <krion@FreeBSD.org>2004-03-26 16:43:20 +0800
commit07673746b443a9359d005eb235a5c5526670df0f (patch)
tree36338bc6a0b2661fbcfa3c04b6807e847bde953a /sysutils
parent906e8728edba360643691d1761516c9cc435f002 (diff)
downloadfreebsd-ports-gnome-07673746b443a9359d005eb235a5c5526670df0f.tar.gz
freebsd-ports-gnome-07673746b443a9359d005eb235a5c5526670df0f.tar.zst
freebsd-ports-gnome-07673746b443a9359d005eb235a5c5526670df0f.zip
- Update fsck_ext2fs wrapper to make it safe in sudo - the old
would copy unlimited arguments over - Replace MACHINE_ARCH by ARCH - Bump portrevision PR: ports/64736 Submitted by: maintainer
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/e2fsprogs/Makefile8
-rw-r--r--sysutils/e2fsprogs/files/fsck_ext2fs.c15
2 files changed, 18 insertions, 5 deletions
diff --git a/sysutils/e2fsprogs/Makefile b/sysutils/e2fsprogs/Makefile
index e8328ca9d9af..b49fd75f1808 100644
--- a/sysutils/e2fsprogs/Makefile
+++ b/sysutils/e2fsprogs/Makefile
@@ -7,7 +7,7 @@
PORTNAME= e2fsprogs
PORTVERSION= 1.35
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -65,6 +65,8 @@ post-extract:
${CHMOD} u+w ${WRKSRC}/po/*.po ${WRKSRC}/po/*.pot \
${WRKSRC}/${CONFIGURE_SCRIPT}
+.include <bsd.port.pre.mk>
+
post-patch:
${REINPLACE_CMD} -e 's|-DRESOURCE_TRACK||' ${WRKSRC}/e2fsck/Makefile.in
${GUNZIP_CMD} ${WRKSRC}/tests/m_*/expect*.gz
@@ -73,7 +75,7 @@ post-patch:
-e 's|group root|group wheel|' \
-e '/Exit status is 0/ N;s/Exit status is 0\n/Exit status is 0/' \
${WRKSRC}/tests/m_*/expect.1
-.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "sparc64"
+.if ${ARCH} == "alpha" || ${ARCH} == "sparc64"
${RM} -rf ${WRKSRC}/tests/m_large_file
.endif
@@ -93,4 +95,4 @@ post-install:
@${CAT} ${PKGMESSAGE}
@${ECHO_MSG}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/sysutils/e2fsprogs/files/fsck_ext2fs.c b/sysutils/e2fsprogs/files/fsck_ext2fs.c
index a84cc51dd897..9856530c7453 100644
--- a/sysutils/e2fsprogs/files/fsck_ext2fs.c
+++ b/sysutils/e2fsprogs/files/fsck_ext2fs.c
@@ -6,7 +6,7 @@
*
* $FreeBSD$
*
- * Upstream: $Id: fsck_ext2fs.c,v 1.3 2004/03/09 01:10:22 emma Exp $
+ * Upstream: $Id: fsck_ext2fs.c,v 1.4 2004/03/20 15:51:01 emma Exp $
*
* format: gindent -kr
*/
@@ -19,6 +19,7 @@
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <errno.h>
__attribute__ ((noreturn))
static int die(const char *tag)
@@ -94,11 +95,21 @@ int main(int argc, char **argv)
cmd[i++] = b;
}
+ /* silently limit verbose to 15 so we don't overflow the cmd array */
+ if (verbose > 15)
+ verbose = 15;
+
for (t = verbose; t > 1; t--)
cmd[i++] = "-v";
- while (optind < argc)
+ while (optind < argc) {
cmd[i++] = argv[optind++];
+ /* sanity check so we don't overflow the cmd buffer */
+ if (i+1 == sizeof(cmd)/sizeof(cmd[0])) {
+ errno = E2BIG;
+ die(argv[0]);
+ }
+ }
cmd[i++] = 0;