summaryrefslogtreecommitdiffstats
path: root/source/lib/util_sec.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-10-31 01:52:34 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-10-31 01:52:34 +0000
commit0c8e9339d8238de92e9146d04091694b62874c33 (patch)
treeaecac30b3bfe1bb767a260e3160262ad06f6171f /source/lib/util_sec.c
parent190898586fa218c952fbd5bea56155d04e6f248b (diff)
downloadsamba-0c8e9339d8238de92e9146d04091694b62874c33.tar.gz
samba-0c8e9339d8238de92e9146d04091694b62874c33.tar.xz
samba-0c8e9339d8238de92e9146d04091694b62874c33.zip
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
Diffstat (limited to 'source/lib/util_sec.c')
-rw-r--r--source/lib/util_sec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/lib/util_sec.c b/source/lib/util_sec.c
index a07e7d0e1af..c559647bf45 100644
--- a/source/lib/util_sec.c
+++ b/source/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);
+}