diff options
| author | 2015-11-26 19:03:10 +0000 | |
|---|---|---|
| committer | 2015-11-26 19:03:10 +0000 | |
| commit | 123b50946e11a616fd7d09540b18b58cc56f9d3b (patch) | |
| tree | d38dd6efdc000a149a47f1d3721c701b892f6b26 | |
| parent | Delete YP password related code. As a result, these can also be (diff) | |
| download | wireguard-openbsd-123b50946e11a616fd7d09540b18b58cc56f9d3b.tar.xz wireguard-openbsd-123b50946e11a616fd7d09540b18b58cc56f9d3b.zip | |
Apply pledge.
The people I asked to review this did not get back to me, so
we will test this a different way.
| -rw-r--r-- | usr.sbin/installboot/i386_installboot.c | 8 | ||||
| -rw-r--r-- | usr.sbin/installboot/installboot.c | 5 | ||||
| -rw-r--r-- | usr.sbin/installboot/landisk_installboot.c | 5 | ||||
| -rw-r--r-- | usr.sbin/installboot/sparc64_installboot.c | 5 | ||||
| -rw-r--r-- | usr.sbin/installboot/vax_installboot.c | 5 |
5 files changed, 13 insertions, 15 deletions
diff --git a/usr.sbin/installboot/i386_installboot.c b/usr.sbin/installboot/i386_installboot.c index 6bbf514b59d..b18def5828c 100644 --- a/usr.sbin/installboot/i386_installboot.c +++ b/usr.sbin/installboot/i386_installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i386_installboot.c,v 1.16 2015/11/03 11:38:41 jsg Exp $ */ +/* $OpenBSD: i386_installboot.c,v 1.17 2015/11/26 19:03:10 deraadt Exp $ */ /* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */ /* @@ -180,8 +180,7 @@ write_bootblocks(int devfd, char *dev, struct disklabel *dl) pbr_set_symbols(stage1, blkstore, pbr_symbols); if (!nowrite) { - /* Sync filesystems (to clean in-memory superblock?). */ - sync(); sleep(1); + fsync(devfd); sleep(1); } /* @@ -638,8 +637,7 @@ getbootparams(char *boot, int devfd, struct disklabel *dl) * to be able to load it later. */ - /* Make sure the (probably new) boot file is on disk. */ - sync(); sleep(1); + fsync(devfd); sleep(1); if ((fd = open(boot, O_RDONLY)) < 0) err(1, "open: %s", boot); diff --git a/usr.sbin/installboot/installboot.c b/usr.sbin/installboot/installboot.c index 50d027355c1..33e33a7be8e 100644 --- a/usr.sbin/installboot/installboot.c +++ b/usr.sbin/installboot/installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: installboot.c,v 1.9 2015/10/14 00:19:04 krw Exp $ */ +/* $OpenBSD: installboot.c,v 1.10 2015/11/26 19:03:10 deraadt Exp $ */ /* * Copyright (c) 2012, 2013 Joel Sing <jsing@openbsd.org> @@ -51,6 +51,9 @@ main(int argc, char **argv) char *dev, *realdev; int devfd, opt; + if (pledge("stdio rpath wpath cpath fattr disklabel", NULL) == -1) + err(1, "pledge"); + md_init(); while ((opt = getopt(argc, argv, "nr:v")) != -1) { diff --git a/usr.sbin/installboot/landisk_installboot.c b/usr.sbin/installboot/landisk_installboot.c index a8de186a41f..30df58a107a 100644 --- a/usr.sbin/installboot/landisk_installboot.c +++ b/usr.sbin/installboot/landisk_installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: landisk_installboot.c,v 1.5 2015/10/15 19:27:30 miod Exp $ */ +/* $OpenBSD: landisk_installboot.c,v 1.6 2015/11/26 19:03:10 deraadt Exp $ */ /* * Copyright (c) 2013 Joel Sing <jsing@openbsd.org> @@ -40,8 +40,7 @@ md_loadboot(void) void md_installboot(int devfd, char *dev) { - /* XXX - is this necessary? */ - sync(); + fsync(devfd); bootldr = fileprefix(root, bootldr); if (bootldr == NULL) diff --git a/usr.sbin/installboot/sparc64_installboot.c b/usr.sbin/installboot/sparc64_installboot.c index f68eec070f7..85f37e1f370 100644 --- a/usr.sbin/installboot/sparc64_installboot.c +++ b/usr.sbin/installboot/sparc64_installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sparc64_installboot.c,v 1.4 2015/10/08 14:50:38 krw Exp $ */ +/* $OpenBSD: sparc64_installboot.c,v 1.5 2015/11/26 19:03:10 deraadt Exp $ */ /* * Copyright (c) 2012, 2013 Joel Sing <jsing@openbsd.org> @@ -92,8 +92,7 @@ md_loadboot(void) void md_installboot(int devfd, char *dev) { - /* XXX - is this necessary? */ - sync(); + fsync(devfd); bootldr = fileprefix(root, bootldr); if (bootldr == NULL) diff --git a/usr.sbin/installboot/vax_installboot.c b/usr.sbin/installboot/vax_installboot.c index e002a970660..2914d230dc4 100644 --- a/usr.sbin/installboot/vax_installboot.c +++ b/usr.sbin/installboot/vax_installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vax_installboot.c,v 1.2 2015/10/15 19:27:30 miod Exp $ */ +/* $OpenBSD: vax_installboot.c,v 1.3 2015/11/26 19:03:10 deraadt Exp $ */ /* * Copyright (c) 2013 Joel Sing <jsing@openbsd.org> @@ -40,8 +40,7 @@ md_loadboot(void) void md_installboot(int devfd, char *dev) { - /* XXX - is this necessary? */ - sync(); + fsync(devfd); bootldr = fileprefix(root, bootldr); if (bootldr == NULL) |
