summaryrefslogtreecommitdiff
path: root/source3/lib/util_sec.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-06-22 15:14:45 +0000
committerAndrew Tridgell <tridge@samba.org>2001-06-22 15:14:45 +0000
commit868d010aa1b614109b54928e46eb626a1d320a2d (patch)
tree7f3f13b0781a7758d8f7b7f40ef15a396dc5a0dc /source3/lib/util_sec.c
parent3281f6f076a13b78f3a688775993c9139526d6a3 (diff)
downloadsamba-868d010aa1b614109b54928e46eb626a1d320a2d.tar.gz
samba-868d010aa1b614109b54928e46eb626a1d320a2d.tar.bz2
samba-868d010aa1b614109b54928e46eb626a1d320a2d.zip
added the ability to test smbd safely as an ordinary user. The way it works is
that libsmb/ creates a local tcp socket then launches smbd as a subprocess attached to that socket. smbd thinks it is being launched from inetd. to use it do the following: - compile with -DSMB_REGRESSION_TEST - run like this (also works with smbtorture etc) export SMBD_TEST=1 export LIBSMB_PROG=bin/smbd smbclient //server/share -Uuser%pass obviously you need to setup a smb.conf etc. Using --prefix to configure is useful. The aim of all this stuff is to add a decent set of regression tests to the build farm, so we know if smbd actually runs correctly on all the platforms, not just builds. We can run smbtorture, masktest, locktest etc, plus a bunch of smbclient scripts and any new tests we write. This doesn't help much with nmbd (at least not yet) but its a good start. (This used to be commit 7e8e6ae9a88c4d2587eb4e7f0501cd71bd36ebb2)
Diffstat (limited to 'source3/lib/util_sec.c')
-rw-r--r--source3/lib/util_sec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
index 068be684f3..164e6ab506 100644
--- a/source3/lib/util_sec.c
+++ b/source3/lib/util_sec.c
@@ -51,11 +51,13 @@ static void assert_uid(uid_t ruid, uid_t euid)
{
if ((euid != (uid_t)-1 && geteuid() != euid) ||
(ruid != (uid_t)-1 && getuid() != ruid)) {
+#ifndef SMB_REGRESSION_TEST
DEBUG(0,("Failed to set uid privileges to (%d,%d) now set to (%d,%d)\n",
(int)ruid, (int)euid,
(int)getuid(), (int)geteuid()));
smb_panic("failed to set uid\n");
exit(1);
+#endif
}
}
@@ -66,12 +68,14 @@ static void assert_gid(gid_t rgid, gid_t egid)
{
if ((egid != (gid_t)-1 && getegid() != egid) ||
(rgid != (gid_t)-1 && getgid() != rgid)) {
+#ifndef SMB_REGRESSION_TEST
DEBUG(0,("Failed to set gid privileges to (%d,%d) now set to (%d,%d) uid=(%d,%d)\n",
(int)rgid, (int)egid,
(int)getgid(), (int)getegid(),
(int)getuid(), (int)geteuid()));
smb_panic("failed to set gid\n");
exit(1);
+#endif
}
}