1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r19507: Merge my DSO fixes branch. Building Samba's libraries as shared libraries

works again now, by specifying --enable-dso to configure.
This commit is contained in:
Jelmer Vernooij 2006-10-29 17:40:19 +00:00 committed by Gerald (Jerry) Carter
parent 66bebb2105
commit 7a01235067
34 changed files with 80 additions and 42 deletions

View File

@ -1,3 +1,4 @@
source/lib/gencache/gencache.h
source/lib/ldb/bin
*.pc
autom4te.cache

View File

@ -51,7 +51,7 @@ BOOL auth_challenge_may_be_modified(struct auth_context *auth_ctx)
Try to get a challenge out of the various authentication modules.
Returns a const char of length 8 bytes.
****************************************************************************/
NTSTATUS auth_get_challenge(struct auth_context *auth_ctx, const uint8_t **_chal)
_PUBLIC_ NTSTATUS auth_get_challenge(struct auth_context *auth_ctx, const uint8_t **_chal)
{
NTSTATUS nt_status;
struct auth_method_context *method;

View File

@ -65,7 +65,9 @@ OBJ_FILES = pam_errors.o
#######################
# Start SUBSYSTEM auth
[SUBSYSTEM::auth]
[LIBRARY::auth]
VERSION = 0.0.1
SO_VERSION = 0
PUBLIC_HEADERS = auth.h
PUBLIC_PROTO_HEADER = auth_proto.h
OBJ_FILES = \

View File

@ -48,7 +48,7 @@ PUBLIC_DEPENDENCIES = SASL auth
SUBSYSTEM = gensec
INIT_FUNCTION = gensec_spnego_init
PRIVATE_PROTO_HEADER = spnego_proto.h
PRIVATE_DEPENDENCIES = ASN1_UTIL
PRIVATE_DEPENDENCIES = ASN1_UTIL GENSEC_SOCKET
OBJ_FILES = spnego.o \
spnego_parse.o
# End MODULE gensec_spnego
@ -82,7 +82,7 @@ OBJ_FILES = \
[SUBSYSTEM::GENSEC_SOCKET]
OBJ_FILES = \
socket.o
PUBLIC_DEPENDENCIES = samba-socket
PUBLIC_DEPENDENCIES = samba-socket LIBPACKET
#PUBLIC_DEPENDENCIES = gensec
#
# End SUBSYSTEM GENSEC_SOCKET

View File

@ -60,7 +60,7 @@ static NTSTATUS gensec_socket_init_fn(struct socket_context *sock)
/* These functions are for use here only (public because SPNEGO must
* use them for recursion) */
NTSTATUS gensec_wrap_packets(struct gensec_security *gensec_security,
_PUBLIC_ NTSTATUS gensec_wrap_packets(struct gensec_security *gensec_security,
TALLOC_CTX *mem_ctx,
const DATA_BLOB *in,
DATA_BLOB *out,

View File

@ -157,6 +157,7 @@ AC_MSG_RESULT([$SHLD])
AC_MSG_CHECKING([SHLD_FLAGS])
AC_MSG_RESULT([$SHLD_FLAGS])
AC_DEFINE_UNQUOTED(SHLIBEXT, "$SHLIBEXT", [Shared library extension])
AC_MSG_CHECKING([SHLIBEXT])
AC_MSG_RESULT([$SHLIBEXT])
AC_MSG_CHECKING([SONAMEFLAG])

View File

@ -123,7 +123,7 @@ SHELL=$self->{config}->{SHELL}
PERL=$self->{config}->{PERL}
CPP=$self->{config}->{CPP}
CPPFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $self->{config}->{CPPFLAGS}
CPPFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $self->{config}->{CPPFLAGS}
CC=$self->{config}->{CC}
CFLAGS=$self->{config}->{CFLAGS} \$(CPPFLAGS)

View File

@ -32,7 +32,6 @@ m4_include(lib/ldb/libldb.m4)
m4_include(lib/tls/config.m4)
m4_include(lib/events/config.m4)
dnl disabled until we support external heimdal again
dnl m4_include(auth/kerberos/config.m4)
m4_include(auth/gensec/config.m4)
@ -51,6 +50,15 @@ m4_include(lib/appweb/config.m4)
m4_include(nsswitch/config.m4)
m4_include(libcli/config.m4)
dnl disabled until we support external heimdal again
AC_ARG_ENABLE(dso,
[ --enable-dso Enable building internal libraries as DSO's (experimental)],
[ if test x$enable_dso != xno; then
BLDSHARED=true
fi],
[BLDSHARED=false])
#################################################
# add *_CFLAGS only for the real build
CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}"

View File

@ -28,7 +28,7 @@ OBJ_FILES = \
[MODULE::ldb_samba3sam]
SUBSYSTEM = ldb
INIT_FUNCTION = ldb_samba3sam_module_init
PRIVATE_DEPENDENCIES = LIBTALLOC
PRIVATE_DEPENDENCIES = LIBTALLOC ldb_map
OBJ_FILES = \
samba3sam.o
#

View File

@ -61,9 +61,6 @@ _PUBLIC_ const char *dyn_DATADIR = DATADIR;
_PUBLIC_ const char *dyn_MODULESDIR = MODULESDIR;
/** Shared library extension */
_PUBLIC_ const char *dyn_SHLIBEXT = SHLIBEXT;
/**
* @brief Directory holding lock files.
*

View File

@ -32,7 +32,6 @@ extern const char *dyn_LOGFILEBASE;
extern const char *dyn_LMHOSTSFILE;
extern const char *dyn_DATADIR;
extern const char *dyn_MODULESDIR;
extern const char *dyn_SHLIBEXT;
extern const char *dyn_LOCKDIR;
extern const char *dyn_PIDDIR;
extern const char *dyn_PRIVATE_DIR;

View File

@ -6,7 +6,7 @@ OBJ_FILES = dynconfig.o
PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\" \
-DBINDIR=\"$(BINDIR)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
-DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DDATADIR=\"$(DATADIR)\" \
-DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"$(SHLIBEXT)\" \
-DLOGFILEBASE=\"$(LOGFILEBASE)\" \
-DCONFIGDIR=\"$(CONFIGDIR)\" -DNCALRPCDIR=\"$(NCALRPCDIR)\" \
-DSWATDIR=\"$(SWATDIR)\" -DSERVICESDIR=\"$(SERVICESDIR)\" \
-DPRIVATE_DIR=\"$(PRIVATEDIR)\" \

View File

@ -207,17 +207,26 @@ int ldb_try_load_dso(struct ldb_context *ldb, const char *name)
char *path;
void *handle;
int (*init_fn) (void);
char *modulesdir;
#ifdef HAVE_DLOPEN
if (getenv("LD_LDB_MODULE_PATH") != NULL) {
modulesdir = talloc_strdup(ldb, getenv("LD_LDB_MODULE_PATH"));
} else {
#ifdef _SAMBA_BUILD_
path = talloc_asprintf(ldb, "%s/ldb/%s.%s", dyn_MODULESDIR, name, dyn_SHLIBEXT);
modulesdir = talloc_asprintf(ldb, "%s/ldb", dyn_MODULESDIR);
#else
path = talloc_asprintf(ldb, "%s/%s.%s", MODULESDIR, name, SHLIBEXT);
modulesdir = talloc_strdup(ldb, MODULESDIR);
#endif
}
path = talloc_asprintf(ldb, "%s/%s.%s", modulesdir, name, SHLIBEXT);
talloc_free(modulesdir);
ldb_debug(ldb, LDB_DEBUG_TRACE, "trying to load %s from %s\n", name, path);
handle = dlopen(path, 0);
handle = dlopen(path, RTLD_NOW);
if (handle == NULL) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "unable to load %s from %s: %s\n", name, path, dlerror());
return -1;

View File

@ -1296,13 +1296,13 @@ static int map_init_maps(struct ldb_module *module, struct ldb_map_context *data
}
/* Copy the list of provided module operations. */
struct ldb_module_ops ldb_map_get_ops(void)
_PUBLIC_ struct ldb_module_ops ldb_map_get_ops(void)
{
return map_ops;
}
/* Initialize global private data. */
int ldb_map_init(struct ldb_module *module, const struct ldb_map_attribute *attrs,
_PUBLIC_ int ldb_map_init(struct ldb_module *module, const struct ldb_map_attribute *attrs,
const struct ldb_map_objectclass *ocls,
const char * const *wildcard_attributes,
const char *name)

View File

@ -432,7 +432,7 @@ static void ldap_connect_recv_unix_conn(struct composite_context *ctx)
ldap_connect_got_sock(state->ctx, conn);
}
NTSTATUS ldap_connect_recv(struct composite_context *ctx)
_PUBLIC_ NTSTATUS ldap_connect_recv(struct composite_context *ctx)
{
NTSTATUS status = composite_wait(ctx);
talloc_free(ctx);

View File

@ -665,7 +665,7 @@ PUBLIC_DEPENDENCIES = dcerpc NDR_DFS EJSRPC
INIT_FUNCTION = ejs_init_drsuapi
OBJ_FILES = gen_ndr/ndr_drsuapi_ejs.o
SUBSYSTEM = smbcalls
PUBLIC_DEPENDENCIES = dcerpc NDR_DRSUAPI EJSRPC RPC_EJS_MISC
PUBLIC_DEPENDENCIES = dcerpc NDR_DRSUAPI EJSRPC RPC_EJS_MISC RPC_EJS_SAMR
[MODULE::RPC_EJS_SPOOLSS]
INIT_FUNCTION = ejs_init_spoolss

View File

@ -408,4 +408,3 @@ configure:
clean::
@echo Removing dependency files
@find . -name \*.d -o -name \*.hd | xargs rm -f

View File

@ -14,7 +14,7 @@ PUBLIC_DEPENDENCIES = \
################################################
# Start SUBSYSTEM ntptr
[SUBSYSTEM::ntptr]
[LIBRARY::ntptr]
PRIVATE_PROTO_HEADER = ntptr_proto.h
OBJ_FILES = \
ntptr_base.o \

View File

@ -2,9 +2,10 @@
# Start MODULE pvfs_acl_xattr
[MODULE::pvfs_acl_xattr]
INIT_FUNCTION = pvfs_acl_xattr_init
SUBSYSTEM = ntvfs
SUBSYSTEM = ntvfs_posix
OBJ_FILES = \
pvfs_acl_xattr.o
PRIVATE_DEPENDENCIES = NDR_XATTR
# End MODULE pvfs_acl_xattr
################################################
@ -52,7 +53,7 @@ OBJ_FILES = \
pvfs_notify.o \
xattr_system.o \
xattr_tdb.o
PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4
#PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4
PUBLIC_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING
# End MODULE ntvfs_posix
################################################

View File

@ -101,7 +101,7 @@ NTSTATUS pvfs_xattr_unlink_hook(struct pvfs_state *pvfs, const char *fname)
/*
load a NDR structure from a xattr
*/
NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs,
_PUBLIC_ NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs,
TALLOC_CTX *mem_ctx,
const char *fname, int fd, const char *attr_name,
void *p, void *pull_fn)
@ -126,7 +126,7 @@ NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs,
/*
save a NDR structure into a xattr
*/
NTSTATUS pvfs_xattr_ndr_save(struct pvfs_state *pvfs,
_PUBLIC_ NTSTATUS pvfs_xattr_ndr_save(struct pvfs_state *pvfs,
const char *fname, int fd, const char *attr_name,
void *p, void *push_fn)
{

View File

@ -169,7 +169,10 @@ _PUBLIC_ char *smbd_tmp_path(TALLOC_CTX *mem_ctx, const char *name)
static char *modules_path(TALLOC_CTX* mem_ctx, const char *name)
{
return talloc_asprintf(mem_ctx, "%s/%s", lp_modulesdir(), name);
const char *env_moduledir = getenv("LD_SAMBA_MODULE_PATH");
return talloc_asprintf(mem_ctx, "%s/%s",
env_moduledir?env_moduledir:lp_modulesdir(),
name);
}
/**

View File

@ -141,7 +141,8 @@ PUBLIC_DEPENDENCIES = \
SAMDB \
DCERPC_COMMON \
NDR_LSA \
LIBCLI_AUTH
LIBCLI_AUTH \
NDR_DSSETUP
# End MODULE dcerpc_lsa
################################################

View File

@ -38,6 +38,12 @@ else
fi
export TLS_ENABLED
LD_LDB_MODULE_PATH=$OLD_PWD/bin/modules/ldb
export LD_LDB_MODULE_PATH
LD_SAMBA_MODULE_PATH=$OLD_PWD/bin/modules
export LD_SAMBA_MODULE_PATH
LD_LIBRARY_PATH=$OLD_PWD/bin:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

View File

@ -12,7 +12,7 @@ PUBLIC_DEPENDENCIES = \
#######################
# Start SUBSERVICE
[SUBSYSTEM::service]
[LIBRARY::service]
PRIVATE_PROTO_HEADER = service_proto.h
OBJ_FILES = \
service.o \

View File

@ -118,7 +118,7 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx)
return true;
}
struct torture_suite *torture_ntlmssp(TALLOC_CTX *mem_ctx)
_PUBLIC_ struct torture_suite *torture_ntlmssp(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite = torture_suite_create(mem_ctx,
"NTLMSSP");

View File

@ -626,7 +626,7 @@ static bool torture_pac_saved_check(struct torture_context *tctx)
return true;
}
struct torture_suite *torture_pac(TALLOC_CTX *mem_ctx)
_PUBLIC_ struct torture_suite *torture_pac(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite = torture_suite_create(mem_ctx, "PAC");

View File

@ -14,6 +14,7 @@ PUBLIC_DEPENDENCIES = \
[SUBSYSTEM::TORTURE_UTIL]
OBJ_FILES = util.o util_smb.o
PRIVATE_DEPENDENCIES = LIBCLI_RAW
PUBLIC_PROTO_HEADER = util.h
PUBLIC_DEPENDENCIES = POPT_CREDENTIALS
@ -50,7 +51,8 @@ OBJ_FILES = \
basic/properties.o
PUBLIC_DEPENDENCIES = \
LIBCLI_SMB POPT_CREDENTIALS \
TORTURE_UTIL
TORTURE_UTIL LIBCLI_RAW
PRIVATE_DEPENDENCIES = TORTURE_RAW
# End SUBSYSTEM TORTURE_BASIC
#################################
@ -91,6 +93,7 @@ OBJ_FILES = \
PUBLIC_DEPENDENCIES = \
LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE \
POPT_CREDENTIALS
PRIVATE_DEPENDENCIES = TORTURE_UTIL
# End SUBSYSTEM TORTURE_RAW
#################################
@ -152,6 +155,7 @@ PUBLIC_DEPENDENCIES = \
RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP \
RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER WB_HELPER LIBSAMBA-NET \
LIBCLI_AUTH POPT_CREDENTIALS
PRIVATE_DEPENDENCIES = TORTURE_LDAP TORTURE_UTIL TORTURE_RAP
#################################
# Start SUBSYSTEM TORTURE_RAP
@ -162,6 +166,7 @@ PRIVATE_PROTO_HEADER = \
rap/proto.h
OBJ_FILES = \
rap/rap.o
PRIVATE_DEPENDENCIES = TORTURE_UTIL
PUBLIC_DEPENDENCIES = \
LIBCLI_SMB
# End SUBSYSTEM TORTURE_RAP
@ -189,6 +194,7 @@ include local/config.mk
[MODULE::TORTURE_NBENCH]
SUBSYSTEM = torture
INIT_FUNCTION = torture_nbench_init
PRIVATE_DEPENDENCIES = TORTURE_UTIL
PRIVATE_PROTO_HEADER = \
nbench/proto.h
OBJ_FILES = \
@ -232,6 +238,7 @@ OBJ_FILES = \
nbt/nbt.o
PUBLIC_DEPENDENCIES = \
LIBCLI_SMB LIBCLI_NBT LIBCLI_DGRAM LIBCLI_WREPL
PRIVATE_DEPENDENCIES = torture_rpc
# End SUBSYSTEM TORTURE_NBT
#################################
@ -255,6 +262,7 @@ OBJ_FILES = \
PUBLIC_DEPENDENCIES = \
LIBSAMBA-NET \
POPT_CREDENTIALS
PRIVATE_DEPENDENCIES = torture_rpc
# End SUBSYSTEM TORTURE_NET
#################################

View File

@ -39,7 +39,7 @@ NTSTATUS torture_ldap_bind(struct ldap_connection *conn, const char *userdn, con
return status;
}
NTSTATUS torture_ldap_bind_sasl(struct ldap_connection *conn,
_PUBLIC_ NTSTATUS torture_ldap_bind_sasl(struct ldap_connection *conn,
struct cli_credentials *creds)
{
NTSTATUS status;
@ -54,7 +54,7 @@ NTSTATUS torture_ldap_bind_sasl(struct ldap_connection *conn,
}
/* open a ldap connection to a server */
NTSTATUS torture_ldap_connection(TALLOC_CTX *mem_ctx, struct ldap_connection **conn,
_PUBLIC_ NTSTATUS torture_ldap_connection(TALLOC_CTX *mem_ctx, struct ldap_connection **conn,
const char *url)
{
NTSTATUS status;

View File

@ -38,7 +38,9 @@ PUBLIC_DEPENDENCIES = \
registry \
LIBCRYPTO \
POPT_CREDENTIALS \
TORTURE_UI
TORTURE_UI \
TORTURE_AUTH \
TORTURE_UTIL
# End SUBSYSTEM TORTURE_LOCAL
#################################

View File

@ -419,7 +419,7 @@ static BOOL test_netserverenum(struct smbcli_tree *tree)
return True;
}
NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree,
_PUBLIC_ NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
struct rap_WserverGetInfo *r)
{

View File

@ -43,7 +43,7 @@ static BOOL single_search_callback(void *private, union smb_search_data *file)
/*
do a single file (non-wildcard) search
*/
NTSTATUS torture_single_search(struct smbcli_state *cli,
_PUBLIC_ NTSTATUS torture_single_search(struct smbcli_state *cli,
TALLOC_CTX *mem_ctx,
const char *pattern,
enum smb_search_level level,

View File

@ -280,7 +280,7 @@ failed:
}
struct test_join *torture_join_domain(const char *machine_name,
_PUBLIC_ struct test_join *torture_join_domain(const char *machine_name,
uint32_t acct_flags,
struct cli_credentials **machine_credentials)
{
@ -462,7 +462,7 @@ NTSTATUS torture_leave_ads_domain(TALLOC_CTX *mem_ctx, struct libnet_JoinDomain
leave the domain, deleting the machine acct
*/
void torture_leave_domain(struct test_join *join)
_PUBLIC_ void torture_leave_domain(struct test_join *join)
{
struct samr_DeleteUser d;
NTSTATUS status;
@ -491,7 +491,7 @@ void torture_leave_domain(struct test_join *join)
/*
return the dom sid for a test join
*/
const struct dom_sid *torture_join_sid(struct test_join *join)
_PUBLIC_ const struct dom_sid *torture_join_sid(struct test_join *join)
{
return join->dom_sid;
}

View File

@ -462,7 +462,7 @@ NTSTATUS torture_check_ea(struct smbcli_state *cli,
return NT_STATUS_EA_CORRUPT_ERROR;
}
bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
_PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
struct smbcli_state **c,
const char *hostname,
const char *sharename,

View File

@ -31,7 +31,8 @@ PUBLIC_DEPENDENCIES = \
process_model \
RPC_NDR_LSA \
RPC_NDR_SAMR \
PAM_ERRORS
PAM_ERRORS \
LIBCLI_LDAP
# End SUBSYSTEM WINBIND
#######################