mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Prevent unintentionally running as root
Some users try to run Subsurface as root for example to get around permission problems with dive computer devices. This is a bad idea since config files get touched as root and then cannot be read as normal user anymore. This patch allows running as root only with verbose option on. We can assume if somebody manages to start subsurface as root this happens from the command line. For some reason, I couldn't get translation working at this stage. Windows version is a stub. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d99c931219
commit
e216f91ebc
7 changed files with 28 additions and 2 deletions
|
@ -225,3 +225,8 @@ void subsurface_console_exit(void)
|
|||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
bool subsurface_user_is_root()
|
||||
{
|
||||
return (geteuid() == 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue