mount_msdosfs.c (2892) | mount_msdosfs.c (2999) |
---|---|
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 | 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 $"; | 32static char rcsid[] = "$Id: mount_msdos.c,v 1.1 1994/09/19 15:30:36 dfr 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]; | 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 struct vfsconf *vfc; |
|
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 | 71 72 mntflags = set_gid = set_uid = set_mask = 0; 73 (void)memset(&args, '\0', sizeof(args)); 74 75 while ((c = getopt(argc, argv, "u:g:m:o:")) != EOF) { 76 switch (c) { 77 case 'u': 78 args.uid = a_uid(optarg); --- 45 unchanged lines hidden (view full) --- 124 if (!set_uid) 125 args.uid = sb.st_uid; 126 if (!set_gid) 127 args.gid = sb.st_gid; 128 if (!set_mask) 129 args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); 130 } 131 |
131 if (mount(MOUNT_MSDOS, dir, mntflags, &args) < 0) | 132 vfc = getvfsbyname("msdos"); 133 if(!vfc && vfsisloadable("msdos")) { 134 if(vfsload("msdos")) 135 err(1, "vfsload(msdos)"); 136 endvfsent(); /* clear cache */ 137 vfc = getvfsbyname("msdos"); 138 } 139 140 if (mount(vfc ? vfc->vfc_index : 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 --- | 141 err(1, "mount"); 142 143 exit (0); 144} 145 146gid_t 147a_gid(s) 148 char *s; --- 60 unchanged lines hidden --- |