[dev] [slock] chown to root:root on install?

From: Nick <suckless-dev_AT_njw.me.uk>
Date: Tue, 8 Sep 2015 14:30:39 +0100

Hi folks,

I just installed slock, and found that it couldn't disable the
out-of-memory killer for itself, so wouldn't run (presumably it
would have failed later through not being able to read the shadow
file, too). This was because I installed it in a directory in my
$HOME using "make install" rather than as root with "sudo make
install", so it was owned by my user. As such the setuid bit didn't
mean its privileges were heightened to the root user.

Ideally slock should always be owned by the root user, so that it
can disable the oom lock. I wonder what the right solution is here,
as obviously one can't chown a file to be owned by root if one isn't
root oneself.

One option would be to add a line like this to the install rule of
the makefile:

        _AT_chown root:root ${DESTDIR}${PREFIX}/bin/slock || echo "Could not chown root:root ${DESTDIR}${PREFIX}/bin/slock; please do this manually"

Or else add a note to the readme that the make install rule should
be run as root. I am not in the habit of installing software outside
of $HOME, so I don't tend to think about elevating to root to
install software, so this initially confused me.

Separately to this, slock seems to exit (without prompt) after about
0.3s after I run it, unless I move the mouse or hit the keyboard
directly after starting it. Has anyone else seen this? I could look
into it more, but wonder if I am perhaps being stupid?

Nick
Received on Tue Sep 08 2015 - 15:30:39 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 08 2015 - 15:36:09 CEST