summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgene <gene@openbsd.org>1998-01-23 01:15:37 +0000
committergene <gene@openbsd.org>1998-01-23 01:15:37 +0000
commit8d2f37c90835d985ef5a4d7161c512753a66dc3d (patch)
treecf07102ade0d2a01a70d322550070d6900a43678
parentindent better; mph@pobox.com (diff)
downloadwireguard-openbsd-8d2f37c90835d985ef5a4d7161c512753a66dc3d.tar.xz
wireguard-openbsd-8d2f37c90835d985ef5a4d7161c512753a66dc3d.zip
Inspired by hubertf@netbsd:
Quote filenames passed to different extract commands preventing certain security risks.
-rw-r--r--usr.sbin/pkg_install/add/extract.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c
index ff1cc588ff5..000b743ec9d 100644
--- a/usr.sbin/pkg_install/add/extract.c
+++ b/usr.sbin/pkg_install/add/extract.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: extract.c,v 1.3 1998/01/14 13:20:50 niklas Exp $ */
+/* $OpenBSD: extract.c,v 1.4 1998/01/23 01:15:37 gene Exp $ */
#ifndef lint
-static const char *rcsid = "$OpenBSD: extract.c,v 1.3 1998/01/14 13:20:50 niklas Exp $";
+static const char *rcsid = "$OpenBSD: extract.c,v 1.4 1998/01/23 01:15:37 gene Exp $";
#endif
/*
@@ -103,7 +103,7 @@ extract_plist(char *home, Package *pkg)
and run in bulk. */
add_count = snprintf(&perm_args[perm_count],
maxargs - perm_count,
- "%s ", p->name);
+ "'%s' ", p->name);
if (add_count > maxargs - perm_count)
barf("oops, miscounted strings!");
perm_count += add_count;
@@ -126,7 +126,7 @@ extract_plist(char *home, Package *pkg)
where_count += add_count;
add_count = snprintf(&perm_args[perm_count],
maxargs - perm_count,
- "%s ", p->name);
+ "'%s' ", p->name);
if (add_count > maxargs - perm_count)
barf("oops, miscounted strings!");
perm_count += add_count;