Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: why does perl-suid not mount

by JavaFan (Canon)
on Nov 10, 2010 at 12:41 UTC ( [id://870570]=note: print w/replies, xml ) Need Help??


in reply to why does perl-suid not mount

There might be a check somewhere not only for the EUID, but also for the UID. Try setting $< = 0, or by using POSIX::setuid.

Having said that, you may want to get rid of perl-suid, as it has been deprecated for some time, and gotten rid of in 5.12. You're probably better of either using sudo, or putting the appropriate magic in your /etc/fstab so a file system can be mounted by a non-root user. For instance, on my home boxes, I have:

/dev/sdb1 /mnt/sdb1 auto use 0 0 /dev/sdb2 /mnt/sdb2 auto user 0 0
in my /etc/fstab file, allowing a non-root user to mount usb devices.

Replies are listed 'Best First'.
Re^2: why does perl-suid not mount
by Anonymous Monk on Nov 10, 2010 at 13:26 UTC

    $< = 0 made it, at least until perl 5.12. I had not expected that I was allowed to do that, so I didn't try this obvious step.

    Thanks a lot!

    Unfortunately, neither sudo nor fstab can help. It is required that user A cannot access the media of user B. fstab solutions would at best bind a user to some device node, which is determined by the order of plugging the device and does not relate to users.

    In principle I could define a whole bunch of sudo rules per user, but this would require to rewrite the /etc/sudoers on all systems, whenever the central user LDAP changes. Such things tend to be unmaintainable.

      If sudo or fstab won't help, you are probably at the point of having to make a special group, whose purpose it is to run that script/device. Then add that group to allowed users.

      This is from memory, but I'm sure Ubuntu allows it's users to run mount via sudo

      sudo mount -t ext4 ....etc,etc
      so I don't think any sort of filesystem permission checking stops mount by non-root users. Ubuntu may even have a group called mount. ?

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://870570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found