setcap was worth a try.

# install -o root -g users -m 750 /home/lh/prog/hmount/hmount.pl /home +/lh/prog/hmount/hmount # setcap cap_dac_override,cap_sys_admin+ep /home/lh/prog/hmount/hmount

I'm not proficient with the capability system, but these caps were proposed for the mount command in the link that you supplied. The effect was similar and still mount denies its service:

~/prog/hmount$ ./hmount --usb= ~/mnt Real uid: 1000 Effective uid: 1000 whoami> lh INFO: Attached sda: (sda1 sda2 sda3) on USB bus 17:0:0:0 mount: only root can do that

sudo on the other hand does not transport the real uid to the program, does it? So the program cannot determine what the $home of the real user may be, i.e. where mounting is deemed to be allowed.

Anyhow, thanks for theese ideas.


In reply to Re^2: why does perl-suid not mount by Anonymous Monk
in thread why does perl-suid not mount by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.