[Slackbuilds-users] All-writable directory under /opt

B. Watson urchlay at slackware.uk
Sun May 5 03:09:47 UTC 2024



On Sat, 4 May 2024, Daniel Prosser wrote:

> Thanks for the ideas. I like the idea of using the setgid bit, but I'm having 
> trouble getting it to work. First, the main executable is a wrapper script, 
> which may be a problem, but even applying the setguid bit to the binary file 
> and foregoing the wrapper script (doing the stuff the wrapper script would 
> have done manually in the shell for testing purposes) results in library 
> import errors. I assume this is due to permissions somehow, but I don't 
> really understand why.

Because the wrapper script exports LD_LIBRARY_PATH (to tell the
executable where to find the libs), and glibc deliberately ignores
that variable on binaries with the setuid or setgid bits set.

So that approach wouldn't work.

> Asking the user to run as root the first time would work, but I would also 
> have to tell them to then copy the configuration directory from /root to 
> their user directory and set permissions accordingly, which seems rather 
> unwieldy and inconvenient.

Hm. You mean, if the copy was created by running it as root, it
*still* tries to make a new copy, if run without a config file?

> In a related idea, what about installing the 
> program with some group ownership (say "LucasChess") and asking the user to 
> join that group before running?

That could work. Go with a lowercase group name though, lucaschess or
just lucas.

For that matter, you could go with the system games group. Ask
user to join that group. Though, it would also let the user edit
the high scores for games that save high scores as the games
group. Realistically I don't think this matters much.


More information about the SlackBuilds-users mailing list