home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky alt.sys.sun:3594 comp.sys.sun.misc:6546
- Path: sparky!uunet!digex.com!intercon!udel!gatech!asuvax!ukma!cs.widener.edu!dsinc!ub!galileo.cc.rochester.edu!rochester!rit!cci632!djh
- From: djh@cci632.cci.com (Daniel J. Hazekamp)
- Newsgroups: alt.sys.sun,comp.sys.sun.misc
- Subject: Re: Can "normal" users mount under Solaris 2.X
- Summary: DOS floppy mount tools
- Message-ID: <1993Jan27.155702.14041@cci632.cci.com>
- Date: 27 Jan 93 15:57:02 GMT
- References: <C15usz.L0t@intcorp.mn.org>
- Organization: Northern Telecom, Inc. - Network Application Systems
- Lines: 45
-
-
- To get around the setuid shell script issue, I wrote two small C programs to
- mount and unmount DOS format floppies. We do not allow mounting of Unix format
- floppies here.
-
- The following code works under SunOS 4.1.x. You`ll have to try it under
- Solaris 2.x yourself. Just compile it and make it SetUID root.
-
- Dan
- djh@cci.com
-
- -------------------------------------------------------------------------------
-
- fdmount.c
-
- #define PCFS
- #include <sys/mount.h>
-
- main()
- {
-
- struct pc_args fd_data;
-
- fd_data.fspec = "/dev/fd0";
-
- if (mount("pcfs","/pcfs",(M_NEWTYPE|M_NOSUID|M_NOSUB),
- &fd_data) != 0)
- perror("fdmount");
- }
-
- -------------------------------------------------------------------------------
-
- fdunmount.c
-
- main()
- {
- if (unmount("/pcfs") != 0)
- perror("fdunmount");
- else
- system("eject /dev/rfd0");
- }
- --
- Dan Hazekamp uupsi!cci632!djh
- Computer Consoles Inc. (CCI) uunet!ccicpg!cci632!djh
- Rochester, NY Internet: djh@cci.com
-