Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/makefs zero out the superblock so that it does not ...



details:   https://anonhg.NetBSD.org/src/rev/1dc258689ea5
branches:  trunk
changeset: 821482:1dc258689ea5
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 08 02:20:35 2017 +0000

description:
zero out the superblock so that it does not contain random stuff in the
spare fields.

diffstat:

 usr.sbin/makefs/ffs.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 878c554b1d67 -r 1dc258689ea5 usr.sbin/makefs/ffs.c
--- a/usr.sbin/makefs/ffs.c     Wed Feb 08 01:32:37 2017 +0000
+++ b/usr.sbin/makefs/ffs.c     Wed Feb 08 02:20:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs.c,v 1.66 2015/12/21 00:58:08 christos Exp $        */
+/*     $NetBSD: ffs.c,v 1.67 2017/02/08 02:20:35 christos Exp $        */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.66 2015/12/21 00:58:08 christos Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.67 2017/02/08 02:20:35 christos Exp $");
 #endif /* !__lint */
 
 #include <sys/param.h>
@@ -294,6 +294,7 @@
 
                /* update various superblock parameters */
        superblock = fsopts->superblock;
+       memset(superblock, 0, sizeof(*superblock));
        superblock->fs_fmod = 0;
        superblock->fs_old_cstotal.cs_ndir   = superblock->fs_cstotal.cs_ndir;
        superblock->fs_old_cstotal.cs_nbfree = superblock->fs_cstotal.cs_nbfree;



Home | Main Index | Thread Index | Old Index