From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078718211756.tru64-unix-managers.marc@archive.invalid> From: "richard n. frank" Date: Mon, 17 Aug 1998 20:45:03 +0000 To: tru64-unix-managers Subject: Summary: C program to mount/umount disks X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078718211756 Many thanks for the excellent information. This group is a tremendous resource. rich frank rnfrank@llnl.gov George Gallen Bob Sloane sloane@UKANS.EDU georg.buesse@db.com Dave Courtade Kevin Reardon Tom Webster Stefan Heim Biggerstaff, Craig T" --------------------------------------------------------------------------------- Several suggestions promoted the sudo program, but I think I prefer the direct approach. Georg Buesse provided this C program which looks very servicable: ...we used this script to start predefined .sh scripts on an AIX workstation. It should be possible to either write an .sh-script for mounting or to change the system call to use the mount-instruction. #include #include #include main(argc, argv) char *argv[]; int argc; { char sys_call[50]; const char user[] = "root"; if (argc != 1) { printf("Bitte Aufrufsyntax beachten! \n"); printf("z.B:> start_script \n"); }else { sprintf(sys_call, "/home/xxxxx/start_script.sh %s \0 ", ""); printf ("%s \n" , sys_call); /*printf ("%s \n", user);*/ setpcred(user,NULL); system (sys_call); } } -------------------------------------------------------------------------------- Kevin Reardon also furnished a C program complete with documentation. It is fairly long so I won't post it here. I will be happy to foreward it to anyone who is interested. --------------------------------------------------------------------------------- David R. Courtade has a program specifically for a JAZ drive available at: ftp.amherst.com/pub/jazstuf --------------------------------------------------------------------------------- Craig Biggerstaff remembered a program that was posted by Emanuele Lombardi. This should be in the archives. --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- original question: Good morning, I will be putting a Jaz drive on a 4.0D personal workstation. On VMS systems I have a Fortran program which is installed with privilege. It calls .com file which mounts a disk. I would think the same sort of thing could be done in UNIX with a C program. I'd experiment with a Fortran program but alas, we have a C compiler for DU but no Fortran. Has anyone created a C program which can be set to "suid" to allow unprivilged users to mount and umount a disk? Thanks for the help. rich frank rnfrank@llnl.gov