From 2fc8e32ad342e3285e0d30a3a102e06ec4af5199 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 31 Oct 2001 01:52:34 +0000 Subject: Parionia to ensure people don't install libsmb based programs setuid root. libsmb has not been written to be setuid, with things like LIBSMB_PROG allowing all sort of fun and games. Andrew Bartlett (This used to be commit 0c8e9339d8238de92e9146d04091694b62874c33) --- source3/lib/util_sec.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/lib/util_sec.c') diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c index a07e7d0e1a..c559647bf4 100644 --- a/source3/lib/util_sec.c +++ b/source3/lib/util_sec.c @@ -413,3 +413,11 @@ main() exit(0); } #endif + +/**************************************************************************** +Check if we are setuid root. Used in libsmb and smbpasswd parinoia checks. +****************************************************************************/ +BOOL is_setuid_root(void) +{ + return (geteuid() == (uid_t)0) && (getuid() != (uid_t)0); +} -- cgit