[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: setuid question



On 2021-01-22 at 19:09, Gene Heskett wrote:

> On Friday 22 January 2021 18:35:27 David Christensen wrote:
> 
>>  chmod u+s /usr/local/libexec/amanda/ambind
> 
> root@coyote:amanda-3.5.1$ chmod u+s /usr/local/libexec/amanda/ambind
> root@coyote:amanda-3.5.1$ su amanda -c "/usr/local/sbin/amcheck Daily"
> Amanda Tape Server Host Check
> -----------------------------
> ERROR: program /usr/local/libexec/amanda/ambind: not setuid-root

What does

$ ls -lh /usr/local/libexec/amanda/ambind

say?

All 'chmod u+s' does is set the suid bit. What having that bit does (as
I understand matters) is cause the program to run with the permissions
of the user who owns the file.

If that file is owned by some user other than root, than the suid bit
will just cause it to be run as that other user, which may well not be
enough.

You may also want to check

$ file /usr/local/libexec/amanda/ambind

to confirm whether this program is a script; I've seen cases where
having a script with the suid bit set isn't enough, because it invokes
another binary which isn't and the permissions don't wind up getting
passed along. (Whether that happens typically with scripts I don't know.)

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: