diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2025-11-02 18:59:43 +0100 | 
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2025-11-02 18:59:43 +0100 | 
| commit | ec173685a453bde9f6f024e04a5ed5da897210ab (patch) | |
| tree | e04985afab644bc1fc33e534f086ac81250c3a86 /FICS/ficsmain.c | |
| parent | 05cf281ed146182f70521e9be359cde1ef8e7c89 (diff) | |
Handle if the FICS is installed system-wide
Diffstat (limited to 'FICS/ficsmain.c')
| -rw-r--r-- | FICS/ficsmain.c | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/FICS/ficsmain.c b/FICS/ficsmain.c index bf5aafb..36055b8 100644 --- a/FICS/ficsmain.c +++ b/FICS/ficsmain.c @@ -298,9 +298,12 @@ main(int argc, char *argv[])  	settings_init();  	settings_read_conf(FICS_SETTINGS); -	if (is_super_user()) { -		if (strncmp(FICS_PREFIX, "/home", 5) == 0) +	if (strncmp(FICS_PREFIX, "/home", 5) == 0) { +		if (is_super_user())  			errx(1, "Do not run as root"); +	} else { +		if (!is_super_user()) +			errx(1, "Need root privileges");  		else if (read_the_group_permissions_file("/etc/group") != 0)  			errx(1, "Failed to read the group permissions file");  		else if (fics_addgroup(settings_get("sysgroup")) != 0)  | 
