Skip to content

Commit e780137

Browse files
author
dsl
committed
Add additional 'sizeof args' parameter to mount(2).
1 parent 8d4544a commit e780137

File tree

27 files changed

+80
-80
lines changed

27 files changed

+80
-80
lines changed

sbin/fsck_ext2fs/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: main.c,v 1.24 2007/02/08 21:36:58 drochner Exp $ */
1+
/* $NetBSD: main.c,v 1.25 2007/07/14 15:57:24 dsl Exp $ */
22

33
/*
44
* Copyright (c) 1980, 1986, 1993
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n\
6868
#if 0
6969
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94";
7070
#else
71-
__RCSID("$NetBSD: main.c,v 1.24 2007/02/08 21:36:58 drochner Exp $");
71+
__RCSID("$NetBSD: main.c,v 1.25 2007/07/14 15:57:24 dsl Exp $");
7272
#endif
7373
#endif /* not lint */
7474

@@ -329,7 +329,7 @@ checkfilesys(const char *filesys, char *mntpt, long auxdata, int child)
329329
if (flags & MNT_RDONLY) {
330330
args.fspec = 0;
331331
flags |= MNT_UPDATE | MNT_RELOAD;
332-
ret = mount(MOUNT_EXT2FS, "/", flags, &args);
332+
ret = mount(MOUNT_EXT2FS, "/", flags, &args, sizeof args);
333333
if (ret == 0)
334334
return(0);
335335
}

sbin/fsck_ffs/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: main.c,v 1.64 2007/02/08 21:36:58 drochner Exp $ */
1+
/* $NetBSD: main.c,v 1.65 2007/07/14 15:57:24 dsl Exp $ */
22

33
/*
44
* Copyright (c) 1980, 1986, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n\
3939
#if 0
4040
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
4141
#else
42-
__RCSID("$NetBSD: main.c,v 1.64 2007/02/08 21:36:58 drochner Exp $");
42+
__RCSID("$NetBSD: main.c,v 1.65 2007/07/14 15:57:24 dsl Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -437,7 +437,7 @@ checkfilesys(const char *filesys, char *mntpt, long auxdata, int child)
437437
if (flags & MNT_RDONLY) {
438438
args.fspec = 0;
439439
flags |= MNT_UPDATE | MNT_RELOAD;
440-
ret = mount(MOUNT_FFS, "/", flags, &args);
440+
ret = mount(MOUNT_FFS, "/", flags, &args, sizeof args);
441441
if (ret == 0)
442442
return(0);
443443
}

sbin/fsck_lfs/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: main.c,v 1.34 2007/02/08 21:36:58 drochner Exp $ */
1+
/* $NetBSD: main.c,v 1.35 2007/07/14 15:57:24 dsl Exp $ */
22

33
/*
44
* Copyright (c) 1980, 1986, 1993
@@ -307,7 +307,7 @@ checkfilesys(const char *filesys, char *mntpt, long auxdata, int child)
307307
if (flags & MNT_RDONLY) {
308308
args.fspec = 0;
309309
flags |= MNT_UPDATE | MNT_RELOAD;
310-
ret = mount(MOUNT_LFS, "/", flags, &args);
310+
ret = mount(MOUNT_LFS, "/", flags, &args, sizeof args);
311311
if (ret == 0)
312312
return (0);
313313
}

sbin/mount_ados/mount_ados.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mount_ados.c,v 1.25 2007/03/10 00:30:36 hubertf Exp $ */
1+
/* $NetBSD: mount_ados.c,v 1.26 2007/07/14 15:57:24 dsl Exp $ */
22

33
/*
44
* Copyright (c) 1994 Christopher G. Demetriou
@@ -36,7 +36,7 @@
3636

3737
#include <sys/cdefs.h>
3838
#ifndef lint
39-
__RCSID("$NetBSD: mount_ados.c,v 1.25 2007/03/10 00:30:36 hubertf Exp $");
39+
__RCSID("$NetBSD: mount_ados.c,v 1.26 2007/07/14 15:57:24 dsl Exp $");
4040
#endif /* not lint */
4141

4242
#include <sys/param.h>
@@ -147,15 +147,15 @@ mount_ados(int argc, char **argv)
147147
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
148148
}
149149

150-
if (mount(MOUNT_ADOSFS, dir, mntflags, &args) >= 0)
150+
if (mount(MOUNT_ADOSFS, dir, mntflags, &args, sizeof args) >= 0)
151151
exit (0);
152152

153153
if (errno != EROFS)
154154
err(1, "%s on %s", dev, dir);
155155

156156
mntflags |= MNT_RDONLY;
157157

158-
if (mount(MOUNT_ADOSFS, dir, mntflags, &args) == -1)
158+
if (mount(MOUNT_ADOSFS, dir, mntflags, &args, sizeof args) == -1)
159159
err(1, "%s on %s", dev, dir);
160160

161161
if (mntflags & MNT_GETARGS)

sbin/mount_cd9660/mount_cd9660.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mount_cd9660.c,v 1.24 2006/10/16 03:37:42 christos Exp $ */
1+
/* $NetBSD: mount_cd9660.c,v 1.25 2007/07/14 15:57:25 dsl Exp $ */
22

33
/*
44
* Copyright (c) 1992, 1993, 1994
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\
4646
#if 0
4747
static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95";
4848
#else
49-
__RCSID("$NetBSD: mount_cd9660.c,v 1.24 2006/10/16 03:37:42 christos Exp $");
49+
__RCSID("$NetBSD: mount_cd9660.c,v 1.25 2007/07/14 15:57:25 dsl Exp $");
5050
#endif
5151
#endif /* not lint */
5252

@@ -163,7 +163,7 @@ mount_cd9660(int argc, char **argv)
163163
args.fspec = dev;
164164
args.flags = opts;
165165

166-
if (mount(MOUNT_CD9660, dir, mntflags, &args) < 0)
166+
if (mount(MOUNT_CD9660, dir, mntflags, &args, sizeof args) < 0)
167167
err(1, "%s on %s", dev, dir);
168168
if (mntflags & MNT_GETARGS) {
169169
char buf[2048];

sbin/mount_efs/mount_efs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mount_efs.c,v 1.1 2007/06/29 23:30:20 rumble Exp $ */
1+
/* $NetBSD: mount_efs.c,v 1.2 2007/07/14 15:57:25 dsl Exp $ */
22

33
/*
44
* Copyright (c) 2006 Stephen M. Rumble <rumble@ephemeral.org>
@@ -90,7 +90,7 @@ mount_efs(int argc, char **argv)
9090

9191
args.fspec = special;
9292
args.version = EFS_MNT_VERSION;
93-
if (mount(MOUNT_EFS, node, mntflags, &args) < 0)
93+
if (mount(MOUNT_EFS, node, mntflags, &args, sizeof args) < 0)
9494
err(EXIT_FAILURE, "%s on %s", special, node);
9595

9696
return (0);

sbin/mount_ext2fs/mount_ext2fs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mount_ext2fs.c,v 1.17 2006/10/16 03:37:42 christos Exp $ */
1+
/* $NetBSD: mount_ext2fs.c,v 1.18 2007/07/14 15:57:25 dsl Exp $ */
22

33
/*-
44
* Copyright (c) 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993, 1994\n\
3939
#if 0
4040
static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95";
4141
#else
42-
__RCSID("$NetBSD: mount_ext2fs.c,v 1.17 2006/10/16 03:37:42 christos Exp $");
42+
__RCSID("$NetBSD: mount_ext2fs.c,v 1.18 2007/07/14 15:57:25 dsl Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -124,7 +124,7 @@ mount_ext2fs(int argc, char *argv[])
124124
warnx("using \"%s\" instead.", fs_name);
125125
}
126126

127-
if (mount(MOUNT_EXT2FS, fs_name, mntflags, &args) < 0) {
127+
if (mount(MOUNT_EXT2FS, fs_name, mntflags, &args, sizeof args) < 0) {
128128
switch (errno) {
129129
case EMFILE:
130130
errcause = "mount table full";

sbin/mount_fdesc/mount_fdesc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mount_fdesc.c,v 1.19 2006/10/16 03:37:42 christos Exp $ */
1+
/* $NetBSD: mount_fdesc.c,v 1.20 2007/07/14 15:57:25 dsl Exp $ */
22

33
/*
44
* Copyright (c) 1992, 1993, 1994
@@ -77,7 +77,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\n\
7777
#if 0
7878
static char sccsid[] = "@(#)mount_fdesc.c 8.3 (Berkeley) 4/26/95";
7979
#else
80-
__RCSID("$NetBSD: mount_fdesc.c,v 1.19 2006/10/16 03:37:42 christos Exp $");
80+
__RCSID("$NetBSD: mount_fdesc.c,v 1.20 2007/07/14 15:57:25 dsl Exp $");
8181
#endif
8282
#endif /* not lint */
8383

@@ -142,7 +142,7 @@ mount_fdesc(int argc, char *argv[])
142142
warnx("using \"%s\" instead.", canon_dir);
143143
}
144144

145-
if (mount(MOUNT_FDESC, canon_dir, mntflags, NULL))
145+
if (mount(MOUNT_FDESC, canon_dir, mntflags, NULL, 0))
146146
err(1, "fdesc on %s", argv[1]);
147147
exit(0);
148148
}

sbin/mount_ffs/mount_ffs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mount_ffs.c,v 1.20 2006/10/16 03:37:42 christos Exp $ */
1+
/* $NetBSD: mount_ffs.c,v 1.21 2007/07/14 15:57:25 dsl Exp $ */
22

33
/*-
44
* Copyright (c) 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993, 1994\n\
3939
#if 0
4040
static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95";
4141
#else
42-
__RCSID("$NetBSD: mount_ffs.c,v 1.20 2006/10/16 03:37:42 christos Exp $");
42+
__RCSID("$NetBSD: mount_ffs.c,v 1.21 2007/07/14 15:57:25 dsl Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -126,7 +126,7 @@ mount_ffs(int argc, char *argv[])
126126
warnx("using \"%s\" instead.", fs_name);
127127
}
128128

129-
if (mount(MOUNT_FFS, fs_name, mntflags, &args) < 0) {
129+
if (mount(MOUNT_FFS, fs_name, mntflags, &args, sizeof args) < 0) {
130130
switch (errno) {
131131
case EMFILE:
132132
errcause = "mount table full";

sbin/mount_filecore/mount_filecore.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mount_filecore.c,v 1.15 2007/03/10 00:30:36 hubertf Exp $ */
1+
/* $NetBSD: mount_filecore.c,v 1.16 2007/07/14 15:57:25 dsl Exp $ */
22

33
/*
44
* Copyright (c) 1992, 1993, 1994 The Regents of the University of California.
@@ -193,7 +193,7 @@ mount_filecore(int argc, char **argv)
193193
args.fspec = dev;
194194
args.flags = opts;
195195

196-
if (mount(MOUNT_FILECORE, dir, mntflags, &args) < 0)
196+
if (mount(MOUNT_FILECORE, dir, mntflags, &args, sizeof args) < 0)
197197
err(1, "%s on %s", dev, dir);
198198
if (mntflags & MNT_GETARGS) {
199199
char buf[1024];

0 commit comments

Comments
 (0)