diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-06-01 07:03:19 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-06-01 07:03:19 +0000 |
commit | cde016a0744553a8e4215002f5f5476ed0f5b2b7 (patch) | |
tree | 1dc87cec74548f61b78028b2398c748c3776547f /bin/df/df.c | |
parent | afff72ecd8c6a9de9c6e574b757c77815c65af5a (diff) |
From denny@c200234-a.frmt1.sfba.home.com, check superblock magic number.
I'm unsure if this code should even remain in df.
Diffstat (limited to 'bin/df/df.c')
-rw-r--r-- | bin/df/df.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/df/df.c b/bin/df/df.c index 9d10c2e28cf..da951b82862 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -1,4 +1,4 @@ -/* $OpenBSD: df.c,v 1.14 1997/04/14 20:25:37 kstailey Exp $ */ +/* $OpenBSD: df.c,v 1.15 1997/06/01 07:03:18 downsj Exp $ */ /* $NetBSD: df.c,v 1.21.2.1 1995/11/01 00:06:11 jtc Exp $ */ /* @@ -49,7 +49,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: df.c,v 1.14 1997/04/14 20:25:37 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: df.c,v 1.15 1997/06/01 07:03:18 downsj Exp $"; #endif #endif /* not lint */ @@ -454,6 +454,10 @@ ufs_df(file, sfsp) (void)close(rfd); return (-1); } + if (sblock.fs_magic != FS_MAGIC) { + (void)close(rfd); + return (-1); + } sfsp->f_type = 0; sfsp->f_flags = 0; sfsp->f_bsize = sblock.fs_fsize; |