diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2025-11-01 10:50:41 +0100 | 
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2025-11-01 10:50:41 +0100 | 
| commit | f670011d32f423690c540eb134d36d099ce1321c (patch) | |
| tree | 8f1c9cacc7513144090395db54960a627e61cd19 /FICS | |
| parent | a0eaf31a3c0c9eff54663d3546e5eda77921867f (diff) | |
Added is_super_user()
Diffstat (limited to 'FICS')
| -rw-r--r-- | FICS/ficsmain.c | 6 | ||||
| -rw-r--r-- | FICS/ficsmain.h | 3 | 
2 files changed, 9 insertions, 0 deletions
diff --git a/FICS/ficsmain.c b/FICS/ficsmain.c index a5d17e9..ceefedf 100644 --- a/FICS/ficsmain.c +++ b/FICS/ficsmain.c @@ -273,6 +273,12 @@ usage(char *progname)  	exit(EXIT_FAILURE);  } +PUBLIC bool +is_super_user(void) +{ +	return (geteuid() == UID_SUPER_USER); +} +  PUBLIC int  main(int argc, char *argv[])  { diff --git a/FICS/ficsmain.h b/FICS/ficsmain.h index aba2886..024959e 100644 --- a/FICS/ficsmain.h +++ b/FICS/ficsmain.h @@ -30,6 +30,7 @@  #include <sys/stat.h>  #include <fcntl.h> +#include <stdbool.h>  #include <unistd.h>  #include "common.h" @@ -81,6 +82,8 @@ extern const mode_t	g_open_modes;  /* Arguments */  extern int	port;  extern int	withConsole; + +bool is_super_user(void);  __FICS_END_DECLS  #endif /* _FICSMAIN_H */  | 
