Merge commit 'origin/v3-2-test' into v3-2-stable
authorKarolin Seeger <kseeger@samba.org>
Fri, 29 Feb 2008 09:44:38 +0000 (10:44 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 29 Feb 2008 09:44:38 +0000 (10:44 +0100)
Conflicts:

WHATSNEW.txt
(This used to be commit a390bcf9403df4cf4d5eef42b35ebccbe253882e)

501 files changed:
.gitignore
PFIF.txt [new file with mode: 0644]
README
WHATSNEW.txt
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
examples/libsmbclient/Makefile
examples/libsmbclient/get_auth_data_fn.h
examples/libsmbclient/smbwrapper/select.c
examples/libsmbclient/testacl3.c [new file with mode: 0644]
examples/libsmbclient/testread.c
examples/libsmbclient/teststat3.c [new file with mode: 0644]
examples/libsmbclient/testtruncate.c [new file with mode: 0644]
examples/libsmbclient/testwrite.c [new file with mode: 0644]
examples/misc/adssearch.pl
examples/scripts/mount/mount.smbfs [new file with mode: 0644]
source3/Makefile.in
source3/auth/auth.c
source3/auth/auth_domain.c
source3/auth/auth_ntlmssp.c
source3/auth/auth_sam.c
source3/auth/auth_util.c
source3/auth/auth_winbind.c
source3/client/cifs.spnego.c
source3/client/client.c
source3/client/clitar.c
source3/client/mount.cifs.c
source3/client/smbmnt.c [deleted file]
source3/client/smbmount.c [deleted file]
source3/client/smbumount.c [deleted file]
source3/configure.in
source3/dynconfig.c
source3/exports/libtalloc.syms [new file with mode: 0644]
source3/include/MacExtensions.h
source3/include/ads.h
source3/include/async_req.h [new file with mode: 0644]
source3/include/async_smb.h [new file with mode: 0644]
source3/include/authdata.h
source3/include/byteorder.h
source3/include/client.h
source3/include/ctdbd_conn.h
source3/include/dbwrap.h
source3/include/debug.h
source3/include/doserr.h
source3/include/dynconfig.h
source3/include/includes.h
source3/include/libsmb_internal.h
source3/include/libsmbclient.h
source3/include/messages.h
source3/include/ntdomain.h
source3/include/passdb.h
source3/include/reg_objects.h
source3/include/rpc_brs.h [deleted file]
source3/include/rpc_client.h
source3/include/rpc_dce.h
source3/include/rpc_ds.h [deleted file]
source3/include/rpc_eventlog.h
source3/include/rpc_lsa.h
source3/include/rpc_netlogon.h
source3/include/rpc_ntsvcs.h
source3/include/rpc_samr.h [deleted file]
source3/include/rpc_svcctl.h
source3/include/smb.h
source3/include/smb_macros.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/intl/lang_tdb.c
source3/lib/afs.c
source3/lib/afs_settoken.c
source3/lib/async_req.c [new file with mode: 0644]
source3/lib/charcnv.c
source3/lib/conn_tdb.c
source3/lib/ctdbd_conn.c
source3/lib/data_blob.c
source3/lib/dbwrap.c
source3/lib/dbwrap_ctdb.c
source3/lib/dbwrap_file.c
source3/lib/dbwrap_tdb.c
source3/lib/dbwrap_util.c [new file with mode: 0644]
source3/lib/debug.c
source3/lib/display_dsdcinfo.c [deleted file]
source3/lib/dprintf.c
source3/lib/errmap_unix.c
source3/lib/fault.c
source3/lib/gencache.c
source3/lib/interfaces.c
source3/lib/ldap_debug_handler.c [new file with mode: 0644]
source3/lib/messages_ctdbd.c
source3/lib/netapi/examples/Makefile.in
source3/lib/netapi/examples/getdc/getdc.c
source3/lib/netapi/examples/getjoinableous/getjoinableous.c [new file with mode: 0644]
source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
source3/lib/netapi/getdc.c
source3/lib/netapi/joindomain.c
source3/lib/netapi/netapi.c
source3/lib/netapi/netapi.h
source3/lib/netapi/serverinfo.c
source3/lib/popt_common.c
source3/lib/privileges_basic.c
source3/lib/repdir.c [deleted file]
source3/lib/replace/Makefile.in
source3/lib/replace/README
source3/lib/replace/configure.ac
source3/lib/replace/dlfcn.c
source3/lib/replace/getifaddrs.c [new file with mode: 0644]
source3/lib/replace/getifaddrs.m4 [new file with mode: 0644]
source3/lib/replace/getpass.c
source3/lib/replace/getpass.m4
source3/lib/replace/libreplace.m4
source3/lib/replace/libreplace_cc.m4
source3/lib/replace/libreplace_ld.m4
source3/lib/replace/libreplace_macros.m4
source3/lib/replace/replace.h
source3/lib/replace/socket.c [new file with mode: 0644]
source3/lib/replace/socket.m4 [new file with mode: 0644]
source3/lib/replace/system/config.m4
source3/lib/replace/system/network.h
source3/lib/replace/system/printing.h [deleted file]
source3/lib/replace/test/getifaddrs.c [new file with mode: 0644]
source3/lib/replace/test/testsuite.c
source3/lib/select.c
source3/lib/smbldap.c
source3/lib/sock_exec.c
source3/lib/system.c
source3/lib/system_smbd.c
source3/lib/talloc/Makefile.in
source3/lib/talloc/config.mk
source3/lib/talloc/configure.ac
source3/lib/talloc/rules.mk [new file with mode: 0644]
source3/lib/talloc/talloc.i [moved from source3/torture/samtest.h with 63% similarity]
source3/lib/talloc/talloc.mk [new file with mode: 0644]
source3/lib/tdb/Makefile.in
source3/lib/tdb/common/freelist.c
source3/lib/tdb/common/open.c
source3/lib/tdb/common/tdb.c
source3/lib/tdb/common/tdb_private.h
source3/lib/tdb/common/transaction.c
source3/lib/tdb/config.mk
source3/lib/tdb/configure.ac
source3/lib/util.c
source3/lib/util_reg.c
source3/lib/util_sid.c
source3/lib/util_sock.c
source3/lib/util_str.c
source3/lib/util_tdb.c
source3/lib/version.c
source3/lib/xfile.c
source3/libads/ads_struct.c
source3/libads/authdata.c
source3/libads/kerberos.c
source3/libads/kerberos_verify.c
source3/libads/ldap.c
source3/libads/ndr.c [new file with mode: 0644]
source3/libgpo/gpo_ldap.c
source3/libnet/libnet_conf.c
source3/libnet/libnet_join.c
source3/library-versions.in
source3/librpc/gen_ndr/cli_dfs.c
source3/librpc/gen_ndr/cli_dfs.h
source3/librpc/gen_ndr/cli_dssetup.c [new file with mode: 0644]
source3/librpc/gen_ndr/cli_dssetup.h [new file with mode: 0644]
source3/librpc/gen_ndr/cli_eventlog.c
source3/librpc/gen_ndr/cli_eventlog.h
source3/librpc/gen_ndr/cli_lsa.c
source3/librpc/gen_ndr/cli_lsa.h
source3/librpc/gen_ndr/cli_netlogon.c
source3/librpc/gen_ndr/cli_netlogon.h
source3/librpc/gen_ndr/cli_ntsvcs.c [new file with mode: 0644]
source3/librpc/gen_ndr/cli_ntsvcs.h [new file with mode: 0644]
source3/librpc/gen_ndr/cli_samr.c [new file with mode: 0644]
source3/librpc/gen_ndr/cli_samr.h [new file with mode: 0644]
source3/librpc/gen_ndr/cli_svcctl.c
source3/librpc/gen_ndr/cli_svcctl.h
source3/librpc/gen_ndr/cli_unixinfo.c [deleted file]
source3/librpc/gen_ndr/cli_unixinfo.h [deleted file]
source3/librpc/gen_ndr/cli_wkssvc.c
source3/librpc/gen_ndr/dfs.h
source3/librpc/gen_ndr/dssetup.h [new file with mode: 0644]
source3/librpc/gen_ndr/eventlog.h
source3/librpc/gen_ndr/initshutdown.h
source3/librpc/gen_ndr/krb5pac.h [new file with mode: 0644]
source3/librpc/gen_ndr/libnet_join.h
source3/librpc/gen_ndr/lsa.h
source3/librpc/gen_ndr/misc.h [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_dfs.c
source3/librpc/gen_ndr/ndr_dfs.h
source3/librpc/gen_ndr/ndr_dssetup.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_dssetup.h [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_echo.c
source3/librpc/gen_ndr/ndr_echo.h
source3/librpc/gen_ndr/ndr_epmapper.c
source3/librpc/gen_ndr/ndr_eventlog.c
source3/librpc/gen_ndr/ndr_krb5pac.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_krb5pac.h [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_libnet_join.c
source3/librpc/gen_ndr/ndr_libnet_join.h
source3/librpc/gen_ndr/ndr_lsa.c
source3/librpc/gen_ndr/ndr_lsa.h
source3/librpc/gen_ndr/ndr_messaging.c
source3/librpc/gen_ndr/ndr_misc.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_misc.h
source3/librpc/gen_ndr/ndr_netlogon.c
source3/librpc/gen_ndr/ndr_netlogon.h
source3/librpc/gen_ndr/ndr_notify.c
source3/librpc/gen_ndr/ndr_ntsvcs.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_ntsvcs.h [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_samr.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_samr.h [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_security.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_security.h
source3/librpc/gen_ndr/ndr_srvsvc.c
source3/librpc/gen_ndr/ndr_svcctl.c
source3/librpc/gen_ndr/ndr_unixinfo.c [deleted file]
source3/librpc/gen_ndr/ndr_unixinfo.h [deleted file]
source3/librpc/gen_ndr/ndr_winreg.c
source3/librpc/gen_ndr/ndr_wkssvc.c
source3/librpc/gen_ndr/ndr_xattr.c
source3/librpc/gen_ndr/netlogon.h
source3/librpc/gen_ndr/ntsvcs.h [new file with mode: 0644]
source3/librpc/gen_ndr/samr.h [new file with mode: 0644]
source3/librpc/gen_ndr/security.h
source3/librpc/gen_ndr/srv_dfs.c
source3/librpc/gen_ndr/srv_dssetup.c [new file with mode: 0644]
source3/librpc/gen_ndr/srv_dssetup.h [new file with mode: 0644]
source3/librpc/gen_ndr/srv_echo.c
source3/librpc/gen_ndr/srv_epmapper.c
source3/librpc/gen_ndr/srv_eventlog.c
source3/librpc/gen_ndr/srv_initshutdown.c
source3/librpc/gen_ndr/srv_lsa.c
source3/librpc/gen_ndr/srv_lsa.h
source3/librpc/gen_ndr/srv_netlogon.c
source3/librpc/gen_ndr/srv_netlogon.h
source3/librpc/gen_ndr/srv_ntsvcs.c [new file with mode: 0644]
source3/librpc/gen_ndr/srv_ntsvcs.h [new file with mode: 0644]
source3/librpc/gen_ndr/srv_samr.c [new file with mode: 0644]
source3/librpc/gen_ndr/srv_samr.h [new file with mode: 0644]
source3/librpc/gen_ndr/srv_srvsvc.c
source3/librpc/gen_ndr/srv_svcctl.c
source3/librpc/gen_ndr/srv_unixinfo.c [deleted file]
source3/librpc/gen_ndr/srv_unixinfo.h [deleted file]
source3/librpc/gen_ndr/srv_winreg.c
source3/librpc/gen_ndr/srv_wkssvc.c
source3/librpc/gen_ndr/srvsvc.h
source3/librpc/gen_ndr/svcctl.h
source3/librpc/gen_ndr/unixinfo.h [deleted file]
source3/librpc/gen_ndr/winreg.h
source3/librpc/gen_ndr/wkssvc.h
source3/librpc/idl/dfs.idl
source3/librpc/idl/dssetup.idl [new file with mode: 0644]
source3/librpc/idl/echo.idl
source3/librpc/idl/eventlog.idl
source3/librpc/idl/initshutdown.idl
source3/librpc/idl/krb5pac.idl [new file with mode: 0644]
source3/librpc/idl/libnet_join.idl
source3/librpc/idl/lsa.idl
source3/librpc/idl/misc.idl
source3/librpc/idl/netlogon.idl
source3/librpc/idl/ntsvcs.idl
source3/librpc/idl/samr.idl
source3/librpc/idl/security.idl
source3/librpc/idl/spoolss.idl
source3/librpc/idl/srvsvc.idl
source3/librpc/idl/svcctl.idl
source3/librpc/idl/unixinfo.idl [deleted file]
source3/librpc/idl/winreg.idl
source3/librpc/idl/wkssvc.idl
source3/librpc/ndr/libndr.h
source3/librpc/ndr/misc.h [deleted file]
source3/librpc/ndr/ndr.c
source3/librpc/ndr/ndr_basic.c
source3/librpc/ndr/ndr_krb5pac.c [new file with mode: 0644]
source3/librpc/ndr/ndr_misc.c
source3/librpc/ndr/ndr_sec_helper.c
source3/librpc/ndr/ndr_string.c
source3/librpc/ndr/security.h [deleted file]
source3/librpc/ndr/sid.c
source3/libsmb/async_smb.c [new file with mode: 0644]
source3/libsmb/cliconnect.c
source3/libsmb/clientgen.c
source3/libsmb/clierror.c
source3/libsmb/clifile.c
source3/libsmb/clifsinfo.c
source3/libsmb/clikrb5.c
source3/libsmb/clilist.c
source3/libsmb/clirap.c
source3/libsmb/clireadwrite.c
source3/libsmb/clispnego.c
source3/libsmb/credentials.c
source3/libsmb/doserr.c
source3/libsmb/dsgetdcname.c
source3/libsmb/libsmb_compat.c
source3/libsmb/libsmbclient.c
source3/libsmb/namequery.c
source3/libsmb/ntlmssp_parse.c
source3/libsmb/samlogon_cache.c
source3/libsmb/smb_seal.c
source3/libsmb/smb_signing.c
source3/libsmb/trusts_util.c
source3/locking/brlock.c
source3/m4/aclocal.m4
source3/m4/check_gnu_make.m4 [deleted file]
source3/m4/check_path.m4 [new file with mode: 0644]
source3/m4/cond.m4 [deleted file]
source3/m4/depend.m4 [deleted file]
source3/m4/depout.m4 [deleted file]
source3/m4/lead-dot.m4 [deleted file]
source3/m4/make.m4 [deleted file]
source3/m4/samba_version.m4 [new file with mode: 0644]
source3/m4/substnot.m4 [deleted file]
source3/m4/swat.m4 [new file with mode: 0644]
source3/modules/gpfs.c
source3/modules/nfs4_acls.c
source3/modules/vfs_aio_fork.c [new file with mode: 0644]
source3/modules/vfs_default.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_gpfs.h [new file with mode: 0644]
source3/modules/vfs_hpuxacl.c
source3/modules/vfs_prealloc.c
source3/modules/vfs_recycle.c
source3/modules/vfs_shadow_copy2.c [new file with mode: 0644]
source3/modules/vfs_streams_depot.c [new file with mode: 0644]
source3/modules/vfs_streams_xattr.c [new file with mode: 0644]
source3/modules/vfs_tsmsm.c [new file with mode: 0644]
source3/modules/vfs_xattr_tdb.c
source3/nmbd/asyncdns.c
source3/nmbd/nmbd.c
source3/nmbd/nmbd_processlogon.c
source3/nmbd/nmbd_synclists.c
source3/nsswitch/libwbclient/wbc_pam.c
source3/nsswitch/libwbclient/wbc_pwd.c
source3/nsswitch/libwbclient/wbc_sid.c
source3/nsswitch/libwbclient/wbclient.c
source3/nsswitch/libwbclient/wbclient.h
source3/nsswitch/pam_winbind.c
source3/nsswitch/pam_winbind.h
source3/nsswitch/wb_common.c
source3/nsswitch/wbinfo.c
source3/nsswitch/winbind_client.h
source3/nsswitch/winbind_krb5_locator.c
source3/nsswitch/winbind_struct_protocol.h
source3/nsswitch/wins.c
source3/pam_smbpass/pam_smb_acct.c
source3/pam_smbpass/pam_smb_passwd.c
source3/param/loadparm.c
source3/passdb/lookup_sid.c
source3/passdb/machine_sid.c
source3/passdb/passdb.c
source3/passdb/pdb_get_set.c
source3/passdb/pdb_interface.c
source3/passdb/pdb_ldap.c
source3/passdb/pdb_smbpasswd.c
source3/passdb/secrets.c
source3/printing/load.c
source3/printing/lpq_parse.c
source3/printing/nt_printing.c
source3/printing/print_aix.c
source3/printing/print_generic.c
source3/printing/printing.c
source3/registry/reg_api.c
source3/registry/reg_backend_current_version.c [new file with mode: 0644]
source3/registry/reg_backend_db.c [moved from source3/registry/reg_db.c with 98% similarity]
source3/registry/reg_backend_hkpt_params.c [new file with mode: 0644]
source3/registry/reg_backend_netlogon_params.c [new file with mode: 0644]
source3/registry/reg_backend_perflib.c [new file with mode: 0644]
source3/registry/reg_backend_printing.c [moved from source3/registry/reg_printing.c with 99% similarity]
source3/registry/reg_backend_prod_options.c [new file with mode: 0644]
source3/registry/reg_backend_shares.c [moved from source3/registry/reg_shares.c with 96% similarity]
source3/registry/reg_backend_smbconf.c [moved from source3/registry/reg_smbconf.c with 96% similarity]
source3/registry/reg_backend_tcpip_params.c [new file with mode: 0644]
source3/registry/reg_cachehook.c
source3/registry/reg_dispatcher.c [moved from source3/registry/reg_frontend_hilvl.c with 82% similarity]
source3/registry/reg_dynamic.c [deleted file]
source3/registry/reg_frontend.c [deleted file]
source3/registry/reg_init_full.c [new file with mode: 0644]
source3/registry/reg_init_smbconf.c [moved from source3/lib/util_reg_smbconf.c with 96% similarity]
source3/registry/reg_util_legacy.c [new file with mode: 0644]
source3/registry/regfio.c
source3/rpc_client/cli_ds.c [deleted file]
source3/rpc_client/cli_lsarpc.c
source3/rpc_client/cli_netlogon.c
source3/rpc_client/cli_pipe.c
source3/rpc_client/cli_samr.c
source3/rpc_client/cli_svcctl.c
source3/rpc_client/init_lsa.c [new file with mode: 0644]
source3/rpc_client/init_netlogon.c [new file with mode: 0644]
source3/rpc_client/init_samr.c [new file with mode: 0644]
source3/rpc_parse/parse_ds.c [deleted file]
source3/rpc_parse/parse_eventlog.c
source3/rpc_parse/parse_lsa.c [deleted file]
source3/rpc_parse/parse_misc.c
source3/rpc_parse/parse_net.c [deleted file]
source3/rpc_parse/parse_ntsvcs.c
source3/rpc_parse/parse_samr.c [deleted file]
source3/rpc_parse/parse_sec.c
source3/rpc_parse/parse_svcctl.c
source3/rpc_server/srv_dssetup_nt.c [new file with mode: 0644]
source3/rpc_server/srv_eventlog.c
source3/rpc_server/srv_eventlog_lib.c
source3/rpc_server/srv_eventlog_nt.c
source3/rpc_server/srv_lsa.c [deleted file]
source3/rpc_server/srv_lsa_ds.c [deleted file]
source3/rpc_server/srv_lsa_ds_nt.c [deleted file]
source3/rpc_server/srv_lsa_nt.c
source3/rpc_server/srv_netlog.c [deleted file]
source3/rpc_server/srv_netlog_nt.c
source3/rpc_server/srv_ntsvcs.c
source3/rpc_server/srv_ntsvcs_nt.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_samr.c [deleted file]
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_samr_util.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpc_server/srv_svcctl.c
source3/rpc_server/srv_svcctl_nt.c
source3/rpc_server/srv_winreg_nt.c
source3/rpc_server/srv_wkssvc_nt.c
source3/rpcclient/cmd_ds.c [deleted file]
source3/rpcclient/cmd_dssetup.c [new file with mode: 0644]
source3/rpcclient/cmd_lsarpc.c
source3/rpcclient/cmd_netlogon.c
source3/rpcclient/cmd_ntsvcs.c [new file with mode: 0644]
source3/rpcclient/cmd_samr.c
source3/rpcclient/cmd_spoolss.c
source3/rpcclient/rpcclient.c
source3/script/build_idl.sh
source3/script/installbin.sh.in
source3/script/installman.sh
source3/script/mkproto.sh
source3/script/mksyms.awk [new file with mode: 0644]
source3/script/mksyms.sh [new file with mode: 0755]
source3/script/tests/selftest.sh
source3/script/tests/test_ntlm_auth_s3.sh [new file with mode: 0755]
source3/script/tests/test_posix_s3.sh
source3/script/tests/tests_all.sh
source3/script/uninstallbin.sh.in
source3/services/services_db.c
source3/smbd/aio.c
source3/smbd/chgpasswd.c
source3/smbd/close.c
source3/smbd/connection.c
source3/smbd/dmapi.c
source3/smbd/dosmode.c
source3/smbd/filename.c
source3/smbd/lanman.c
source3/smbd/map_username.c
source3/smbd/msdfs.c
source3/smbd/notify_inotify.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/oplock_irix.c
source3/smbd/oplock_linux.c
source3/smbd/password.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/seal.c
source3/smbd/server.c
source3/smbd/service.c
source3/smbd/sesssetup.c
source3/smbd/trans2.c
source3/smbd/utmp.c
source3/tests/os2_delete.c [deleted file]
source3/tests/shared_mmap.c [deleted file]
source3/torture/cmd_vfs.c
source3/torture/smbiconv.c
source3/torture/test_ntlm_auth.py [new file with mode: 0755]
source3/torture/torture.c
source3/utils/net_ads.c
source3/utils/net_dom.c
source3/utils/net_domain.c [deleted file]
source3/utils/net_lookup.c
source3/utils/net_rpc.c
source3/utils/net_rpc_audit.c
source3/utils/net_rpc_join.c
source3/utils/net_rpc_rights.c
source3/utils/net_rpc_samsync.c
source3/utils/net_rpc_service.c
source3/utils/net_rpc_sh_acct.c
source3/utils/ntlm_auth.c
source3/utils/smbcontrol.c
source3/utils/smbfilter.c
source3/web/cgi.c
source3/web/neg_lang.c
source3/winbindd/idmap_nss.c
source3/winbindd/idmap_tdb2.c [new file with mode: 0644]
source3/winbindd/winbindd.c
source3/winbindd/winbindd.h
source3/winbindd/winbindd_ads.c
source3/winbindd/winbindd_async.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_creds.c
source3/winbindd/winbindd_dual.c
source3/winbindd/winbindd_locator.c
source3/winbindd/winbindd_misc.c
source3/winbindd/winbindd_ndr.c [new file with mode: 0644]
source3/winbindd/winbindd_pam.c
source3/winbindd/winbindd_passdb.c
source3/winbindd/winbindd_reconnect.c
source3/winbindd/winbindd_rpc.c
source3/winbindd/winbindd_util.c

index f11de0883839937534256b21aaca9b92879449ad..516fd45fe904f0826c73867435a7dae20337c7ac 100644 (file)
@@ -1,6 +1,7 @@
 *.o
 *.po
 *~
+source/TAGS
 source/client/client_proto.h
 source/libnet/libnet_proto.h
 source/include/build_env.h
@@ -45,3 +46,19 @@ examples/VFS/module_config.h.in
 examples/VFS/shadow_copy_test.so
 examples/VFS/skel_opaque.so
 examples/VFS/skel_transparent.so
+examples/libsmbclient/smbwrapper/smbsh
+examples/libsmbclient/smbwrapper/smbwrapper.so
+examples/libsmbclient/testacl
+examples/libsmbclient/testacl2
+examples/libsmbclient/testacl3
+examples/libsmbclient/testbrowse
+examples/libsmbclient/testbrowse2
+examples/libsmbclient/testchmod
+examples/libsmbclient/testread
+examples/libsmbclient/testsmbc
+examples/libsmbclient/teststat
+examples/libsmbclient/teststat2
+examples/libsmbclient/teststat3
+examples/libsmbclient/testutime
+examples/libsmbclient/testwrite
+examples/libsmbclient/testtruncate
diff --git a/PFIF.txt b/PFIF.txt
new file mode 100644 (file)
index 0000000..09f1458
--- /dev/null
+++ b/PFIF.txt
@@ -0,0 +1,7 @@
+This code was developed in participation with the Protocol Freedom
+Information Foundation.
+
+Please see 
+  http://protocolfreedom.org/ and
+  http://samba.org/samba/PFIF/ 
+for more details.
diff --git a/README b/README
index 1d55a1040ca150b1e51eb8ca44fe1995956171b3..e6634febc0ea08a3551dc0ba3b170a98fb7b7064 100644 (file)
--- a/README
+++ b/README
@@ -102,16 +102,16 @@ for more details) and are always glad to receive feedback or
 suggestions to the address samba@lists.samba.org.  More information
 on the various Samba mailing lists can be found at http://lists.samba.org/.
 
-You can also get the Samba sourcecode straight from the Subversion tree - see
-http://samba.org/samba/subversion.html.
+You can also get the Samba sourcecode straight from the git repository - see
+http://wiki.samba.org/index.php/Using_Git_for_Samba_Development.
 
 You could also send hardware/software/money/jewelry or pre-paid pizza
 vouchers directly to Andrew. The pizza vouchers would be especially
 welcome, in fact there is a special field in the survey for people who
 have paid up their pizza :-)
 
-If you like a particular feature then look through the Subversion change-log
-(on the web at http://websvn.samba.org/cgi-bin/viewcvs.cgi) and see
+If you like a particular feature then look through the git change-log
+(on the web at http://gitweb.samba.org/?p=samba.git;a=summary) and see
 who added it, then send them an email.
 
 Remember that free software of this kind lives or dies by the response
index 253fe260ded46f1118ee5c694b2b202ce2af33cd..2ac227d141ffcb696d58d92e94b637bdf7c1c658 100644 (file)
@@ -1,6 +1,6 @@
                    =================================
                    Release Notes for Samba 3.2.0pre2
-                               Jan 16, 2008
+                               Feb 29, 2008
                    =================================
 
 This is the second preview release of Samba 3.2.0.  This is *not*
@@ -22,18 +22,19 @@ Major enhancements in Samba 3.2.0 include:
   o Introduction of a registry based configuration system.
   o Improved CIFS Unix Extensions support.
   o Experimental support for file serving clusters.
-  o Support for IPv6 connections.
-
+  o Support for IPv6 in the server, and client tools and libraries.
+  o Support for storing alternate data streams in xattrs.
+  o Encrypted SMB transport in client tools and libraries, and server.
 
   Winbind and Active Directory Integration:
   o Full support for Windows 2003 cross-forest, transitive trusts
-    and one-way domain trusts
+    and one-way domain trusts.
   o Support for userPrincipalName logons via pam_winbind and NSS
     lookups.
   o Support in pam_winbind for logging on using the userPrincipalName.
   o Expansion of nested domain groups via NSS calls.
   o Support for Active Directory LDAP Signing policy.
-  o New LGPL Winbind client library (libwbclient.so)
+  o New LGPL Winbind client library (libwbclient.so).
 
 
   Users & Groups:
@@ -74,13 +75,12 @@ to the "Changes" section for details on the exact parameters that were
 updated.
 
 
-
 Registry Configuration Backend
 ==============================
 
 Samba is now able to use a registry based configuration backed to
 supplement smb.conf setting.  This feature may be enabled by setting
-"include = registry" and "registry shares = yes" in the [global]
+"config backend = registry" and "registry shares = yes" in the [global]
 section of smb.conf and may be managed using the "net conf" command.
 
 More information may be obtained from the smb.conf(5) and net(8) man
@@ -93,6 +93,11 @@ Removed Features
 Both the Python bindings and the libmsrpc shared library have been
 removed from the tree due to lack of an official maintainer.
 
+As smbfs is no longer supported in current kernel versions, smbmount has
+been removed in this Samba version. Please use cifs (mount.cifs) instead.
+See examples/scripts/mount/mount.smbfs as an example for a wrapper which
+calls mount.cifs instead of smbmount/mount.smbfs.
+
 
 
 ######################################################################
@@ -109,16 +114,20 @@ smb.conf changes
     client plaintext auth              Changed Default No
     clustering                         New             No
     cluster addresses                  New             ""
-    debug class                         New             No
+    config backend                     New             file
     ctdb socket                                New             ""
+    debug class                                New             No
+    hidden                             New             No
     lanman auth                                Changed Default No
-    mangle map                          Removed
-    min receive file size                New             0
-    open files database hash size      Removed
-    read bmpx                           Removed
+    ldap debug level                   New             0
+    ldap debug threshold               New             10
+    mangle map                         Removed
+    min receive file size              New             0
+    open files database hashsize       Removed
+    read bmpx                          Removed                         
     registry shares                    New             No
-    winbind expand groups               New             1
-    winbind rpc only                    New             No
+    winbind expand groups              New             1
+    winbind rpc only                   New             No
 
 
 Changes since 3.2.0pre1:
@@ -130,13 +139,24 @@ o   Michael Adam <obnox@samba.org>
     * BUG 4308: Fix Excel save operation ACL bug.
     * Refactor and consolidate logic for retrieving the machine
       trust password information.
-    * VFS API cleanup.
+    * VFS API cleanup (remove redundant parameter).
     * BUG 4801: Correctly implement LSA lookup levels for LookupNames.
     * Add new option "debug class" to control printing of the debug class.
       in debug headers.
     * Enable building of the zfsacl and notify_fam vfs modules.
     * BUG 5083: Fix memleak in solarisacl module.
     * BUG 5063: Fix build on RHEL5.
+    * New smb.conf parameter "config backend = registry" to enable registry
+      only configuration.
+    * Move "net conf" functionality into a separate module libnet_conf.c
+    * Restructure registry code, eliminating the dynamic overlay.
+      Make use of reg_api instead of backend code in most places.
+    * Add support for intercepting LDAP libraries' debug output and print
+      it in Samba's debugging system.
+    * Libreplace fixes.
+    * Build fixes.
+    * Initial support for using subsystems as shared libraries.
+      Use talloc, tdb, and libnetapi as shared libraries internally.
 
 
 o   Jeremy Allison <jra@samba.org>
@@ -146,8 +166,15 @@ o   Jeremy Allison <jra@samba.org>
     * Remove unused utilities: smbctool and rpctorture.
     * Fix service principal detection to match Windows Vista
       (based on work from Andreas Schneider).
-    * Additional work on the session data privacy for clients
-      implementing the Unix CIFS Extensions.
+    * Encrypted SMB transport in client tools and libraries, and server.
+
+
+o   Kai Blin <kai@samba.org>
+    * Added support for an SMB_CONF_PATH environment variable
+      containing the path to smb.conf.
+    * Various fixes to ntlm_auth.
+    * make test now supports more extensive SPOOLSS testing using vlp.
+    * Correctly handle mixed-case hostnames in NTLMv2 authentication.
 
 
 o   Gerald (Jerry) Carter <jerry@samba.org>
@@ -175,7 +202,12 @@ o   Volker Lendecke <vl@samba.org>
     * Add generic a in-memory cache.
     * Import the Linux red-black tree implementation.
     * Remove large amount of global variables.
-    * Add vfs_xattr_tdb module for file systems that do not implement xattrs.
+    * Support for storing xattrs in tdb files.
+    * Support for storing alternate data streams in xattrs.
+    * Implement a generic in-memory cache based on rb-trees.
+    * Add implicit temporary talloc contexts via talloc_stack().
+    * Speed up the smbclient "get" command
+    * Add the aio_fork module
 
 
 o   Stefan Metzmacher <metze@samba.org>
@@ -185,6 +217,18 @@ o   Stefan Metzmacher <metze@samba.org>
     * Networking fixes to the libreplace library.
     * Pidl fixes.
     * Remove unused Winbind pipe calls.
+    * Build fixes.
+    * Fix for a crash bug in pidl generated client code.
+      This could have happend with [in,out,unique] pointers
+      when the client sends a valid pointer, but the server
+      responds with a NULL pointer (as samba-3.0.26a does for some calls).
+    * Change NTSTATUS into enum ndr_err_code in librpc/ndr.
+    * Remove unused calls in the struct based winbindd protocol.
+    * Add --configfile option to wbinfo.
+    * Convert winbind_env_set(), winbind_on() and winbind_off() into macros.
+    * Return rids and other_sids arrays in WBFLAG_PAM_INFO3_TEXT mode.
+    * Implement wbcErrorString() and wbcAuthenticateUserEx().
+    * Convert auth_winbind to use wbcAuthenticateUserEx().
 
 
 o   James Peach <jpeach@samba.org>
@@ -195,10 +239,16 @@ o   James Peach <jpeach@samba.org>
 o   Andreas Schneider <anschneider@suse.de>
     * Don't restart winbind if a corrupted tdb is found during
       initialization.
+    * Fix Windows 2008 (Longhorn) join.
+    * Add share parameter "hidden".
 
 
 o   Karolin Seeger <ks@sernet.de>
-    * Add net rap file user.
+    * Improve error messages of net subcommands.
+    * Add 'net rap file user'.
+    * Change LDAP search filter to find machine accounts which
+      are not located in the user suffix.
+    * Remove smbmount.
 
 
 o   David Shaw <dshaw@jabberwocky.com>
@@ -223,6 +273,9 @@ o   Jelmer Vernooij <jelmer@samba.org>
     * Additional portability support for building shared libraries.
 
 
+o   Corinna Vinschen <corinna@vinschen.de>
+    * Get Samba version or capability information from Windows user space.
+
 
 Original 3.2.0pre1 commits:
 ---------------------------
@@ -301,7 +354,7 @@ o   Volker Lendecke <vl@samba.org>
 
 
 o   Steve French <sfrench@samba.org>
-    * Fixes for mount.cfs Linux utility.
+    * Fixes for mount.cifs Linux utility.
 
 
 o   Stefan Metzmacher <metze@samba.org>
@@ -322,7 +375,7 @@ o   James Peach <jpeach@apple.com>
 
 
 o   Jiri Sasek <Jiri.Sasek@Sun.COM>
-    * Added vfs_vfsacl module.
+    * Added vfs_zfsacl module.
 
 
 o   Karolin Seeger <ks@sernet.de>
index 5b196af5eb32dc384981f6a81d4f630032c5a06e..4a6e6be42fd04b1c40ebd52a42cbf4a162af35e6 100644 (file)
@@ -580,6 +580,21 @@ static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struc
        return vfswrap_aio_suspend(NULL, fsp, aiocb, n, ts);
 }
 
+static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
+{
+       return vfswrap_aio_force(NULL, fsp);
+}
+
+static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
+{
+       return vfswrap_is_offline(NULL, path, sbuf);
+}
+
+static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
+{
+       return vfswrap_set_offline(NULL, path);
+}
+
 /* VFS operations structure */
 
 static vfs_op_tuple skel_op_tuples[] = {
@@ -676,7 +691,7 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_sys_acl_free_text),            SMB_VFS_OP_SYS_ACL_FREE_TEXT,           SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_sys_acl_free_acl),             SMB_VFS_OP_SYS_ACL_FREE_ACL,            SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_sys_acl_free_qualifier),       SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER,      SMB_VFS_LAYER_OPAQUE},
-       
+
        /* EA operations. */
        {SMB_VFS_OP(skel_getxattr),                     SMB_VFS_OP_GETXATTR,                    SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_lgetxattr),                    SMB_VFS_OP_LGETXATTR,                   SMB_VFS_LAYER_OPAQUE},
@@ -699,6 +714,11 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_aio_error),                    SMB_VFS_OP_AIO_ERROR,                   SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_aio_fsync),                    SMB_VFS_OP_AIO_FSYNC,                   SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_aio_suspend),                  SMB_VFS_OP_AIO_SUSPEND,                 SMB_VFS_LAYER_OPAQUE},
+       {SMB_VFS_OP(skel_aio_force),                    SMB_VFS_OP_AIO_FORCE,                   SMB_VFS_LAYER_OPAQUE},
+
+        /* offline operations */
+       {SMB_VFS_OP(skel_is_offline),                   SMB_VFS_OP_IS_OFFLINE,                  SMB_VFS_LAYER_OPAQUE},
+       {SMB_VFS_OP(skel_set_offline),                  SMB_VFS_OP_SET_OFFLINE,                 SMB_VFS_LAYER_OPAQUE},
 
        {NULL,                                          SMB_VFS_OP_NOOP,                        SMB_VFS_LAYER_NOOP}
 };
index 55407be10cc708dcd55e0fc7918dc830fc70c872..f4cb9b15ba2e048dfa7523e6c54ba707e1f03fc7 100644 (file)
@@ -539,6 +539,26 @@ static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struc
        return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
 }
 
+static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
+{
+        return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
+}
+
+static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
+{
+       return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf);
+}
+
+static int skel_set_offline(struct vfs_handle_struct *handle, const char *path)
+{
+       return SMB_VFS_NEXT_SET_OFFLINE(handle, path);
+}
+
+static bool skel_is_remotestorage(struct vfs_handle_struct *handle, const char *path)
+{
+       return SMB_VFS_NEXT_IS_REMOTESTORAGE(handle, path);
+}
+
 /* VFS operations structure */
 
 static vfs_op_tuple skel_op_tuples[] = {
@@ -633,7 +653,7 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_sys_acl_free_text),            SMB_VFS_OP_SYS_ACL_FREE_TEXT,           SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(skel_sys_acl_free_acl),             SMB_VFS_OP_SYS_ACL_FREE_ACL,            SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(skel_sys_acl_free_qualifier),       SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER,      SMB_VFS_LAYER_TRANSPARENT},
-       
+
        /* EA operations. */
        {SMB_VFS_OP(skel_getxattr),                     SMB_VFS_OP_GETXATTR,                    SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(skel_lgetxattr),                    SMB_VFS_OP_LGETXATTR,                   SMB_VFS_LAYER_TRANSPARENT},
@@ -656,6 +676,11 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_aio_error),                    SMB_VFS_OP_AIO_ERROR,                   SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(skel_aio_fsync),                    SMB_VFS_OP_AIO_FSYNC,                   SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(skel_aio_suspend),                  SMB_VFS_OP_AIO_SUSPEND,                 SMB_VFS_LAYER_TRANSPARENT},
+       {SMB_VFS_OP(skel_aio_force),                    SMB_VFS_OP_AIO_FORCE,                   SMB_VFS_LAYER_TRANSPARENT},
+
+       /* offline operations */
+       {SMB_VFS_OP(skel_is_offline),                   SMB_VFS_OP_IS_OFFLINE,                  SMB_VFS_LAYER_TRANSPARENT},
+       {SMB_VFS_OP(skel_set_offline),                  SMB_VFS_OP_SET_OFFLINE,                 SMB_VFS_LAYER_TRANSPARENT},
 
        {NULL,                                          SMB_VFS_OP_NOOP,                        SMB_VFS_LAYER_NOOP}
 };
index 26b80575fb6c7c3e9382e5e0bdaac4f8140bd5d5..e2d8b6895f47563621818084e2e8af27237639ec 100644 (file)
@@ -18,13 +18,17 @@ LIBSMBCLIENT = -lwbclient -lsmbclient -ldl -lresolv
 TESTS= testsmbc \
        testacl \
        testacl2 \
+       testacl3 \
        testbrowse \
        testbrowse2 \
        teststat \
        teststat2 \
+       teststat3 \
+       testtruncate \
        testchmod \
        testutime \
-       testread
+       testread \
+       testwrite
 
 #      tree \
 
@@ -46,6 +50,10 @@ testacl2: testacl2.o
        @echo Linking testacl2
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
 
+testacl3: testacl3.o
+       @echo Linking testacl3
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
+
 testbrowse: testbrowse.o
        @echo Linking testbrowse
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
@@ -62,6 +70,14 @@ teststat2: teststat2.o
        @echo Linking teststat2
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
 
+teststat3: teststat3.o
+       @echo Linking teststat3
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
+
+testtruncate: testtruncate.o
+       @echo Linking testtruncate
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
+
 testchmod: testchmod.o
        @echo Linking testchmod
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
@@ -74,6 +90,10 @@ testread: testread.o
        @echo Linking testread
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
 
+testwrite: testwrite.o
+       @echo Linking testwrite
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
+
 smbsh:
        make -C smbwrapper
 
index eb493885af207b2e0ec71ccbf71bd2136e6cc90a..b1d36c8beacd4ecadc63075f2d8719cd5c7dd6c8 100644 (file)
@@ -8,7 +8,23 @@ get_auth_data_fn(const char * pServer,
                  char * pPassword,
                  int maxLenPassword)
 {
-    char temp[128];
+    char            temp[128];
+    char            server[256] = { '\0' };
+    char            share[256] = { '\0' };
+    char            workgroup[256] = { '\0' };
+    char            username[256] = { '\0' };
+    char            password[256] = { '\0' };
+
+    if (strcmp(server, pServer) == 0 &&
+        strcmp(share, pShare) == 0 &&
+        *workgroup != '\0' &&
+        *username != '\0')
+    {
+        strncpy(pWorkgroup, workgroup, maxLenWorkgroup - 1);
+        strncpy(pUsername, username, maxLenUsername - 1);
+        strncpy(pPassword, password, maxLenPassword - 1);
+        return;
+    }
     
     fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
     fgets(temp, sizeof(temp), stdin);
@@ -48,4 +64,8 @@ get_auth_data_fn(const char * pServer,
     {
         strncpy(pPassword, temp, maxLenPassword - 1);
     }
+
+    strncpy(workgroup, pWorkgroup, sizeof(workgroup) - 1);
+    strncpy(username, pUsername, sizeof(username) - 1);
+    strncpy(password, pPassword, sizeof(password) - 1);
 }
index 4e87a2e2e8ed95f8688a5550aa86bff3e3da98b8..bb7a25f13e8f526386e1e0f858cac236960f6a23 100644 (file)
@@ -72,13 +72,12 @@ int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorf
        int ret;
        fd_set *readfds2, readfds_buf, *writefds2, writefds_buf, *errorfds2, errorfds_buf;
        struct timeval tval2, *ptval, end_time, now_time;
-        extern void GetTimeOfDay(struct timeval *tval);
 
        readfds2 = (readfds ? &readfds_buf : NULL);
        writefds2 = (writefds ? &writefds_buf : NULL);
        errorfds2 = (errorfds ? &errorfds_buf : NULL);
         if (tval) {
-                GetTimeOfDay(&end_time);
+                gettimeofday(&end_time, NULL);
                 end_time.tv_sec += tval->tv_sec;
                 end_time.tv_usec += tval->tv_usec;
                 end_time.tv_sec += end_time.tv_usec / 1000000;
@@ -96,7 +95,7 @@ int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorf
                if (errorfds)
                        errorfds_buf = *errorfds;
                if (tval) {
-                        GetTimeOfDay(&now_time);
+                        gettimeofday(&now_time, NULL);
                         tval2.tv_sec = end_time.tv_sec - now_time.tv_sec;
                        tval2.tv_usec = end_time.tv_usec - now_time.tv_usec;
                         if ((signed long) tval2.tv_usec < 0) {
diff --git a/examples/libsmbclient/testacl3.c b/examples/libsmbclient/testacl3.c
new file mode 100644 (file)
index 0000000..9102405
--- /dev/null
@@ -0,0 +1,62 @@
+#include <sys/types.h>
+#include <stdio.h> 
+#include <unistd.h>
+#include <string.h> 
+#include <time.h> 
+#include <errno.h>
+#include <libsmbclient.h> 
+#include "get_auth_data_fn.h"
+
+
+int main(int argc, char * argv[]) 
+{ 
+    int             i;
+    int             fd;
+    int             ret;
+    int             debug = 0;
+    int             mode = 0666;
+    int             savedErrno;
+    char            value[2048]; 
+    char            path[2048];
+    char *          the_acl;
+    char *          p;
+    time_t          t0;
+    time_t          t1;
+    struct stat     st; 
+    SMBCCTX *       context;
+    
+    smbc_init(get_auth_data_fn, debug); 
+    
+    context = smbc_set_context(NULL);
+    smbc_option_set(context, "full_time_names", 1);
+    
+    for (;;)
+    {
+        fprintf(stdout, "Path: ");
+        *path = '\0';
+        fgets(path, sizeof(path) - 1, stdin);
+        if (strlen(path) == 0)
+        {
+            return 0;
+        }
+
+        p = path + strlen(path) - 1;
+        if (*p == '\n')
+        {
+            *p = '\0';
+        }
+    
+        the_acl = strdup("system.nt_sec_desc.*+");
+        ret = smbc_getxattr(path, the_acl, value, sizeof(value));
+        if (ret < 0)
+        {
+            printf("Could not get attributes for [%s] %d: %s\n",
+                   path, errno, strerror(errno));
+            return 1;
+        }
+    
+        printf("Attributes for [%s] are:\n%s\n", path, value);
+    }
+
+    return 0; 
+}
index d59fc70ec11fcc7683ed71cf0c991e6c291a46b8..3f948848957151badf4ad95f7560bbc26eeca194 100644 (file)
 
 int main(int argc, char * argv[]) 
 { 
+    int             i;
     int             fd;
     int             ret;
     int             debug = 0;
     int             mode = 0666;
     int             savedErrno;
     char            buffer[2048]; 
-    char *          pSmbPath = NULL;
+    char            path[2048];
+    char *          p;
     time_t          t0;
     time_t          t1;
     struct stat     st; 
     
-    if (argc == 1)
-    {
-        pSmbPath = "smb://RANDOM/Public/bigfile";
-    }
-    else if (argc == 2)
-    {
-        pSmbPath = argv[1];
-    }
-    else
-    {
-        printf("usage: "
-               "%s [ smb://path/to/file ]\n",
-               argv[0]);
-        return 1;
-    }
-
     smbc_init(get_auth_data_fn, debug); 
     
-    printf("Open file %s\n", pSmbPath);
-    
-    t0 = time(NULL);
-
-    if ((fd = smbc_open(pSmbPath, O_RDONLY, 0)) < 0)
+    for (;;)
     {
-        perror("smbc_open");
-        return 1;
-    }
+        fprintf(stdout, "Path: ");
+        *path = '\0';
+        fgets(path, sizeof(path) - 1, stdin);
+        if (strlen(path) == 0)
+        {
+            return 0;
+        }
 
-    printf("Beginning read loop.\n");
+        p = path + strlen(path) - 1;
+        if (*p == '\n')
+        {
+            *p = '\0';
+        }
+    
+        if ((fd = smbc_open(path, O_RDONLY, 0)) < 0)
+        {
+            perror("smbc_open");
+            continue;
+        }
 
-    do
-    {
-        ret = smbc_read(fd, buffer, sizeof(buffer));
-        savedErrno = errno;
-        if (ret > 0) fwrite(buffer, 1, ret, stdout);
-    } while (ret > 0);
+        do
+        {
+            ret = smbc_read(fd, buffer, sizeof(buffer));
+            savedErrno = errno;
+            if (ret > 0) fwrite(buffer, 1, ret, stdout);
+        } while (ret > 0);
 
-    smbc_close(fd);
+        smbc_close(fd);
 
-    if (ret < 0)
-    {
-        errno = savedErrno;
-        perror("read");
-        return 1;
+        if (ret < 0)
+        {
+            errno = savedErrno;
+            perror("read");
+        }
     }
 
-    t1 = time(NULL);
-
-    printf("Elapsed time: %d seconds\n", t1 - t0);
-
     return 0; 
 }
diff --git a/examples/libsmbclient/teststat3.c b/examples/libsmbclient/teststat3.c
new file mode 100644 (file)
index 0000000..26348b3
--- /dev/null
@@ -0,0 +1,78 @@
+#include <libsmbclient.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+#include "get_auth_data_fn.h"
+
+/*
+ * This test is intended to ensure that the timestamps returned by
+ * libsmbclient using smbc_stat() are the same as those returned by
+ * smbc_fstat().
+ */
+
+
+int main(int argc, char* argv[])
+{
+        int             fd;
+        struct stat     st1;
+        struct stat     st2;
+        char            mtime[32];
+        char            ctime[32];
+        char            atime[32];
+        char *          pUrl = argv[1];
+
+        if(argc != 2)
+        {
+                printf("usage: %s <file_url>\n", argv[0]);
+                return 1;
+        }
+
+        
+        smbc_init(get_auth_data_fn, 0);
+        
+        if (smbc_stat(pUrl, &st1) < 0)
+        {
+                perror("smbc_stat");
+                return 1;
+        }
+        
+        if ((fd = smbc_open(pUrl, O_RDONLY, 0)) < 0)
+        {
+                perror("smbc_open");
+                return 1;
+        }
+
+        if (smbc_fstat(fd, &st2) < 0)
+        {
+                perror("smbc_fstat");
+                return 1;
+        }
+        
+        smbc_close(fd);
+
+#define COMPARE(name, field)                                            \
+        if (st1.field != st2.field)                                     \
+        {                                                               \
+                printf("Field " name " MISMATCH: st1=%lu, st2=%lu\n",   \
+                       (unsigned long) st1.field,                       \
+                       (unsigned long) st2.field);                      \
+        }
+
+        COMPARE("st_dev", st_dev);
+        COMPARE("st_ino", st_ino);
+        COMPARE("st_mode", st_mode);
+        COMPARE("st_nlink", st_nlink);
+        COMPARE("st_uid", st_uid);
+        COMPARE("st_gid", st_gid);
+        COMPARE("st_rdev", st_rdev);
+        COMPARE("st_size", st_size);
+        COMPARE("st_blksize", st_blksize);
+        COMPARE("st_blocks", st_blocks);
+        COMPARE("st_atime", st_atime);
+        COMPARE("st_mtime", st_mtime);
+        COMPARE("st_ctime", st_ctime);
+
+        return 0;
+}
+
diff --git a/examples/libsmbclient/testtruncate.c b/examples/libsmbclient/testtruncate.c
new file mode 100644 (file)
index 0000000..8882acd
--- /dev/null
@@ -0,0 +1,82 @@
+#include <stdio.h> 
+#include <unistd.h>
+#include <string.h> 
+#include <time.h> 
+#include <errno.h>
+#include <libsmbclient.h> 
+#include "get_auth_data_fn.h"
+
+
+int main(int argc, char * argv[]) 
+{ 
+    int             fd;
+    int             ret;
+    int             debug = 0;
+    int             savedErrno;
+    char            buffer[128];
+    char *          pSmbPath = NULL;
+    char *          pLocalPath = NULL;
+    struct stat     st; 
+    
+    if (argc != 2)
+    {
+        printf("usage: "
+               "%s smb://path/to/file\n",
+               argv[0]);
+        return 1;
+    }
+
+    smbc_init(get_auth_data_fn, debug); 
+    
+    if ((fd = smbc_open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0)) < 0)
+    {
+        perror("smbc_open");
+        return 1;
+    }
+
+    strcpy(buffer, "Hello world.\nThis is a test.\n");
+
+    ret = smbc_write(fd, buffer, strlen(buffer));
+    savedErrno = errno;
+    smbc_close(fd);
+
+    if (ret < 0)
+    {
+        errno = savedErrno;
+        perror("write");
+    }
+
+    if (smbc_stat(argv[1], &st) < 0)
+    {
+        perror("smbc_stat");
+        return 1;
+    }
+    
+    printf("Original size: %lu\n", (unsigned long) st.st_size);
+    
+    if ((fd = smbc_open(argv[1], O_WRONLY, 0)) < 0)
+    {
+        perror("smbc_open");
+        return 1;
+    }
+
+    ret = smbc_ftruncate(fd, 13);
+    savedErrno = errno;
+    smbc_close(fd);
+    if (ret < 0)
+    {
+        errno = savedErrno;
+        perror("smbc_ftruncate");
+        return 1;
+    }
+    
+    if (smbc_stat(argv[1], &st) < 0)
+    {
+        perror("smbc_stat");
+        return 1;
+    }
+    
+    printf("New size: %lu\n", (unsigned long) st.st_size);
+    
+    return 0; 
+}
diff --git a/examples/libsmbclient/testwrite.c b/examples/libsmbclient/testwrite.c
new file mode 100644 (file)
index 0000000..780f0e9
--- /dev/null
@@ -0,0 +1,69 @@
+#include <sys/types.h>
+#include <stdio.h> 
+#include <unistd.h>
+#include <string.h> 
+#include <time.h> 
+#include <errno.h>
+#include <libsmbclient.h> 
+#include "get_auth_data_fn.h"
+
+
+int main(int argc, char * argv[]) 
+{ 
+    int             i;
+    int             fd;
+    int             ret;
+    int             debug = 0;
+    int             mode = 0666;
+    int             savedErrno;
+    char            buffer[2048]; 
+    char            path[2048];
+    char *          p;
+    time_t          t0;
+    time_t          t1;
+    struct stat     st; 
+    
+    smbc_init(get_auth_data_fn, debug); 
+    
+    printf("CAUTION: This program will overwrite a file.  "
+           "Press ENTER to continue.");
+    fgets(buffer, sizeof(buffer), stdin);
+           
+
+    for (;;)
+    {
+        fprintf(stdout, "\nPath: ");
+        *path = '\0';
+        fgets(path, sizeof(path) - 1, stdin);
+        if (strlen(path) == 0)
+        {
+            return 0;
+        }
+
+        p = path + strlen(path) - 1;
+        if (*p == '\n')
+        {
+            *p = '\0';
+        }
+    
+        if ((fd = smbc_open(path, O_WRONLY | O_CREAT | O_TRUNC, 0)) < 0)
+        {
+            perror("smbc_open");
+            continue;
+        }
+
+        strcpy(buffer, "Hello world\n");
+
+        ret = smbc_write(fd, buffer, strlen(buffer));
+        savedErrno = errno;
+        smbc_close(fd);
+
+        if (ret < 0)
+        {
+            errno = savedErrno;
+            perror("write");
+        }
+    }
+
+    return 0; 
+}
index a63ae311eb877df398752163302845e08be4a6f0..d17e680ec8e9b0fefe5c83ccd35c33cf738944c8 100755 (executable)
@@ -3,7 +3,7 @@
 # adssearch.pl         - query an Active Directory server and
 #                display objects in a human readable format
 #
-# Copyright (C) Guenther Deschner <gd@samba.org> 2003-2007
+# Copyright (C) Guenther Deschner <gd@samba.org> 2003-2008
 #
 # TODO: add range retrieval
 #      write sddl-converter, decode userParameters
@@ -230,6 +230,7 @@ my %ads_mixed_domain = (
 my %ads_ds_func = (
 "DS_BEHAVIOR_WIN2000"                  => 0,   # untested
 "DS_BEHAVIOR_WIN2003"                  => 2,
+"DS_BEHAVIOR_WIN2008"                  => 3,
 );
 
 my %ads_instance_type = (
@@ -244,6 +245,14 @@ my %ads_uacc = (
        "ACCOUNT_LOCKED_OUT"            => 0x800010, # 8388624
 );
 
+my %ads_enctypes = (
+       "DES-CBC-CRC"                           => 0x01,
+       "DES-CBC-MD5"                           => 0x02,
+       "RC4_HMAC_MD5"                          => 0x04,
+       "AES128_CTS_HMAC_SHA1_96"               => 0x08,
+       "AES128_CTS_HMAC_SHA1_128"              => 0x10,
+);
+
 my %ads_gpoptions = (
        "GPOPTIONS_INHERIT"             => 0,
        "GPOPTIONS_BLOCK_INHERITANCE"   => 1,
@@ -518,6 +527,7 @@ my %attr_handler = (
        "modifyTimeStamp"               => \&dump_timestr,
        "msDS-Behavior-Version"         => \&dump_ds_func,      #unsure
        "msDS-User-Account-Control-Computed" => \&dump_uacc,
+       "msDS-SupportedEncryptionTypes" => \&dump_enctypes,
        "mS-DS-CreatorSID"              => \&dump_sid,
 #      "msRADIUSFramedIPAddress"       => \&dump_ipaddr,
 #      "msRASSavedFramedIPAddress"     => \&dump_ipaddr,
@@ -1209,6 +1219,10 @@ sub dump_uacc {
        return dump_bitmask_equal(@_,%ads_uacc); 
 }
 
+sub dump_enctypes {
+       return dump_bitmask_and(@_,%ads_enctypes);
+}
+
 sub dump_uf {
        return dump_bitmask_and(@_,%ads_uf);
 }
diff --git a/examples/scripts/mount/mount.smbfs b/examples/scripts/mount/mount.smbfs
new file mode 100644 (file)
index 0000000..3b57bc5
--- /dev/null
@@ -0,0 +1,115 @@
+#!/bin/bash
+# Debian mount.smbfs compatibility wrapper
+# Copyright 2007, Steve Langasek <vorlon at debian.org>
+# Licensed under the GNU General Public License, version 2.  See the
+# file /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+
+# This script accepts all documented mount options for mount.smbfs,
+# passing through those that are also recognized by mount.cifs,
+# converting those that are not recognized but map to available cifs
+# options, and warning about the use of options for which no equivalent
+# exists.
+
+# known bugs: quoted spaces in arguments are not passed intact
+
+set -e
+
+# reverse the order of username and password in a "username" parameter,
+# taking care to leave any "%password" bit intact
+
+reverse_username_workgroup() {
+       local workgroup password username
+
+       username="$1"
+       case "$username" in
+       *%*)    password="${username#*%}"
+               username="${username%%%*}"
+               ;;
+       *) ;;
+       esac
+       case "$username" in
+       */*)    workgroup="${username#*/}"
+               username="${username%%/*}"
+               ;;
+       *) ;;
+       esac
+       if [ -n "$workgroup" ]; then
+               username="$workgroup\\$username"
+       fi
+       if [ -n "$password" ]; then
+               username="$username%$password"
+       fi
+       echo "$username"
+}
+
+
+# parse out the mount options that have been specified using -o, and if
+# necessary, convert them for use by mount.cifs
+
+parse_mount_options () {
+       local OLD_IFS IFS options option username
+       OLD_IFS="$IFS"
+       IFS=","
+       options=""
+       workgroup=""
+       password=""
+
+       for option in $@; do
+               case "$option" in
+               sockopt=* | scope=* | codepage=* | ttl=* | debug=*)
+                       echo "Warning: ignoring deprecated smbfs option '$option'" >&2
+                       ;;
+
+               krb)
+                       options="$options${options:+,}sec=krb5"
+                       ;;
+
+               guest)
+                       echo "Warning: mapping 'guest' to 'guest,sec=none'" >&2
+                       options="$options${options:+,}guest,sec=none"
+                       ;;
+
+               # username and workgroup are reversed in username= arguments,
+               # so need to be parsed out
+               username=*/*)
+                       IFS="$OLD_IFS"
+                       username="${option#username=}"
+                       username="$(reverse_username_workgroup "$username")"
+                       IFS=","
+                       options="$options${options:+,}username=$username"
+                       ;;
+
+               *)
+                       options="$options${options:+,}$option"
+                       ;;
+               esac
+       done
+       IFS="$OLD_IFS"
+       echo $options
+}
+
+args=()
+while [ "$#" -gt 0 ]; do
+       case "$1" in
+       -o*)
+               arg=${1#-o}
+               shift
+               if [ -z "$arg" ]; then
+                       arg=$1
+                       shift
+               fi
+               arg="$(parse_mount_options "$arg")"
+               if [ -n "$arg" ]; then
+                       args=("${args[@]}" "-o" "$arg")
+               fi
+               ;;
+       *)
+               args=("${args[@]}" "$1")
+               shift
+               ;;
+       esac
+done
+
+USER="$(reverse_username_workgroup "$USER")"
+
+exec /sbin/mount.cifs "${args[@]}"
index 46f733c0bcd641f32d9afc394f92f738e5666d72..2f963e295da60f9ca2fb07136aafdcd353b2ae99 100644 (file)
@@ -18,7 +18,7 @@ datarootdir=@datarootdir@
 selftest_prefix=@selftest_prefix@
 smbtorture4_path=@smbtorture4_path@
 
-LIBS=@LIBS@
+LIBS=@LIBS@ @LIBTALLOC_LIBS@
 CC=@CC@
 SHLD=@SHLD@
 LIB_PATH_VAR=@LIB_PATH_VAR@
@@ -141,11 +141,24 @@ CODEPAGEDIR = @codepagedir@
 # the directory where pid files go
 PIDDIR = @piddir@
 
+LIBTALLOC_SHARED_TARGET=@LIBTALLOC_SHARED_TARGET@
+LIBTALLOC_STATIC_TARGET=@LIBTALLOC_STATIC_TARGET@
+LIBTALLOC=$(LIBTALLOC_STATIC_TARGET) @LIBTALLOC_SHARED@
+
+LIBTDB_SHARED_TARGET=@LIBTDB_SHARED_TARGET@
+LIBTDB_STATIC_TARGET=@LIBTDB_STATIC_TARGET@
+LIBTDB=$(LIBTDB_STATIC_TARGET) @LIBTDB_SHARED@
+LIBTDB_SYMS=exports/libtdb.syms
+LIBTDB_HEADERS=@tdbdir@/include/tdb.h
+
 LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
 LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
 LIBADDNS=bin/libaddns.a @LIBADDNS_SHARED@
 LIBWBCLIENT=@LIBWBCLIENT_SHARED@
-LIBNETAPI=bin/libnetapi.a @LIBNETAPI_SHARED@
+
+LIBNETAPI_SHARED_TARGET=@LIBNETAPI_SHARED_TARGET@
+LIBNETAPI_STATIC_TARGET=@LIBNETAPI_STATIC_TARGET@
+LIBNETAPI=$(LIBNETAPI_STATIC_TARGET) @LIBNETAPI_SHARED@
 
 FLAGS1 = $(CFLAGS) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS)
 FLAGS2 =
@@ -195,15 +208,15 @@ TORTURE_PROGS = bin/smbtorture@EXEEXT@ bin/msgtest@EXEEXT@ \
        bin/pdbtest@EXEEXT@ bin/talloctort@EXEEXT@ bin/replacetort@EXEEXT@ \
        bin/tdbtorture@EXEEXT@
 
-BIN_PROGS = @EXTRA_BIN_PROGS@ @SMBMOUNT_PROGS@ \
+BIN_PROGS = @EXTRA_BIN_PROGS@ \
        $(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) $(BIN_PROGS4) 
 
 EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ \
        bin/talloctort@EXEEXT@ bin/replacetort@EXEEXT@ \
        bin/log2pcap@EXEEXT@ bin/sharesec@EXEEXT@ bin/ndrdump@EXEEXT@ \
-       bin/vlp@EXEEXT@
+       bin/vlp@EXEEXT@ bin/smbiconv@EXEEXT@
 
-SHLIBS = @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ @LIBNETAPI@ @LIBWBCLIENT@
+SHLIBS = libtalloc libtdb @LIBWBCLIENT@ @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ libnetapi
 
 PAM_MODULES = @PAM_MODULES@
 
@@ -225,14 +238,12 @@ MODULES = $(VFS_MODULES) $(PDB_MODULES) $(RPC_MODULES) $(IDMAP_MODULES) \
 # object file lists
 ######################################################################
 
-TDBBASE_OBJ = lib/tdb/common/tdb.o lib/tdb/common/dump.o lib/tdb/common/error.o \
-       lib/tdb/common/freelist.o lib/tdb/common/freelistcheck.o \
-       lib/tdb/common/io.o lib/tdb/common/lock.o \
-       lib/tdb/common/open.o lib/tdb/common/transaction.o \
-       lib/tdb/common/traverse.o
+LIBTDB_OBJ0 = @TDB_OBJS@
+LIBTDB_OBJ = $(LIBTDB_OBJ0) $(LIBREPLACE_OBJ)
 
-TDB_OBJ = $(TDBBASE_OBJ) lib/util_tdb.o \
-       lib/dbwrap.o lib/dbwrap_tdb.o lib/dbwrap_ctdb.o lib/dbwrap_rbt.o
+TDB_OBJ = lib/util_tdb.o \
+         lib/dbwrap.o lib/dbwrap_tdb.o lib/dbwrap_ctdb.o \
+         lib/dbwrap_rbt.o @LIBTDB_STATIC@
 
 SMBLDAP_OBJ = @SMBLDAP@ @SMBLDAPUTIL@
 
@@ -253,8 +264,14 @@ ERRORMAP_OBJ = libsmb/errormap.o
 PASSCHANGE_OBJ = libsmb/passchange.o
 
 
-LIBNDR_OBJ = librpc/ndr/ndr_basic.o librpc/ndr/ndr.o librpc/ndr/ndr_misc.o \
-            librpc/ndr/ndr_sec_helper.o librpc/ndr/ndr_string.o librpc/ndr/sid.o \
+LIBNDR_OBJ = librpc/ndr/ndr_basic.o \
+            librpc/ndr/ndr.o \
+            librpc/ndr/ndr_misc.o \
+            librpc/gen_ndr/ndr_misc.o \
+            librpc/gen_ndr/ndr_security.o \
+            librpc/ndr/ndr_sec_helper.o \
+            librpc/ndr/ndr_string.o \
+            librpc/ndr/sid.o \
             librpc/ndr/uuid.o
 
 RPCCLIENT_NDR_OBJ = rpc_client/ndr.o
@@ -268,8 +285,12 @@ LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_wkssvc.o \
                 librpc/gen_ndr/ndr_srvsvc.o \
                 librpc/gen_ndr/ndr_svcctl.o \
                 librpc/gen_ndr/ndr_eventlog.o \
+                librpc/gen_ndr/ndr_netlogon.o \
+                librpc/gen_ndr/ndr_samr.o \
+                librpc/gen_ndr/ndr_dssetup.o \
                 librpc/gen_ndr/ndr_notify.o \
-                librpc/gen_ndr/ndr_libnet_join.o
+                librpc/gen_ndr/ndr_xattr.o \
+                librpc/gen_ndr/ndr_ntsvcs.o
 
 RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
 
@@ -277,16 +298,23 @@ RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
 # that requires knowledge of security contexts
 RPC_PARSE_OBJ1 = $(RPC_PARSE_OBJ0) rpc_parse/parse_sec.o
 
-RPC_PARSE_OBJ2 = rpc_parse/parse_rpc.o rpc_parse/parse_net.o rpc_parse/parse_srv.o
+RPC_PARSE_OBJ2 = rpc_parse/parse_rpc.o rpc_parse/parse_srv.o
+RPC_PARSE_OBJ2 = rpc_parse/parse_rpc.o rpc_parse/parse_srv.o \
+                rpc_client/init_netlogon.o \
+                rpc_client/init_lsa.o
 
 LIBREPLACE_OBJ = @LIBREPLACE_OBJS@
 
 SOCKET_WRAPPER_OBJ = @SOCKET_WRAPPER_OBJS@
 NSS_WRAPPER_OBJ = @NSS_WRAPPER_OBJS@
 
-TALLOC_OBJ = lib/talloc/talloc.o
+TALLOC_OBJ = @TALLOC_OBJS@
+
+
+LIBTALLOC_OBJ0 = $(TALLOC_OBJ)
+LIBTALLOC_OBJ = $(LIBTALLOC_OBJ0) $(LIBREPLACE_OBJ)
 
-LIBSAMBAUTIL_OBJ = $(TALLOC_OBJ) \
+LIBSAMBAUTIL_OBJ = @LIBTALLOC_STATIC@ \
                $(LIBREPLACE_OBJ) \
                $(SOCKET_WRAPPER_OBJ) \
                $(NSS_WRAPPER_OBJ)
@@ -295,7 +323,7 @@ LIB_WITHOUT_PROTO_OBJ = $(LIBSAMBAUTIL_OBJ) \
        lib/messages.o librpc/gen_ndr/ndr_messaging.o lib/messages_local.o \
        lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o \
        lib/interfaces.o lib/rbtree.o lib/memcache.o \
-       lib/util_transfer_file.o
+       lib/util_transfer_file.o lib/async_req.o
 
 LIB_WITH_PROTO_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
          lib/interface.o lib/md4.o \
@@ -308,11 +336,10 @@ LIB_WITH_PROTO_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
          lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
          lib/util_unistr.o lib/util_file.o lib/data_blob.o \
          lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
-         lib/substitute.o lib/fsusage.o \
+         lib/substitute.o lib/fsusage.o lib/dbwrap_util.o \
          lib/ms_fnmatch.o lib/select.o lib/errmap_unix.o \
          lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
          lib/md5.o lib/hmacmd5.o lib/arc4.o lib/iconv.o \
-         $(WBCOMMON_OBJ) \
          lib/pam_errors.o intl/lang_tdb.o lib/conn_tdb.o \
          lib/adt_tree.o lib/gencache.o $(TDB_OBJ) \
          lib/module.o lib/events.o lib/ldap_escape.o @CHARSET_STATIC@ \
@@ -331,15 +358,15 @@ READLINE_OBJ = lib/readline.o
 # Be sure to include them into your application
 POPT_LIB_OBJ = lib/popt_common.o
 
-PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o param/util.o lib/sharesec.o
-PARAM_REG_ADD_OBJ = $(UTIL_REG_API_OBJ)
+PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o param/util.o lib/sharesec.o lib/ldap_debug_handler.o
+PARAM_REG_ADD_OBJ = $(REG_SMBCONF_OBJ) $(LIBNET_CONF_OBJ) $(PRIVILEGES_BASIC_OBJ)
 PARAM_OBJ = $(PARAM_WITHOUT_REG_OBJ) $(PARAM_REG_ADD_OBJ)
 
 KRBCLIENT_OBJ = libads/kerberos.o libads/ads_status.o
 
 LIBADDNS_OBJ0 = libaddns/dnsrecord.o libaddns/dnsutils.o  libaddns/dnssock.o \
               libaddns/dnsgss.o libaddns/dnsmarshall.o
-LIBADDNS_OBJ = $(LIBADDNS_OBJ0) $(TALLOC_OBJ)
+LIBADDNS_OBJ = $(LIBADDNS_OBJ0) @LIBTALLOC_STATIC@
 
 LIBWBCLIENT_OBJ0 = nsswitch/libwbclient/wbclient.o \
                  nsswitch/libwbclient/wbc_util.o \
@@ -347,7 +374,7 @@ LIBWBCLIENT_OBJ0 = nsswitch/libwbclient/wbclient.o \
                  nsswitch/libwbclient/wbc_idmap.o \
                  nsswitch/libwbclient/wbc_sid.o \
                  nsswitch/libwbclient/wbc_pam.o
-LIBWBCLIENT_OBJ = $(LIBWBCLIENT_OBJ0) $(WBCOMMON_OBJ) $(TALLOC_OBJ) $(LIBREPLACE_OBJ)
+LIBWBCLIENT_OBJ = $(LIBWBCLIENT_OBJ0) $(WBCOMMON_OBJ) @LIBTALLOC_STATIC@ $(LIBREPLACE_OBJ)
 
 LIBGPO_OBJ0 = libgpo/gpo_ldap.o libgpo/gpo_ini.o libgpo/gpo_util.o \
              libgpo/gpo_fetch.o libgpo/gpo_filesync.o libgpo/gpo_sec.o
@@ -358,9 +385,11 @@ LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o \
             libads/krb5_setpw.o libads/ldap_user.o \
             libads/ads_struct.o libads/kerberos_keytab.o \
              libads/disp_sec.o libads/ads_utils.o libads/ldap_utils.o \
-            libads/cldap.o libads/ldap_schema.o libads/util.o
+            libads/cldap.o libads/ldap_schema.o libads/util.o libads/ndr.o
 
-LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o
+LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o \
+                   librpc/ndr/ndr_krb5pac.o \
+                   librpc/gen_ndr/ndr_krb5pac.o
 
 SECRETS_OBJ = passdb/secrets.o passdb/machine_sid.o
 
@@ -379,7 +408,7 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
             libsmb/clistr.o libsmb/cliquota.o libsmb/clifsinfo.o libsmb/clidfs.o \
              libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o \
             libsmb/clioplock.o $(ERRORMAP_OBJ) libsmb/clirap2.o \
-            libsmb/smb_seal.o $(DOSERR_OBJ) \
+            libsmb/smb_seal.o $(DOSERR_OBJ) libsmb/async_smb.o \
             $(RPC_PARSE_OBJ1) $(LIBSAMBA_OBJ) $(LIBNMB_OBJ)
 
 RPC_CLIENT_OBJ1 = rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o
@@ -387,7 +416,8 @@ RPC_CLIENT_OBJ1 = rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o
 LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
               $(RPC_CLIENT_OBJ1) rpc_client/cli_reg.o $(RPC_CLIENT_OBJ) \
               rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o  \
-              rpc_client/cli_ds.o rpc_client/cli_svcctl.o
+              rpc_client/cli_svcctl.o \
+              rpc_client/init_samr.o
 
 LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_lsa.o \
                   librpc/gen_ndr/cli_dfs.o \
@@ -398,34 +428,76 @@ LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_lsa.o \
                   librpc/gen_ndr/cli_initshutdown.o \
                   librpc/gen_ndr/cli_eventlog.o \
                   librpc/gen_ndr/cli_wkssvc.o \
+                  librpc/gen_ndr/cli_netlogon.o \
+                  librpc/gen_ndr/cli_samr.o \
+                  librpc/gen_ndr/cli_dssetup.o \
+                  librpc/gen_ndr/cli_ntsvcs.o \
                   $(LIBNDR_GEN_OBJ) \
                   $(RPCCLIENT_NDR_OBJ)
 
+#
+# registry-related objects
+#
+UTIL_REG_OBJ = lib/util_reg.o
+UTIL_REG_API_OBJ = lib/util_reg_api.o
+
+REG_INIT_SMBCONF_OBJ = registry/reg_init_smbconf.o
+REG_INIT_FULL_OBJ = registry/reg_init_full.o
+
+REGFIO_OBJ = registry/regfio.o
+
 REGOBJS_OBJ = registry/reg_objects.o
 
-REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_printing.o \
-               registry/reg_db.o registry/reg_eventlog.o registry/reg_shares.o \
-               registry/reg_util.o registry/reg_dynamic.o registry/reg_perfcount.o \
-              registry/reg_smbconf.o registry/reg_api.o \
-              registry/reg_frontend_hilvl.o \
-              $(UTIL_REG_API_OBJ) $(UTIL_REG_SMBCONF_OBJ)
+REG_BACKENDS_BASE_OBJ = registry/reg_backend_db.o
 
-RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o librpc/gen_ndr/srv_lsa.o
+REG_BACKENDS_SMBCONF_OBJ = registry/reg_backend_smbconf.o
 
-RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o
+REG_BACKENDS_EXTRA_OBJ = registry/reg_backend_printing.o \
+                        registry/reg_backend_shares.o \
+                        registry/reg_backend_netlogon_params.o \
+                        registry/reg_backend_prod_options.o \
+                        registry/reg_backend_tcpip_params.o \
+                        registry/reg_backend_hkpt_params.o \
+                        registry/reg_backend_current_version.o \
+                        registry/reg_backend_perflib.o
 
-RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
-               rpc_server/srv_samr_util.o
+REG_BASE_OBJ = registry/reg_api.o \
+              registry/reg_dispatcher.o \
+              registry/reg_cachehook.o \
+              $(REGFIO_OBJ) \
+              $(REGOBJS_OBJ) \
+              registry/reg_util.o \
+              $(UTIL_REG_API_OBJ) \
+              lib/util_nttoken.o \
+              $(REG_BACKENDS_BASE_OBJ)
 
-REGFIO_OBJ = registry/regfio.o
+REG_SMBCONF_OBJ = $(REG_BASE_OBJ) \
+                 $(REG_BACKENDS_SMBCONF_OBJ) \
+                 $(REG_INIT_SMBCONF_OBJ)
+
+REG_FULL_OBJ = $(REG_SMBCONF_OBJ) \
+              $(REG_BACKENDS_EXTRA_OBJ) \
+              $(REG_INIT_FULL_OBJ) \
+              registry/reg_eventlog.o \
+              registry/reg_perfcount.o \
+              registry/reg_util_legacy.o
+
+
+RPC_LSA_OBJ = rpc_server/srv_lsa_nt.o librpc/gen_ndr/srv_lsa.o
+
+RPC_NETLOG_OBJ = rpc_server/srv_netlog_nt.o \
+                librpc/gen_ndr/srv_netlogon.o
+
+RPC_SAMR_OBJ = rpc_server/srv_samr_nt.o \
+               rpc_server/srv_samr_util.o \
+              librpc/gen_ndr/srv_samr.o
 
 RPC_INITSHUTDOWN_OBJ =  librpc/gen_ndr/srv_initshutdown.o rpc_server/srv_initshutdown_nt.o
 
 RPC_REG_OBJ =  rpc_server/srv_winreg_nt.o \
-              librpc/gen_ndr/srv_winreg.o \
-              $(REGFIO_OBJ)
+              librpc/gen_ndr/srv_winreg.o
 
-RPC_LSA_DS_OBJ =  rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o
+RPC_DSSETUP_OBJ =  rpc_server/srv_dssetup_nt.o librpc/gen_ndr/srv_dssetup.o
 
 RPC_SVC_OBJ = rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o \
              librpc/gen_ndr/srv_srvsvc.o
@@ -438,7 +510,8 @@ RPC_SVCCTL_OBJ =  rpc_server/srv_svcctl.o rpc_server/srv_svcctl_nt.o \
                   services/svc_netlogon.o services/svc_winreg.o \
                   services/svc_wins.o
 
-RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs.o rpc_server/srv_ntsvcs_nt.o
+RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs.o rpc_server/srv_ntsvcs_nt.o \
+                librpc/gen_ndr/srv_ntsvcs.o
 
 RPC_DFS_OBJ =  librpc/gen_ndr/srv_dfs.o rpc_server/srv_dfs_nt.o
 
@@ -454,23 +527,26 @@ RPC_ECHO_OBJ = rpc_server/srv_echo_nt.o librpc/gen_ndr/srv_echo.o
 
 RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ)
 
-RPC_PARSE_OBJ = rpc_parse/parse_lsa.o $(RPC_PARSE_OBJ2) \
-                rpc_parse/parse_samr.o \
-                rpc_parse/parse_ds.o rpc_parse/parse_spoolss.o \
+RPC_PARSE_OBJ = $(RPC_PARSE_OBJ2) \
+                rpc_parse/parse_spoolss.o \
                rpc_parse/parse_eventlog.o rpc_parse/parse_buffer.o \
-                rpc_parse/parse_ntsvcs.o rpc_parse/parse_svcctl.o $(REGOBJS_OBJ)
+                rpc_parse/parse_ntsvcs.o rpc_parse/parse_svcctl.o
 
 RPC_CLIENT_OBJ = rpc_client/cli_pipe.o
 
 LOCKING_OBJ = locking/locking.o locking/brlock.o locking/posix.o
 
+PRIVILEGES_BASIC_OBJ = lib/privileges_basic.o
+
+PRIVILEGES_OBJ = lib/privileges.o
+
 PASSDB_GET_SET_OBJ = passdb/pdb_get_set.o
 
 PASSDB_OBJ = $(PASSDB_GET_SET_OBJ) passdb/passdb.o passdb/pdb_interface.o \
                passdb/util_wellknown.o passdb/util_builtin.o passdb/pdb_compat.o \
                passdb/util_unixsids.o passdb/lookup_sid.o \
                passdb/login_cache.o @PDB_STATIC@ \
-               lib/account_pol.o lib/privileges.o lib/privileges_basic.o \
+               lib/account_pol.o $(PRIVILEGES_OBJ) \
                lib/util_nscd.o lib/winbind_util.o
 
 DEVEL_HELP_WEIRD_OBJ = modules/weird.o
@@ -482,7 +558,7 @@ GROUPDB_OBJ = groupdb/mapping.o groupdb/mapping_tdb.o groupdb/mapping_ldb.o
 
 PROFILE_OBJ = profile/profile.o
 PROFILES_OBJ = utils/profiles.o \
-               $(REGFIO_OBJ) $(REGOBJS_OBJ) $(ERRORMAP_OBJ) \
+               $(ERRORMAP_OBJ) \
               $(RPC_PARSE_OBJ1) $(PARAM_OBJ) $(LIBSAMBA_OBJ) \
                $(DOSERR_OBJ) $(LIB_OBJ) $(LIB_DUMMY_OBJ) \
                $(POPT_LIB_OBJ) $(SECRETS_OBJ)
@@ -503,8 +579,9 @@ VFS_READONLY_OBJ = modules/vfs_readonly.o modules/getdate.o
 VFS_CAP_OBJ = modules/vfs_cap.o
 VFS_EXPAND_MSDFS_OBJ = modules/vfs_expand_msdfs.o
 VFS_SHADOW_COPY_OBJ = modules/vfs_shadow_copy.o
+VFS_SHADOW_COPY2_OBJ = modules/vfs_shadow_copy2.o
 VFS_AFSACL_OBJ = modules/vfs_afsacl.o
-VFS_XATTR_TDB_OBJ = modules/vfs_xattr_tdb.o librpc/gen_ndr/ndr_xattr.o
+VFS_XATTR_TDB_OBJ = modules/vfs_xattr_tdb.o
 VFS_POSIXACL_OBJ = modules/vfs_posixacl.o
 VFS_AIXACL_OBJ = modules/vfs_aixacl.o modules/vfs_aixacl_util.o
 VFS_AIXACL2_OBJ = modules/vfs_aixacl2.o modules/vfs_aixacl_util.o modules/nfs4_acls.o
@@ -514,13 +591,17 @@ VFS_HPUXACL_OBJ = modules/vfs_hpuxacl.o
 VFS_IRIXACL_OBJ = modules/vfs_irixacl.o
 VFS_TRU64ACL_OBJ = modules/vfs_tru64acl.o
 VFS_CATIA_OBJ = modules/vfs_catia.o
+VFS_STREAMS_XATTR_OBJ = modules/vfs_streams_xattr.o
+VFS_STREAMS_DEPOT_OBJ = modules/vfs_streams_depot.o
 VFS_CACHEPRIME_OBJ = modules/vfs_cacheprime.o
 VFS_PREALLOC_OBJ = modules/vfs_prealloc.o
 VFS_COMMIT_OBJ = modules/vfs_commit.o
 VFS_GPFS_OBJ = modules/vfs_gpfs.o modules/gpfs.o modules/nfs4_acls.o
 VFS_NOTIFY_FAM_OBJ = modules/vfs_notify_fam.o
 VFS_READAHEAD_OBJ = modules/vfs_readahead.o
+VFS_TSMSM_OBJ = modules/vfs_tsmsm.o
 VFS_FILEID_OBJ = modules/vfs_fileid.o
+VFS_AIO_FORK_OBJ = modules/vfs_aio_fork.o
 VFS_SYNCOPS_OBJ = modules/vfs_syncops.o
 
 PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o
@@ -538,7 +619,6 @@ AUTH_WINBIND_OBJ = auth/auth_winbind.o
 AUTH_SCRIPT_OBJ = auth/auth_script.o
 
 AUTH_OBJ = auth/auth.o @AUTH_STATIC@ auth/auth_util.o auth/token_util.o \
-          lib/util_nttoken.o \
           auth/auth_compat.o auth/auth_ntlmssp.o \
           $(PLAINTEXT_AUTH_OBJ) $(SLCACHE_OBJ) $(DCUTIL_OBJ)
 
@@ -577,8 +657,9 @@ SMBD_OBJ_BASE = $(PARAM_WITHOUT_REG_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \
                $(NOTIFY_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \
                $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) \
                $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
-               $(REGISTRY_OBJ) $(POPT_LIB_OBJ) @LIBWBCLIENT_STATIC@ \
-               $(BUILDOPT_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ) $(LIBNET_OBJ)
+               $(REG_FULL_OBJ) $(POPT_LIB_OBJ) $(BUILDOPT_OBJ) \
+               $(SMBLDAP_OBJ) $(LDB_OBJ) $(LIBNET_OBJ) @LIBWBCLIENT_STATIC@ \
+               $(PRIVILEGES_BASIC_OBJ)
 
 PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \
                printing/print_cups.o printing/print_generic.o \
@@ -636,7 +717,8 @@ SMBTREE_OBJ = utils/smbtree.o $(PARAM_OBJ) \
 
 TESTPARM_OBJ = utils/testparm.o \
                $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
-              $(SECRETS_OBJ) $(LIBSAMBA_OBJ) $(RPC_PARSE_OBJ1) $(DOSERR_OBJ)
+              $(SECRETS_OBJ) $(LIBSAMBA_OBJ) $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) \
+              $(ERRORMAP_OBJ)
 
 PASSWD_UTIL_OBJ = utils/passwd_util.o
 
@@ -644,26 +726,25 @@ SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSWD_UTIL_OBJ) $(PASSCHANGE_OBJ) \
                $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ \
                $(GROUPDB_OBJ) $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \
                $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) \
-               $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) $(LDB_OBJ) 
+               $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) $(LDB_OBJ)
 
 PDBEDIT_OBJ = utils/pdbedit.o $(PASSWD_UTIL_OBJ) $(PARAM_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ \
                $(LIBSAMBA_OBJ) $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) \
                $(SECRETS_OBJ) $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) libsmb/asn1.o \
                $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(LDB_OBJ) $(ERRORMAP_OBJ) 
 
-SMBGET_OBJ = utils/smbget.o $(POPT_LIB_OBJ) $(LIBSMBCLIENT_OBJ)
+SMBGET_OBJ = utils/smbget.o $(POPT_LIB_OBJ) $(LIBSMBCLIENT_OBJ0)
 
 DISPLAY_SEC_OBJ= lib/display_sec.o
-DISPLAY_DSDCINFO_OBJ= lib/display_dsdcinfo.o
 
 RPCCLIENT_OBJ1 = rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o \
                 rpcclient/cmd_samr.o rpcclient/cmd_spoolss.o \
                 rpcclient/cmd_netlogon.o rpcclient/cmd_srvsvc.o \
                 rpcclient/cmd_dfs.o \
-                rpcclient/cmd_ds.o rpcclient/cmd_echo.o \
+                rpcclient/cmd_dssetup.o rpcclient/cmd_echo.o \
                 rpcclient/cmd_shutdown.o rpcclient/cmd_test.o \
-                rpcclient/cmd_wkssvc.o \
-                $(DISPLAY_SEC_OBJ) $(DISPLAY_DSDCINFO_OBJ)
+                rpcclient/cmd_wkssvc.o rpcclient/cmd_ntsvcs.o \
+                $(DISPLAY_SEC_OBJ)
 
 RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
              $(PARAM_OBJ) $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) \
@@ -675,14 +756,16 @@ RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
 PAM_WINBIND_OBJ = nsswitch/pam_winbind.o $(WBCOMMON_OBJ) \
                  $(LIBREPLACE_OBJ) @BUILD_INIPARSER@
 
-LIBSMBCLIENT_OBJ = libsmb/libsmbclient.o libsmb/libsmb_compat.o \
-                  libsmb/libsmb_cache.o \
-                  $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
-                  $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
-                  $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
-                  $(SECRETS_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ)
+LIBSMBCLIENT_OBJ0 = libsmb/libsmbclient.o libsmb/libsmb_compat.o \
+                   libsmb/libsmb_cache.o \
+                   $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
+                   $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
+                   $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
+                   $(SECRETS_OBJ) $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ)
 
-LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o $(TDBBASE_OBJ)
+LIBSMBCLIENT_OBJ = $(LIBSMBCLIENT_OBJ0) @LIBWBCLIENT_STATIC@
+
+LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o @LIBTDB_STATIC@
 
 # This shared library is intended for linking with unit test programs
 # to test Samba internals.  It's called libbigballofmud.so to
@@ -705,45 +788,25 @@ CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
              $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
             $(DISPLAY_SEC_OBJ) 
 
-UTIL_REG_OBJ = lib/util_reg.o
-UTIL_REG_API_OBJ = lib/util_reg_api.o
-UTIL_REG_SMBCONF_OBJ = lib/util_reg_smbconf.o
-
-# objects to be used when not all of the registry code should be
-# loaded but only the portion needed by reg_api, typically for
-# using smbconf (registry) - full access
-REG_API_OBJ = registry/reg_api.o \
-             registry/reg_frontend_hilvl.o \
-             registry/reg_smbconf.o \
-             registry/reg_db.o \
-             registry/reg_util.o \
-             \
-             registry/reg_cachehook.o \
-             registry/reg_eventlog.o \
-             registry/reg_perfcount.o \
-             registry/reg_dynamic.o \
-             \
-             lib/util_nttoken.o \
-             $(UTIL_REG_API_OBJ) \
-             $(UTIL_REG_SMBCONF_OBJ)
-
-
 LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
                 lib/netapi/joindomain.o \
                 lib/netapi/serverinfo.o \
                 lib/netapi/getdc.o
 
 LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
-                $(REG_API_OBJ) \
+                $(REG_SMBCONF_OBJ) \
                 $(PARAM_WITHOUT_REG_OBJ) $(LIB_NONSMBD_OBJ) \
                 $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                 $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
                 $(SECRETS_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
-                $(DCUTIL_OBJ) $(LIBADS_OBJ)
+                $(DCUTIL_OBJ) $(LIBADS_OBJ) $(PRIVILEGES_BASIC_OBJ)
 
-LIBNET_OBJ = libnet/libnet_conf.o libnet/libnet_join.o
+LIBNET_CONF_OBJ = libnet/libnet_conf.o
 
-NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
+LIBNET_OBJ = $(LIBNET_CONF_OBJ) libnet/libnet_join.o \
+            librpc/gen_ndr/ndr_libnet_join.o
+
+NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_help.o \
           utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
           utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \
           utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o \
@@ -755,26 +818,20 @@ NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
           utils/net_conf.o auth/token_util.o utils/net_dom.o nsswitch/wb_client.o
 
 NET_OBJ = $(NET_OBJ1) $(PARAM_WITHOUT_REG_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
-         $(RPC_PARSE_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) \
+         $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
          $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(LIBADDNS_OBJ0) \
          $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) \
          $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(POPT_LIB_OBJ) \
          $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \
-         $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(REGFIO_OBJ) $(READLINE_OBJ) \
+         $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(READLINE_OBJ) \
          $(LDB_OBJ) $(LIBGPO_OBJ) @BUILD_INIPARSER@ $(DISPLAY_SEC_OBJ) \
-         $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) $(LIBNETAPI_OBJ1) $(LIBNET_OBJ)
+         $(REG_SMBCONF_OBJ) @LIBNETAPI_STATIC@ $(LIBNET_OBJ) \
+         $(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@ \
+         $(PRIVILEGES_BASIC_OBJ)
 
 CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
          $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
 
-MOUNT_OBJ = client/smbmount.o \
-             $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ)
-
-MNT_OBJ = client/smbmnt.o $(VERSION_OBJ) $(LIBREPLACE_OBJ) $(SOCKET_WRAPPER_OBJ)
-
-UMOUNT_OBJ = client/smbumount.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
-            $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ)
-
 CIFS_MOUNT_OBJ = client/mount.cifs.o
 
 CIFS_UMOUNT_OBJ = client/umount.cifs.o
@@ -782,7 +839,8 @@ CIFS_UMOUNT_OBJ = client/umount.cifs.o
 CIFS_SPNEGO_OBJ = client/cifs.spnego.o
 
 NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(LIBNMB_OBJ) $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) \
-               $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
+               $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ) \
+              $(ERRORMAP_OBJ)
 
 SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/utable.o \
                torture/denytest.o torture/mangle_test.o
@@ -809,7 +867,7 @@ PDBTEST_OBJ = torture/pdbtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
 
 VFSTEST_OBJ = torture/cmd_vfs.o torture/vfstest.o $(SMBD_OBJ_BASE) $(READLINE_OBJ)
 
-SMBICONV_OBJ = $(PARAM_OBJ) torture/smbiconv.o $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
+SMBICONV_OBJ = $(PARAM_OBJ) torture/smbiconv.o $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ) $(DOSERR_OBJ) $(RPC_PARSE_OBJ1) $(ERRORMAP_OBJ)
 
 LOG2PCAP_OBJ = utils/log2pcaphex.o
 
@@ -830,21 +888,22 @@ SMBCQUOTAS_OBJ = utils/smbcquotas.o $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
 
 EVTLOGADM_OBJ0 = utils/eventlogadm.o
 
-EVTLOGADM_OBJ  = $(EVTLOGADM_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(REGOBJS_OBJ) \
+EVTLOGADM_OBJ  = $(EVTLOGADM_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
                $(ERRORMAP_OBJ) $(RPC_PARSE_OBJ1) $(LIBSAMBA_OBJ) $(DOSERR_OBJ) \
                $(SECRETS_OBJ) \
-               registry/reg_eventlog.o rpc_server/srv_eventlog_lib.o registry/reg_util.o \
-               registry/reg_db.o
+               registry/reg_eventlog.o rpc_server/srv_eventlog_lib.o
 
 SHARESEC_OBJ0 = utils/sharesec.o
-SHARESEC_OBJ  = $(SHARESEC_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(REGOBJS_OBJ) \
+SHARESEC_OBJ  = $(SHARESEC_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
                $(ERRORMAP_OBJ) $(RPC_PARSE_OBJ1) $(LIBSAMBA_OBJ) $(DOSERR_OBJ) \
                 $(POPT_LIB_OBJ) $(SECRETS_OBJ)
 
-TALLOCTORT_OBJ = lib/talloc/testsuite.o $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
-                 $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(LIBSAMBA_OBJ) $(SECRETS_OBJ)
+TALLOCTORT_OBJ = @tallocdir@/testsuite.o $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
+                 $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(LIBSAMBA_OBJ) $(SECRETS_OBJ) \
+                $(ERRORMAP_OBJ)
 
 REPLACETORT_OBJ = lib/replace/test/testsuite.o \
+               lib/replace/test/getifaddrs.o \
                lib/replace/test/os2_delete.o \
                lib/replace/test/strptime.o \
                $(LIBREPLACE_OBJ)
@@ -852,7 +911,8 @@ REPLACETORT_OBJ = lib/replace/test/testsuite.o \
 NDRDUMP_OBJ = librpc/tools/ndrdump.o \
                          $(PARAM_OBJ) $(LIBNDR_GEN_OBJ) \
                          $(LIBSAMBA_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
-                         $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(SECRETS_OBJ)
+                         $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(SECRETS_OBJ) \
+                         $(ERRORMAP_OBJ)
 
 DEBUG2HTML_OBJ = utils/debug2html.o utils/debugparse.o
 
@@ -865,18 +925,19 @@ PROTO_OBJ = $(SMBD_OBJ_MAIN) $(LIBNDR_OBJ) $(LIBNDR_GEN_OBJ) \
            $(LIBMSRPC_OBJ) \
            $(LIB_WITH_PROTO_OBJ) \
            $(RPC_PIPE_OBJ) $(RPC_PARSE_OBJ) $(KRBCLIENT_OBJ) \
-           $(AUTH_OBJ) $(PARAM_OBJ) $(LOCKING_OBJ) $(SECRETS_OBJ) \
+           $(AUTH_OBJ) $(PARAM_WITHOUT_REG_OBJ) $(LOCKING_OBJ) $(SECRETS_OBJ) \
            $(PRINTING_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) $(NOTIFY_OBJ) \
            $(PASSDB_OBJ) $(GROUPDB_OBJ) \
            $(READLINE_OBJ) $(PROFILE_OBJ) $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) \
-           $(AUTH_SAM_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
-           $(RPC_LSA_OBJ) $(RPC_NETLOG_OBJ) $(RPC_SAMR_OBJ) $(RPC_REG_OBJ) $(RPC_LSA_DS_OBJ) \
+           $(AUTH_SAM_OBJ) $(REG_FULL_OBJ) $(POPT_LIB_OBJ) \
+           $(RPC_LSA_OBJ) $(RPC_NETLOG_OBJ) $(RPC_SAMR_OBJ) $(RPC_REG_OBJ) $(RPC_DSSETUP_OBJ) \
            $(RPC_SVC_OBJ) $(RPC_WKS_OBJ) $(RPC_DFS_OBJ) $(RPC_SPOOLSS_OBJ) \
            $(RPC_ECHO_OBJ) $(RPC_SVCCTL_OBJ) $(RPC_EVENTLOG_OBJ) $(SMBLDAP_OBJ) \
-            $(IDMAP_OBJ) libsmb/spnego.o $(PASSCHANGE_OBJ) $(RPC_UNIXINFO_OBJ) \
+            $(IDMAP_OBJ) libsmb/spnego.o $(PASSCHANGE_OBJ) \
            $(RPC_NTSVCS_OBJ) $(RPC_INITSHUTDOWN_OBJ) \
            utils/passwd_util.o $(LIBGPO_OBJ) $(NSS_INFO_OBJ) \
-           $(RPCCLIENT_NDR_OBJ) $(DISPLAY_DSDCINFO_OBJ)
+           $(RPCCLIENT_NDR_OBJ) \
+           $(PRIVILEGES_BASIC_OBJ)
 
 WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) \
        $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ)
@@ -914,6 +975,7 @@ WINBINDD_OBJ1 = \
                winbindd/winbindd_domain.o \
                winbindd/winbindd_idmap.o \
                winbindd/winbindd_locator.o \
+               winbindd/winbindd_ndr.o \
                auth/token_util.o
 
 WINBINDD_OBJ = \
@@ -928,7 +990,8 @@ WINBINDD_OBJ = \
 
 WBINFO_OBJ = nsswitch/wbinfo.o $(LIBSAMBA_OBJ) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
                $(SECRETS_OBJ) $(POPT_LIB_OBJ) $(AFS_SETTOKEN_OBJ) $(RPC_PARSE_OBJ1) \
-               $(DOSERR_OBJ) lib/winbind_util.o @LIBWBCLIENT_STATIC@
+               $(DOSERR_OBJ) lib/winbind_util.o $(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@ \
+               $(ERRORMAP_OBJ)
 
 WINBIND_NSS_OBJ = $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ) @WINBIND_NSS_EXTRA_OBJS@
 
@@ -957,7 +1020,7 @@ LDB_CMDLINE_OBJ = $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
          $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) \
          $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(POPT_LIB_OBJ) \
          $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \
-         $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(REGFIO_OBJ) $(READLINE_OBJ) \
+         $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(READLINE_OBJ) \
          $(LDB_OBJ) lib/ldb/tools/cmdline.o 
 
 
@@ -976,16 +1039,16 @@ POPT_OBJ=popt/findme.o popt/popt.o popt/poptconfig.o \
 INIPARSER_OBJ = iniparser_build/iniparser.o iniparser_build/dictionary.o \
                iniparser_build/strlib.o
 
-TDBBACKUP_OBJ = lib/tdb/tools/tdbbackup.o $(LIBREPLACE_OBJ) \
-       $(TDBBASE_OBJ) $(SOCKET_WRAPPER_OBJ)
+TDBBACKUP_OBJ = @tdbdir@/tools/tdbbackup.o $(LIBREPLACE_OBJ) \
+       @LIBTDB_STATIC@ $(SOCKET_WRAPPER_OBJ)
 
-TDBTOOL_OBJ = lib/tdb/tools/tdbtool.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ) \
+TDBTOOL_OBJ = @tdbdir@/tools/tdbtool.o @LIBTDB_STATIC@ $(LIBREPLACE_OBJ) \
        $(SOCKET_WRAPPER_OBJ)
 
-TDBDUMP_OBJ = lib/tdb/tools/tdbdump.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ) \
+TDBDUMP_OBJ = @tdbdir@/tools/tdbdump.o @LIBTDB_STATIC@ $(LIBREPLACE_OBJ) \
        $(SOCKET_WRAPPER_OBJ)
 
-TDBTORTURE_OBJ = lib/tdb/tools/tdbtorture.o $(TDBBASE_OBJ) $(LIBREPLACE_OBJ) \
+TDBTORTURE_OBJ = @tdbdir@/tools/tdbtorture.o @LIBTDB_STATIC@ $(LIBREPLACE_OBJ) \
        $(SOCKET_WRAPPER_OBJ)
 
 
@@ -993,10 +1056,14 @@ NTLM_AUTH_OBJ1 = utils/ntlm_auth.o utils/ntlm_auth_diagnostics.o
 
 NTLM_AUTH_OBJ = ${NTLM_AUTH_OBJ1} $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
                libsmb/asn1.o libsmb/spnego.o libsmb/clikrb5.o libads/kerberos.o \
-               libads/kerberos_verify.o $(SECRETS_OBJ) $(SERVER_MUTEX_OBJ) \
-               libads/authdata.o $(RPC_PARSE_OBJ1) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) \
-               $(SMBLDAP_OBJ) $(DOSERR_OBJ) rpc_parse/parse_net.o $(LIBNMB_OBJ) \
-               $(LDB_OBJ) $(ERRORMAP_OBJ) 
+               $(SECRETS_OBJ) $(SERVER_MUTEX_OBJ) $(LIBADS_SERVER_OBJ) \
+               $(RPC_PARSE_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+               $(SMBLDAP_OBJ) $(DOSERR_OBJ) $(LIBNMB_OBJ) \
+               $(LDB_OBJ) $(ERRORMAP_OBJ) $(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@ \
+               librpc/gen_ndr/ndr_samr.o \
+               librpc/gen_ndr/ndr_lsa.o \
+               librpc/gen_ndr/ndr_netlogon.o
+
 
 VLP_OBJ1 = ../testsuite/printing/vlp.o $(RPC_CLIENT_OBJ1) $(RPC_PARSE_OBJ2) $(RPC_CLIENT_OBJ)
 
@@ -1009,8 +1076,8 @@ VLP_OBJ = $(VLP_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
 ######################################################################
 # now the rules...
 ######################################################################
-all : SHOWFLAGS $(SBIN_PROGS) $(BIN_PROGS) $(ROOT_SBIN_PROGS) \
-       $(SHLIBS) $(MODULES) $(NSS_MODULES) $(PAM_MODULES) @EXTRA_ALL_TARGETS@
+all : SHOWFLAGS $(SHLIBS) $(SBIN_PROGS) $(BIN_PROGS) $(ROOT_SBIN_PROGS) \
+       $(MODULES) $(NSS_MODULES) $(PAM_MODULES) @EXTRA_ALL_TARGETS@
 
 nss_modules : $(NSS_MODULES)
 
@@ -1060,9 +1127,10 @@ modules: SHOWFLAGS $(MODULES)
 
 #####################################################################
 ## Perl IDL Compiler
-IDL_FILES = unixinfo.idl lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
+IDL_FILES = lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
        srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
-       epmapper.idl messaging.idl xattr.idl
+       epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
+       dssetup.idl krb5pac.idl ntsvcs.idl libnet_join.idl
 
 idl:
        @IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
@@ -1072,7 +1140,7 @@ idl:
 #####################################################################
 
 
-everything: all libsmbclient libnetapi debug2html smbfilter talloctort replacetort modules torture \
+everything: all libtalloc libsmbclient libnetapi debug2html smbfilter talloctort replacetort modules torture \
        $(EVERYTHING_PROGS)
 
 .SUFFIXES:
@@ -1175,61 +1243,50 @@ bin/.dummy:
          dir=bin $(MAKEDIR); fi
        @: >> $@ || : > $@ # what a fancy emoticon!
 
-bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) @LIBWBCLIENT_SHARED@ @BUILD_POPT@
+bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@ @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) \
                $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \
                $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) \
-               @POPTLIBS@ @SMBD_LIBS@ @WINBIND_LIBS@
+               @POPTLIBS@ @SMBD_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/nmbd@EXEEXT@: $(BINARY_PREREQS) $(NMBD_OBJ) @BUILD_POPT@
+bin/nmbd@EXEEXT@: $(BINARY_PREREQS) $(NMBD_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
+               @LIBTDB_LIBS@ @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
 
-bin/swat@EXEEXT@: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@ 
+bin/swat@EXEEXT@: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \
          $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) \
-         $(LDAP_LIBS) @WINBIND_LIBS@
+         $(LDAP_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/rpcclient@EXEEXT@: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/rpcclient@EXEEXT@: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \
                $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
-               $(KRB5LIBS) $(LDAP_LIBS) @WINBIND_LIBS@
+               $(KRB5LIBS) $(LDAP_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/smbclient@EXEEXT@: $(BINARY_PREREQS) $(CLIENT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/smbclient@EXEEXT@: $(BINARY_PREREQS) $(CLIENT_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) \
                $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
-               $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(DNSSD_LIBS) @WINBIND_LIBS@
+               $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(DNSSD_LIBS) \
+               @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/net@EXEEXT@: $(BINARY_PREREQS) $(NET_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/net@EXEEXT@: $(BINARY_PREREQS) $(NET_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
                @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) \
-               $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @INIPARSERLIBS@ @WINBIND_LIBS@
+               $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @INIPARSERLIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@ @LIBNETAPI_LIBS@
 
-bin/profiles@EXEEXT@: $(BINARY_PREREQS) $(PROFILES_OBJ) @BUILD_POPT@
+bin/profiles@EXEEXT@: $(BINARY_PREREQS) $(PROFILES_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(PROFILES_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(PROFILES_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/smbspool@EXEEXT@: $(BINARY_PREREQS) $(CUPS_OBJ) @BUILD_POPT@
+bin/smbspool@EXEEXT@: $(BINARY_PREREQS) $(CUPS_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(CUPS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
-
-bin/smbmount@EXEEXT@: $(BINARY_PREREQS) $(MOUNT_OBJ) @BUILD_POPT@
-       @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
-
-bin/smbmnt@EXEEXT@: $(BINARY_PREREQS) $(MNT_OBJ) @BUILD_POPT@
-       @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(DYNEXP) $(LDFLAGS) @POPTLIBS@
-
-bin/smbumount@EXEEXT@: $(BINARY_PREREQS) $(UMOUNT_OBJ) @BUILD_POPT@
-       @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(CUPS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
 bin/mount.cifs@EXEEXT@: $(BINARY_PREREQS) $(CIFS_MOUNT_OBJ) @BUILD_POPT@
        @echo Linking $@
@@ -1239,174 +1296,199 @@ bin/umount.cifs@EXEEXT@: $(BINARY_PREREQS) $(CIFS_UMOUNT_OBJ) @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(CIFS_UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) @POPTLIBS@
 
-bin/cifs.spnego@EXEEXT@: $(BINARY_PREREQS) $(CIFS_SPNEGO_OBJ) $(LIBSMBCLIENT_OBJ) @BUILD_POPT@
+bin/cifs.spnego@EXEEXT@: $(BINARY_PREREQS) $(CIFS_SPNEGO_OBJ) $(LIBSMBCLIENT_OBJ0) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(CIFS_SPNEGO_OBJ) $(DYNEXP) $(LDFLAGS) -lkeyutils $(LIBS) \
-               $(LIBSMBCLIENT_OBJ) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBWBCLIENT_SHARED@
+               $(LIBSMBCLIENT_OBJ0) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBWBCLIENT_SHARED@ @LIBTDB_LIBS@
 
-bin/testparm@EXEEXT@: $(BINARY_PREREQS) $(TESTPARM_OBJ) @BUILD_POPT@
+bin/testparm@EXEEXT@: $(BINARY_PREREQS) $(TESTPARM_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/smbstatus@EXEEXT@: $(BINARY_PREREQS) $(STATUS_OBJ) @BUILD_POPT@
+bin/smbstatus@EXEEXT@: $(BINARY_PREREQS) $(STATUS_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAP_LIBS) \
-       @POPTLIBS@
+       @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/smbcontrol@EXEEXT@: $(BINARY_PREREQS) $(SMBCONTROL_OBJ) @BUILD_POPT@
+bin/smbcontrol@EXEEXT@: $(BINARY_PREREQS) $(SMBCONTROL_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) -DUSING_SMBCONTROL $(FLAGS) -o $@ \
        $(SMBCONTROL_OBJ) $(DYNEXP) $(LDFLAGS) \
-       $(LIBS) $(LDAP_LIBS) @LIBUNWIND_PTRACE@ @POPTLIBS@
+       $(LIBS) $(LDAP_LIBS) @LIBUNWIND_PTRACE@ @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/smbtree@EXEEXT@: $(BINARY_PREREQS) $(SMBTREE_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/smbtree@EXEEXT@: $(BINARY_PREREQS) $(SMBTREE_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBTREE_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/smbpasswd@EXEEXT@: $(BINARY_PREREQS) $(SMBPASSWD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/smbpasswd@EXEEXT@: $(BINARY_PREREQS) $(SMBPASSWD_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(PASSDB_LIBS) \
-               $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) @WINBIND_LIBS@
+               $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) \
+               @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/pdbedit@EXEEXT@: $(BINARY_PREREQS) $(PDBEDIT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/pdbedit@EXEEXT@: $(BINARY_PREREQS) $(PDBEDIT_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS) @WINBIND_LIBS@
+               @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/smbget@EXEEXT@: $(BINARY_PREREQS) $(SMBGET_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/smbget@EXEEXT@: $(BINARY_PREREQS) $(SMBGET_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBGET_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@  $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               @POPTLIBS@  $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/samtest@EXEEXT@: $(SAMTEST_OBJ) @BUILD_POPT@
+bin/nmblookup@EXEEXT@: $(BINARY_PREREQS) $(NMBLOOKUP_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SAMTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(KRB5LIBS) $(LDAP_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
+               @POPTLIBS@ $(LDAP_LIBS) @LIBTDB_LIBS@
 
-bin/nmblookup@EXEEXT@: $(BINARY_PREREQS) $(NMBLOOKUP_OBJ) @BUILD_POPT@
+bin/smbtorture@EXEEXT@: $(BINARY_PREREQS) $(SMBTORTURE_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(LDAP_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/smbtorture@EXEEXT@: $(BINARY_PREREQS) $(SMBTORTURE_OBJ) @BUILD_POPT@
-       @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
-
-bin/talloctort@EXEEXT@: $(BINARY_PREREQS) $(TALLOCTORT_OBJ) @BUILD_POPT@
+bin/talloctort@EXEEXT@: $(BINARY_PREREQS) $(TALLOCTORT_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(TALLOCTORT_OBJ) $(LDFLAGS) \
-               $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@
+               $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
 bin/replacetort@EXEEXT@: $(REPLACETORT_OBJ) @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(REPLACETORT_OBJ) $(LDFLAGS) \
                $(DYNEXP) $(LIBS) @POPTLIBS@
 
-bin/masktest@EXEEXT@: $(BINARY_PREREQS) $(MASKTEST_OBJ) @BUILD_POPT@
+bin/masktest@EXEEXT@: $(BINARY_PREREQS) $(MASKTEST_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/msgtest@EXEEXT@: $(BINARY_PREREQS) $(MSGTEST_OBJ) @BUILD_POPT@
+bin/msgtest@EXEEXT@: $(BINARY_PREREQS) $(MSGTEST_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/smbcacls@EXEEXT@: $(BINARY_PREREQS) $(SMBCACLS_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/smbcacls@EXEEXT@: $(BINARY_PREREQS) $(SMBCACLS_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ \
-       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/smbcquotas@EXEEXT@: $(BINARY_PREREQS) $(SMBCQUOTAS_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/smbcquotas@EXEEXT@: $(BINARY_PREREQS) $(SMBCQUOTAS_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBCQUOTAS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ \
-       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/eventlogadm@EXEEXT@: $(BINARY_PREREQS) $(EVTLOGADM_OBJ) @BUILD_POPT@
+bin/eventlogadm@EXEEXT@: $(BINARY_PREREQS) $(EVTLOGADM_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(EVTLOGADM_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(EVTLOGADM_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/sharesec@EXEEXT@: $(BINARY_PREREQS) $(SHARESEC_OBJ) @BUILD_POPT@
+bin/sharesec@EXEEXT@: $(BINARY_PREREQS) $(SHARESEC_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SHARESEC_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(SHARESEC_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/locktest@EXEEXT@: $(BINARY_PREREQS) $(LOCKTEST_OBJ) @BUILD_POPT@
+bin/locktest@EXEEXT@: $(BINARY_PREREQS) $(LOCKTEST_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/nsstest@EXEEXT@: $(BINARY_PREREQS) $(NSSTEST_OBJ) @BUILD_POPT@
+bin/nsstest@EXEEXT@: $(BINARY_PREREQS) $(NSSTEST_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS)  $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS)  $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/pdbtest@EXEEXT@: $(BINARY_PREREQS) $(PDBTEST_OBJ) @BUILD_POPT@
+bin/pdbtest@EXEEXT@: $(BINARY_PREREQS) $(PDBTEST_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(PDBTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@ @LIBWBCLIENT_SHARED@
+       @$(CC) $(FLAGS) -o $@ $(PDBTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@ @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@
 
-bin/vfstest@EXEEXT@: $(BINARY_PREREQS) $(VFSTEST_OBJ) @BUILD_POPT@
+bin/vfstest@EXEEXT@: $(BINARY_PREREQS) $(VFSTEST_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(VFSTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) $(ACL_LIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) @SMBD_LIBS@ $(NSCD_LIBS) @LIBWBCLIENT_SHARED@
+       @$(CC) $(FLAGS) -o $@ $(VFSTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) $(ACL_LIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) @SMBD_LIBS@ $(NSCD_LIBS) @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@
 
-bin/smbiconv@EXEEXT@: $(BINARY_PREREQS) $(SMBICONV_OBJ) @BUILD_POPT@
+bin/smbiconv@EXEEXT@: $(BINARY_PREREQS) $(SMBICONV_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBICONV_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(SMBICONV_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
 bin/log2pcap@EXEEXT@: $(BINARY_PREREQS) $(LOG2PCAP_OBJ) @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LOG2PCAP_OBJ) $(LDFLAGS) $(DYNEXP) @POPTLIBS@ $(LIBS)
 
-bin/locktest2@EXEEXT@: $(BINARY_PREREQS) $(LOCKTEST2_OBJ) @BUILD_POPT@
+bin/locktest2@EXEEXT@: $(BINARY_PREREQS) $(LOCKTEST2_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/ndrdump@EXEEXT@: $(BINARY_PREREQS) $(NDRDUMP_OBJ) @BUILD_POPT@
+bin/ndrdump@EXEEXT@: $(BINARY_PREREQS) $(NDRDUMP_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NDRDUMP_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
-               @POPTLIBS@ @LDAP_LIBS@
+               @POPTLIBS@ @LDAP_LIBS@ @LIBTDB_LIBS@
 
 bin/debug2html@EXEEXT@: $(BINARY_PREREQS) $(DEBUG2HTML_OBJ) @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(DEBUG2HTML_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS)
 
-bin/smbfilter@EXEEXT@: $(BINARY_PREREQS) $(SMBFILTER_OBJ) @BUILD_POPT@
+bin/smbfilter@EXEEXT@: $(BINARY_PREREQS) $(SMBFILTER_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@
 
-bin/ldbedit: $(BINARY_PREREQS) $(LDBEDIT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/ldbedit: $(BINARY_PREREQS) $(LDBEDIT_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBEDIT_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
                @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
-               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/ldbsearch: $(BINARY_PREREQS) $(LDBSEARCH_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/ldbsearch: $(BINARY_PREREQS) $(LDBSEARCH_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBSEARCH_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
                @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
-               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/ldbadd: $(BINARY_PREREQS) $(LDBADD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/ldbadd: $(BINARY_PREREQS) $(LDBADD_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBADD_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
                @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
-               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/ldbmodify: $(BINARY_PREREQS) $(LDBMODIFY_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/ldbmodify: $(BINARY_PREREQS) $(LDBMODIFY_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBMODIFY_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
                @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
-               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBDEL_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
                @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
-               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
+
+$(LIBTALLOC_SHARED_TARGET): $(BINARY_PREREQS) $(LIBTALLOC_OBJ)
+       @echo Linking shared library $@
+       @$(SHLD_DSO) $(LIBTALLOC_OBJ) \
+               @SONAMEFLAG@`basename $@`.$(SONAME_VER)
+       @ln -s -f `basename $@` $@.$(SONAME_VER)
+
+$(LIBTALLOC_STATIC_TARGET): $(BINARY_PREREQS) $(LIBTALLOC_OBJ0)
+       @echo Linking non-shared library $@
+       @-$(AR) -rc $@ $(LIBTALLOC_OBJ0)
+
+MKSYMS_SH = $(srcdir)/script/mksyms.sh
+
+$(LIBTDB_SYMS): $(LIBTDB_HEADERS)
+       @$(MKSYMS_SH) $(AWK) $@ $(LIBTDB_HEADERS)
 
-bin/libwbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ)
+$(LIBTDB_SHARED_TARGET): $(BINARY_PREREQS) $(LIBTDB_OBJ) $(LIBTDB_SYMS)
        @echo Linking shared library $@
-       @$(SHLD_DSO) $(LIBWBCLIENT_OBJ) \
+       @$(SHLD_DSO) $(LIBTDB_OBJ) \
                @SONAMEFLAG@`basename $@`.$(SONAME_VER)
        @ln -s -f `basename $@` $@.$(SONAME_VER)
 
-bin/libwbclient.a: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ0)
+$(LIBTDB_STATIC_TARGET): $(BINARY_PREREQS) $(LIBTDB_OBJ0)
        @echo Linking non-shared library $@
-       @-$(AR) -rc $@ $(LIBWBCLIENT_OBJ0)
+       @-$(AR) -rc $@ $(LIBTDB_OBJ0)
+
+bin/libwbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ) @LIBTALLOC_SHARED@
+       @echo Linking shared library $@
+       @$(SHLD_DSO) @LIBTALLOC_LIBS@ $(LIBWBCLIENT_OBJ) \
+               @SONAMEFLAG@`basename $@`.$(SONAME_VER)
+       @ln -s -f `basename $@` $@.$(SONAME_VER)
+
+bin/libwbclient.a: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ0) $(WBCOMMON_OBJ)
+       @echo Linking non-shared library $@
+       @-$(AR) -rc $@ $(LIBWBCLIENT_OBJ0) $(WBCOMMON_OBJ)
 
 bin/libaddns.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
        @echo Linking shared library $@
@@ -1418,29 +1500,30 @@ bin/libaddns.a: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
        @echo Linking non-shared library $@
        @-$(AR) -rc $@ $(LIBADDNS_OBJ)
 
-bin/libnetapi.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBNETAPI_OBJ)
+$(LIBNETAPI_SHARED_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ) @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking shared library $@
-       @$(SHLD_DSO) $(LIBNETAPI_OBJ) @LIBWBCLIENT_SHARED@ $(LIBS) \
+       @$(SHLD_DSO) $(LIBNETAPI_OBJ) @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@ $(LIBS) \
                $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) \
                @SONAMEFLAG@`basename $@`.$(SONAME_VER)
+       @ln -s -f `basename $@` $@.$(SONAME_VER)
 
-bin/libnetapi.a: $(BINARY_PREREQS) $(LIBNETAPI_OBJ)
+$(LIBNETAPI_STATIC_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ1)
        @echo Linking non-shared library $@
-       @-$(AR) -rc $@ $(LIBNETAPI_OBJ)
+       @-$(AR) -rc $@ $(LIBNETAPI_OBJ1)
 
-bin/libsmbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
+bin/libsmbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ) @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking shared library $@
-       @$(SHLD_DSO) $(LIBSMBCLIENT_OBJ) @LIBWBCLIENT_SHARED@ $(LIBS) \
+       @$(SHLD_DSO) $(LIBSMBCLIENT_OBJ) @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@ $(LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
                @SONAMEFLAG@`basename $@`.$(SONAME_VER)
 
-bin/libsmbclient.a: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
+bin/libsmbclient.a: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ0)
        @echo Linking non-shared library $@
-       @-$(AR) -rc $@ $(LIBSMBCLIENT_OBJ)
+       @-$(AR) -rc $@ $(LIBSMBCLIENT_OBJ0)
 
-bin/libsmbsharemodes.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ)
+bin/libsmbsharemodes.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ) @LIBTDB_SHARED@
        @echo Linking shared library $@
-       @$(SHLD_DSO) $(LIBSMBSHAREMODES_OBJ) $(LIBS) \
+       @$(SHLD_DSO) $(LIBSMBSHAREMODES_OBJ) $(LIBS) @LIBTDB_LIBS@ \
                $(KRB5LIBS) $(LDAP_LIBS) \
                @SONAMEFLAG@`basename $@`.$(SONAME_VER)
 
@@ -1461,6 +1544,8 @@ bin/libbigballofmud.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBBIGBALLOFMUD_OBJ)
 # it can be fixed or if they just can't be called from a static
 # library.
 
+libtalloc: $(LIBTALLOC)
+libtdb: $(LIBTDB)
 libsmbclient: $(LIBSMBCLIENT)
 libsmbsharemodes: $(LIBSMBSHAREMODES)
 libaddns: $(LIBADDNS)
@@ -1479,10 +1564,6 @@ bin/librpc_samr.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SAMR_OBJ)
        @echo "Linking $@"
        @$(SHLD_MODULE) $(RPC_SAMR_OBJ)
 
-bin/librpc_unixinfo.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_UNIXINFO_OBJ)
-       @echo "Linking $@"
-       @$(SHLD_MODULE) $(RPC_UNIXINFO_OBJ)
-
 bin/librpc_srvsvc.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SVC_OBJ)
        @echo "Linking $@"
        @$(SHLD_MODULE) $(RPC_SVC_OBJ)
@@ -1511,9 +1592,9 @@ bin/librpc_initshutdown.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_INITSHUTDOWN_OBJ)
        @echo "Linking $@"
        @$(SHLD_MODULE) $(RPC_INITSHUTDOWN_OBJ)
 
-bin/librpc_lsa_ds.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_LSA_DS_OBJ)
+bin/librpc_dssetup.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_DSSETUP_OBJ)
        @echo "Linking $@"
-       @$(SHLD_MODULE) $(RPC_LSA_DS_OBJ)
+       @$(SHLD_MODULE) $(RPC_DSSETUP_OBJ)
 
 bin/librpc_spoolss.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_SPOOLSS_OBJ)
        @echo "Linking $@"
@@ -1531,26 +1612,26 @@ bin/librpc_echo.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_ECHO_OBJ)
        @echo "Linking $@"
        @$(SHLD_MODULE) $(RPC_ECHO_OBJ)
 
-bin/winbindd@EXEEXT@: $(BINARY_PREREQS) $(WINBINDD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/winbindd@EXEEXT@: $(BINARY_PREREQS) $(WINBINDD_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
        @$(CC) $(FLAGS) -o $@ $(WINBINDD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
                @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) \
-               $(PASSDB_LIBS) @WINBIND_LIBS@
+               $(PASSDB_LIBS) @LIBTDB_LIBS@ @WINBIND_LIBS@
 
-bin/vlp@EXEEXT@: $(BINARY_PREREQS) $(VLP_OBJ) @LIBWBCLIENT_SHARED@
+bin/vlp@EXEEXT@: $(BINARY_PREREQS) $(VLP_OBJ) @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
        @$(CC) $(FLAGS) -o $@ $(VLP_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
-               $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @LIBWBCLIENT_SHARED@
+               $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@
 
 @WINBIND_NSS@: $(BINARY_PREREQS) $(WINBIND_NSS_OBJ)
        @echo "Linking $@"
        @$(SHLD) $(WINBIND_NSS_LDSHFLAGS) -o $@ $(WINBIND_NSS_OBJ) \
                @WINBIND_NSS_EXTRA_LIBS@ @WINBIND_NSS_PTHREAD@ @SONAMEFLAG@`basename $@`@NSSSONAMEVERSIONSUFFIX@
 
-@WINBIND_WINS_NSS@: $(BINARY_PREREQS) $(WINBIND_WINS_NSS_OBJ)
+@WINBIND_WINS_NSS@: $(BINARY_PREREQS) $(WINBIND_WINS_NSS_OBJ) @LIBTDB_SHARED@
        @echo "Linking $@"
        @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_OBJ) \
-               $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) \
+               $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) @LIBTDB_LIBS@ \
                @SONAMEFLAG@`basename $@`@NSSSONAMEVERSIONSUFFIX@
 
 bin/winbind_krb5_locator.@SHLIBEXT@: $(BINARY_PREREQS) $(WINBIND_KRB5_LOCATOR_OBJ)
@@ -1611,6 +1692,10 @@ bin/ad.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_ad.o
        @echo "Building plugin $@"
        @$(SHLD_MODULE) winbindd/idmap_ad.o
 
+bin/tdb2.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_tdb2.o
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) winbindd/idmap_tdb2.o
+
 bin/ldap.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_ldap.o
        @echo "Building plugin $@"
        @$(SHLD_MODULE) winbindd/idmap_ldap.o
@@ -1670,6 +1755,10 @@ bin/shadow_copy.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_SHADOW_COPY_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_SHADOW_COPY_OBJ)
 
+bin/shadow_copy2.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_SHADOW_COPY2_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_SHADOW_COPY2_OBJ)
+
 bin/syncops.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_SYNCOPS_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_SYNCOPS_OBJ)
@@ -1726,6 +1815,14 @@ bin/catia.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_CATIA_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_CATIA_OBJ)
 
+bin/streams_xattr.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_STREAMS_XATTR_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_STREAMS_XATTR_OBJ)
+
+bin/streams_depot.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_STREAMS_DEPOT_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_STREAMS_DEPOT_OBJ)
+
 bin/cacheprime.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_CACHEPRIME_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_CACHEPRIME_OBJ)
@@ -1750,47 +1847,56 @@ bin/readahead.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_READAHEAD_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_READAHEAD_OBJ)
 
+bin/tsmsm.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_TSMSM_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_TSMSM_OBJ)
+
 bin/fileid.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_FILEID_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_FILEID_OBJ)
 
+bin/aio_fork.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_AIO_FORK_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_AIO_FORK_OBJ)
+
 #########################################################
 ## IdMap NSS plugins
 
 ## None here right now
 #########################################################
 
-bin/wbinfo@EXEEXT@: $(BINARY_PREREQS) $(WBINFO_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+bin/wbinfo@EXEEXT@: $(BINARY_PREREQS) $(WBINFO_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(WBINFO_OBJ) $(DYNEXP) $(LIBS) \
-               $(LDAP_LIBS) @POPTLIBS@ @WINBIND_LIBS@
+               $(LDAP_LIBS) @POPTLIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
 
 bin/ntlm_auth@EXEEXT@: $(BINARY_PREREQS) $(NTLM_AUTH_OBJ) $(PARAM_OBJ) \
-       $(LIB_NONSMBD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
+       $(LIB_NONSMBD_OBJ) @BUILD_POPT@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(NTLM_AUTH_OBJ) \
                $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBS) \
-               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               @LIBTDB_LIBS@ @WINBIND_LIBS@
 
 bin/pam_smbpass.@SHLIBEXT@: $(BINARY_PREREQS) $(PAM_SMBPASS_OBJ)
        @echo "Linking shared library $@"
        @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(DYNEXP) $(LIBS) $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS)
 
-bin/tdbbackup@EXEEXT@: $(BINARY_PREREQS) $(TDBBACKUP_OBJ)
+bin/tdbbackup@EXEEXT@: $(BINARY_PREREQS) $(TDBBACKUP_OBJ) @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ)
+       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBBACKUP_OBJ) $(DYNEXP) $(LIBS) @LIBTDB_LIBS@
 
-bin/tdbtool@EXEEXT@: $(BINARY_PREREQS) $(TDBTOOL_OBJ)
+bin/tdbtool@EXEEXT@: $(BINARY_PREREQS) $(TDBTOOL_OBJ) @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBTOOL_OBJ)
+       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBTOOL_OBJ) $(DYNEXP) $(LIBS) @LIBTDB_LIBS@
 
-bin/tdbdump@EXEEXT@: $(BINARY_PREREQS) $(TDBDUMP_OBJ)
+bin/tdbdump@EXEEXT@: $(BINARY_PREREQS) $(TDBDUMP_OBJ) @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBDUMP_OBJ)
+       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBDUMP_OBJ) $(DYNEXP) $(LIBS) @LIBTDB_LIBS@
 
-bin/tdbtorture@EXEEXT@: $(BINARY_PREREQS) $(TDBTORTURE_OBJ)
+bin/tdbtorture@EXEEXT@: $(BINARY_PREREQS) $(TDBTORTURE_OBJ) @LIBTDB_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBTORTURE_OBJ)
+       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBTORTURE_OBJ) $(DYNEXP) $(LIBS) @LIBTDB_LIBS@
 
 bin/t_strcmp@EXEEXT@: $(BINARY_PREREQS) bin/libbigballofmud.@SHLIBEXT@ torture/t_strcmp.o
        $(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) torture/t_strcmp.o -L ./bin -lbigballofmud
@@ -1810,8 +1916,10 @@ bin/timelimit@EXEEXT@: script/tests/timelimit.o
 
 install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ installman \
                installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ \
+               installlibtalloc \
+               installlibtdb \
                @INSTALL_LIBSMBCLIENT@ @INSTALL_PAM_MODULES@ \
-               @INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBWBCLIENT@ @INSTALL_LIBNETAPI@
+               @INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBWBCLIENT@ installlibnetapi
 
 install-everything: install installmodules
 
@@ -1878,6 +1986,20 @@ installclientlib: installdirs libsmbclient
        @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) ${prefix}/include
        -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include
 
+installlibtalloc: installdirs libtalloc
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
+       -$(INSTALLLIBCMD_SH) $(LIBTALLOC_SHARED_TARGET) $(DESTDIR)$(LIBDIR)
+       -$(INSTALLLIBCMD_A) $(LIBTALLOC_STATIC_TARGET) $(DESTDIR)$(LIBDIR)
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) ${prefix}/include
+       -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) @tallocdir@/talloc.h $(DESTDIR)${prefix}/include
+
+installlibtdb: installdirs libtdb
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
+       -$(INSTALLLIBCMD_SH) $(LIBTDB_SHARED_TARGET) $(DESTDIR)$(LIBDIR)
+       -$(INSTALLLIBCMD_A) $(LIBTDB_STATIC_TARGET) $(DESTDIR)$(LIBDIR)
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) ${prefix}/include
+       -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(LIBTDB_HEADERS) $(DESTDIR)${prefix}/include
+
 installlibsmbsharemodes: installdirs libsmbsharemodes
        @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
        -$(INSTALLLIBCMD_SH) bin/libsmbsharemodes.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
@@ -1897,8 +2019,8 @@ installlibwbclient: installdirs libwbclient
 
 installlibnetapi: installdirs libnetapi
        @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
-       -$(INSTALLLIBCMD_SH) bin/libnetapi.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
-       -$(INSTALLLIBCMD_A) bin/libnetapi.a $(DESTDIR)$(LIBDIR)
+       -$(INSTALLLIBCMD_SH) $(LIBNETAPI_SHARED_TARGET) $(DESTDIR)$(LIBDIR)
+       -$(INSTALLLIBCMD_A) $(LIBNETAPI_STATIC_TARGET) $(DESTDIR)$(LIBDIR)
        -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/lib/netapi/netapi.h $(DESTDIR)${prefix}/include
 
 installpammodules: $(PAM_MODULES)
@@ -1915,8 +2037,7 @@ revert:
        @$(SHELL) $(srcdir)/script/revert.sh $(BINDIR) $(BIN_PROGS) $(SCRIPTS)
 
 installman: installdirs
-       @SMBMOUNT_PROGS="@SMBMOUNT_PROGS@" $(SHELL) \
-               $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(srcdir) C "@ROFF@"
+       @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(srcdir) C "@ROFF@"
 
 .PHONY: showlayout
 
@@ -1935,7 +2056,7 @@ showlayout:
        @echo "  swatdir:     $(SWATDIR)"
 
 
-uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ @UNINSTALL_LIBNETAPI@
+uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules uninstalllibtalloc uninstalllibtdb @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ uninstalllibnetapi
 
 uninstallman:
        @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C
@@ -2006,10 +2127,12 @@ clean: delheaders
                ../testsuite/*/*.o \
                */*.@SHLIBEXT@ */*/*.@SHLIBEXT@ */*/*/*.@SHLIBEXT@ \
                $(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(ROOT_SBIN_PROGS) \
-               $(MODULES) $(TORTURE_PROGS) $(LIBSMBCLIENT) $(LIBADDNS) \
+               $(MODULES) $(TORTURE_PROGS) \
+               $(LIBTALLOC) $(LIBSMBCLIENT) $(LIBADDNS) \
                $(LIBSMBSHAREMODES) $(EVERYTHING_PROGS) $(LIBNETAPI) \
                bin/libwbclient.so.0 bin/timelimit \
-               .headers.stamp */src/*.o proto_exists
+               .headers.stamp */src/*.o proto_exists \
+               $(LIBTDB_SYMS)
        -rm -rf t_dir
 
 # Making this target will just make sure that the prototype files
@@ -2172,7 +2295,7 @@ test_pam_modules: pam_modules
 ##
 test: all torture timelimit
        @echo Running Test suite
-       @LIB_PATH_VAR=$(LIB_PATH_VAR) PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix}/st all "${smbtorture4_path}"
+       @LIB_PATH_VAR=$(LIB_PATH_VAR) PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix} all "${smbtorture4_path}"
 
 valgrindtest: all torture timelimit
        @echo Running Test suite with valgrind
@@ -2180,5 +2303,5 @@ valgrindtest: all torture timelimit
         NMBD_VALGRIND="xterm -n nmbd -e valgrind -q --db-attach=yes --num-callers=30" \
         WINBINDD_VALGRIND="xterm -n winbindd -e valgrind -q --db-attach=yes --num-callers=30" \
         SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
-        VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/st/valgrind.log" \
-        PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix}/st all "${smbtorture4_path}"
+        VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
+        PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix} all "${smbtorture4_path}"
index 0a9ae32472d850686fc2912814708e1705d35566..05bb6a5af0c1650a4257bd3404495b9a573a8261 100644 (file)
@@ -458,7 +458,9 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
        char **auth_method_list = NULL; 
        NTSTATUS nt_status;
 
-       if (lp_auth_methods() && !str_list_copy(&auth_method_list, lp_auth_methods())) {
+       if (lp_auth_methods()
+           && !str_list_copy(talloc_tos(), &auth_method_list,
+                             lp_auth_methods())) {
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -467,38 +469,52 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
                {
                case SEC_DOMAIN:
                        DEBUG(5,("Making default auth method list for security=domain\n"));
-                       auth_method_list = str_list_make("guest sam winbind:ntdomain", NULL);
+                       auth_method_list = str_list_make(
+                               talloc_tos(), "guest sam winbind:ntdomain",
+                               NULL);
                        break;
                case SEC_SERVER:
                        DEBUG(5,("Making default auth method list for security=server\n"));
-                       auth_method_list = str_list_make("guest sam smbserver", NULL);
+                       auth_method_list = str_list_make(
+                               talloc_tos(), "guest sam smbserver",
+                               NULL);
                        break;
                case SEC_USER:
                        if (lp_encrypted_passwords()) { 
                                if ((lp_server_role() == ROLE_DOMAIN_PDC) || (lp_server_role() == ROLE_DOMAIN_BDC)) {
                                        DEBUG(5,("Making default auth method list for DC, security=user, encrypt passwords = yes\n"));
-                                       auth_method_list = str_list_make("guest sam winbind:trustdomain", NULL);
+                                       auth_method_list = str_list_make(
+                                               talloc_tos(),
+                                               "guest sam winbind:trustdomain",
+                                               NULL);
                                } else {
                                        DEBUG(5,("Making default auth method list for standalone security=user, encrypt passwords = yes\n"));
-                                       auth_method_list = str_list_make("guest sam", NULL);
+                                       auth_method_list = str_list_make(
+                                               talloc_tos(), "guest sam",
+                                               NULL);
                                }
                        } else {
                                DEBUG(5,("Making default auth method list for security=user, encrypt passwords = no\n"));
-                               auth_method_list = str_list_make("guest unix", NULL);
+                               auth_method_list = str_list_make(
+                                       talloc_tos(), "guest unix", NULL);
                        }
                        break;
                case SEC_SHARE:
                        if (lp_encrypted_passwords()) {
                                DEBUG(5,("Making default auth method list for security=share, encrypt passwords = yes\n"));
-                               auth_method_list = str_list_make("guest sam", NULL);
+                               auth_method_list = str_list_make(
+                                       talloc_tos(), "guest sam", NULL);
                        } else {
                                DEBUG(5,("Making default auth method list for security=share, encrypt passwords = no\n"));
-                               auth_method_list = str_list_make("guest unix", NULL);
+                               auth_method_list = str_list_make(
+                                       talloc_tos(), "guest unix", NULL);
                        }
                        break;
                case SEC_ADS:
                        DEBUG(5,("Making default auth method list for security=ADS\n"));
-                       auth_method_list = str_list_make("guest sam winbind:ntdomain", NULL);
+                       auth_method_list = str_list_make(
+                               talloc_tos(), "guest sam winbind:ntdomain",
+                               NULL);
                        break;
                default:
                        DEBUG(5,("Unknown auth method!\n"));
@@ -508,12 +524,10 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
                DEBUG(5,("Using specified auth order\n"));
        }
        
-       if (!NT_STATUS_IS_OK(nt_status = make_auth_context_text_list(auth_context, auth_method_list))) {
-               str_list_free(&auth_method_list);
-               return nt_status;
-       }
-       
-       str_list_free(&auth_method_list);
+       nt_status = make_auth_context_text_list(auth_context,
+                                               auth_method_list);
+
+       TALLOC_FREE(auth_method_list);
        return nt_status;
 }
 
index 1de9869f9078e91d41957b6df7fb1cf0cbe94735..df51966f4c155d34de3a60ec43b4b1edfc23f1fe 100644 (file)
@@ -124,7 +124,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result)));
 
        if (!lp_client_schannel()) {
                /* We need to set up a creds chain on an unauthenticated netlogon pipe. */
-               uint32 neg_flags = NETLOGON_NEG_AUTH2_FLAGS;
+               uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS;
                uint32 sec_chan_type = 0;
                unsigned char machine_pwd[16];
                const char *account_name;
@@ -189,7 +189,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
                                        struct sockaddr_storage *dc_ss)
 
 {
-       NET_USER_INFO_3 info3;
+       struct netr_SamInfo3 *info3 = NULL;
        struct cli_state *cli = NULL;
        struct rpc_pipe_client *netlogon_pipe = NULL;
        NTSTATUS nt_status = NT_STATUS_NO_LOGON_SERVERS;
@@ -227,8 +227,6 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
 
        saf_store( domain, cli->desthost );
 
-       ZERO_STRUCT(info3);
-
         /*
          * If this call succeeds, we now have lots of info about the user
          * in the info3 structure.  
@@ -267,7 +265,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
                                                user_info->smb_name,
                                                domain,
                                                server_info,
-                                               &info3);
+                                               info3);
 
                if (NT_STATUS_IS_OK(nt_status)) {
                        if (user_info->was_mapped) {
@@ -281,12 +279,14 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
                                if (  !NT_STATUS_IS_OK(nt_status)) {
                                        DEBUG(1, ("PAM account restriction prevents user login\n"));
                                        cli_shutdown(cli);
+                                       TALLOC_FREE(info3);
                                        return nt_status;
                                }
                        }
                }
 
-               netsamlogon_cache_store( user_info->smb_name, &info3 );
+               netsamlogon_cache_store(user_info->smb_name, info3);
+               TALLOC_FREE(info3);
        }
 
        /* Note - once the cli stream is shutdown the mem_ctx used
index 526f2c93df0f3a733a8735998353d35c852ad34c..ed66d0db0afeed1147a797ed00d97d4e98415008 100644 (file)
@@ -186,8 +186,13 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
 
 void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
 {
-       TALLOC_CTX *mem_ctx = (*auth_ntlmssp_state)->mem_ctx;
+       TALLOC_CTX *mem_ctx;
+
+       if (*auth_ntlmssp_state == NULL) {
+               return;
+       }
 
+       mem_ctx = (*auth_ntlmssp_state)->mem_ctx;
        if ((*auth_ntlmssp_state)->ntlmssp_state) {
                ntlmssp_end(&(*auth_ntlmssp_state)->ntlmssp_state);
        }
index 1ab0c8b3eb5f52bfbf4047414f3d4164c3000b69..66504a8a525aaa2fa8d046efd866e81b4ca30e26 100644 (file)
@@ -122,7 +122,7 @@ static bool logon_hours_ok(struct samu *sampass)
 }
 
 /****************************************************************************
- Do a specific test for a struct samu being vaild for this connection 
+ Do a specific test for a struct samu being valid for this connection
  (ie not disabled, expired and the like).
 ****************************************************************************/
 
index ce47e94eb54f3279e8b2b200625bb94e665f9ff6..a95a59ea46f58d1c58c51174fadff767bd94879a 100644 (file)
@@ -1422,7 +1422,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                                const char *sent_nt_username,
                                const char *domain,
                                auth_serversupplied_info **server_info, 
-                               NET_USER_INFO_3 *info3) 
+                               struct netr_SamInfo3 *info3)
 {
        char zeros[16];
 
@@ -1446,23 +1446,25 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
           matches.
        */
 
-       sid_copy(&user_sid, &info3->dom_sid.sid);
-       if (!sid_append_rid(&user_sid, info3->user_rid)) {
+       sid_copy(&user_sid, info3->base.domain_sid);
+       if (!sid_append_rid(&user_sid, info3->base.rid)) {
                return NT_STATUS_INVALID_PARAMETER;
        }
        
-       sid_copy(&group_sid, &info3->dom_sid.sid);
-       if (!sid_append_rid(&group_sid, info3->group_rid)) {
+       sid_copy(&group_sid, info3->base.domain_sid);
+       if (!sid_append_rid(&group_sid, info3->base.primary_gid)) {
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       if (!(nt_username = unistr2_to_ascii_talloc(mem_ctx, &(info3->uni_user_name)))) {
+       nt_username = talloc_strdup(mem_ctx, info3->base.account_name.string);
+       if (!nt_username) {
                /* If the server didn't give us one, just use the one we sent
                 * them */
                nt_username = sent_nt_username;
        }
 
-       if (!(nt_domain = unistr2_to_ascii_talloc(mem_ctx, &(info3->uni_logon_dom)))) {
+       nt_domain = talloc_strdup(mem_ctx, info3->base.domain.string);
+       if (!nt_domain) {
                /* If the server didn't give us one, just use the one we sent
                 * them */
                nt_domain = domain;
@@ -1527,50 +1529,50 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                TALLOC_FREE(sam_account);
                return NT_STATUS_UNSUCCESSFUL;
        }
-               
+
        if (!pdb_set_fullname(sam_account,
-                             unistr2_static(&(info3->uni_full_name)), 
+                             info3->base.full_name.string,
                              PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
        }
 
        if (!pdb_set_logon_script(sam_account,
-                                 unistr2_static(&(info3->uni_logon_script)),
+                                 info3->base.logon_script.string,
                                  PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
        }
 
        if (!pdb_set_profile_path(sam_account,
-                                 unistr2_static(&(info3->uni_profile_path)),
+                                 info3->base.profile_path.string,
                                  PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
        }
 
        if (!pdb_set_homedir(sam_account,
-                            unistr2_static(&(info3->uni_home_dir)),
+                            info3->base.home_directory.string,
                             PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
        }
 
        if (!pdb_set_dir_drive(sam_account,
-                              unistr2_static(&(info3->uni_dir_drive)),
+                              info3->base.home_drive.string,
                               PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (!pdb_set_acct_ctrl(sam_account, info3->acct_flags, PDB_CHANGED)) {
+       if (!pdb_set_acct_ctrl(sam_account, info3->base.acct_flags, PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
        }
 
        if (!pdb_set_pass_last_set_time(
                    sam_account,
-                   nt_time_to_unix(info3->pass_last_set_time),
+                   nt_time_to_unix(info3->base.last_password_change),
                    PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
@@ -1578,7 +1580,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 
        if (!pdb_set_pass_can_change_time(
                    sam_account,
-                   nt_time_to_unix(info3->pass_can_change_time),
+                   nt_time_to_unix(info3->base.allow_password_change),
                    PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
@@ -1586,7 +1588,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
 
        if (!pdb_set_pass_must_change_time(
                    sam_account,
-                   nt_time_to_unix(info3->pass_must_change_time),
+                   nt_time_to_unix(info3->base.force_password_change),
                    PDB_CHANGED)) {
                TALLOC_FREE(sam_account);
                return NT_STATUS_NO_MEMORY;
@@ -1624,27 +1626,260 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                return nt_status;
        }
 
-       result->login_server = unistr2_to_ascii_talloc(result, 
-                                           &(info3->uni_logon_srv));
+       result->login_server = talloc_strdup(result,
+                                            info3->base.logon_server.string);
+
+       /* ensure we are never given NULL session keys */
+
+       ZERO_STRUCT(zeros);
+
+       if (memcmp(info3->base.key.key, zeros, sizeof(zeros)) == 0) {
+               result->user_session_key = data_blob_null;
+       } else {
+               result->user_session_key = data_blob_talloc(
+                       result, info3->base.key.key,
+                       sizeof(info3->base.key.key));
+       }
+
+       if (memcmp(info3->base.LMSessKey.key, zeros, 8) == 0) {
+               result->lm_session_key = data_blob_null;
+       } else {
+               result->lm_session_key = data_blob_talloc(
+                       result, info3->base.LMSessKey.key,
+                       sizeof(info3->base.LMSessKey.key));
+       }
+
+       result->was_mapped = username_was_mapped;
+
+       *server_info = result;
+
+       return NT_STATUS_OK;
+}
+
+/*****************************************************************************
+ Make a server_info struct from the wbcAuthUserInfo returned by a domain logon
+******************************************************************************/
+
+NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
+                                         const char *sent_nt_username,
+                                         const char *domain,
+                                         const struct wbcAuthUserInfo *info,
+                                         auth_serversupplied_info **server_info)
+{
+       char zeros[16];
+
+       NTSTATUS nt_status = NT_STATUS_OK;
+       char *found_username = NULL;
+       const char *nt_domain;
+       const char *nt_username;
+       struct samu *sam_account = NULL;
+       DOM_SID user_sid;
+       DOM_SID group_sid;
+       bool username_was_mapped;
+       uint32_t i;
+
+       uid_t uid = (uid_t)-1;
+       gid_t gid = (gid_t)-1;
+
+       auth_serversupplied_info *result;
+
+       result = make_server_info(NULL);
+       if (result == NULL) {
+               DEBUG(4, ("make_server_info failed!\n"));
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       /*
+          Here is where we should check the list of
+          trusted domains, and verify that the SID
+          matches.
+       */
+
+       memcpy(&user_sid, &info->sids[0].sid, sizeof(user_sid));
+       memcpy(&group_sid, &info->sids[1].sid, sizeof(group_sid));
+
+       if (info->account_name) {
+               nt_username = talloc_strdup(result, info->account_name);
+       } else {
+               /* If the server didn't give us one, just use the one we sent
+                * them */
+               nt_username = talloc_strdup(result, sent_nt_username);
+       }
+       if (!nt_username) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (info->domain_name) {
+               nt_domain = talloc_strdup(result, info->domain_name);
+       } else {
+               /* If the server didn't give us one, just use the one we sent
+                * them */
+               nt_domain = talloc_strdup(result, domain);
+       }
+       if (!nt_domain) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       /* try to fill the SAM account..  If getpwnam() fails, then try the
+          add user script (2.2.x behavior).
+
+          We use the _unmapped_ username here in an attempt to provide
+          consistent username mapping behavior between kerberos and NTLM[SSP]
+          authentication in domain mode security.  I.E. Username mapping
+          should be applied to the fully qualified username
+          (e.g. DOMAIN\user) and not just the login name.  Yes this means we
+          called map_username() unnecessarily in make_user_info_map() but
+          that is how the current code is designed.  Making the change here
+          is the least disruptive place.  -- jerry */
+
+       if ( !(sam_account = samu_new( result )) ) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       /* this call will try to create the user if necessary */
+
+       nt_status = fill_sam_account(result, nt_domain, sent_nt_username,
+                                    &found_username, &uid, &gid, sam_account,
+                                    &username_was_mapped);
+
+       /* if we still don't have a valid unix account check for
+         'map to guest = bad uid' */
+
+       if (!NT_STATUS_IS_OK(nt_status)) {
+               TALLOC_FREE( result );
+               if ( lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_UID ) {
+                       make_server_info_guest(server_info);
+                       return NT_STATUS_OK;
+               }
+               return nt_status;
+       }
+
+       if (!pdb_set_nt_username(sam_account, nt_username, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_username(sam_account, nt_username, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_domain(sam_account, nt_domain, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_user_sid(sam_account, &user_sid, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_UNSUCCESSFUL;
+       }
+
+       if (!pdb_set_group_sid(sam_account, &group_sid, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_UNSUCCESSFUL;
+       }
+
+       if (!pdb_set_fullname(sam_account, info->full_name, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_logon_script(sam_account, info->logon_script, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_profile_path(sam_account, info->profile_path, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_homedir(sam_account, info->home_directory, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_dir_drive(sam_account, info->home_drive, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_acct_ctrl(sam_account, info->acct_flags, PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_pass_last_set_time(
+                   sam_account,
+                   nt_time_to_unix(info->pass_last_set_time),
+                   PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_pass_can_change_time(
+                   sam_account,
+                   nt_time_to_unix(info->pass_can_change_time),
+                   PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (!pdb_set_pass_must_change_time(
+                   sam_account,
+                   nt_time_to_unix(info->pass_must_change_time),
+                   PDB_CHANGED)) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       /* save this here to _net_sam_logon() doesn't fail (it assumes a
+          valid struct samu) */
+
+       result->sam_account = sam_account;
+       result->unix_name = talloc_strdup(result, found_username);
+
+       result->login_server = talloc_strdup(result, info->logon_server);
+
+       /* Fill in the unix info we found on the way */
+
+       result->uid = uid;
+       result->gid = gid;
+
+       /* Create a 'combined' list of all SIDs we might want in the SD */
+
+       result->num_sids = info->num_sids - 2;
+       result->sids = talloc_array(result, DOM_SID, result->num_sids);
+       if (result->sids == NULL) {
+               TALLOC_FREE(result);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       for (i=0; i < result->num_sids; i++) {
+               memcpy(&result->sids[i], &info->sids[i+2].sid, sizeof(result->sids[i]));
+       }
 
        /* ensure we are never given NULL session keys */
 
        ZERO_STRUCT(zeros);
 
-       if (memcmp(info3->user_sess_key, zeros, sizeof(zeros)) == 0) {
+       if (memcmp(info->user_session_key, zeros, sizeof(zeros)) == 0) {
                result->user_session_key = data_blob_null;
        } else {
                result->user_session_key = data_blob_talloc(
-                       result, info3->user_sess_key,
-                       sizeof(info3->user_sess_key));
+                       result, info->user_session_key,
+                       sizeof(info->user_session_key));
        }
 
-       if (memcmp(info3->lm_sess_key, zeros, 8) == 0) {
+       if (memcmp(info->lm_session_key, zeros, 8) == 0) {
                result->lm_session_key = data_blob_null;
        } else {
                result->lm_session_key = data_blob_talloc(
-                       result, info3->lm_sess_key,
-                       sizeof(info3->lm_sess_key));
+                       result, info->lm_session_key,
+                       sizeof(info->lm_session_key));
        }
 
        result->was_mapped = username_was_mapped;
index b24aa3a75b3a036c0d362d073000996ff210adcc..26a1b7f10103f7f9960b749f1161ce411e2d9dab 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
-static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response *response, NET_USER_INFO_3 *info3)
-{
-       uint8 *info3_ndr;
-       size_t len = response->length - sizeof(struct winbindd_response);
-       prs_struct ps;
-       if (len > 0) {
-               info3_ndr = (uint8 *)response->extra_data.data;
-               if (!prs_init(&ps, len, mem_ctx, UNMARSHALL)) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-               prs_copy_data_in(&ps, (char *)info3_ndr, len);
-               prs_set_offset(&ps,0);
-               if (!net_io_user_info3("", info3, &ps, 1, 3, False)) {
-                       DEBUG(2, ("get_info3_from_ndr: could not parse info3 struct!\n"));
-                       return NT_STATUS_UNSUCCESSFUL;
-               }
-               prs_mem_free(&ps);
-
-               return NT_STATUS_OK;
-       } else {
-               DEBUG(2, ("get_info3_from_ndr: No info3 struct found!\n"));
-               return NT_STATUS_UNSUCCESSFUL;
-       }
-}
-
 /* Authenticate a user with a challenge/response */
 
 static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
@@ -58,11 +33,11 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
                                       const auth_usersupplied_info *user_info, 
                                       auth_serversupplied_info **server_info)
 {
-       struct winbindd_request request;
-       struct winbindd_response response;
-        NSS_STATUS result;
        NTSTATUS nt_status;
-        NET_USER_INFO_3 info3;
+       wbcErr wbc_status;
+       struct wbcAuthUserParams params;
+       struct wbcAuthUserInfo *info = NULL;
+       struct wbcAuthErrorInfo *err = NULL;
 
        if (!user_info) {
                return NT_STATUS_INVALID_PARAMETER;
@@ -82,36 +57,34 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
 
        /* Send off request */
 
-       ZERO_STRUCT(request);
-       ZERO_STRUCT(response);
+       params.account_name     = user_info->smb_name;
+       params.domain_name      = user_info->domain;
+       params.workstation_name = user_info->wksta_name;
 
-       request.flags = WBFLAG_PAM_INFO3_NDR;
+       params.flags            = 0;
+       params.parameter_control= user_info->logon_parameters;
 
-       request.data.auth_crap.logon_parameters = user_info->logon_parameters;
+       params.level            = WBC_AUTH_USER_LEVEL_RESPONSE;
 
-       fstrcpy(request.data.auth_crap.user, user_info->smb_name);
-       fstrcpy(request.data.auth_crap.domain, user_info->domain);
-       fstrcpy(request.data.auth_crap.workstation, user_info->wksta_name);
+       memcpy(params.password.response.challenge,
+              auth_context->challenge.data,
+              sizeof(params.password.response.challenge));
 
-       memcpy(request.data.auth_crap.chal, auth_context->challenge.data, sizeof(request.data.auth_crap.chal));
-       
-       request.data.auth_crap.lm_resp_len = MIN(user_info->lm_resp.length, 
-                                                sizeof(request.data.auth_crap.lm_resp));
-       request.data.auth_crap.nt_resp_len = MIN(user_info->nt_resp.length, 
-                                                sizeof(request.data.auth_crap.nt_resp));
-       
-       memcpy(request.data.auth_crap.lm_resp, user_info->lm_resp.data, 
-              request.data.auth_crap.lm_resp_len);
-       memcpy(request.data.auth_crap.nt_resp, user_info->nt_resp.data, 
-              request.data.auth_crap.nt_resp_len);
+       params.password.response.nt_length      = user_info->nt_resp.length;
+       params.password.response.nt_data        = user_info->nt_resp.data;
+       params.password.response.lm_length      = user_info->lm_resp.length;
+       params.password.response.lm_data        = user_info->lm_resp.data;
 
        /* we are contacting the privileged pipe */
        become_root();
-       result = winbindd_priv_request_response(WINBINDD_PAM_AUTH_CRAP,
-                                               &request, &response);
+       wbc_status = wbcAuthenticateUserEx(&params, &info, &err);
        unbecome_root();
 
-       if ( result == NSS_STATUS_UNAVAIL )  {
+       if (wbc_status == WBC_ERR_NO_MEMORY) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       if (wbc_status == WBC_ERR_WINBIND_NOT_AVAILABLE) {
                struct auth_methods *auth_method =
                        (struct auth_methods *)my_private_data;
 
@@ -123,27 +96,29 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
                        DEBUG(0,("check_winbind_security: ERROR!  my_private_data == NULL!\n"));
        }
 
-       nt_status = NT_STATUS(response.data.auth.nt_status);
-
-       if (result == NSS_STATUS_SUCCESS && response.extra_data.data) {
-               if (NT_STATUS_IS_OK(nt_status)) {
-                       if (NT_STATUS_IS_OK(nt_status = get_info3_from_ndr(mem_ctx, &response, &info3))) { 
-                               nt_status = make_server_info_info3(mem_ctx, 
-                                       user_info->smb_name, user_info->domain, 
-                                       server_info, &info3); 
-                       }
-                       
-                       if (NT_STATUS_IS_OK(nt_status)) {
-                               if (user_info->was_mapped) {
-                                       (*server_info)->was_mapped = user_info->was_mapped;
-                               }
-                       }
-               }
-       } else if (NT_STATUS_IS_OK(nt_status)) {
-               nt_status = NT_STATUS_NO_LOGON_SERVERS;
+       if (wbc_status == WBC_ERR_AUTH_ERROR) {
+               nt_status = NT_STATUS(err->nt_status);
+               wbcFreeMemory(err);
+               return nt_status;
+       }
+
+       if (!WBC_ERROR_IS_OK(wbc_status)) {
+               return NT_STATUS_LOGON_FAILURE;
+       }
+
+       nt_status = make_server_info_wbcAuthUserInfo(mem_ctx,
+                                                    user_info->smb_name,
+                                                    user_info->domain,
+                                                    info, server_info);
+       wbcFreeMemory(info);
+       if (!NT_STATUS_IS_OK(nt_status)) {
+               return nt_status;
+       }
+
+       if (user_info->was_mapped) {
+               (*server_info)->was_mapped = user_info->was_mapped;
        }
 
-       SAFE_FREE(response.extra_data.data);
         return nt_status;
 }
 
index caa22276c47b46eb30c1857977207f37ec3b00f0..d10d19da96ad48d05eca436b71c4f4e3c9bc0423 100644 (file)
@@ -3,11 +3,13 @@
 * Copyright (C) Igor Mammedov (niallain@gmail.com) 2007
 *
 * Used by /sbin/request-key for handling
-* cifs upcall for kerberos authorization of access to share.
+* cifs upcall for kerberos authorization of access to share and
+* cifs upcall for DFS srver name resolving (IPv4/IPv6 aware).
 * You should have keyutils installed and add following line to
 * /etc/request-key.conf file
 
 create cifs.spnego * * /usr/local/sbin/cifs.spnego [-v][-c] %k
+create cifs.resolver * * /usr/local/sbin/cifs.spnego [-v] %k
 
 * 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
@@ -27,7 +29,7 @@ create cifs.spnego * * /usr/local/sbin/cifs.spnego [-v][-c] %k
 
 #include "cifs_spnego.h"
 
-const char* CIFSSPNEGO_VERSION="1.0";
+const char *CIFSSPNEGO_VERSION = "1.1";
 static const char *prog = "cifs.spnego";
 typedef enum _secType {
        KRB5,
@@ -146,6 +148,58 @@ int decode_key_description(const char *desc, int *ver, secType_t * sec,
        return retval;
 }
 
+int cifs_resolver(const key_serial_t key, const char *key_descr)
+{
+       int c;
+       struct addrinfo *addr;
+       char ip[INET6_ADDRSTRLEN];
+       void *p;
+       const char *keyend = key_descr;
+       /* skip next 4 ';' delimiters to get to description */
+       for (c = 1; c <= 4; c++) {
+               keyend = index(keyend+1, ';');
+               if (!keyend) {
+                       syslog(LOG_WARNING, "invalid key description: %s",
+                                       key_descr);
+                       return 1;
+               }
+       }
+       keyend++;
+
+       /* resolve name to ip */
+       c = getaddrinfo(keyend, NULL, NULL, &addr);
+       if (c) {
+               syslog(LOG_WARNING, "unable to resolve hostname: %s [%s]",
+                               keyend, gai_strerror(c));
+               return 1;
+       }
+
+       /* conver ip to string form */
+       if (addr->ai_family == AF_INET) {
+               p = &(((struct sockaddr_in *)addr->ai_addr)->sin_addr);
+       } else {
+               p = &(((struct sockaddr_in6 *)addr->ai_addr)->sin6_addr);
+       }
+       if (!inet_ntop(addr->ai_family, p, ip, sizeof(ip))) {
+               syslog(LOG_WARNING, "%s: inet_ntop: %s",
+                               __FUNCTION__, strerror(errno));
+               freeaddrinfo(addr);
+               return 1;
+       }
+
+       /* setup key */
+       c = keyctl_instantiate(key, ip, strlen(ip)+1, 0);
+       if (c == -1) {
+               syslog(LOG_WARNING, "%s: keyctl_instantiate: %s",
+                               __FUNCTION__, strerror(errno));
+               freeaddrinfo(addr);
+               return 1;
+       }
+
+       freeaddrinfo(addr);
+       return 0;
+}
+
 int main(const int argc, char *const argv[])
 {
        struct cifs_spnego_msg *keydata = NULL;
@@ -199,6 +253,11 @@ int main(const int argc, char *const argv[])
                goto out;
        }
 
+       if (strncmp(buf, "cifs.resolver", sizeof("cifs.resolver")-1) == 0) {
+               rc = cifs_resolver(key, buf);
+               goto out;
+       }
+
        rc = decode_key_description(buf, &kernel_upcall_version, &sectype,
                                    &hostname, &uid);
        if ((rc & DKD_MUSTHAVE_SET) != DKD_MUSTHAVE_SET) {
index 267c13048ec37de942e99f80972fbe2f0218e039..1410fc2f331b5c169112dc665b84ae3d2b7bdf93 100644 (file)
@@ -308,6 +308,17 @@ static int cmd_pwd(void)
        return 0;
 }
 
+/****************************************************************************
+ Ensure name has correct directory separators.
+****************************************************************************/
+
+static void normalize_name(char *newdir)
+{
+       if (!(cli->posix_capabilities & CIFS_UNIX_POSIX_PATHNAMES_CAP)) {
+               string_replace(newdir,'/','\\');
+       }
+}
+
 /****************************************************************************
  Change directory - inner section.
 ****************************************************************************/
@@ -329,7 +340,8 @@ static int do_cd(const char *new_dir)
                TALLOC_FREE(ctx);
                return 1;
        }
-       string_replace(newdir,'/','\\');
+
+       normalize_name(newdir);
 
        /* Save the current directory in case the new directory is invalid */
 
@@ -349,17 +361,16 @@ static int do_cd(const char *new_dir)
                if (!new_cd) {
                        goto out;
                }
-               if ((new_cd[0] != '\0') && (*(new_cd+strlen(new_cd)-1) != CLI_DIRSEP_CHAR)) {
-                       new_cd = talloc_asprintf_append(new_cd, CLI_DIRSEP_STR);
-                       if (!new_cd) {
-                               goto out;
-                       }
-               }
-               client_set_cur_dir(new_cd);
        }
-       if (!new_cd) {
-               goto out;
+
+       /* Ensure cur_dir ends in a DIRSEP */
+       if ((new_cd[0] != '\0') && (*(new_cd+strlen(new_cd)-1) != CLI_DIRSEP_CHAR)) {
+               new_cd = talloc_asprintf_append(new_cd, CLI_DIRSEP_STR);
+               if (!new_cd) {
+                       goto out;
+               }
        }
+       client_set_cur_dir(new_cd);
 
        new_cd = clean_name(ctx, new_cd);
        client_set_cur_dir(new_cd);
@@ -851,26 +862,15 @@ static int cmd_dir(void)
        int rc = 1;
 
        dir_total = 0;
-       if (strcmp(client_get_cur_dir(), CLI_DIRSEP_STR) != 0) {
-               mask = talloc_strdup(ctx, client_get_cur_dir());
-               if (!mask) {
-                       return 1;
-               }
-               if ((mask[0] != '\0') && (mask[strlen(mask)-1]!=CLI_DIRSEP_CHAR)) {
-                       mask = talloc_asprintf_append(mask, CLI_DIRSEP_STR);
-               }
-       } else {
-               mask = talloc_strdup(ctx, CLI_DIRSEP_STR);
-       }
-
+       mask = talloc_strdup(ctx, client_get_cur_dir());
        if (!mask) {
                return 1;
        }
 
        if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
-               string_replace(buf,'/','\\');
+               normalize_name(buf);
                if (*buf == CLI_DIRSEP_CHAR) {
-                       mask = talloc_strdup(ctx, buf + 1);
+                       mask = talloc_strdup(ctx, buf);
                } else {
                        mask = talloc_asprintf_append(mask, buf);
                }
@@ -920,7 +920,7 @@ static int cmd_du(void)
        }
 
        if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
-               string_replace(buf,'/','\\');
+               normalize_name(buf);
                if (*buf == CLI_DIRSEP_CHAR) {
                        mask = talloc_strdup(ctx, buf);
                } else {
@@ -964,12 +964,20 @@ static int cmd_echo(void)
  Get a file from rname to lname
 ****************************************************************************/
 
+static NTSTATUS writefile_sink(char *buf, size_t n, void *priv)
+{
+       int *pfd = (int *)priv;
+       if (writefile(*pfd, buf, n) == -1) {
+               return map_nt_error_from_unix(errno);
+       }
+       return NT_STATUS_OK;
+}
+
 static int do_get(const char *rname, const char *lname_in, bool reget)
 {
        TALLOC_CTX *ctx = talloc_tos();
        int handle = 0, fnum;
        bool newhandle = false;
-       char *data = NULL;
        struct timeval tp_start;
        int read_size = io_bufsize;
        uint16 attr;
@@ -980,6 +988,7 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
        struct cli_state *targetcli = NULL;
        char *targetname = NULL;
        char *lname = NULL;
+       NTSTATUS status;
 
        lname = talloc_strdup(ctx, lname_in);
        if (!lname) {
@@ -1038,36 +1047,15 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
        DEBUG(1,("getting file %s of size %.0f as %s ",
                 rname, (double)size, lname));
 
-       if(!(data = (char *)SMB_MALLOC(read_size))) {
-               d_printf("malloc fail for size %d\n", read_size);
+       status = cli_pull(targetcli, fnum, start, size, 1024*1024,
+                         writefile_sink, (void *)&handle, &nread);
+       if (!NT_STATUS_IS_OK(status)) {
+               d_fprintf(stderr, "parallel_read returned %s\n",
+                         nt_errstr(status));
                cli_close(targetcli, fnum);
                return 1;
        }
 
-       while (1) {
-               int n = cli_read(targetcli, fnum, data, nread + start, read_size);
-
-               if (n <= 0)
-                       break;
-
-               if (writefile(handle,data, n) != n) {
-                       d_printf("Error writing local file\n");
-                       rc = 1;
-                       break;
-               }
-
-               nread += n;
-       }
-
-       if (nread + start < size) {
-               DEBUG (0, ("Short read when getting file %s. Only got %ld bytes.\n",
-                           rname, (long)nread));
-
-               rc = 1;
-       }
-
-       SAFE_FREE(data);
-
        if (!cli_close(targetcli, fnum)) {
                d_printf("Error %s closing remote file\n",cli_errstr(cli));
                rc = 1;
@@ -1112,10 +1100,7 @@ static int cmd_get(void)
        char *rname = NULL;
        char *fname = NULL;
 
-       rname = talloc_asprintf(ctx,
-                       "%s%s",
-                       client_get_cur_dir(),
-                       CLI_DIRSEP_STR);
+       rname = talloc_strdup(ctx, client_get_cur_dir());
        if (!rname) {
                return 1;
        }
@@ -1262,10 +1247,7 @@ static int cmd_more(void)
        int fd;
        int rc = 0;
 
-       rname = talloc_asprintf(ctx,
-                       "%s%s",
-                       client_get_cur_dir(),
-                       CLI_DIRSEP_STR);
+       rname = talloc_strdup(ctx, client_get_cur_dir());
        if (!rname) {
                return 1;
        }
@@ -1334,15 +1316,6 @@ static int cmd_mget(void)
                if (!mget_mask) {
                        return 1;
                }
-               if ((mget_mask[0] != '\0') &&
-                               (mget_mask[strlen(mget_mask)-1]!=CLI_DIRSEP_CHAR)) {
-                       mget_mask = talloc_asprintf_append(mget_mask,
-                                                       CLI_DIRSEP_STR);
-                       if (!mget_mask) {
-                               return 1;
-                       }
-               }
-
                if (*buf == CLI_DIRSEP_CHAR) {
                        mget_mask = talloc_strdup(ctx, buf);
                } else {
@@ -1356,18 +1329,9 @@ static int cmd_mget(void)
        }
 
        if (!*mget_mask) {
-               mget_mask = talloc_strdup(ctx, client_get_cur_dir());
-               if (!mget_mask) {
-                       return 1;
-               }
-               if(mget_mask[strlen(mget_mask)-1]!=CLI_DIRSEP_CHAR) {
-                       mget_mask = talloc_asprintf_append(mget_mask,
-                                                       CLI_DIRSEP_STR);
-                       if (!mget_mask) {
-                               return 1;
-                       }
-               }
-               mget_mask = talloc_asprintf_append(mget_mask, "*");
+               mget_mask = talloc_asprintf(ctx,
+                                       "%s*",
+                                       client_get_cur_dir());
                if (!mget_mask) {
                        return 1;
                }
@@ -1463,6 +1427,7 @@ static int cmd_mkdir(void)
                struct cli_state *targetcli;
                char *targetname = NULL;
                char *p = NULL;
+               char *saveptr;
 
                ddir2 = talloc_strdup(ctx, "");
                if (!ddir2) {
@@ -1478,7 +1443,7 @@ static int cmd_mkdir(void)
                        return 1;
                }
                trim_char(ddir,'.','\0');
-               p = strtok(ddir,"/\\");
+               p = strtok_r(ddir, "/\\", &saveptr);
                while (p) {
                        ddir2 = talloc_asprintf_append(ddir2, p);
                        if (!ddir2) {
@@ -1491,7 +1456,7 @@ static int cmd_mkdir(void)
                        if (!ddir2) {
                                return 1;
                        }
-                       p = strtok(NULL,"/\\");
+                       p = strtok_r(NULL, "/\\", &saveptr);
                }
        } else {
                do_mkdir(mask);
@@ -1527,6 +1492,92 @@ static int cmd_altname(void)
        return 0;
 }
 
+/****************************************************************************
+ Show all info we can get
+****************************************************************************/
+
+static int do_allinfo(const char *name)
+{
+       fstring altname;
+       struct timespec b_time, a_time, m_time, c_time;
+       SMB_OFF_T size;
+       uint16_t mode;
+       SMB_INO_T ino;
+       NTTIME tmp;
+       unsigned int num_streams;
+       struct stream_struct *streams;
+       unsigned int i;
+
+       if (!NT_STATUS_IS_OK(cli_qpathinfo_alt_name(cli, name, altname))) {
+               d_printf("%s getting alt name for %s\n",
+                        cli_errstr(cli),name);
+               return false;
+       }
+       d_printf("altname: %s\n", altname);
+
+       if (!cli_qpathinfo2(cli, name, &b_time, &a_time, &m_time, &c_time,
+                           &size, &mode, &ino)) {
+               d_printf("%s getting pathinfo for %s\n",
+                        cli_errstr(cli),name);
+               return false;
+       }
+
+       unix_timespec_to_nt_time(&tmp, b_time);
+       d_printf("create_time:    %s\n", nt_time_string(talloc_tos(), tmp));
+
+       unix_timespec_to_nt_time(&tmp, a_time);
+       d_printf("access_time:    %s\n", nt_time_string(talloc_tos(), tmp));
+
+       unix_timespec_to_nt_time(&tmp, m_time);
+       d_printf("write_time:     %s\n", nt_time_string(talloc_tos(), tmp));
+
+       unix_timespec_to_nt_time(&tmp, c_time);
+       d_printf("change_time:    %s\n", nt_time_string(talloc_tos(), tmp));
+
+       if (!cli_qpathinfo_streams(cli, name, talloc_tos(), &num_streams,
+                                  &streams)) {
+               d_printf("%s getting streams for %s\n",
+                        cli_errstr(cli),name);
+               return false;
+       }
+
+       for (i=0; i<num_streams; i++) {
+               d_printf("stream: [%s], %lld bytes\n", streams[i].name,
+                        (unsigned long long)streams[i].size);
+       }
+
+       return 0;
+}
+
+/****************************************************************************
+ Show all info we can get
+****************************************************************************/
+
+static int cmd_allinfo(void)
+{
+       TALLOC_CTX *ctx = talloc_tos();
+       char *name;
+       char *buf;
+
+       name = talloc_strdup(ctx, client_get_cur_dir());
+       if (!name) {
+               return 1;
+       }
+
+       if (!next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) {
+               d_printf("allinfo <file>\n");
+               return 1;
+       }
+       name = talloc_asprintf_append(name, buf);
+       if (!name) {
+               return 1;
+       }
+
+       do_allinfo(name);
+
+       return 0;
+}
+
 /****************************************************************************
  Put a single file.
 ****************************************************************************/
@@ -1673,10 +1724,7 @@ static int cmd_put(void)
        char *rname;
        char *buf;
 
-       rname = talloc_asprintf(ctx,
-                       "%s%s",
-                       client_get_cur_dir(),
-                       CLI_DIRSEP_STR);
+       rname = talloc_strdup(ctx, client_get_cur_dir());
        if (!rname) {
                return 1;
        }
@@ -1893,10 +1941,10 @@ static int cmd_mput(void)
                                                break;
                                } else { /* Yes */
                                        SAFE_FREE(rname);
-                                       if(asprintf(&rname, "%s%s", cur_dir, lname) < 0) {
+                                       if(asprintf(&rname, "%s%s", client_get_cur_dir(), lname) < 0) {
                                                break;
                                        }
-                                       string_replace(rname,'/','\\');
+                                       normalize_name(rname);
                                        if (!cli_chkpath(cli, rname) &&
                                            !do_mkdir(rname)) {
                                                DEBUG (0, ("Unable to make dir, skipping..."));
@@ -1920,12 +1968,12 @@ static int cmd_mput(void)
 
                                /* Yes */
                                SAFE_FREE(rname);
-                               if (asprintf(&rname, "%s%s", cur_dir, lname) < 0) {
+                               if (asprintf(&rname, "%s%s", client_get_cur_dir(), lname) < 0) {
                                        break;
                                }
                        }
 
-                       string_replace(rname,'/','\\');
+                       normalize_name(rname);
 
                        do_put(rname, lname, false);
                }
@@ -3469,10 +3517,7 @@ static int cmd_reget(void)
        char *fname = NULL;
        char *p = NULL;
 
-       remote_name = talloc_asprintf(ctx,
-                               "%s%s",
-                               client_get_cur_dir(),
-                               CLI_DIRSEP_STR);
+       remote_name = talloc_strdup(ctx, client_get_cur_dir());
        if (!remote_name) {
                return 1;
        }
@@ -3511,10 +3556,7 @@ static int cmd_reput(void)
        char *buf;
        SMB_STRUCT_STAT st;
 
-       remote_name = talloc_asprintf(ctx,
-                               "%s%s",
-                               client_get_cur_dir(),
-                               CLI_DIRSEP_STR);
+       remote_name = talloc_strdup(ctx, client_get_cur_dir());
        if (!remote_name) {
                return 1;
        }
@@ -3839,6 +3881,8 @@ static struct {
        char compl_args[2];      /* Completion argument info */
 } commands[] = {
   {"?",cmd_help,"[command] give help on a command",{COMPL_NONE,COMPL_NONE}},
+  {"allinfo",cmd_allinfo,"<file> show all available info",
+   {COMPL_NONE,COMPL_NONE}},
   {"altname",cmd_altname,"<file> show alt name",{COMPL_NONE,COMPL_NONE}},
   {"archive",cmd_archive,"<level>\n0=ignore archive bit\n1=only get archive files\n2=only get archive files and reset archive bit\n3=get all files and reset archive bit",{COMPL_NONE,COMPL_NONE}},
   {"blocksize",cmd_block,"blocksize <number> (default 20)",{COMPL_NONE,COMPL_NONE}},
@@ -4069,7 +4113,7 @@ static void completion_remote_filter(const char *mnt,
                                return;
                        }
                        if (f->mode & aDIR) {
-                               tmp = talloc_asprintf_append(tmp, "/");
+                               tmp = talloc_asprintf_append(tmp, CLI_DIRSEP_STR);
                        }
                        if (!tmp) {
                                TALLOC_FREE(ctx);
@@ -4333,9 +4377,30 @@ static void readline_callback(void)
           session keepalives and then drop them here.
        */
        if (FD_ISSET(cli->fd,&fds)) {
-               if (receive_smb_raw(cli->fd,cli->inbuf,0,0,&cli->smb_rw_error) == -1) {
-                       DEBUG(0, ("Read from server failed, maybe it closed the "
-                               "connection\n"));
+               NTSTATUS status;
+               size_t len;
+
+               set_smb_read_error(&cli->smb_rw_error, SMB_READ_OK);
+
+               status = receive_smb_raw(cli->fd, cli->inbuf, 0, 0, &len);
+
+               if (!NT_STATUS_IS_OK(status)) {
+                       DEBUG(0, ("Read from server failed, maybe it closed "
+                                 "the connection\n"));
+
+                       if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
+                               set_smb_read_error(&cli->smb_rw_error,
+                                                  SMB_READ_EOF);
+                               return;
+                       }
+
+                       if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
+                               set_smb_read_error(&cli->smb_rw_error,
+                                                  SMB_READ_TIMEOUT);
+                               return;
+                       }
+
+                       set_smb_read_error(&cli->smb_rw_error, SMB_READ_ERROR);
                        return;
                }
                if(CVAL(cli->inbuf,0) != SMBkeepalive) {
index 135815c3cd7d11a848f13d1725ce0f5ae051483f..04cc987889428937047e56e5b9e83baa22f1ec4d 100644 (file)
@@ -513,6 +513,7 @@ static bool ensurepath(const char *fname)
        char *partpath, *ffname;
        const char *p=fname;
        char *basehack;
+       char *saveptr;
 
        DEBUG(5, ( "Ensurepath called with: %s\n", fname));
 
@@ -528,7 +529,7 @@ static bool ensurepath(const char *fname)
 
        *partpath = 0;
 
-       /* fname copied to ffname so can strtok */
+       /* fname copied to ffname so can strtok_r */
 
        safe_strcpy(ffname, fname, strlen(fname));
 
@@ -541,7 +542,7 @@ static bool ensurepath(const char *fname)
                *basehack='\0';
        }
 
-       p=strtok(ffname, "\\");
+       p=strtok_r(ffname, "\\", &saveptr);
 
        while (p) {
                safe_strcat(partpath, p, strlen(fname) + 1);
@@ -558,7 +559,7 @@ static bool ensurepath(const char *fname)
                }
 
                safe_strcat(partpath, "\\", strlen(fname) + 1);
-               p = strtok(NULL,"/\\");
+               p = strtok_r(NULL, "/\\", &saveptr);
        }
 
        SAFE_FREE(partpath);
@@ -1470,8 +1471,10 @@ int cmd_tar(void)
        }
 
        argl=toktocliplist(&argcl, NULL);
-       if (!tar_parseargs(argcl, argl, buf, 0))
+       if (!tar_parseargs(argcl, argl, buf, 0)) {
+               SAFE_FREE(argl);
                return 1;
+       }
 
        ret = process_tar();
        SAFE_FREE(argl);
index 79f402a7d486cc6ae2d09a0cd81dbbfba459d553..e73d90859caf740d0349acd0934237f8d202cc95 100644 (file)
@@ -37,6 +37,7 @@
 #include <string.h>
 #include <mntent.h>
 #include <fcntl.h>
+#include <limits.h>
 
 #define MOUNT_CIFS_VERSION_MAJOR "1"
 #define MOUNT_CIFS_VERSION_MINOR "11"
@@ -62,8 +63,6 @@
 #define MS_BIND 4096
 #endif
 
-#define MAX_UNC_LEN 1024
-
 #define CONST_DISCARD(type, ptr)      ((type) ((void *) (ptr)))
 
 const char *thisprogram;
@@ -75,6 +74,7 @@ static int got_ip = 0;
 static int got_unc = 0;
 static int got_uid = 0;
 static int got_gid = 0;
+static int free_share_name = 0;
 static char * user_name = NULL;
 static char * mountpassword = NULL;
 char * domain_name = NULL;
@@ -205,8 +205,10 @@ static int open_cred_file(char * file_name)
                                /* go past equals sign */
                                temp_val++;
                                for(length = 0;length<4087;length++) {
-                                       if(temp_val[length] == '\n')
+                                       if ((temp_val[length] == '\n')
+                                           || (temp_val[length] == '\0')) {
                                                break;
+                                       }
                                }
                                if(length > 4086) {
                                        printf("mount.cifs failed due to malformed username in credentials file");
@@ -229,8 +231,10 @@ static int open_cred_file(char * file_name)
                                /* go past equals sign */
                                temp_val++;
                                for(length = 0;length<65;length++) {
-                                       if(temp_val[length] == '\n')
+                                       if ((temp_val[length] == '\n')
+                                           || (temp_val[length] == '\0')) {
                                                break;
+                                       }
                                }
                                if(length > 64) {
                                        printf("mount.cifs failed: password in credentials file too long\n");
@@ -258,8 +262,10 @@ static int open_cred_file(char * file_name)
                                if(verboseflag)
                                        printf("\nDomain %s\n",temp_val);
                                 for(length = 0;length<65;length++) {
-                                        if(temp_val[length] == '\n')
-                                                break;
+                                       if ((temp_val[length] == '\n')
+                                           || (temp_val[length] == '\0')) {
+                                               break;
+                                       }
                                 }
                                 if(length > 64) {
                                         printf("mount.cifs failed: domain in credentials file too long\n");
@@ -831,27 +837,17 @@ static char * check_for_domain(char **ppuser)
        return domainnm;
 }
 
-/* replace all occurances of "from" in a string with "to" */
-static void replace_char(char *string, char from, char to)
-{
-       while (string) {
-               string = strchr(string, from);
-               if (string)
-                       *string = to;
-       }
-}
-
 /* Note that caller frees the returned buffer if necessary */
 static char * parse_server(char ** punc_name)
 {
        char * unc_name = *punc_name;
-       int length = strnlen(unc_name, MAX_UNC_LEN);
+       int length = strnlen(unc_name,1024);
        char * share;
        char * ipaddress_string = NULL;
        struct hostent * host_entry = NULL;
        struct in_addr server_ipaddr;
 
-       if(length > (MAX_UNC_LEN - 1)) {
+       if(length > 1023) {
                printf("mount error: UNC name too long");
                return NULL;
        }
@@ -870,6 +866,7 @@ static char * parse_server(char ** punc_name)
                        /* check for nfs syntax ie server:share */
                        share = strchr(unc_name,':');
                        if(share) {
+                               free_share_name = 1;
                                *punc_name = (char *)malloc(length+3);
                                if(*punc_name == NULL) {
                                        /* put the original string back  if 
@@ -877,9 +874,9 @@ static char * parse_server(char ** punc_name)
                                        *punc_name = unc_name;
                                        return NULL;
                                }
+                                       
                                *share = '/';
                                strncpy((*punc_name)+2,unc_name,length);
-                               free(unc_name);
                                unc_name = *punc_name;
                                unc_name[length+2] = 0;
                                goto continue_unc_parsing;
@@ -890,21 +887,18 @@ static char * parse_server(char ** punc_name)
                        }
                } else {
 continue_unc_parsing:
-                       unc_name[0] = '\\';
-                       unc_name[1] = '\\';
+                       unc_name[0] = '/';
+                       unc_name[1] = '/';
                        unc_name += 2;
-
-                       /* convert any '/' in unc to '\\' */
-                       replace_char(unc_name, '/', '\\');
-
-                       if ((share = strchr(unc_name,'\\'))) {
+                       if ((share = strchr(unc_name, '/')) || 
+                               (share = strchr(unc_name,'\\'))) {
                                *share = 0;  /* temporarily terminate the string */
                                share += 1;
                                if(got_ip == 0) {
                                        host_entry = gethostbyname(unc_name);
                                }
-                               *(share - 1) = '\\'; /* put delimiter back */
-                               if ((prefixpath = strchr(share, '\\'))) {
+                               *(share - 1) = '/'; /* put the slash back */
+                               if ((prefixpath = strchr(share, '/'))) {
                                        *prefixpath = 0;  /* permanently terminate the string */
                                        if (!strlen(++prefixpath))
                                                prefixpath = NULL; /* this needs to be done explicitly */
@@ -969,25 +963,6 @@ static struct option longopts[] = {
        { NULL, 0, NULL, 0 }
 };
 
-/* convert a string to uppercase. return false if the string
- * wasn't ASCII or was a NULL ptr */
-static int
-uppercase_string(char *string)
-{
-       if (!string)
-               return 0;
-
-       while (*string) {
-               /* check for unicode */
-               if ((unsigned char) string[0] & 0x80)
-                       return 0;
-               *string = toupper((unsigned char) *string);
-               string++;
-       }
-
-       return 1;
-}
-
 int main(int argc, char ** argv)
 {
        int c;
@@ -1000,7 +975,6 @@ int main(int argc, char ** argv)
        char * options = NULL;
        char * resolved_path = NULL;
        char * temp;
-       char * dev_name;
        int rc;
        int rsize = 0;
        int wsize = 0;
@@ -1037,16 +1011,8 @@ int main(int argc, char ** argv)
        printf(" node: %s machine: %s sysname %s domain %s\n", sysinfo.nodename,sysinfo.machine,sysinfo.sysname,sysinfo.domainname);
 #endif */
        if(argc > 2) {
-               dev_name = argv[1];
-               share_name = strndup(argv[1], MAX_UNC_LEN);
-               if (share_name == NULL) {
-                       fprintf(stderr, "%s: %s", argv[0], strerror(ENOMEM));
-                       exit(1);
-               }
+               share_name = argv[1];
                mountpoint = argv[2];
-       } else {
-               mount_cifs_usage();
-               exit(1);
        }
 
        /* add sharename in opts string as unc= parm */
@@ -1186,7 +1152,7 @@ int main(int argc, char ** argv)
                }
        }
 
-       if((argc < 3) || (dev_name == NULL) || (mountpoint == NULL)) {
+       if((argc < 3) || (share_name == NULL) || (mountpoint == NULL)) {
                mount_cifs_usage();
                exit(1);
        }
@@ -1344,12 +1310,10 @@ mount_retry:
        }
        if(verboseflag)
                printf("\nmount.cifs kernel mount options %s \n",options);
-
-       /* convert all '\\' to '/' so that /proc/mounts looks pretty */
-       replace_char(dev_name, '\\', '/');
-
-       if(mount(dev_name, mountpoint, "cifs", flags, options)) {
+       if(mount(share_name, mountpoint, "cifs", flags, options)) {
        /* remember to kill daemon on error */
+               char * tmp;
+
                switch (errno) {
                case 0:
                        printf("mount failed but no error number set\n");
@@ -1360,9 +1324,12 @@ mount_retry:
                case ENXIO:
                        if(retry == 0) {
                                retry = 1;
-                               if (uppercase_string(dev_name) &&
-                                   uppercase_string(share_name) &&
-                                   uppercase_string(prefixpath)) {
+                               tmp = share_name;
+                               while (*tmp && !(((unsigned char)tmp[0]) & 0x80)) {
+                                       *tmp = toupper((unsigned char)*tmp);
+                                       tmp++;
+                               }
+                               if(!*tmp) {
                                        printf("retrying with upper case share name\n");
                                        goto mount_retry;
                                }
@@ -1376,7 +1343,7 @@ mount_retry:
        } else {
                pmntfile = setmntent(MOUNTED, "a+");
                if(pmntfile) {
-                       mountent.mnt_fsname = dev_name;
+                       mountent.mnt_fsname = share_name;
                        mountent.mnt_dir = mountpoint;
                        mountent.mnt_type = CONST_DISCARD(char *,"cifs");
                        mountent.mnt_opts = (char *)malloc(220);
@@ -1436,6 +1403,8 @@ mount_exit:
                free(resolved_path);
        }
 
-       free(share_name);
+       if(free_share_name) {
+               free(share_name);
+               }
        return rc;
 }
diff --git a/source3/client/smbmnt.c b/source3/client/smbmnt.c
deleted file mode 100644 (file)
index 7f1e1d5..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- *  smbmnt.c
- *
- *  Copyright (C) 1995-1998 by Paal-Kr. Engstad and Volker Lendecke
- *  extensively modified by Tridge
- *
- *  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/>.
- *
- */
-
-#define SMBMOUNT_MALLOC 1
-
-#include "includes.h"
-
-#include <mntent.h>
-#include <sys/utsname.h>
-
-#include <asm/types.h>
-#include <asm/posix_types.h>
-#include <linux/smb.h>
-#include <linux/smb_mount.h>
-#include <asm/unistd.h>
-
-#ifndef        MS_MGC_VAL
-/* This may look strange but MS_MGC_VAL is what we are looking for and
-       is what we need from <linux/fs.h> under libc systems and is
-       provided in standard includes on glibc systems.  So...  We
-       switch on what we need...  */
-#include <linux/fs.h>
-#endif
-
-static uid_t mount_uid;
-static gid_t mount_gid;
-static int mount_ro;
-static unsigned mount_fmask;
-static unsigned mount_dmask;
-static int user_mount;
-static char *options;
-
-static void
-help(void)
-{
-        printf("\n");
-        printf("Usage: smbmnt mount-point [options]\n");
-       printf("Version %s\n\n",SAMBA_VERSION_STRING);
-        printf("-s share       share name on server\n"
-               "-r             mount read-only\n"
-               "-u uid         mount as uid\n"
-               "-g gid         mount as gid\n"
-               "-f mask        permission mask for files\n"
-               "-d mask        permission mask for directories\n"
-               "-o options     name=value, list of options\n"
-               "-h             print this help text\n");
-}
-
-static int
-parse_args(int argc, char *argv[], struct smb_mount_data *data, char **share)
-{
-        int opt;
-
-        while ((opt = getopt (argc, argv, "s:u:g:rf:d:o:")) != EOF)
-       {
-                switch (opt)
-               {
-                case 's':
-                        *share = optarg;
-                        break;
-                case 'u':
-                       if (!user_mount) {
-                               mount_uid = strtol(optarg, NULL, 0);
-                       }
-                        break;
-                case 'g':
-                       if (!user_mount) {
-                               mount_gid = strtol(optarg, NULL, 0);
-                       }
-                        break;
-                case 'r':
-                        mount_ro = 1;
-                        break;
-                case 'f':
-                        mount_fmask = strtol(optarg, NULL, 8);
-                        break;
-                case 'd':
-                        mount_dmask = strtol(optarg, NULL, 8);
-                        break;
-               case 'o':
-                       options = optarg;
-                       break;
-                default:
-                        return -1;
-                }
-        }
-        return 0;
-        
-}
-
-static char *
-fullpath(const char *p)
-{
-        char path[PATH_MAX+1];
-
-       if (strlen(p) > PATH_MAX) {
-               return NULL;
-       }
-
-        if (realpath(p, path) == NULL) {
-               fprintf(stderr,"Failed to find real path for mount point %s: %s\n",
-                       p, strerror(errno));
-               exit(1);
-       }
-       return strdup(path);
-}
-
-/* Check whether user is allowed to mount on the specified mount point. If it's
-   OK then we change into that directory - this prevents race conditions */
-static int mount_ok(char *mount_point)
-{
-       struct stat st;
-
-       if (chdir(mount_point) != 0) {
-               return -1;
-       }
-
-        if (stat(".", &st) != 0) {
-               return -1;
-        }
-
-        if (!S_ISDIR(st.st_mode)) {
-                errno = ENOTDIR;
-                return -1;
-        }
-
-        if ((getuid() != 0) && 
-           ((getuid() != st.st_uid) || 
-            ((st.st_mode & S_IRWXU) != S_IRWXU))) {
-                errno = EPERM;
-                return -1;
-        }
-
-        return 0;
-}
-
-/* Tries to mount using the appropriate format. For 2.2 the struct,
-   for 2.4 the ascii version. */
-static int
-do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data)
-{
-       char *opts;
-       struct utsname uts;
-       char *release, *major, *minor;
-       char *data1, *data2;
-       int ret;
-
-       if (asprintf(&opts,
-                       "version=7,uid=%d,gid=%d,file_mode=0%o,dir_mode=0%o,%s",
-                       mount_uid, mount_gid, data->file_mode,
-                       data->dir_mode,options) < 0) {
-               return -1;
-       }
-
-       uname(&uts);
-       release = uts.release;
-       major = strtok(release, ".");
-       minor = strtok(NULL, ".");
-       if (major && minor && atoi(major) == 2 && atoi(minor) < 4) {
-               /* < 2.4, assume struct */
-               data1 = (char *) data;
-               data2 = opts;
-       } else {
-               /* >= 2.4, assume ascii but fall back on struct */
-               data1 = opts;
-               data2 = (char *) data;
-       }
-
-       if (mount(share_name, ".", "smbfs", flags, data1) == 0) {
-               SAFE_FREE(opts);
-               return 0;
-       }
-       ret = mount(share_name, ".", "smbfs", flags, data2);
-       SAFE_FREE(opts);
-       return ret;
-}
-
- int main(int argc, char *argv[])
-{
-       char *mount_point, *share_name = NULL;
-       FILE *mtab;
-       int fd;
-       unsigned int flags;
-       struct smb_mount_data data;
-       struct mntent ment;
-
-       memset(&data, 0, sizeof(struct smb_mount_data));
-
-       if (argc < 2) {
-               help();
-               exit(1);
-       }
-
-       if (argv[1][0] == '-') {
-               help();
-               exit(1);
-       }
-
-       if (getuid() != 0) {
-               user_mount = 1;
-       }
-
-        if (geteuid() != 0) {
-                fprintf(stderr, "smbmnt must be installed suid root for direct user mounts (%d,%d)\n", getuid(), geteuid());
-                exit(1);
-        }
-
-       mount_uid = getuid();
-       mount_gid = getgid();
-       mount_fmask = umask(0);
-        umask(mount_fmask);
-       mount_fmask = ~mount_fmask;
-
-        mount_point = fullpath(argv[1]);
-
-        argv += 1;
-        argc -= 1;
-
-        if (mount_ok(mount_point) != 0) {
-                fprintf(stderr, "cannot mount on %s: %s\n",
-                        mount_point, strerror(errno));
-                exit(1);
-        }
-
-       data.version = SMB_MOUNT_VERSION;
-
-        /* getuid() gives us the real uid, who may umount the fs */
-        data.mounted_uid = getuid();
-
-        if (parse_args(argc, argv, &data, &share_name) != 0) {
-                help();
-                return -1;
-        }
-
-        data.uid = mount_uid;    // truncates to 16-bits here!!!
-        data.gid = mount_gid;
-        data.file_mode = (S_IRWXU|S_IRWXG|S_IRWXO) & mount_fmask;
-        data.dir_mode  = (S_IRWXU|S_IRWXG|S_IRWXO) & mount_dmask;
-
-        if (mount_dmask == 0) {
-                data.dir_mode = data.file_mode;
-                if ((data.dir_mode & S_IRUSR) != 0)
-                        data.dir_mode |= S_IXUSR;
-                if ((data.dir_mode & S_IRGRP) != 0)
-                        data.dir_mode |= S_IXGRP;
-                if ((data.dir_mode & S_IROTH) != 0)
-                        data.dir_mode |= S_IXOTH;
-        }
-
-       flags = MS_MGC_VAL | MS_NOSUID | MS_NODEV;
-
-       if (mount_ro) flags |= MS_RDONLY;
-
-       if (do_mount(share_name, flags, &data) < 0) {
-               switch (errno) {
-               case ENODEV:
-                       fprintf(stderr, "ERROR: smbfs filesystem not supported by the kernel\n");
-                       break;
-               default:
-                       perror("mount error");
-               }
-               fprintf(stderr, "Please refer to the smbmnt(8) manual page\n");
-               return -1;
-       }
-
-        ment.mnt_fsname = share_name ? share_name : (char *)"none";
-        ment.mnt_dir = mount_point;
-        ment.mnt_type = (char *)"smbfs";
-        ment.mnt_opts = (char *)"";
-        ment.mnt_freq = 0;
-        ment.mnt_passno= 0;
-
-        mount_point = ment.mnt_dir;
-
-       if (mount_point == NULL)
-       {
-               fprintf(stderr, "Mount point too long\n");
-               return -1;
-       }
-       
-        if ((fd = open(MOUNTED"~", O_RDWR|O_CREAT|O_EXCL, 0600)) == -1)
-        {
-                fprintf(stderr, "Can't get "MOUNTED"~ lock file");
-                return 1;
-        }
-        close(fd);
-       
-        if ((mtab = setmntent(MOUNTED, "a+")) == NULL)
-        {
-                fprintf(stderr, "Can't open " MOUNTED);
-                return 1;
-        }
-
-        if (addmntent(mtab, &ment) == 1)
-        {
-                fprintf(stderr, "Can't write mount entry");
-                return 1;
-        }
-        if (fchmod(fileno(mtab), 0644) == -1)
-        {
-                fprintf(stderr, "Can't set perms on "MOUNTED);
-                return 1;
-        }
-        endmntent(mtab);
-
-        if (unlink(MOUNTED"~") == -1)
-        {
-                fprintf(stderr, "Can't remove "MOUNTED"~");
-                return 1;
-        }
-
-       return 0;
-}      
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
deleted file mode 100644 (file)
index 98c61a3..0000000
+++ /dev/null
@@ -1,1045 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-   SMBFS mount program
-   Copyright (C) Andrew Tridgell 1999
-   
-   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 <mntent.h>
-#include <asm/types.h>
-#include <linux/smb_fs.h>
-
-extern bool in_client;
-extern char *optarg;
-extern int optind;
-
-static char *credentials;
-static fstring my_netbios_name;
-static char *password;
-static char *username;
-static fstring workgroup;
-static char *mpoint;
-static char *service;
-static char *options;
-
-static struct sockaddr_storage dest_ip;
-static bool have_ip;
-static int smb_port = 0;
-static bool got_user;
-static bool got_pass;
-static uid_t mount_uid;
-static gid_t mount_gid;
-static int mount_ro;
-static unsigned mount_fmask;
-static unsigned mount_dmask;
-static bool use_kerberos;
-/* TODO: Add code to detect smbfs version in kernel */
-static bool status32_smbfs = False;
-static bool smbfs_has_unicode = False;
-static bool smbfs_has_lfs = False;
-
-static void usage(void);
-
-static void exit_parent(int sig)
-{
-       /* parent simply exits when child says go... */
-       exit(0);
-}
-
-static void daemonize(void)
-{
-       int j, status;
-       pid_t child_pid;
-
-       signal( SIGTERM, exit_parent );
-
-       if ((child_pid = sys_fork()) < 0) {
-               DEBUG(0,("could not fork\n"));
-       }
-
-       if (child_pid > 0) {
-               while( 1 ) {
-                       j = waitpid( child_pid, &status, 0 );
-                       if( j < 0 ) {
-                               if( EINTR == errno ) {
-                                       continue;
-                               }
-                               status = errno;
-                       }
-                       break;
-               }
-
-               /* If we get here - the child exited with some error status */
-               if (WIFSIGNALED(status))
-                       exit(128 + WTERMSIG(status));
-               else
-                       exit(WEXITSTATUS(status));
-       }
-
-       signal( SIGTERM, SIG_DFL );
-       chdir("/");
-}
-
-static void close_our_files(int client_fd)
-{
-       int i;
-       struct rlimit limits;
-
-       getrlimit(RLIMIT_NOFILE,&limits);
-       for (i = 0; i< limits.rlim_max; i++) {
-               if (i == client_fd)
-                       continue;
-               close(i);
-       }
-}
-
-static void usr1_handler(int x)
-{
-       return;
-}
-
-
-/***************************************************** 
-return a connection to a server
-*******************************************************/
-static struct cli_state *do_connection(char *the_service)
-{
-       struct cli_state *c;
-       struct nmb_name called, calling;
-       char *server_n;
-       struct sockaddr_storage ip;
-       char *server;
-       char *share;
-       const char *c_username;
-       const char *c_password;
-       TALLOC_CTX *ctx = talloc_tos();
-
-       if (the_service[0] != '\\' || the_service[1] != '\\') {
-               usage();
-               exit(1);
-       }
-
-       server = talloc_strdup(ctx, the_service+2);
-       if (!server) {
-               fprintf(stderr,"Out of memory\n");
-               exit(ENOMEM);
-       }
-       share = strchr_m(server,'\\');
-       if (!share) {
-               usage();
-              &