diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-06-22 15:14:45 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-06-22 15:14:45 +0000 |
commit | 7e8e6ae9a88c4d2587eb4e7f0501cd71bd36ebb2 (patch) | |
tree | 916a989d16af55f6d4d4b09292f7cca8d73b2d11 /source/libsmb/cliconnect.c | |
parent | 3ab50e648d682080308d2db6bdb71eef0e303988 (diff) | |
download | samba-7e8e6ae9a88c4d2587eb4e7f0501cd71bd36ebb2.tar.gz samba-7e8e6ae9a88c4d2587eb4e7f0501cd71bd36ebb2.tar.xz samba-7e8e6ae9a88c4d2587eb4e7f0501cd71bd36ebb2.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.
Diffstat (limited to 'source/libsmb/cliconnect.c')
-rw-r--r-- | source/libsmb/cliconnect.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index 529aa0fef96..034208f3b24 100644 --- a/source/libsmb/cliconnect.c +++ b/source/libsmb/cliconnect.c @@ -558,7 +558,6 @@ retry: return(True); } - /**************************************************************************** open the client sockets ****************************************************************************/ @@ -580,8 +579,15 @@ BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip) if (cli->port == 0) cli->port = 139; /* Set to default */ - cli->fd = open_socket_out(SOCK_STREAM, &cli->dest_ip, - cli->port, cli->timeout); +#ifdef SMB_REGRESSION_TEST + if (getenv("LIBSMB_PROG")) { + cli->fd = sock_exec(getenv("LIBSMB_PROG")); + } else +#endif + { + cli->fd = open_socket_out(SOCK_STREAM, &cli->dest_ip, + cli->port, cli->timeout); + } if (cli->fd == -1) return False; |