summaryrefslogtreecommitdiff
path: root/source3/libsmb
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
commit2fc8e32ad342e3285e0d30a3a102e06ec4af5199 (patch)
tree201cb208c4914214860575ffb07b2a50c9f678c7 /source3/libsmb
parent1f829e19eb3b81ad1c4451fe9a90617e6cee7dd7 (diff)
downloadsamba-2fc8e32ad342e3285e0d30a3a102e06ec4af5199.tar.gz
samba-2fc8e32ad342e3285e0d30a3a102e06ec4af5199.tar.bz2
samba-2fc8e32ad342e3285e0d30a3a102e06ec4af5199.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 (This used to be commit 0c8e9339d8238de92e9146d04091694b62874c33)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clientgen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index ec8d2e2bfc..d509924a26 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -154,6 +154,12 @@ struct cli_state *cli_initialise(struct cli_state *cli)
{
BOOL alloced_cli = False;
+ /* Check the effective uid - make sure we are not setuid */
+ if (is_setuid_root()) {
+ DEBUG(0,("libsmb based programs must *NOT* be setuid root.\n"));
+ return NULL;
+ }
+
if (!cli) {
cli = (struct cli_state *)malloc(sizeof(*cli));
if (!cli)