aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
Diffstat (limited to 'FICS')
-rw-r--r--FICS/ficsmain.c6
-rw-r--r--FICS/ficsmain.h3
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 */