Patch from metze and me that adds dummy smb_register_*() functions so
authorJelmer Vernooij <jelmer@samba.org>
Sat, 10 May 2003 10:53:48 +0000 (10:53 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 10 May 2003 10:53:48 +0000 (10:53 +0000)
that is now possible to, for example, load a module which contains
an auth method into a binary without the auth/ subsystem built in.

35 files changed:
source/client/client.c
source/client/smbmount.c
source/client/smbspool.c
source/include/module_dummy.h [new file with mode: 0644]
source/nmbd/nmbd.c
source/nsswitch/winbindd.c
source/passdb/pdb_interface.c
source/rpcclient/rpcclient.c
source/smbd/server.c
source/torture/locktest.c
source/torture/locktest2.c
source/torture/masktest.c
source/torture/msgtest.c
source/torture/nsstest.c
source/torture/rpctorture.c
source/torture/smbiconv.c
source/torture/torture.c
source/torture/vfstest.c
source/utils/net.c
source/utils/nmblookup.c
source/utils/ntlm_auth.c
source/utils/pdbedit.c
source/utils/profiles.c
source/utils/rpccheck.c
source/utils/smbcacls.c
source/utils/smbcontrol.c
source/utils/smbcquotas.c
source/utils/smbfilter.c
source/utils/smbpasswd.c
source/utils/smbtree.c
source/utils/status.c
source/utils/testparm.c
source/utils/testprns.c
source/web/swat.c
source/wrepld/server.c

index 36c76cbf15d67336383652774c6dcb3fa95b42fc..c8d2ca7b04ff05bce1434497b3207c33835dfe55 100644 (file)
@@ -28,6 +28,8 @@
 #define REGISTER 0
 #endif
 
+#include "module_dummy.h"
+
 struct cli_state *cli;
 extern BOOL in_client;
 static int port = 0;
index 1ee7dbc8cb93137df242da5983128e8b87e26081..eeaec6420407740783f558ca2a08d5838bc311dc 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 #include <mntent.h>
 #include <asm/types.h>
 #include <linux/smb_fs.h>
index 68165792da3df3f86f95284d67b0113485aa369f..eef663ebfd24fc81a78292e60af5448db4ebddd6 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 /*
  * Globals...
  */
diff --git a/source/include/module_dummy.h b/source/include/module_dummy.h
new file mode 100644 (file)
index 0000000..dfa0e15
--- /dev/null
@@ -0,0 +1,53 @@
+/* 
+   Unix SMB/CIFS implementation.
+   For faking up smb_register_*() functions
+   e.g. smb_register_vfs() in nmbd
+   Copyright (C) Stefan (metze) Metzmacher     2003
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _MODULE_DUMMY_H
+#define _MODULE_DUMMY_H
+
+#ifndef HAVE_SMB_REGISTER_AUTH
+NTSTATUS smb_register_auth(int version, const char *name, auth_init_function init)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+#endif /*HAVE_SMB_REGISTER_AUTH*/
+
+#ifndef HAVE_SMB_REGISTER_PASSDB
+NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function init) 
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+#endif /*HAVE_SMB_REGISTER_PASSDB*/
+
+#ifndef HAVE_RPC_PIPE_REGISTER_COMMANDS
+NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *srv, const struct api_struct *cmds, int size)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+#endif /*HAVE_RPC_PIPE_REGISTER_COMMANDS*/
+
+#ifndef HAVE_SMB_REGISTER_VFS
+NTSTATUS smb_register_vfs(int version, const char *name, vfs_op_tuple *(*init)(const struct vfs_ops *, struct smb_vfs_handle_struct *))
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+#endif /*HAVE_SMB_REGISTER_VFS*/
+
+#endif /* _MODULE_DUMMY_H */
index d9300f4668f99b1c3eb2a8c50b35d47b225c85c1..411a406a929d5565b66b96db00da618baf0d09dc 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 int ClientNMB       = -1;
 int ClientDGRAM     = -1;
 int global_nmb_port = -1;
index fb6f67625c0da72b44f3ef1080bd84db44269896..7c59344be2ba4e45e1cf47bd8ba3cb0c693003f1 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "winbindd.h"
 
+#include "module_dummy.h"
+
 BOOL opt_nocache = False;
 BOOL opt_dual_daemon = False;
 
index 7b44df193fccfd72da0c6c027a41d8fc46ce61d4..dc2b43d204d65a4ef3e1ab94d7ec6703099fc17a 100644 (file)
@@ -436,10 +436,10 @@ static NTSTATUS make_pdb_methods_name(struct pdb_methods **methods, struct pdb_c
        /* Try to find a module that contains this module */
        if (!entry) { 
                DEBUG(2,("No builtin backend found, trying to load plugin\n"));
-               if(NT_STATUS_IS_OK(smb_probe_module("pdb", module_name)) && !(entry = pdb_find_backend_entry(module_name))) {
+               if(NT_STATUS_IS_OK(nt_status = smb_probe_module("pdb", module_name)) && !(entry = pdb_find_backend_entry(module_name))) {
                        DEBUG(0,("Plugin is available, but doesn't register passdb backend %s\n", module_name));
                        SAFE_FREE(module_name);
-                       return NT_STATUS_UNSUCCESSFUL;
+                       return nt_status;
                }
        }
        
index a1b0a8cd34550d41e035b0e77777487552e0bccd..fb0845e615b54f388d940dc8415b47faaade9f2a 100644 (file)
 #include "includes.h"
 #include "rpcclient.h"
 
+
+#define HAVE_SMB_REGISTER_PASSDB
+#include "module_dummy.h"
+
 DOM_SID domain_sid;
 
 
index d46be42eba6e7f260c329de5340d2c37a60b2fd9..e933c4d3d4597c11f9e751920583f435c6441e51 100644 (file)
 
 #include "includes.h"
 
+#define HAVE_SMB_REGISTER_AUTH
+#define HAVE_SMB_REGISTER_PASSDB
+#define HAVE_RPC_PIPE_REGISTER_COMMANDS
+#define HAVE_SMB_REGISTER_VFS
+#include "module_dummy.h"
+
+
 int am_parent = 1;
 
 /* the last message the was processed */
index 63b9590dd61639605633ff0714623d50b89b347b..c18d2c100bc7b5daea4743680ff52c590abc1e1a 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static fstring password[2];
 static fstring username[2];
 static int got_user;
index 97844b5609ecfbea1ad374ab0862d453079592f4..596596eb8a8fd3e8e456b5e62e97512cfeedaabc 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static fstring password;
 static fstring username;
 static int got_pass;
index 06dead3f16f26a70e2e3a745ff88a2621e74e54f..a4da1baff27a1a52a9688ba393e2b56b5e60e1c5 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static fstring password;
 static fstring username;
 static int got_pass;
index 8abb0a20d2e6ff275db06705d88e6d8577f76caa..091b6337ab1905c11a1c132eb36e165fac171c83 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static int pong_count;
 
 /****************************************************************************
index a82fa05203e270ab3d850f1a45d18881f4b0978e..27b77e2a83bf91db3aef084ffc3d0808c1433aeb 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static const char *so_path = "/lib/libnss_winbind.so";
 static const char *nss_name = "winbind";
 static int nss_errno;
index 086f8d5d3311eef45e42c0fb02e604191864eca8..e88a39a4839f89e7973c92a7bf50ae4b83bd4e39 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 #ifndef REGISTER
 #define REGISTER 0
 #endif
index ce21a09025eb9330db546f47ca340ed3b6fece02..613082225a2ceac5ea6eeec19c6b03bedd3ae066 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static int
 process_block (smb_iconv_t cd, char *addr, size_t len, FILE *output)
 {
index 07d7f1547eddd605a03832b4b445b6f75de7a47f..4141b29cc2012f46e8b35af4dff42be34bcca55e 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static fstring host, workgroup, share, password, username, myname;
 static int max_protocol = PROTOCOL_NT1;
 static const char *sockops="TCP_NODELAY";
index 3b28a3c496b90a9515e97057ebb5caba02b5f0a4..d6b84126a0b665ff50cc71985a11d4de0a3526ca 100644 (file)
 #include "includes.h"
 #include "vfstest.h"
 
+#define HAVE_SMB_REGISTER_AUTH
+#define HAVE_SMB_REGISTER_PASSDB
+#define HAVE_RPC_PIPE_REGISTER_COMMANDS
+#define HAVE_SMB_REGISTER_VFS
+#include "module_dummy.h"
+
 /* List to hold groups of commands */
 static struct cmd_list {
        struct cmd_list *prev, *next;
index aa245a920a71fda222fa82c2f69e10b383b12d8c..b2a86bb020160fd23be3301b61d8580c7e3c3b32 100644 (file)
 #include "includes.h"
 #include "../utils/net.h"
 
+#define HAVE_SMB_REGISTER_PASSDB
+#include "module_dummy.h"
+
+
 /***********************************************************************/
 /* Beginning of internationalization section.  Translatable constants  */
 /* should be kept in this area and referenced in the rest of the code. */
index d2c5cbc00ed41579c9ad01c7ef3dbc0df6a2c5c8..7083961ccb5846ab7929c757f09026e5916eb038 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 extern BOOL AllowDebugChange;
 
 static BOOL give_flags = False;
index a713f3aa2dd3189fca4a4ae04686f56e26df7d80..0d63afda72c688b35b384c8812af4e70a6f5286a 100644 (file)
@@ -27,6 +27,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
+#include "module_dummy.h"
+
 #define SQUID_BUFFER_SIZE 2010
 
 enum squid_mode {
index 3a3d06a6452478c009d4a042d741761e9cf1a994..5116855e71b6a8d8ba6a8ecd41be3435c7c78638 100644 (file)
@@ -23,6 +23,9 @@
 
 #include "includes.h"
 
+#define HAVE_SMB_REGISTER_PASSDB
+#include "module_dummy.h"
+
 #define BIT_BACKEND    0x00000004
 #define BIT_VERBOSE    0x00000008
 #define BIT_SPSTYLE    0x00000010
index 7c2d820c8102d25ccbf51f614000635b2952a907..8abdfd6f77e75e2c8e493abd59e3545c88951556 100644 (file)
@@ -297,6 +297,8 @@ Hope this helps....  (Although it was "fun" for me to uncover this things,
 #include <unistd.h>
 #include <sys/mman.h>
 
+#include "module_dummy.h"
+
 typedef unsigned int DWORD;
 typedef unsigned short WORD;
 
index ae109f69b65c36e5bab997dae8c9c1b2bcd0fcef..11a2a9d8baaa5e60d27021cec82c387bb1e1d92d 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 main()
 {
        char filter[]="0123456789ABCDEF";
index 9d8a6577263379200e76edcbc3b5f29783e36b09..35a9b05dcd776fd5ba4056e7005ca3e0a502937a 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static pstring owner_username;
 static fstring server;
 static int test_args = False;
index 06add6af228a306dbe90edf040cc7412a7a9b2eb..0c68bfc329af7c4b8eae5bb2a1507be2ac3c1eb8 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 /* Default timeout value when waiting for replies (in seconds) */
 
 #define DEFAULT_TIMEOUT 10
index 9c7379ca2a9c94837213afe270d02cda8fb6d1d8..9ba243a4a58ac337aaf65e2abf879b0e4a1e215c 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static pstring server;
 
 /* numeric is set when the user wants numeric SIDs and ACEs rather
index 1a0d639f0254efdbef8a1476b5d1eec7e943c3c3..fe5208227d7682767dfa1902337e0c4c6362ecbc 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 #define SECURITY_MASK 0
 #define SECURITY_SET  0
 
index 577e467fbdbe71717a2fb8455b86073c18f8d2cc..2070adb3e56ae74276439b0882bc0ba54b817240 100644 (file)
@@ -19,6 +19,9 @@
 
 #include "includes.h"
 
+#define HAVE_SMB_REGISTER_PASSDB
+#include "module_dummy.h"
+
 extern BOOL AllowDebugChange;
 
 /*
index cbe1bd448f8b9ed2bb240590025d83a339b578df..bc669b4aa165dfccceb85eb8933c2905dbdd3db1 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static BOOL use_bcast;
 
 /* How low can we go? */
index bbaeecdd6bb2686ef6ca4db7518b2b0b349748fb..fab55baabbb625bd8b1d41df75d0dcd142b96cde 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 static pstring Ucrit_username = "";                   /* added by OH */
 static pid_t   Ucrit_pid[100];  /* Ugly !!! */        /* added by OH */
 static int            Ucrit_MaxPid=0;                        /* added by OH */
index e3d6ce02748d7a754a20bfc30edf5f79e3d60165..b3e8f8badbfd973803c669b29e7356f8bf6ee83e 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 extern BOOL AllowDebugChange;
 
 /***********************************************
index 7e52b86afb6979bd731ebc177d98fbca1e9767c0..758e2b41dd6043af2e0590667595d52c555b3c5d 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "includes.h"
 
+#include "module_dummy.h"
+
 int main(int argc, char *argv[])
 {
    const char *pszTemp;
index 7f9492933a540df4cfcfbb7648f37fea62bcacea..e93fb2e5e124a1247fc83cb8fb38c957b1ec0e9c 100644 (file)
@@ -31,6 +31,9 @@
 #include "includes.h"
 #include "../web/swat_proto.h"
 
+#define HAVE_SMB_REGISTER_PASSDB
+#include "module_dummy.h"
+
 #define GLOBALS_SNUM -1
 
 static BOOL demo_mode = False;
index 504818b8d5277d80e8e3f5d7660f14b3b960aae4..21bc2e4925b9a2a741a3056ca125117d79885604 100644 (file)
@@ -21,6 +21,8 @@
 #include "includes.h"
 #include "wins_repl.h"
 
+#include "module_dummy.h"
+
 extern pstring user_socket_options;
 
 extern WINS_OWNER *global_wins_table;