tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Steve McLaughlin <mclaughl () milkyway ! gsfc ! nasa ! gov>
To: tru64-unix-managers
Subject: Summary - Secure mountcd
Date: Wed, 18 Mar 1998 16:20:27 +0000	[thread overview]
Message-ID: <96078701111534.tru64-unix-managers.marc@archive.invalid> (raw)


First, Thanks to the following for their responses:
Avraham
David Warren
alan@nabeth.cxo.de
Matt Groener
Jeffrey G. Micono

Basically, there really isn't a way to determine CD-ROM /dev files in
a C program.  Avraham suggested exec-ing the file command and passing
the information via environment variables.  I thought of this as well
but thought it too kludjy.  David sent me a program that I have yet to
try, but will.  Alan gave me some really good advice concerning not
using the file command to determine the CD-ROMs but to use scu.  Matt
agreed that trying this in C would be a considerable endeavor (not for
me ;0).  Jeff suggested using statfs(2) which gave almost the
information I needed but not all.  So I'm going to write a script that
gets that CD-ROM information and pass the arguments to mountcd.  I'll
post the code when complete.


Original Question:

>I'm trying to write a very secure version of mountcd that will do the
>following:
>
>1) When invoked, appends session information to security log.
>
>2) Dynamically determines default CD-ROM device (not statically in the
>   program).
>
>3) Prompts user for a CD-ROM device and/or mount point that is not the
>   default ones. If the user selects a non-default CD-ROM device, check
>   the validity of it.
>
>4) Check mount point directory to ensure it's valid and empty.
>
>5) If all checks, mount CD-ROM.
>
>6) Closes security log.
>
>I've got all of this EXCEPT how to determine if a raw file is a valid
>CD-ROM device.  For example, in a shell script (our environment) the
>following command works nicely,
> # file /dev/rrz*c | grep offline | cut -c 1-5,7-10
>How can I do the equivalent in a C program?  This is the only thing
>left to do.  I really don't want to wrap this is in a script or add a
>system call to the program.

                 reply	other threads:[~1998-03-18 16:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox