--- /dev/null
+/*
+ Unix SMB/CIFS implementation.
+
+ s3 compatibility routines
+
+ Copyright (C) Andrew Tridgell 2010
+
+ 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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "lib/util/talloc_stack.h"
+#include "s3compat.h"
+
+
+_PUBLIC_ const char *s3compat_samba_version_string(void)
+{
+ const char *samba_version_string(void);
+ return samba_version_string();
+}
+
+_PUBLIC_
+void s3compat_test(void)
+{
+ TALLOC_CTX *stack = talloc_stackframe();
+ /* use stdout logging for now */
+ setup_logging("s3compat", true);
+ DEBUG(0,("s3compat: samba_version_string: %s\n",
+ s3compat_samba_version_string()));
+}
--- /dev/null
+/*
+ Unix SMB/CIFS implementation.
+
+ s3 compatibility routines
+
+ Copyright (C) Andrew Tridgell 2010
+
+ 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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "s3compat.h"
+#include "source4/dynconfig/dynconfig.h"
+
+const char *get_dyn_CODEPAGEDIR(void)
+{
+ return "";
+}
+
+const char *get_dyn_MODULESDIR(void)
+{
+ return "";
+}
+
+const char *get_dyn_SHLIBEXT(void)
+{
+ return ".so";
+}
+
+const char *get_dyn_CONFIGFILE(void)
+{
+ return dyn_CONFIGFILE;
+}
+
+const char *get_dyn_LIBDIR(void)
+{
+ return "";
+}
+
+const char *get_dyn_LOGFILEBASE(void)
+{
+ return dyn_LOGFILEBASE;
+}
+
+const char *get_dyn_PRIVATE_DIR(void)
+{
+ return dyn_PRIVATE_DIR;
+}
+
+const char *get_dyn_STATEDIR(void)
+{
+ return "";
+}
+
+const char *get_dyn_PIDDIR(void)
+{
+ return dyn_PIDDIR;
+}
+
+const char *get_dyn_LOCKDIR(void)
+{
+ return dyn_LOCKDIR;
+}
+
+const char *get_dyn_CACHEDIR(void)
+{
+ return "";
+}
+
+const char *get_dyn_SMB_PASSWD_FILE(void)
+{
+ return "";
+}
+
--- /dev/null
+#!/usr/bin/env python
+
+PARAM_WITHOUT_REG_SRC = '''param/loadparm.c param/util.c lib/sharesec.c lib/ldap_debug_handler.c'''
+
+PRIVILEGES_BASIC_SRC = '''lib/privileges_basic.c'''
+
+UTIL_SRC = '''../lib/util/rbtree.c ../lib/util/signal.c ../lib/util/time.c
+ ../lib/util/xfile.c ../lib/util/util_strlist.c
+ ../lib/util/util_file.c ../lib/util/data_blob.c
+ ../lib/util/util.c ../lib/util/fsusage.c
+ ../lib/util/params.c ../lib/util/talloc_stack.c
+ ../lib/util/genrand.c ../lib/util/util_net.c
+ ../lib/util/become_daemon.c ../lib/util/system.c
+ ../lib/util/tevent_unix.c ../lib/util/tevent_ntstatus.c
+ ../lib/util/smb_threads.c ../lib/util/util_id.c
+ ../lib/util/blocking.c ../lib/util/rfc1738.c '''
+
+CRYPTO_SRC = '''../lib/crypto/crc32.c ../lib/crypto/md5.c
+ ../lib/crypto/hmacmd5.c ../lib/crypto/arcfour.c
+ ../lib/crypto/md4.c
+ ../lib/crypto/sha256.c ../lib/crypto/hmacsha256.c
+ ../lib/crypto/aes.c ../lib/crypto/rijndael-alg-fst.c'''
+
+TDB_LIB_SRC = '''lib/util_tdb.c ../lib/util/util_tdb.c
+ lib/dbwrap.c lib/dbwrap_tdb.c
+ lib/dbwrap_ctdb.c
+ lib/g_lock.c
+ lib/dbwrap_rbt.c'''
+
+TDB_VALIDATE_SRC = '''lib/tdb_validate.c'''
+
+VERSION_SRC = '''lib/version.c'''
+
+UTIL_REG_SRC = '''lib/util_reg.c'''
+UTIL_REG_API_SRC = '''lib/util_reg_api.c'''
+
+LIBNDR_SRC = '''../librpc/ndr/ndr_basic.c
+ ../librpc/ndr/ndr.c
+ ../librpc/ndr/ndr_misc.c
+ ../librpc/gen_ndr/ndr_misc.c
+ ../librpc/gen_ndr/ndr_security.c
+ ../librpc/ndr/ndr_sec_helper.c
+ librpc/ndr/ndr_string.c
+ ../librpc/ndr/uuid.c
+ librpc/ndr/util.c
+ ../librpc/gen_ndr/ndr_dcerpc.c'''
+
+S3_SMBCONF_SRC = '''lib/smbconf/smbconf_init.c lib/smbconf/smbconf_reg.c'''
+
+REGFIO_SRC = '''registry/regfio.c'''
+
+REGSRCS_SRC = '''registry/reg_objects.c'''
+
+REG_BACKENDS_BASE_SRC = '''registry/reg_backend_db.c'''
+
+REG_BACKENDS_SMBCONF_SRC = '''registry/reg_backend_smbconf.c'''
+
+REG_BACKENDS_EXTRA_SRC = '''registry/reg_backend_printing.c
+ registry/reg_backend_shares.c
+ registry/reg_backend_netlogon_params.c
+ registry/reg_backend_prod_options.c
+ registry/reg_backend_tcpip_params.c
+ registry/reg_backend_hkpt_params.c
+ registry/reg_backend_current_version.c
+ registry/reg_backend_perflib.c'''
+
+REG_INIT_BASIC_SRC = '''registry/reg_init_basic.c'''
+REG_INIT_SMBCONF_SRC = '''registry/reg_init_smbconf.c'''
+REG_INIT_FULL_SRC = '''registry/reg_init_full.c'''
+
+RPC_PARSE_SRC0 = '''rpc_parse/parse_prs.c rpc_parse/parse_misc.c'''
+
+# this includes only the low level parse code, not stuff
+# that requires knowledge of security contexts
+RPC_PARSE_SRC1 = '''${RPC_PARSE_SRC0}'''
+
+RPC_PARSE_SRC2 = '''rpc_parse/parse_rpc.c
+ rpc_client/init_netlogon.c
+ rpc_client/init_lsa.c'''
+
+RPC_PARSE_SRC = '''${RPC_PARSE_SRC2}'''
+
+REG_BASE_SRC = '''registry/reg_api.c
+ registry/reg_dispatcher.c
+ registry/reg_cachehook.c
+ ${REGFIO_SRC}
+ ${REGSRCS_SRC}
+ registry/reg_util.c
+ ${UTIL_REG_API_SRC}
+ lib/util_nttoken.c
+ ${REG_BACKENDS_BASE_SRC}
+ ${REG_INIT_BASIC_SRC}'''
+
+NTERR_SRC = '''libsmb/nterr.c libsmb/smberr.c'''
+DOSERR_SRC = '../libcli/util/doserr.c'
+ERRORMAP_SRC = 'libsmb/errormap.c'
+DCE_RPC_ERR_SRC = '../librpc/rpc/dcerpc_error.c'
+
+SECRETS_SRC = '''passdb/secrets.c passdb/machine_sid.c
+ librpc/gen_ndr/ndr_secrets.c'''
+
+LIBSMB_ERR_SRC0 = '''${NTERR_SRC} ${ERRORMAP_SRC} ${DCE_RPC_ERR_SRC}'''
+
+LIBSMB_ERR_SRC1 = '''../libcli/auth/smbdes.c ../libcli/auth/smbencrypt.c ../libcli/auth/msrpc_parse.c ../libcli/auth/session.c'''
+
+LIBSMB_ERR_SRC = '''${LIBSMB_ERR_SRC0} ${LIBSMB_ERR_SRC1}
+ ${RPC_PARSE_SRC1}
+ ${SECRETS_SRC}'''
+
+LIB_SRC = '''
+ lib/messages.c lib/debug.c librpc/gen_ndr/ndr_messaging.c lib/messages_local.c
+ lib/messages_ctdbd.c lib/packet.c lib/ctdbd_conn.c
+ lib/interfaces.c lib/memcache.c
+ lib/talloc_dict.c
+ lib/serverid.c
+ lib/util_transfer_file.c ../lib/async_req/async_sock.c
+ ${TDB_LIB_SRC}
+ ${VERSION_SRC} lib/charcnv.c lib/fault.c
+ lib/interface.c lib/pidfile.c
+ lib/system.c lib/sendfile.c lib/recvfile.c lib/time.c
+ lib/username.c
+ ../libds/common/flag_mapping.c
+ lib/util_pw.c lib/access.c lib/smbrun.c
+ lib/bitmap.c lib/dprintf.c ${UTIL_REG_SRC}
+ lib/wins_srv.c
+ lib/util_str.c lib/clobber.c lib/util_sid.c lib/util_uuid.c
+ lib/util_unistr.c lib/util_file.c
+ lib/util.c lib/util_sock.c lib/sock_exec.c lib/util_sec.c
+ lib/substitute.c lib/dbwrap_util.c
+ lib/ms_fnmatch.c lib/select.c lib/errmap_unix.c
+ lib/tallocmsg.c lib/dmallocmsg.c
+ libsmb/clisigning.c libsmb/smb_signing.c
+ lib/iconv.c lib/pam_errors.c intl/lang_tdb.c
+ lib/conn_tdb.c lib/adt_tree.c lib/gencache.c
+ lib/sessionid_tdb.c
+ lib/module.c lib/events.c
+ lib/ldap_escape.c
+ lib/secdesc.c lib/util_seaccess.c
+ lib/fncall.c
+ libads/krb5_errs.c lib/system_smbd.c lib/audit.c
+ lib/file_id.c lib/idmap_cache.c
+ ${PRIVILEGES_BASIC_SRC}
+ librpc/ndr/util.c
+ ${S3_SMBCONF_SRC}
+ ${REG_BASE_SRC}
+ ${RPC_PARSE_SRC}
+ ${LIBSMB_ERR_SRC}
+ ${REG_INIT_SMBCONF_SRC}
+ ${REG_BACKENDS_SMBCONF_SRC}
+ '''
+
+LIB_SRC = bld.EXPAND_VARIABLES(LIB_SRC, vars=locals())
+
+SAMBA3_INCLUDES = '#source4/s3compat/compat #source4/dynconfig #source3 #source3/lib #source3/include #lib/replace #lib/talloc #source3/libaddns #source3/librpc #source3/build'
+
+bld.SAMBA_SUBSYSTEM('s3_lib',
+ bld.SUBDIR('../../source3', LIB_SRC),
+ includes=SAMBA3_INCLUDES,
+ deps='talloc tevent tdb',
+ hide_symbols=True)
+
+bld.SAMBA_SUBSYSTEM('s3_loadparm',
+ bld.SUBDIR('../../source3', PARAM_WITHOUT_REG_SRC),
+ includes=SAMBA3_INCLUDES,
+ deps='talloc tevent tdb',
+ hide_symbols=True)
+
+bld.SAMBA_SUBSYSTEM('s3_lib_dummy',
+ bld.SUBDIR('../../source3/lib', 'dummysmbd.c dummyroot.c'),
+ includes=SAMBA3_INCLUDES,
+ deps='talloc tevent tdb',
+ hide_symbols=True)
+
+bld.SAMBA_SUBSYSTEM('s3compat_wrapper',
+ source='s3compat.c',
+ hide_symbols=True)
+
+bld.SAMBA_SUBSYSTEM('s3replace',
+ source='s3replace.c',
+ includes=SAMBA3_INCLUDES,
+ deps='talloc tevent tdb',
+ hide_symbols=True)
+
+bld.SAMBA_SUBSYSTEM('s3dynconfig',
+ source='s3dynconfig.c',
+ hide_symbols=True)
+
+bld.SAMBA_LIBRARY('s3compat',
+ source='s3compat.c',
+ autoproto='s3replace.h',
+ deps='s3replace s3dynconfig s3_lib s3_lib_dummy s3_loadparm LIBSMBCONF LIBSECURITY_COMMON LIBCRYPTO LIBSAMBA-UTIL',
+ hide_symbols=True)