Mounting a file as a file system, without being root

I need to be able to mount a file as a file system, but
would prefer not to have to be root to do it. Are
shell scripts on QNX allowed to set-UID to root, or is
that disallowed, as in some UNIX variants?

Also, “mount” seems to require root privilege (reasonably
enough), but the QNX help page for “mount” doesn’t say that,
although it says “you must be root to run this program” for other
commands. Is it possible to mount and unmount without root
privileges in some circumstances?

John Nagle

John Nagle <nagle@downside.com> wrote:

I need to be able to mount a file as a file system, but
would prefer not to have to be root to do it. Are
shell scripts on QNX allowed to set-UID to root, or is
that disallowed, as in some UNIX variants?

well, that should be an easy one to test on your own… probably
faster than typing a request here. (I don’t think they are, but
I’m not positive.)

Also, “mount” seems to require root privilege (reasonably
enough), but the QNX help page for “mount” doesn’t say that,
although it says “you must be root to run this program” for other
commands. Is it possible to mount and unmount without root
privileges in some circumstances?

mount run by itself does a query. So, it can be usefully used by non-root.
Not sure on unmount. If a resmgr doesn’t enforce root perms for
mount/unmount, I expect they could be used.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Thanks.

As it turns out, QNX doesn’t accept scripts with
set-UID to root, probably a good decision.

I’ve written a small program, “mountpfs”, for
mounting “psuedo file systems”, i.e. mounting a file
as a file system. This is a set-UID program, and
it checks that the mount operation is safe.
That solved my problem, which involved building
simulated boot floppies for boot CDs.

John Nagle

David Gibbs wrote:

John Nagle <> nagle@downside.com> > wrote:

I need to be able to mount a file as a file system, but
would prefer not to have to be root to do it. Are
shell scripts on QNX allowed to set-UID to root, or is
that disallowed, as in some UNIX variants?


well, that should be an easy one to test on your own… probably
faster than typing a request here. (I don’t think they are, but
I’m not positive.)


Also, “mount” seems to require root privilege (reasonably
enough), but the QNX help page for “mount” doesn’t say that,
although it says “you must be root to run this program” for other
commands. Is it possible to mount and unmount without root
privileges in some circumstances?


mount run by itself does a query. So, it can be usefully used by non-root.
Not sure on unmount. If a resmgr doesn’t enforce root perms for
mount/unmount, I expect they could be used.

-David