mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
Patch from metze and me that adds dummy smb_register_*() functions so
that is now possible to, for example, load a module which contains an auth method into a binary without the auth/ subsystem built in.
This commit is contained in:
@ -28,6 +28,8 @@
|
||||
#define REGISTER 0
|
||||
#endif
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
struct cli_state *cli;
|
||||
extern BOOL in_client;
|
||||
static int port = 0;
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
#include <mntent.h>
|
||||
#include <asm/types.h>
|
||||
#include <linux/smb_fs.h>
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
/*
|
||||
* Globals...
|
||||
*/
|
||||
|
53
source/include/module_dummy.h
Normal file
53
source/include/module_dummy.h
Normal file
@ -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 */
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
int ClientNMB = -1;
|
||||
int ClientDGRAM = -1;
|
||||
int global_nmb_port = -1;
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include "winbindd.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
BOOL opt_nocache = False;
|
||||
BOOL opt_dual_daemon = False;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,10 @@
|
||||
#include "includes.h"
|
||||
#include "rpcclient.h"
|
||||
|
||||
|
||||
#define HAVE_SMB_REGISTER_PASSDB
|
||||
#include "module_dummy.h"
|
||||
|
||||
DOM_SID domain_sid;
|
||||
|
||||
|
||||
|
@ -22,6 +22,13 @@
|
||||
|
||||
#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 */
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
static fstring password[2];
|
||||
static fstring username[2];
|
||||
static int got_user;
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
static fstring password;
|
||||
static fstring username;
|
||||
static int got_pass;
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
static fstring password;
|
||||
static fstring username;
|
||||
static int got_pass;
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
static int pong_count;
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -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;
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
#ifndef REGISTER
|
||||
#define REGISTER 0
|
||||
#endif
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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";
|
||||
|
@ -27,6 +27,12 @@
|
||||
#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;
|
||||
|
@ -40,6 +40,10 @@
|
||||
#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. */
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
extern BOOL AllowDebugChange;
|
||||
|
||||
static BOOL give_flags = False;
|
||||
|
@ -27,6 +27,8 @@
|
||||
#undef DBGC_CLASS
|
||||
#define DBGC_CLASS DBGC_WINBIND
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
#define SQUID_BUFFER_SIZE 2010
|
||||
|
||||
enum squid_mode {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
main()
|
||||
{
|
||||
char filter[]="0123456789ABCDEF";
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
static pstring owner_username;
|
||||
static fstring server;
|
||||
static int test_args = False;
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
/* Default timeout value when waiting for replies (in seconds) */
|
||||
|
||||
#define DEFAULT_TIMEOUT 10
|
||||
|
@ -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
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
#define SECURITY_MASK 0
|
||||
#define SECURITY_SET 0
|
||||
|
||||
|
@ -19,6 +19,9 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#define HAVE_SMB_REGISTER_PASSDB
|
||||
#include "module_dummy.h"
|
||||
|
||||
extern BOOL AllowDebugChange;
|
||||
|
||||
/*
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
static BOOL use_bcast;
|
||||
|
||||
/* How low can we go? */
|
||||
|
@ -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 */
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
extern BOOL AllowDebugChange;
|
||||
|
||||
/***********************************************
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "module_dummy.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *pszTemp;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user