[Slackbuilds-users] All-writable directory under /opt
B. Watson
urchlay at slackware.uk
Sat May 4 04:16:47 UTC 2024
On Fri, 3 May 2024, Daniel Prosser wrote:
> An alternative potential solution that I think would work would be to have
> the SlackBuild script copy the file, selecting a build that would work for
> everyone.
I can think of three approaches that avoid a world-writable directory
in /opt.
1. Duplicate (or copy/paste, if possible) the logic it uses to decide
which binary to copy, and put the logic in the SlackBuild (you
could also just rm the other binaries, since they'll be unused).
Or maybe do it in the doinst.sh.
2. Mention in the README that it has to be run as root, once, to
set up the engine. Further, you could replace the game binary with
a script that checks whether the copy/symlink exists, and if it
doesn't exist, bail out with a message telling the user to run it
as root.
3. If the main game binary (the thing that copies the engine file) is
a regular binary (not a script), you could make it run setgid
games, and make the engine directory writable by (owned by) the
games group. This is how a lot of games handle their high-scores
file (in /var/games/<whatever>/). But this won't work if the main
game binary is a script (shell, perl, python, etc).
More information about the SlackBuilds-users
mailing list