1/*
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 15 unchanged lines hidden (view full) ---
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static char rcsid[] = "$Id: mount_msdos.c,v 1.8 1994/07/16 21:32:08 cgd Exp $";
33#endif /* not lint */
34
35#include <sys/cdefs.h>
36#include <sys/param.h>
37#define MSDOSFS
38#include <sys/mount.h>
39#include <sys/stat.h>
40#include <ctype.h>
--- 21 unchanged lines hidden (view full) ---
62main(argc, argv)
63 int argc;
64 char **argv;
65{
66 struct msdosfs_args args;
67 struct stat sb;
68 int c, mntflags, set_gid, set_uid, set_mask;
69 char *dev, *dir, ndir[MAXPATHLEN+1];
70
71 mntflags = set_gid = set_uid = set_mask = 0;
72 (void)memset(&args, '\0', sizeof(args));
73
74 while ((c = getopt(argc, argv, "u:g:m:o:")) != EOF) {
75 switch (c) {
76 case 'u':
77 args.uid = a_uid(optarg);
--- 45 unchanged lines hidden (view full) ---
123 if (!set_uid)
124 args.uid = sb.st_uid;
125 if (!set_gid)
126 args.gid = sb.st_gid;
127 if (!set_mask)
128 args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
129 }
130
131 if (mount(MOUNT_MSDOS, dir, mntflags, &args) < 0)
132 err(1, "mount");
133
134 exit (0);
135}
136
137gid_t
138a_gid(s)
139 char *s;
--- 60 unchanged lines hidden ---
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 15 unchanged lines hidden (view full) ---
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static char rcsid[] = "$Id: mount_msdos.c,v 1.8 1994/07/16 21:32:08 cgd Exp $";
33#endif /* not lint */
34
35#include <sys/cdefs.h>
36#include <sys/param.h>
37#define MSDOSFS
38#include <sys/mount.h>
39#include <sys/stat.h>
40#include <ctype.h>
--- 21 unchanged lines hidden (view full) ---
62main(argc, argv)
63 int argc;
64 char **argv;
65{
66 struct msdosfs_args args;
67 struct stat sb;
68 int c, mntflags, set_gid, set_uid, set_mask;
69 char *dev, *dir, ndir[MAXPATHLEN+1];
70
71 mntflags = set_gid = set_uid = set_mask = 0;
72 (void)memset(&args, '\0', sizeof(args));
73
74 while ((c = getopt(argc, argv, "u:g:m:o:")) != EOF) {
75 switch (c) {
76 case 'u':
77 args.uid = a_uid(optarg);
--- 45 unchanged lines hidden (view full) ---
123 if (!set_uid)
124 args.uid = sb.st_uid;
125 if (!set_gid)
126 args.gid = sb.st_gid;
127 if (!set_mask)
128 args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
129 }
130
131 if (mount(MOUNT_MSDOS, dir, mntflags, &args) < 0)
132 err(1, "mount");
133
134 exit (0);
135}
136
137gid_t
138a_gid(s)
139 char *s;
--- 60 unchanged lines hidden ---