| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: mount_msdos.c,v 1.49 2016/02/06 10:35:58 mlelstv Exp $ */ | | 1 | /* $NetBSD: mount_msdos.c,v 1.50 2016/08/21 22:27:20 jdolecek Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1994 Christopher G. Demetriou | | 4 | * Copyright (c) 1994 Christopher G. Demetriou |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -26,27 +26,27 @@ | | | @@ -26,27 +26,27 @@ |
26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | * | | 33 | * |
34 | * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> | | 34 | * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> |
35 | */ | | 35 | */ |
36 | | | 36 | |
37 | #include <sys/cdefs.h> | | 37 | #include <sys/cdefs.h> |
38 | #ifndef lint | | 38 | #ifndef lint |
39 | __RCSID("$NetBSD: mount_msdos.c,v 1.49 2016/02/06 10:35:58 mlelstv Exp $"); | | 39 | __RCSID("$NetBSD: mount_msdos.c,v 1.50 2016/08/21 22:27:20 jdolecek Exp $"); |
40 | #endif /* not lint */ | | 40 | #endif /* not lint */ |
41 | | | 41 | |
42 | #include <sys/param.h> | | 42 | #include <sys/param.h> |
43 | #include <sys/mount.h> | | 43 | #include <sys/mount.h> |
44 | #include <sys/stat.h> | | 44 | #include <sys/stat.h> |
45 | #include <msdosfs/msdosfsmount.h> | | 45 | #include <msdosfs/msdosfsmount.h> |
46 | #include <err.h> | | 46 | #include <err.h> |
47 | #include <grp.h> | | 47 | #include <grp.h> |
48 | #include <pwd.h> | | 48 | #include <pwd.h> |
49 | #include <stdio.h> | | 49 | #include <stdio.h> |
50 | #include <stdlib.h> | | 50 | #include <stdlib.h> |
51 | #include <string.h> | | 51 | #include <string.h> |
52 | #include <time.h> | | 52 | #include <time.h> |
| @@ -193,28 +193,29 @@ mount_msdos(int argc, char **argv) | | | @@ -193,28 +193,29 @@ mount_msdos(int argc, char **argv) |
193 | struct msdosfs_args args; | | 193 | struct msdosfs_args args; |
194 | char canon_dev[MAXPATHLEN], canon_dir[MAXPATHLEN]; | | 194 | char canon_dev[MAXPATHLEN], canon_dir[MAXPATHLEN]; |
195 | int mntflags; | | 195 | int mntflags; |
196 | | | 196 | |
197 | mount_msdos_parseargs(argc, argv, &args, &mntflags, | | 197 | mount_msdos_parseargs(argc, argv, &args, &mntflags, |
198 | canon_dev, canon_dir); | | 198 | canon_dev, canon_dir); |
199 | | | 199 | |
200 | if (mount(MOUNT_MSDOS, canon_dir, mntflags, &args, sizeof args) == -1) | | 200 | if (mount(MOUNT_MSDOS, canon_dir, mntflags, &args, sizeof args) == -1) |
201 | err(1, "%s on %s", canon_dev, canon_dir); | | 201 | err(1, "%s on %s", canon_dev, canon_dir); |
202 | | | 202 | |
203 | if (mntflags & MNT_GETARGS) { | | 203 | if (mntflags & MNT_GETARGS) { |
204 | char buf[1024]; | | 204 | char buf[1024]; |
205 | (void)snprintb(buf, sizeof(buf), MSDOSFSMNT_BITS, args.flags); | | 205 | (void)snprintb(buf, sizeof(buf), MSDOSFSMNT_BITS, args.flags); |
206 | printf("uid=%d, gid=%d, mask=0%o, dirmask=0%o, flags=%s\n", | | 206 | printf("uid=%d, gid=%d, mask=0%o, dirmask=0%o, gmtoff=%d, flags=%s\n", |
207 | args.uid, args.gid, args.mask, args.dirmask, buf); | | 207 | args.uid, args.gid, args.mask, args.dirmask, |
| | | 208 | args.gmtoff, buf); |
208 | } | | 209 | } |
209 | | | 210 | |
210 | exit (0); | | 211 | exit (0); |
211 | } | | 212 | } |
212 | | | 213 | |
213 | static void | | 214 | static void |
214 | usage(void) | | 215 | usage(void) |
215 | { | | 216 | { |
216 | | | 217 | |
217 | fprintf(stderr, "usage: %s [-9GlsU] [-g gid] [-M mask] [-m mask] " | | 218 | fprintf(stderr, "usage: %s [-9GlsU] [-g gid] [-M mask] [-m mask] " |
218 | "[-o options]\n\t[-t gmtoff] [-u uid] special mountpath\n", | | 219 | "[-o options]\n\t[-t gmtoff] [-u uid] special mountpath\n", |
219 | getprogname()); | | 220 | getprogname()); |
220 | exit(1); | | 221 | exit(1); |