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

Re: [leafnode-list] chgrp problems under Red Hat 7.2



On Tue, 2002-07-30 at 20:31, Kenneth Porter wrote:

> I've added fetchnews and texpire to my root crontab, but I have to
> invoke them like this:
> su news -c /usr/sbin/fetchnews
> If I just run fetchnews as root, I get this:
> cannot ensure gid 13: Operation not permitted

Found it. It's a bug in the spec file.

The spec file was installing these as setuid to user news, but the
programs were then issuing a setgid, which only makes sense if the
program is already running as root. I figured it out when I found that
the copy I just built worked in the build directory but failed after
installed as an RPM, because the permissions hadn't been set on the
built version.

I just removed the setuid bits in the spec file, on the assumption that
they'd be run as root from root's crontab. Perhaps a better approach is
to check in initvars() (miscutil.c) first to see if the setgid and
setuid calls are needed. This could be done in uid_ensure and
gid_ensure, since those functions are just making sure that the ID's are
set correctly. They should read the current value and do nothing if the
values are in the desired state.


-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list