home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / sys / sun / 3594 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.6 KB  |  58 lines

  1. Xref: sparky alt.sys.sun:3594 comp.sys.sun.misc:6546
  2. Path: sparky!uunet!digex.com!intercon!udel!gatech!asuvax!ukma!cs.widener.edu!dsinc!ub!galileo.cc.rochester.edu!rochester!rit!cci632!djh
  3. From: djh@cci632.cci.com (Daniel J. Hazekamp)
  4. Newsgroups: alt.sys.sun,comp.sys.sun.misc
  5. Subject: Re: Can "normal" users mount under Solaris 2.X
  6. Summary: DOS floppy mount tools
  7. Message-ID: <1993Jan27.155702.14041@cci632.cci.com>
  8. Date: 27 Jan 93 15:57:02 GMT
  9. References: <C15usz.L0t@intcorp.mn.org>
  10. Organization: Northern Telecom, Inc. - Network Application Systems
  11. Lines: 45
  12.  
  13.  
  14. To get around the setuid shell script issue, I wrote two small C programs to
  15. mount and unmount DOS format floppies. We do not allow mounting of Unix format
  16. floppies here. 
  17.  
  18. The following code works under SunOS 4.1.x. You`ll have to try it under
  19. Solaris 2.x yourself. Just compile it and make it SetUID root.
  20.  
  21. Dan
  22. djh@cci.com
  23.  
  24. -------------------------------------------------------------------------------
  25.  
  26. fdmount.c
  27.  
  28. #define PCFS
  29. #include <sys/mount.h>
  30.  
  31. main()
  32. {
  33.  
  34.         struct pc_args fd_data;
  35.  
  36.         fd_data.fspec = "/dev/fd0";
  37.  
  38.         if (mount("pcfs","/pcfs",(M_NEWTYPE|M_NOSUID|M_NOSUB),
  39.                   &fd_data) != 0)
  40.                 perror("fdmount");
  41. }
  42.  
  43. -------------------------------------------------------------------------------
  44.  
  45. fdunmount.c
  46.  
  47. main()
  48. {
  49.         if (unmount("/pcfs") != 0)
  50.                 perror("fdunmount");
  51.         else
  52.                 system("eject /dev/rfd0");
  53. }
  54. -- 
  55. Dan Hazekamp                    uupsi!cci632!djh
  56. Computer Consoles Inc. (CCI)            uunet!ccicpg!cci632!djh
  57. Rochester, NY                    Internet: djh@cci.com
  58.