Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
authorSimo Sorce <idra@samba.org>
Fri, 1 Feb 2008 19:24:31 +0000 (14:24 -0500)
committerSimo Sorce <idra@samba.org>
Fri, 1 Feb 2008 19:24:31 +0000 (14:24 -0500)
(This used to be commit 7dbfc7bdc65314466a83e8121b35c9bcb24b2631)

544 files changed:
.gitignore
PFIF.txt [new file with mode: 0644]
README
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
examples/libsmbclient/Makefile
examples/libsmbclient/get_auth_data_fn.h
examples/libsmbclient/smbwrapper/Makefile
examples/libsmbclient/smbwrapper/select.c
examples/libsmbclient/smbwrapper/wrapper.c
examples/libsmbclient/testacl.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/testwrite.c [new file with mode: 0644]
examples/libsmbclient/tree.c
examples/logon/genlogon/genlogon.pl
examples/misc/adssearch.pl
packaging/Example/setup.sh
release-scripts/create-tarball [new file with mode: 0755]
source3/Makefile.in
source3/auth/auth_domain.c
source3/auth/auth_server.c
source3/auth/auth_unix.c
source3/auth/auth_util.c
source3/auth/auth_winbind.c
source3/auth/pass_check.c
source3/auth/token_util.c
source3/client/cifs.spnego.c
source3/client/client.c
source3/client/clitar.c
source3/client/dnsbrowse.c [new file with mode: 0644]
source3/client/mount.cifs.c
source3/client/smbmnt.c
source3/client/smbmount.c
source3/client/smbspool.c
source3/configure.in
source3/exports/libnetapi.syms [new file with mode: 0644]
source3/exports/libwbclient.syms [new file with mode: 0644]
source3/groupdb/mapping_ldb.c
source3/groupdb/mapping_tdb.c
source3/include/ads.h
source3/include/ads_protos.h
source3/include/client.h
source3/include/ctdbd_conn.h
source3/include/dbwrap.h
source3/include/debug.h
source3/include/doserr.h
source3/include/includes.h
source3/include/libsmb_internal.h
source3/include/libsmbclient.h
source3/include/memcache.h [new file with mode: 0644]
source3/include/messages.h
source3/include/passdb.h
source3/include/popt_common.h
source3/include/reg_objects.h
source3/include/rpc_client.h
source3/include/rpc_dce.h
source3/include/rpc_ds.h [deleted file]
source3/include/rpc_lsa.h
source3/include/rpc_netlogon.h
source3/include/rpc_samr.h
source3/include/smb.h
source3/include/smb_macros.h
source3/include/talloc_stack.h
source3/include/trans2.h
source3/include/transfer_file.h [new file with mode: 0644]
source3/include/vfs.h
source3/include/vfs_macros.h
source3/lib/access.c
source3/lib/afs.c
source3/lib/afs_settoken.c
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_rbt.c
source3/lib/dbwrap_tdb.c
source3/lib/dbwrap_util.c [new file with mode: 0644]
source3/lib/debug.c
source3/lib/display_sec.c
source3/lib/dprintf.c
source3/lib/dummysmbd.c
source3/lib/errmap_unix.c
source3/lib/fault.c
source3/lib/gencache.c
source3/lib/interfaces.c
source3/lib/md4.c
source3/lib/memcache.c [new file with mode: 0644]
source3/lib/messages_ctdbd.c
source3/lib/module.c
source3/lib/ms_fnmatch.c
source3/lib/netapi/examples/Makefile.in [new file with mode: 0644]
source3/lib/netapi/examples/getdc/getdc.c [new file with mode: 0644]
source3/lib/netapi/examples/getjoinableous/getjoinableous.c [new file with mode: 0644]
source3/lib/netapi/examples/netdomjoin-gui/logo-small.png [new file with mode: 0644]
source3/lib/netapi/examples/netdomjoin-gui/logo.png [new file with mode: 0644]
source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c [new file with mode: 0644]
source3/lib/netapi/examples/netdomjoin-gui/samba.ico [new file with mode: 0755]
source3/lib/netapi/examples/netdomjoin/netdomjoin.c [new file with mode: 0644]
source3/lib/netapi/getdc.c [new file with mode: 0644]
source3/lib/netapi/joindomain.c
source3/lib/netapi/netapi.c [new file with mode: 0644]
source3/lib/netapi/netapi.h [new file with mode: 0644]
source3/lib/netapi/serverinfo.c [new file with mode: 0644]
source3/lib/popt_common.c
source3/lib/privileges.c
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/system/config.m4
source3/lib/replace/system/network.h
source3/lib/replace/system/printing.h [deleted file]
source3/lib/replace/test/testsuite.c
source3/lib/secace.c
source3/lib/secacl.c
source3/lib/secdesc.c
source3/lib/sharesec.c
source3/lib/socket_wrapper/socket_wrapper.c
source3/lib/substitute.c
source3/lib/sysacls.c
source3/lib/system.c
source3/lib/talloc/talloc.c
source3/lib/talloc/talloc.h
source3/lib/talloc/testsuite.c
source3/lib/talloc_stack.c
source3/lib/tdb/common/freelist.c
source3/lib/tdb/common/io.c
source3/lib/tdb/common/lock.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/common/traverse.c
source3/lib/tdb/configure.ac
source3/lib/tdb/include/tdb.h
source3/lib/tdb/tools/tdbtool.c
source3/lib/time.c
source3/lib/username.c
source3/lib/util.c
source3/lib/util_pw.c
source3/lib/util_reg.c
source3/lib/util_seaccess.c
source3/lib/util_sid.c
source3/lib/util_sock.c
source3/lib/util_str.c
source3/lib/util_tdb.c
source3/lib/util_transfer_file.c [new file with mode: 0644]
source3/lib/version.c
source3/lib/winbind_util.c [new file with mode: 0644]
source3/lib/xfile.c
source3/libaddns/dns.h
source3/libaddns/dnsrecord.c
source3/libads/ads_status.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_filesync.c
source3/libgpo/gpo_ldap.c
source3/libnet/libnet.h [moved from source3/lib/netapi/joindomain.h with 68% similarity]
source3/libnet/libnet_conf.c [new file with mode: 0644]
source3/libnet/libnet_conf.h [new file with mode: 0644]
source3/libnet/libnet_join.c [new file with mode: 0644]
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_echo.c
source3/librpc/gen_ndr/cli_echo.h
source3/librpc/gen_ndr/cli_epmapper.c
source3/librpc/gen_ndr/cli_epmapper.h
source3/librpc/gen_ndr/cli_eventlog.c
source3/librpc/gen_ndr/cli_eventlog.h
source3/librpc/gen_ndr/cli_initshutdown.c
source3/librpc/gen_ndr/cli_initshutdown.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_samr.c [new file with mode: 0644]
source3/librpc/gen_ndr/cli_samr.h [new file with mode: 0644]
source3/librpc/gen_ndr/cli_srvsvc.c
source3/librpc/gen_ndr/cli_srvsvc.h
source3/librpc/gen_ndr/cli_svcctl.c
source3/librpc/gen_ndr/cli_svcctl.h
source3/librpc/gen_ndr/cli_unixinfo.c
source3/librpc/gen_ndr/cli_unixinfo.h
source3/librpc/gen_ndr/cli_winreg.c
source3/librpc/gen_ndr/cli_winreg.h
source3/librpc/gen_ndr/cli_wkssvc.c
source3/librpc/gen_ndr/cli_wkssvc.h
source3/librpc/gen_ndr/dfs.h
source3/librpc/gen_ndr/dssetup.h [new file with mode: 0644]
source3/librpc/gen_ndr/echo.h
source3/librpc/gen_ndr/epmapper.h
source3/librpc/gen_ndr/eventlog.h
source3/librpc/gen_ndr/initshutdown.h
source3/librpc/gen_ndr/libnet_join.h [new file with mode: 0644]
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_libnet_join.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_libnet_join.h [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_lsa.c
source3/librpc/gen_ndr/ndr_lsa.h
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_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_svcctl.c
source3/librpc/gen_ndr/ndr_wkssvc.c
source3/librpc/gen_ndr/ndr_xattr.c [new file with mode: 0644]
source3/librpc/gen_ndr/ndr_xattr.h [new file with mode: 0644]
source3/librpc/gen_ndr/netlogon.h
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_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
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/winreg.h
source3/librpc/gen_ndr/wkssvc.h
source3/librpc/gen_ndr/xattr.h [new file with mode: 0644]
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/libnet_join.idl [new file with mode: 0644]
source3/librpc/idl/lsa.idl
source3/librpc/idl/misc.idl
source3/librpc/idl/netlogon.idl
source3/librpc/idl/samr.idl
source3/librpc/idl/security.idl
source3/librpc/idl/srvsvc.idl
source3/librpc/idl/winreg.idl
source3/librpc/idl/wkssvc.idl
source3/librpc/idl/xattr.idl [new file with mode: 0644]
source3/librpc/ndr/libndr.h
source3/librpc/ndr/misc.h [deleted file]
source3/librpc/ndr/ndr_basic.c
source3/librpc/ndr/ndr_misc.c
source3/librpc/ndr/ndr_sec_helper.c
source3/librpc/ndr/security.h [deleted file]
source3/librpc/ndr/sid.c
source3/libsmb/cliconnect.c
source3/libsmb/clidfs.c
source3/libsmb/clidgram.c
source3/libsmb/clientgen.c
source3/libsmb/clifile.c
source3/libsmb/clifsinfo.c
source3/libsmb/clilist.c
source3/libsmb/climessage.c
source3/libsmb/clioplock.c
source3/libsmb/cliprint.c
source3/libsmb/cliquota.c
source3/libsmb/clirap.c
source3/libsmb/clireadwrite.c
source3/libsmb/clisecdesc.c
source3/libsmb/clitrans.c
source3/libsmb/doserr.c
source3/libsmb/dsgetdcname.c
source3/libsmb/errormap.c
source3/libsmb/libsmbclient.c
source3/libsmb/namequery.c
source3/libsmb/nmblib.c
source3/libsmb/ntlm_check.c
source3/libsmb/ntlmssp.c
source3/libsmb/ntlmssp_parse.c
source3/libsmb/smb_seal.c [new file with mode: 0644]
source3/libsmb/smb_signing.c
source3/libsmb/smbencrypt.c
source3/libsmb/trusts_util.c
source3/libsmb/unexpected.c
source3/locking/brlock.c
source3/locking/locking.c
source3/locking/posix.c
source3/modules/gpfs.c
source3/modules/nfs4_acls.c
source3/modules/nfs4_acls.h
source3/modules/vfs_afsacl.c
source3/modules/vfs_aixacl.c
source3/modules/vfs_aixacl2.c
source3/modules/vfs_audit.c
source3/modules/vfs_cacheprime.c
source3/modules/vfs_cap.c
source3/modules/vfs_catia.c
source3/modules/vfs_commit.c
source3/modules/vfs_default.c
source3/modules/vfs_extd_audit.c
source3/modules/vfs_fake_perms.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_gpfs.h [new file with mode: 0644]
source3/modules/vfs_hpuxacl.c
source3/modules/vfs_irixacl.c
source3/modules/vfs_posixacl.c
source3/modules/vfs_prealloc.c
source3/modules/vfs_readahead.c
source3/modules/vfs_recycle.c
source3/modules/vfs_shadow_copy2.c [new file with mode: 0644]
source3/modules/vfs_solarisacl.c
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_tru64acl.c
source3/modules/vfs_tsmsm.c [new file with mode: 0644]
source3/modules/vfs_xattr_tdb.c [new file with mode: 0644]
source3/modules/vfs_zfsacl.c
source3/nmbd/nmbd.c
source3/nmbd/nmbd_elections.c
source3/nmbd/nmbd_incomingdgrams.c
source3/nmbd/nmbd_incomingrequests.c
source3/nmbd/nmbd_packets.c
source3/nmbd/nmbd_processlogon.c
source3/nmbd/nmbd_responserecordsdb.c
source3/nmbd/nmbd_synclists.c
source3/nsswitch/libwbclient/Doxyfile [new file with mode: 0644]
source3/nsswitch/libwbclient/libwbclient.h [new file with mode: 0644]
source3/nsswitch/libwbclient/wbc_err_internal.h [new file with mode: 0644]
source3/nsswitch/libwbclient/wbc_idmap.c [new file with mode: 0644]
source3/nsswitch/libwbclient/wbc_pam.c [new file with mode: 0644]
source3/nsswitch/libwbclient/wbc_pwd.c [new file with mode: 0644]
source3/nsswitch/libwbclient/wbc_sid.c [new file with mode: 0644]
source3/nsswitch/libwbclient/wbc_util.c [new file with mode: 0644]
source3/nsswitch/libwbclient/wbclient.c [new file with mode: 0644]
source3/nsswitch/libwbclient/wbclient.h [new file with mode: 0644]
source3/nsswitch/libwbclient/wbclient_internal.h [new file with mode: 0644]
source3/nsswitch/pam_winbind.c
source3/nsswitch/pam_winbind.h
source3/nsswitch/wb_client.c
source3/nsswitch/wbinfo.c
source3/nsswitch/winbind_nss_config.h
source3/nsswitch/winbind_struct_protocol.h
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/passdb.c
source3/passdb/pdb_interface.c
source3/passdb/pdb_ldap.c
source3/passdb/pdb_smbpasswd.c
source3/passdb/pdb_tdb.c
source3/passdb/secrets.c
source3/pkgconfig/netapi.pc.in [new file with mode: 0644]
source3/pkgconfig/smbclient.pc.in [new file with mode: 0644]
source3/pkgconfig/smbsharemodes.pc.in [new file with mode: 0644]
source3/pkgconfig/wbclient.pc.in [new file with mode: 0644]
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/printfsp.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 95% 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 84% 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 75% 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_parse/parse_buffer.c
source3/rpc_parse/parse_ds.c [deleted file]
source3/rpc_parse/parse_lsa.c
source3/rpc_parse/parse_net.c
source3/rpc_parse/parse_prs.c
source3/rpc_parse/parse_samr.c
source3/rpc_parse/parse_sec.c
source3/rpc_parse/parse_spoolss.c
source3/rpc_parse/parse_srv.c
source3/rpc_server/srv_dfs_nt.c
source3/rpc_server/srv_dssetup_nt.c [new file with mode: 0644]
source3/rpc_server/srv_eventlog_lib.c
source3/rpc_server/srv_eventlog_nt.c
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
source3/rpc_server/srv_netlog_nt.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_samr.c
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_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_samr.c
source3/rpcclient/cmd_spoolss.c
source3/rpcclient/cmd_wkssvc.c
source3/rpcclient/rpcclient.c
source3/script/fix_bool.pl [new file with mode: 0755]
source3/script/mkproto.awk
source3/script/tests/selftest.sh
source3/script/tests/test_local_s3.sh
source3/script/tests/test_ntlm_auth_s3.sh [new file with mode: 0755]
source3/script/tests/test_posix_s3.sh
source3/script/tests/test_smbclient_s3.sh
source3/script/tests/test_smbtorture_s3.sh
source3/script/tests/test_wbinfo_s3.sh
source3/script/tests/tests_all.sh
source3/services/services_db.c
source3/smbd/aio.c
source3/smbd/blocking.c
source3/smbd/chgpasswd.c
source3/smbd/close.c
source3/smbd/connection.c
source3/smbd/dir.c
source3/smbd/dmapi.c
source3/smbd/dnsregister.c
source3/smbd/dosmode.c
source3/smbd/error.c
source3/smbd/file_access.c
source3/smbd/fileio.c
source3/smbd/filename.c
source3/smbd/files.c
source3/smbd/ipc.c
source3/smbd/lanman.c
source3/smbd/mangle_hash.c
source3/smbd/mangle_hash2.c
source3/smbd/map_username.c
source3/smbd/message.c
source3/smbd/msdfs.c
source3/smbd/negprot.c
source3/smbd/notify.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/oplock.c
source3/smbd/oplock_linux.c
source3/smbd/password.c
source3/smbd/pipes.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/seal.c [new file with mode: 0644]
source3/smbd/sec_ctx.c
source3/smbd/server.c
source3/smbd/service.c
source3/smbd/sesssetup.c
source3/smbd/statcache.c
source3/smbd/statvfs.c
source3/smbd/trans2.c
source3/smbd/utmp.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c
source3/torture/pdbtest.c
source3/torture/test_ntlm_auth.py [new file with mode: 0755]
source3/torture/torture.c
source3/torture/vfstest.c
source3/utils/net.c
source3/utils/net.h
source3/utils/net_ads.c
source3/utils/net_conf.c
source3/utils/net_dns.c
source3/utils/net_dom.c
source3/utils/net_domain.c
source3/utils/net_help.c
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_sh_acct.c
source3/utils/net_sam.c
source3/utils/ntlm_auth.c
source3/utils/pdbedit.c
source3/utils/smbcacls.c
source3/utils/smbcontrol.c
source3/utils/smbcquotas.c
source3/utils/smbfilter.c
source3/utils/smbget.c
source3/web/cgi.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_group.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_rpc.c
source3/winbindd/winbindd_util.c

index bd1cba16b0652a1202d71714d9c0de1adcc22a0d..b445ccfca67fd4303da709e877447ba3ebfd08a6 100644 (file)
@@ -1,7 +1,9 @@
 *.o
 *.po
 *~
+source/TAGS
 source/client/client_proto.h
+source/libnet/libnet_proto.h
 source/include/build_env.h
 source/include/config.h
 source/include/config.h.in
@@ -9,6 +11,7 @@ source/include/proto.h
 source/include/stamp-h
 source/include/version.h
 source/Makefile
+source/lib/netapi/examples/Makefile
 source/config.log
 source/config.status
 source/configure
@@ -32,3 +35,29 @@ source/proto_exists
 source/winbindd/winbindd_proto.h
 source/cscope.out
 source/torture.tdb
+source/pkgconfig/*.pc
+source/st
+examples/VFS/Makefile
+examples/VFS/config.log
+examples/VFS/config.status
+examples/VFS/configure
+examples/VFS/module_config.h
+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
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 fd4b20618514c68550aec3d96b75ac4bbc35c0a4..4a6e6be42fd04b1c40ebd52a42cbf4a162af35e6 100644 (file)
@@ -92,7 +92,7 @@ static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,  SMB_STRUCT_DI
 
 static void skel_seekdir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp, long offset)
 {
-       return vfswrap_seekdir(NULL,  dirp, offset);
+       vfswrap_seekdir(NULL,  dirp, offset);
 }
 
 static long skel_telldir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
@@ -102,7 +102,7 @@ static long skel_telldir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
 
 static void skel_rewinddir(vfs_handle_struct *handle,  SMB_STRUCT_DIR *dirp)
 {
-       return vfswrap_rewinddir(NULL,  dirp);
+       vfswrap_rewinddir(NULL,  dirp);
 }
 
 static int skel_mkdir(vfs_handle_struct *handle,  const char *path, mode_t mode)
@@ -130,40 +130,40 @@ static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
        return vfswrap_close(NULL, fsp, fd);
 }
 
-static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n)
+static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
 {
-       return vfswrap_read(NULL, fsp, fd, data, n);
+       return vfswrap_read(NULL, fsp, data, n);
 }
 
-static ssize_t skel_pread(vfs_handle_struct *handle, struct files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset)
+static ssize_t skel_pread(vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
 {
-       return vfswrap_pread(NULL, fsp, fd, data, n, offset);
+       return vfswrap_pread(NULL, fsp, data, n, offset);
 }
 
-static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
+static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
 {
-       return vfswrap_write(NULL, fsp, fd, data, n);
+       return vfswrap_write(NULL, fsp, data, n);
 }
 
-ssize_t skel_pwrite(vfs_handle_struct *handle, struct files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset)
+ssize_t skel_pwrite(vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
 {
-       return vfswrap_pwrite(NULL, fsp, fd, data, n, offset);
+       return vfswrap_pwrite(NULL, fsp, data, n, offset);
 }
 
-static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence)
+static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
 {
-       return vfswrap_lseek(NULL, fsp, filedes, offset, whence);
+       return vfswrap_lseek(NULL, fsp, offset, whence);
 }
 
-static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr,
+static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr,
                                        SMB_OFF_T offset, size_t n)
 {
-       return vfswrap_sendfile(NULL, tofd, fsp, fromfd, hdr, offset, n);
+       return vfswrap_sendfile(NULL, tofd, fromfsp, hdr, offset, n);
 }
 
-static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t n)
+static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
 {
-       return vfswrap_recvfile(NULL, fromfd, fsp, tofd, offset, n);
+       return vfswrap_recvfile(NULL, fromfd, tofsp, offset, n);
 }
 
 static int skel_rename(vfs_handle_struct *handle,  const char *oldname, const char *newname)
@@ -171,9 +171,9 @@ static int skel_rename(vfs_handle_struct *handle,  const char *oldname, const ch
        return vfswrap_rename(NULL,  oldname, newname);
 }
 
-static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
 {
-       return vfswrap_fsync(NULL, fsp, fd);
+       return vfswrap_fsync(NULL, fsp);
 }
 
 static int skel_stat(vfs_handle_struct *handle,  const char *fname, SMB_STRUCT_STAT *sbuf)
@@ -181,9 +181,9 @@ static int skel_stat(vfs_handle_struct *handle,  const char *fname, SMB_STRUCT_S
        return vfswrap_stat(NULL,  fname, sbuf);
 }
 
-static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
 {
-       return vfswrap_fstat(NULL, fsp, fd, sbuf);
+       return vfswrap_fstat(NULL, fsp, sbuf);
 }
 
 static int skel_lstat(vfs_handle_struct *handle,  const char *path, SMB_STRUCT_STAT *sbuf)
@@ -201,9 +201,9 @@ static int skel_chmod(vfs_handle_struct *handle,  const char *path, mode_t mode)
        return vfswrap_chmod(NULL,  path, mode);
 }
 
-static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
-       return vfswrap_fchmod(NULL, fsp, fd, mode);
+       return vfswrap_fchmod(NULL, fsp, mode);
 }
 
 static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
@@ -211,9 +211,9 @@ static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, g
        return vfswrap_chown(NULL,  path, uid, gid);
 }
 
-static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid)
+static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
 {
-       return vfswrap_fchown(NULL, fsp, fd, uid, gid);
+       return vfswrap_fchown(NULL, fsp, uid, gid);
 }
 
 static int skel_lchown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
@@ -236,19 +236,19 @@ static int skel_ntimes(vfs_handle_struct *handle,  const char *path, const struc
        return vfswrap_ntimes(NULL,  path, ts);
 }
 
-static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T offset)
+static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
 {
-       return vfswrap_ftruncate(NULL, fsp, fd, offset);
+       return vfswrap_ftruncate(NULL, fsp, offset);
 }
 
-static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
 {
-       return vfswrap_lock(NULL, fsp, fd, op, offset, count, type);
+       return vfswrap_lock(NULL, fsp, op, offset, count, type);
 }
 
-static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
 {
-       return vfswrap_getlock(NULL, fsp, fd, poffset, pcount, ptype, ppid);
+       return vfswrap_getlock(NULL, fsp, poffset, pcount, ptype, ppid);
 }
 
 static int skel_symlink(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
@@ -301,7 +301,7 @@ static struct file_id skel_file_id_create(vfs_handle_struct *handle,
 }
 
 static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-       int fd, uint32 security_info, SEC_DESC **ppdesc)
+       uint32 security_info, SEC_DESC **ppdesc)
 {
        errno = ENOSYS;
        return 0;
@@ -314,8 +314,8 @@ static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
        return 0;
 }
 
-static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int
-       fd, uint32 security_info_sent, SEC_DESC *psd)
+static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+       uint32 security_info_sent, SEC_DESC *psd)
 {
        errno = ENOSYS;
        return NT_STATUS_NOT_IMPLEMENTED;
@@ -334,7 +334,7 @@ static int skel_chmod_acl(vfs_handle_struct *handle,  const char *name, mode_t m
        return -1;
 }
 
-static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
        errno = ENOSYS;
        return -1;
@@ -370,7 +370,7 @@ static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,  const char *p
        return NULL;
 }
 
-static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
 {
        errno = ENOSYS;
        return NULL;
@@ -436,7 +436,7 @@ static int skel_sys_acl_set_file(vfs_handle_struct *handle,  const char *name, S
        return -1;
 }
 
-static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl)
+static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
 {
        errno = ENOSYS;
        return -1;
@@ -485,7 +485,7 @@ size)
        return -1;
 }
 
-static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size)
+static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
 {
        errno = ENOSYS;
        return -1;
@@ -503,7 +503,7 @@ static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char
        return -1;
 }
 
-static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size)
+static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
 {
        errno = ENOSYS;
        return -1;
@@ -521,7 +521,7 @@ static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const
        return -1;
 }
 
-static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name)
+static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
 {
        errno = ENOSYS;
        return -1;
@@ -539,7 +539,7 @@ static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const cha
        return -1;
 }
 
-static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, const void *value, size_t size, int flags)
+static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
 {
        errno = ENOSYS;
        return -1;
@@ -560,9 +560,9 @@ static ssize_t skel_aio_return(struct vfs_handle_struct *handle, struct files_st
        return vfswrap_aio_return(NULL, fsp, aiocb);
 }
 
-static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb)
+static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
 {
-       return vfswrap_aio_cancel(NULL, fsp, fd, aiocb);
+       return vfswrap_aio_cancel(NULL, fsp, aiocb);
 }
 
 static int skel_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
@@ -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[] = {
@@ -615,7 +630,7 @@ static vfs_op_tuple skel_op_tuples[] = {
        {SMB_VFS_OP(skel_pwrite),                       SMB_VFS_OP_PWRITE,              SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_lseek),                        SMB_VFS_OP_LSEEK,               SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_sendfile),                     SMB_VFS_OP_SENDFILE,            SMB_VFS_LAYER_OPAQUE},
-       {SMB_VFS_OP(skel_recvfile),                     SMB_VFS_OP_RECVFLE,             SMB_VFS_LAYER_OPAQUE},
+       {SMB_VFS_OP(skel_recvfile),                     SMB_VFS_OP_RECVFILE,            SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_rename),                       SMB_VFS_OP_RENAME,              SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_fsync),                        SMB_VFS_OP_FSYNC,               SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(skel_stat),                         SMB_VFS_OP_STAT,                SMB_VFS_LAYER_OPAQUE},
@@ -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 2512f4d6dbdddd6bcd3fa1ceddc16b8db9489a94..f4cb9b15ba2e048dfa7523e6c54ba707e1f03fc7 100644 (file)
@@ -124,39 +124,39 @@ static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
        return SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
 }
 
-static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n)
+static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
 {
-       return SMB_VFS_NEXT_READ(handle, fsp, fd, data, n);
+       return SMB_VFS_NEXT_READ(handle, fsp, data, n);
 }
 
-static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset)
+static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
 {
-       return SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset);
+       return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
 }
 
-static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
+static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
 {
-       return SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n);
+       return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
 }
 
-static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset)
+static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
 {
-       return SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset);
+       return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
 }
 
-static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence)
+static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence)
 {
-       return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence);
+       return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
 }
 
-static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n)
+static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n)
 {
-       return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr, offset, n);
+       return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
 }
 
-static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t n)
+static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
 {
-       return SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, offset, n);
+       return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
 }
 
 static int skel_rename(vfs_handle_struct *handle,  const char *oldname, const char *newname)
@@ -164,9 +164,9 @@ static int skel_rename(vfs_handle_struct *handle,  const char *oldname, const ch
        return SMB_VFS_NEXT_RENAME(handle, oldname, newname);
 }
 
-static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
 {
-       return SMB_VFS_NEXT_FSYNC(handle, fsp, fd);
+       return SMB_VFS_NEXT_FSYNC(handle, fsp);
 }
 
 static int skel_stat(vfs_handle_struct *handle,  const char *fname, SMB_STRUCT_STAT *sbuf)
@@ -174,9 +174,9 @@ static int skel_stat(vfs_handle_struct *handle,  const char *fname, SMB_STRUCT_S
        return SMB_VFS_NEXT_STAT(handle, fname, sbuf);
 }
 
-static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
 {
-       return SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+       return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
 }
 
 static int skel_lstat(vfs_handle_struct *handle,  const char *path, SMB_STRUCT_STAT *sbuf)
@@ -194,9 +194,9 @@ static int skel_chmod(vfs_handle_struct *handle,  const char *path, mode_t mode)
        return SMB_VFS_NEXT_CHMOD(handle, path, mode);
 }
 
-static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
-       return SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
+       return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
 }
 
 static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
@@ -204,9 +204,9 @@ static int skel_chown(vfs_handle_struct *handle,  const char *path, uid_t uid, g
        return SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
 }
 
-static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid)
+static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
 {
-       return SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid);
+       return SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
 }
 
 static int skel_lchown(vfs_handle_struct *handle,  const char *path, uid_t uid, gid_t gid)
@@ -229,19 +229,19 @@ static int skel_ntimes(vfs_handle_struct *handle,  const char *path, const struc
        return SMB_VFS_NEXT_NTIMES(handle, path, ts);
 }
 
-static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T offset)
+static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
 {
-       return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset);
+       return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
 }
 
-static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
 {
-       return SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type);
+       return SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
 }
 
-static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
 {
-       return SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid);
+       return SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
 }
 
 static int skel_symlink(vfs_handle_struct *handle,  const char *oldpath, const char *newpath)
@@ -289,22 +289,22 @@ static struct file_id skel_file_id_create(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
 }
 
-static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-       int fd, uint32 security_info, SEC_DESC **ppdesc)
+static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+       uint32 security_info, SEC_DESC **ppdesc)
 {
-       return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, ppdesc);
+       return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
 }
 
-static size_t skel_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
        const char *name, uint32 security_info, SEC_DESC **ppdesc)
 {
-       return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc);
+       return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
 }
 
 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-       int fd, uint32 security_info_sent, SEC_DESC *psd)
+       uint32 security_info_sent, SEC_DESC *psd)
 {
-       return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, psd);
+       return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
 }
 
 static NTSTATUS skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
@@ -323,14 +323,14 @@ static int skel_chmod_acl(vfs_handle_struct *handle,  const char *name, mode_t m
        return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
 }
 
-static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
+static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
        /* If the underlying VFS doesn't have ACL support... */
        if (!handle->vfs_next.ops.fchmod_acl) {
                errno = ENOSYS;
                return -1;
        }
-       return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode);
+       return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
 }
 
 static int skel_sys_acl_get_entry(vfs_handle_struct *handle,  SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
@@ -358,9 +358,9 @@ static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,  const char *p
        return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
 }
 
-static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp)
 {
-       return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd);
+       return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
 }
 
 static int skel_sys_acl_clear_perms(vfs_handle_struct *handle,  SMB_ACL_PERMSET_T permset)
@@ -413,9 +413,9 @@ static int skel_sys_acl_set_file(vfs_handle_struct *handle,  const char *name, S
        return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
 }
 
-static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl)
+static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
 {
-       return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl);
+       return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
 }
 
 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,  const char *path)
@@ -454,9 +454,9 @@ size)
         return SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size);
 }
 
-static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size)
+static ssize_t skel_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
 {
-        return SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size);
+        return SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
 }
 
 static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size)
@@ -469,9 +469,9 @@ static ssize_t skel_llistxattr(vfs_handle_struct *handle, const char *path, char
         return SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size);
 }
 
-static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size)
+static ssize_t skel_flistxattr(vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
 {
-        return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size);
+        return SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
 }
 
 static int skel_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
@@ -484,9 +484,9 @@ static int skel_lremovexattr(vfs_handle_struct *handle, const char *path, const
         return SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
 }
 
-static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name)
+static int skel_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
 {
-        return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name);
+        return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
 }
 
 static int skel_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
@@ -499,9 +499,9 @@ static int skel_lsetxattr(vfs_handle_struct *handle, const char *path, const cha
         return SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags);
 }
 
-static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, const void *value, size_t size, int flags)
+static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
 {
-        return SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size, flags);
+        return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
 }
 
 static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
@@ -519,9 +519,9 @@ static ssize_t skel_aio_return(struct vfs_handle_struct *handle, struct files_st
        return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
 }
 
-static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb)
+static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
 {
-       return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb);
+       return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
 }
 
 static int skel_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
@@ -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 be383aea671c53347ae68a8d706f7af71de4ec09..6c70659661701bb0292e262783d7b2308501e52b 100644 (file)
@@ -5,7 +5,7 @@ SAMBA_INCL = ../../source/include
 EXTLIB_INCL = -I/usr/include/gtk-1.2 \
              -I/usr/include/glib-1.2 \
              -I/usr/lib/glib/include
-
+EXTLIB_INCL = `gtk-config --cflags`
 
 DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 CFLAGS = -O0 -g -I$(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS)
@@ -13,18 +13,21 @@ CFLAGS = -O0 -g -I$(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS)
 LDFLAGS = -L/usr/local/samba/lib \
          -lldap -lkrb5 -lgssapi_krb5
 #LIBSMBCLIENT = /usr/local/samba/lib/libsmbclient.so
-LIBSMBCLIENT = ../../source/bin/libsmbclient.a -ldl -lresolv
+LIBSMBCLIENT = -lwbclient -lsmbclient -ldl -lresolv
 
 TESTS= testsmbc \
        testacl \
        testacl2 \
+       testacl3 \
        testbrowse \
        testbrowse2 \
        teststat \
        teststat2 \
+       teststat3 \
        testchmod \
        testutime \
-       testread
+       testread \
+       testwrite
 
 #      tree \
 
@@ -46,6 +49,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 +69,10 @@ teststat2: teststat2.o
        @echo Linking teststat2
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
 
+teststat3: teststat3.o
+       @echo Linking teststat3
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
+
 testchmod: testchmod.o
        @echo Linking testchmod
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
@@ -74,6 +85,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 c94ef8fa6afdd47674ab6d7956a7ab822fbd0a28..726435319f89eb3ba14174718f37894a6efecafa 100644 (file)
@@ -1,4 +1,4 @@
-LIBS = -lsmbclient -ldl
+LIBS = -lwbclient -lsmbclient -ldl
 DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
 
 CFLAGS = -I$(SAMBA_INCL) $(EXTLIB_INCL)
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) {
index 30f9037d53a144f62f153312bae31c9eebb50386..958e00636ea5428f455166e601ba3abe06c0f59e 100644 (file)
@@ -61,6 +61,7 @@
 #include <dirent.h>
 #include <signal.h>
 #include <stdarg.h>
+#include <string.h>
 #ifdef __USE_GNU
 # define SMBW_USE_GNU
 #endif
index 4d327b39a7a11e0c7a0eea3768fd94ed66a50ced..51cc90f1015e34289aa4574930448ecade2cd2f7 100644 (file)
@@ -7,6 +7,7 @@
 
 enum acl_mode
 {
+    SMB_ACL_LIST,
     SMB_ACL_GET,
     SMB_ACL_SET,
     SMB_ACL_DELETE,
@@ -24,7 +25,7 @@ int main(int argc, const char *argv[])
     int debug = 0;
     int numeric = 0;
     int full_time_names = 0;
-    enum acl_mode mode = SMB_ACL_GET;
+    enum acl_mode mode = SMB_ACL_LIST;
     static char *the_acl = NULL;
     int ret;
     char *p;
@@ -149,6 +150,30 @@ int main(int argc, const char *argv[])
     
     switch(mode)
     {
+    case SMB_ACL_LIST:
+        ret = smbc_listxattr(path, value, sizeof(value)-2);
+        if (ret < 0)
+        {
+            printf("Could not get attribute list for [%s] %d: %s\n",
+                   path, errno, strerror(errno));
+            return 1;
+        }
+
+        /*
+         * The list of attributes has a series of null-terminated strings.
+         * The list of strings terminates with an extra null byte, thus two in
+         * a row.  Ensure that our buffer, which is conceivably shorter than
+         * the list of attributes, actually ends with two null bytes in a row.
+         */
+        value[sizeof(value) - 2] = '\0';
+        value[sizeof(value) - 1] = '\0';
+        printf("Supported attributes:\n");
+        for (p = value; *p; p += strlen(p) + 1)
+        {
+            printf("\t%s\n", p);
+        }
+        break;
+
     case SMB_ACL_GET:
         if (the_acl == NULL)
         {
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/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 d5a71e2868361f7d3f254294717f166226ed69a2..6e34cd05627c4d47ee05b654e0329baeadf6ba4e 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <string.h>
+#include <stdlib.h>
 #include <gtk/gtk.h>
 #include "libsmbclient.h"
 
index 8ebf39214117fe460fee19a934add6901026cb00..4799ac8452d5c11bc849e5e57f7b826233a7f709 100644 (file)
@@ -45,7 +45,7 @@ if ($ARGV[1] eq "SUPPORT" || $ARGV[0] eq "support")
 }
 
 # Connect shares just used by Administration staff
-If ($ARGV[1] eq "ADMIN" || $ARGV[0] eq "admin")
+if ($ARGV[1] eq "ADMIN" || $ARGV[0] eq "admin")
 {
        print LOGON "NET USE L: \\\\$ARGV[2]\\ADMIN\r\n";
        print LOGON "NET USE K: \\\\$ARGV[2]\\MKTING\r\n";
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);
 }
index 994b16d5ef0fae3b1e6d95bfe7da61d785322008..7fd8fc41105f77708cb72d373c29b21071b03433 100755 (executable)
@@ -24,4 +24,4 @@ echo "Done. Now settting up samba command"
 ln /sbin/init.d/samba.init /sbin/samba
 echo "Done."
 echo "To start / stop samba:"
-echo " execute:  samba [start | stop]
+echo " execute:  samba [start | stop]"
diff --git a/release-scripts/create-tarball b/release-scripts/create-tarball
new file mode 100755 (executable)
index 0000000..4592272
--- /dev/null
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+TOPDIR="`dirname $0`/.."
+
+cd $TOPDIR
+
+echo -n "Please enter branch to cut tarball from: "
+read branch
+
+if [ "x$branch" = "x" ]; then
+   echo "You must enter a name!  Exiting...."
+   exit 1
+fi
+
+git-checkout $branch
+if [ $? -ne 0 ]; then
+   echo "Invalid branch name!  Exiting...."
+   exit 2
+fi
+
+VER_H=source/include/version.h
+(cd source && ./autogen.sh)
+
+if [ ! -f $VER_H ]; then
+   echo "Failed to find $VER_H!  Exiting...."
+   exit 1
+fi
+
+version=`grep SAMBA_VERSION_OFFICIAL_STRING $VER_H | awk '{print $3}'`
+version="$version-`grep SAMBA_VERSION_VENDOR_SUFFIX $VER_H | awk '{print $3}'`"
+version=`echo $version | sed 's/\"//g'`
+
+echo "Creating release tarball for Samba $version"
+
+/bin/rm -rf ../samba-${version}
+git-archive --format=tar --prefix=samba-${version}/ HEAD | (cd .. && tar xf -)
+
+pushd ../samba-${version}
+
+echo "Enter the absolute path to the generated Samba docs directory."
+echo -n "Just hit return to exclude the docs from the generate tarball: "
+read docsdir
+
+if [ "x$docsdir" != "x" ]; then
+   if [ ! -d "$docsdir" ]; then
+      echo "$docsdir does not exist!  Exiting...."
+      exit 1
+   fi
+
+   /bin/rm -rf docs
+   mkdir docs
+   rsync -a $docsdir/ docs/
+
+   cd docs
+   /bin/rm -rf test.pdf Samba4*pdf htmldocs/Samba4* htmldocs/test
+   /bin/mv manpages-3 manpages
+   /bin/mv htmldocs/manpages-3 htmldocs/manpages
+   cd ..
+fi
+
+cd ..
+tar cf samba-${version}.tar --exclude=.git* --exclude=CVS --exclude=.svn samba-${version}
+gpg --detach-sign --armor samba-${version}.tar
+gzip -9 samba-${version}.tar
+
+popd
+echo -n "Enter tag name (or hit <enter> to skip): "
+read tagname
+
+if [ "x$tagname" != "x" ]; then
+   if [ "x`git-tag -l $tagname`" != "x" ]; then
+      echo -n "Tag exists.  Do you wish to overwrite? (y/N): "
+      read answer
+
+      if [ "x$answer" != "xy" ]; then
+        echo "Tag creation aborted."
+        exit 1
+      fi
+   fi
+
+   git-tag -s ${tagname}
+fi
+
+echo "Done!"
+exit 0
index 21fc8cebf76a09e59a21766713cace50e211ac6c..4625feda067583fc70eccf7cd550fed1a4f06f82 100644 (file)
@@ -21,11 +21,12 @@ smbtorture4_path=@smbtorture4_path@
 LIBS=@LIBS@
 CC=@CC@
 SHLD=@SHLD@
+LIB_PATH_VAR=@LIB_PATH_VAR@
 
 ## Dynamic shared libraries build settings
 DSO_EXPORTS_CMD=-Wl,--version-script,$(srcdir)/exports/`basename $@ | sed 's/@SHLIBEXT@$$/syms/'`
 DSO_EXPORTS=@DSO_EXPORTS@
-SONAME_VER=`grep ^$@ $(builddir)/library-versions | cut -d: -f2`
+SONAME_VER=`grep \^$@ $(builddir)/library-versions | cut -d: -f2`
 SHLD_DSO = $(SHLD) $(LDSHFLAGS) $(DSO_EXPORTS) -o $@
 
 # The MODULE_EXPORTS variable contains the platform-specific linker flags
@@ -63,6 +64,7 @@ KRB5LIBS=@KRB5_LIBS@
 LDAP_LIBS=@LDAP_LIBS@
 NSCD_LIBS=@NSCD_LIBS@
 UUID_LIBS=@UUID_LIBS@
+WINBIND_LIBS=@WINBIND_LIBS@
 DNSSD_LIBS=@DNSSD_LIBS@
 
 INSTALLCMD=@INSTALL@
@@ -90,6 +92,7 @@ BINDIR = @bindir@
 SBINDIR = @sbindir@
 ROOTSBINDIR = @rootsbindir@
 LIBDIR = @libdir@
+INCLUDEDIR=@includedir@
 PAMMODULESDIR = @pammodulesdir@
 VFSLIBDIR = $(LIBDIR)/vfs
 PDBLIBDIR = $(LIBDIR)/pdb
@@ -141,6 +144,8 @@ PIDDIR = @piddir@
 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@
 
 FLAGS1 = $(CFLAGS) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS)
 FLAGS2 =
@@ -198,7 +203,7 @@ EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ \
        bin/log2pcap@EXEEXT@ bin/sharesec@EXEEXT@ bin/ndrdump@EXEEXT@ \
        bin/vlp@EXEEXT@
 
-SHLIBS = @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@
+SHLIBS = @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ @LIBNETAPI@ @LIBWBCLIENT@
 
 PAM_MODULES = @PAM_MODULES@
 
@@ -248,8 +253,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
@@ -263,7 +274,11 @@ 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_notify.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_xattr.o
 
 RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
 
@@ -280,11 +295,16 @@ NSS_WRAPPER_OBJ = @NSS_WRAPPER_OBJS@
 
 TALLOC_OBJ = lib/talloc/talloc.o
 
+LIBSAMBAUTIL_OBJ = $(TALLOC_OBJ) \
+               $(LIBREPLACE_OBJ) \
+               $(SOCKET_WRAPPER_OBJ) \
+               $(NSS_WRAPPER_OBJ)
 
-LIB_WITHOUT_PROTO_OBJ = $(LIBREPLACE_OBJ) $(SOCKET_WRAPPER_OBJ) $(NSS_WRAPPER_OBJ) $(TALLOC_OBJ) \
+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/interfaces.o lib/rbtree.o lib/memcache.o \
+       lib/util_transfer_file.o
 
 LIB_WITH_PROTO_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
          lib/interface.o lib/md4.o \
@@ -297,11 +317,11 @@ 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 \
-         nsswitch/wb_client.o $(WBCOMMON_OBJ) \
+         $(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@ \
@@ -330,6 +350,14 @@ LIBADDNS_OBJ0 = libaddns/dnsrecord.o libaddns/dnsutils.o  libaddns/dnssock.o \
               libaddns/dnsgss.o libaddns/dnsmarshall.o
 LIBADDNS_OBJ = $(LIBADDNS_OBJ0) $(TALLOC_OBJ)
 
+LIBWBCLIENT_OBJ0 = nsswitch/libwbclient/wbclient.o \
+                 nsswitch/libwbclient/wbc_util.o \
+                 nsswitch/libwbclient/wbc_pwd.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)
+
 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
 LIBGPO_OBJ = $(LIBGPO_OBJ0)
@@ -339,7 +367,7 @@ 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
 
@@ -360,7 +388,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 \
-            $(DOSERR_OBJ) \
+            libsmb/smb_seal.o $(DOSERR_OBJ) \
             $(RPC_PARSE_OBJ1) $(LIBSAMBA_OBJ) $(LIBNMB_OBJ)
 
 RPC_CLIENT_OBJ1 = rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o
@@ -368,7 +396,7 @@ 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
 
 LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_lsa.o \
                   librpc/gen_ndr/cli_dfs.o \
@@ -379,26 +407,69 @@ 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 \
                   $(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
+
+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)
+REGISTRY_BACKENDS = registry/reg_backend_printing.o \
+                   registry/reg_backend_db.o \
+                   registry/reg_backend_smbconf.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
+
+
+REGISTRY_OBJ = registry/reg_init_full.o registry/reg_cachehook.o \
+               registry/reg_eventlog.o \
+               registry/reg_util.o registry/reg_perfcount.o \
+              registry/reg_util_legacy.o \
+              registry/reg_api.o \
+              registry/reg_dispatcher.o \
+              $(REGISTRY_BACKENDS) \
+              $(UTIL_REG_API_OBJ) \
+              $(REG_INIT_SMBCONF_OBJ)
+
+# 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_dispatcher.o \
+             registry/reg_backend_smbconf.o \
+             registry/reg_backend_db.o \
+             registry/reg_util.o \
+             \
+             registry/reg_cachehook.o \
+             \
+             lib/util_nttoken.o \
+             $(UTIL_REG_API_OBJ) \
+             $(REG_INIT_SMBCONF_OBJ)
+
 
 RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o librpc/gen_ndr/srv_lsa.o
 
-RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o
+RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o \
+                librpc/gen_ndr/srv_netlogon.o
 
 RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
-               rpc_server/srv_samr_util.o
-
-REGFIO_OBJ = registry/regfio.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
 
@@ -406,7 +477,7 @@ RPC_REG_OBJ =  rpc_server/srv_winreg_nt.o \
               librpc/gen_ndr/srv_winreg.o \
               $(REGFIO_OBJ)
 
-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
@@ -437,7 +508,7 @@ 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/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)
 
@@ -452,7 +523,7 @@ PASSDB_OBJ = $(PASSDB_GET_SET_OBJ) passdb/passdb.o passdb/pdb_interface.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/util_nscd.o
+               lib/util_nscd.o lib/winbind_util.o
 
 DEVEL_HELP_WEIRD_OBJ = modules/weird.o
 CP850_OBJ = modules/CP850.o
@@ -484,7 +555,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
 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
@@ -494,12 +567,15 @@ 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_SYNCOPS_OBJ = modules/vfs_syncops.o
 
@@ -537,7 +613,7 @@ SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
                smbd/reply.o smbd/sesssetup.o smbd/trans2.o smbd/uid.o \
               smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o \
               smbd/blocking.o smbd/sec_ctx.o smbd/srvstr.o \
-              smbd/vfs.o smbd/statcache.o \
+              smbd/vfs.o smbd/statcache.o smbd/seal.o \
                smbd/posix_acls.o lib/sysacls.o $(SERVER_MUTEX_OBJ) \
               smbd/process.o smbd/service.o smbd/error.o \
               printing/printfsp.o lib/sysquotas.o lib/sysquotas_linux.o \
@@ -557,8 +633,8 @@ 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) \
-               $(BUILDOPT_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ)
+               $(REGISTRY_OBJ) $(POPT_LIB_OBJ) @LIBWBCLIENT_STATIC@ \
+               $(BUILDOPT_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ) $(LIBNET_OBJ)
 
 PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \
                printing/print_cups.o printing/print_generic.o \
@@ -569,6 +645,7 @@ PRINTBASE_OBJ = printing/notify.o printing/printing_db.o
 PRINTBACKEND_OBJ = printing/printing.o printing/nt_printing.o $(PRINTBASE_OBJ)
 
 SMBD_OBJ = $(SMBD_OBJ_BASE) $(SMBD_OBJ_MAIN)
+
 NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
             nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o \
             nmbd/nmbd_browsesync.o nmbd/nmbd_elections.o \
@@ -589,7 +666,7 @@ SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
            web/swat.o web/neg_lang.o
 
 SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(LIBSMB_OBJ) \
-          $(LOCKING_OBJ) $(PASSDB_OBJ) $(SECRETS_OBJ) $(KRBCLIENT_OBJ) \
+          $(LOCKING_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SECRETS_OBJ) $(KRBCLIENT_OBJ) \
           $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \
           $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \
            $(PASSCHANGE_OBJ) $(LDB_OBJ)
@@ -610,7 +687,7 @@ SMBTREE_OBJ = utils/smbtree.o $(PARAM_OBJ) \
             $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) \
              rpc_client/cli_pipe.o $(RPC_PARSE_OBJ2) \
              $(RPC_CLIENT_OBJ1) \
-            $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ) $(GROUPDB_OBJ) \
+            $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(LDB_OBJ) $(GROUPDB_OBJ) \
             $(LIBMSRPC_GEN_OBJ)
 
 TESTPARM_OBJ = utils/testparm.o \
@@ -620,14 +697,15 @@ TESTPARM_OBJ = utils/testparm.o \
 PASSWD_UTIL_OBJ = utils/passwd_util.o
 
 SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSWD_UTIL_OBJ) $(PASSCHANGE_OBJ) \
-               $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) $(PASSDB_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)
+               $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) \
+               $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) $(LDB_OBJ) 
 
-PDBEDIT_OBJ = utils/pdbedit.o $(PASSWD_UTIL_OBJ) $(PARAM_OBJ) $(PASSDB_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)
+               $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(LDB_OBJ) $(ERRORMAP_OBJ) 
 
 SMBGET_OBJ = utils/smbget.o $(POPT_LIB_OBJ) $(LIBSMBCLIENT_OBJ)
 
@@ -638,29 +716,29 @@ 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_OBJ = $(RPCCLIENT_OBJ1) \
              $(PARAM_OBJ) $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) \
-             $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \
+             $(RPC_PARSE_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \
              $(READLINE_OBJ) $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) \
             $(LIBADS_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \
-            $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(LDB_OBJ)
+            $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(LDB_OBJ) 
 
 PAM_WINBIND_OBJ = nsswitch/pam_winbind.o $(WBCOMMON_OBJ) \
-                 $(LIBREPLACE_OBJ) $(SOCKET_WRAPPER_OBJ) @BUILD_INIPARSER@
+                 $(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) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ)
+                  $(SECRETS_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ)
 
-LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o $(TDB_BASE_OBJ)
+LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o $(TDBBASE_OBJ)
 
 # This shared library is intended for linking with unit test programs
 # to test Samba internals.  It's called libbigballofmud.so to
@@ -669,42 +747,35 @@ LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o $(TDB_BASE_OBJ)
 LIBBIGBALLOFMUD_MAJOR = 0
 
 LIBBIGBALLOFMUD_OBJ = $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) \
-       $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) \
+       $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ \
        $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ)
 
 CLIENT_OBJ1 = client/client.o client/clitar.o rpc_client/cli_pipe.o \
+             client/dnsbrowse.o \
              $(RPC_CLIENT_OBJ1) \
              $(RPC_PARSE_OBJ2)
 
 CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
             $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(LIBMSRPC_GEN_OBJ) \
              $(READLINE_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) \
-             $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
-            $(DISPLAY_SEC_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
+LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
+                lib/netapi/joindomain.o \
+                lib/netapi/serverinfo.o \
+                lib/netapi/getdc.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_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
+                $(REG_API_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)
 
-NETAPI_OBJ = lib/netapi/joindomain.o
+LIBNET_OBJ = libnet/libnet_conf.o libnet/libnet_join.o \
+            librpc/gen_ndr/ndr_libnet_join.o
 
 NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
           utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
@@ -715,17 +786,17 @@ NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
           utils/netlookup.o utils/net_sam.o utils/net_rpc_shell.o \
           utils/net_util.o utils/net_rpc_sh_acct.o utils/net_rpc_audit.o \
           $(PASSWD_UTIL_OBJ) utils/net_dns.o utils/net_ads_gpo.o \
-          utils/net_conf.o auth/token_util.o utils/net_dom.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) $(GROUPDB_OBJ) \
+         $(RPC_PARSE_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(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) \
          $(LDB_OBJ) $(LIBGPO_OBJ) @BUILD_INIPARSER@ $(DISPLAY_SEC_OBJ) \
-         $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) $(NETAPI_OBJ)
+         $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) $(LIBNETAPI_OBJ1) $(LIBNET_OBJ)
 
 CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
          $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
@@ -766,7 +837,7 @@ NSSTEST_OBJ = torture/nsstest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                  $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ)
 
 PDBTEST_OBJ = torture/pdbtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
-               $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+               $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) \
                $(SMBLDAP_OBJ) $(POPT_LIB_OBJ) $(LDB_OBJ)
 
 
@@ -780,15 +851,16 @@ LOCKTEST2_OBJ = torture/locktest2.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \
                $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ)
 
 SMBCACLS_OBJ = utils/smbcacls.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
-                          $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \
-                          $(PASSDB_OBJ) $(GROUPDB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(SECRETS_OBJ) \
-                          $(POPT_LIB_OBJ) $(DCUTIL_OBJ) $(LIBADS_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ)
+               $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \
+               $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) \
+               $(SECRETS_OBJ) \
+               $(POPT_LIB_OBJ) $(DCUTIL_OBJ) $(LIBADS_OBJ) $(SMBLDAP_OBJ) $(LDB_OBJ)
 
 SMBCQUOTAS_OBJ = utils/smbcquotas.o $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                $(PARAM_OBJ) \
                $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \
                $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \
-               $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ)
+               $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ)
 
 EVTLOGADM_OBJ0 = utils/eventlogadm.o
 
@@ -796,7 +868,7 @@ EVTLOGADM_OBJ       = $(EVTLOGADM_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(REGOBJS_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_backend_db.o
 
 SHARESEC_OBJ0 = utils/sharesec.o
 SHARESEC_OBJ  = $(SHARESEC_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(REGOBJS_OBJ) \
@@ -832,7 +904,7 @@ PROTO_OBJ = $(SMBD_OBJ_MAIN) $(LIBNDR_OBJ) $(LIBNDR_GEN_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) \
+           $(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) \
@@ -845,7 +917,7 @@ WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) \
 
 PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
                pam_smbpass/pam_smb_acct.o pam_smbpass/support.o
-PAM_SMBPASS_OBJ = $(PAM_SMBPASS_OBJ_0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+PAM_SMBPASS_OBJ = $(PAM_SMBPASS_OBJ_0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) \
                $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
                $(RPC_PARSE_OBJ1) $(DOSERR_OBJ) $(LDB_OBJ) $(ERRORMAP_OBJ)
 
@@ -876,22 +948,24 @@ WINBINDD_OBJ1 = \
                winbindd/winbindd_domain.o \
                winbindd/winbindd_idmap.o \
                winbindd/winbindd_locator.o \
+               winbindd/winbindd_ndr.o \
                auth/token_util.o
 
 WINBINDD_OBJ = \
-               $(WINBINDD_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+               $(WINBINDD_OBJ1) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) \
                $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
                $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
                $(PROFILE_OBJ) $(SLCACHE_OBJ) $(SMBLDAP_OBJ) \
                $(SECRETS_OBJ) $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \
                $(DCUTIL_OBJ) $(IDMAP_OBJ) $(NSS_INFO_OBJ) \
                $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) \
-               $(LIBADS_SERVER_OBJ) $(SERVER_MUTEX_OBJ) $(LDB_OBJ)
+               $(LIBADS_SERVER_OBJ) $(SERVER_MUTEX_OBJ) $(LDB_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)
+               $(SECRETS_OBJ) $(POPT_LIB_OBJ) $(AFS_SETTOKEN_OBJ) $(RPC_PARSE_OBJ1) \
+               $(DOSERR_OBJ) lib/winbind_util.o @LIBWBCLIENT_STATIC@
 
-WINBIND_NSS_OBJ = $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ) $(SOCKET_WRAPPER_OBJ) @WINBIND_NSS_EXTRA_OBJS@
+WINBIND_NSS_OBJ = $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ) @WINBIND_NSS_EXTRA_OBJS@
 
 LDB_COMMON_OBJ=lib/ldb/common/ldb.o lib/ldb/common/ldb_ldif.o \
           lib/ldb/common/ldb_parse.o lib/ldb/common/ldb_msg.o lib/ldb/common/ldb_utf8.o \
@@ -913,13 +987,13 @@ LDB_LDAP_OBJ=@LDBLDAP@
 LDB_OBJ = ${LDB_COMMON_OBJ} ${LDB_TDB_OBJ} ${LDB_LDAP_OBJ} ${LDB_MODULES_OBJ}
 
 LDB_CMDLINE_OBJ = $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
-         $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
+         $(RPC_PARSE_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(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) \
-         $(LDB_OBJ) lib/ldb/tools/cmdline.o
+         $(LDB_OBJ) lib/ldb/tools/cmdline.o 
 
 
 LDBEDIT_OBJ = $(LDB_CMDLINE_OBJ) lib/ldb/tools/ldbedit.o
@@ -929,7 +1003,7 @@ LDBDEL_OBJ = $(LDB_CMDLINE_OBJ) lib/ldb/tools/ldbdel.o
 LDBMODIFY_OBJ = $(LDB_CMDLINE_OBJ) lib/ldb/tools/ldbmodify.o
 
 WINBIND_KRB5_LOCATOR_OBJ1 = nsswitch/winbind_krb5_locator.o
-WINBIND_KRB5_LOCATOR_OBJ = $(WINBIND_KRB5_LOCATOR_OBJ1) $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ) $(SOCKET_WRAPPER_OBJ)
+WINBIND_KRB5_LOCATOR_OBJ = $(WINBIND_KRB5_LOCATOR_OBJ1) $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ)
 
 POPT_OBJ=popt/findme.o popt/popt.o popt/poptconfig.o \
           popt/popthelp.o popt/poptparse.o
@@ -955,16 +1029,16 @@ 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) $(GROUPDB_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)
+               $(LDB_OBJ) $(ERRORMAP_OBJ) 
 
 VLP_OBJ1 = ../testsuite/printing/vlp.o $(RPC_CLIENT_OBJ1) $(RPC_PARSE_OBJ2) $(RPC_CLIENT_OBJ)
 
 VLP_OBJ = $(VLP_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
          $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(LIBMSRPC_GEN_OBJ) \
          $(READLINE_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) \
-         $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
+         $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
          $(DISPLAY_SEC_OBJ)
 
 ######################################################################
@@ -1012,8 +1086,8 @@ replacetort : SHOWFLAGS bin/replacetort@EXEEXT@
 timelimit : SHOWFLAGS bin/timelimit@EXEEXT@
 
 nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ @WINBIND_NSS@ \
-       @WINBIND_WINS_NSS@ bin/pam_winbind.@SHLIBEXT@ bin/smbcontrol@EXEEXT@ \
-       @WINBIND_KRB5_LOCATOR@
+       @WINBIND_WINS_NSS@ @WINBIND_KRB5_LOCATOR@ \
+       bin/pam_winbind.@SHLIBEXT@ bin/smbcontrol@EXEEXT@
 
 wins : SHOWFLAGS @WINBIND_WINS_NSS@
 
@@ -1023,7 +1097,8 @@ modules: SHOWFLAGS $(MODULES)
 ## Perl IDL Compiler
 IDL_FILES = unixinfo.idl 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
+       epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
+       dssetup.idl
 
 idl:
        @IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
@@ -1033,7 +1108,7 @@ idl:
 #####################################################################
 
 
-everything: all libsmbclient debug2html smbfilter talloctort replacetort modules torture \
+everything: all libsmbclient libnetapi debug2html smbfilter talloctort replacetort modules torture \
        $(EVERYTHING_PROGS)
 
 .SUFFIXES:
@@ -1136,34 +1211,41 @@ bin/.dummy:
          dir=bin $(MAKEDIR); fi
        @: >> $@ || : > $@ # what a fancy emoticon!
 
-bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) @BUILD_POPT@
+bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) @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) @POPTLIBS@ @SMBD_LIBS@
+               $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) \
+               @POPTLIBS@ @SMBD_LIBS@ @WINBIND_LIBS@
 
 bin/nmbd@EXEEXT@: $(BINARY_PREREQS) $(NMBD_OBJ) @BUILD_POPT@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
+               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
 
-bin/swat@EXEEXT@: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@
+bin/swat@EXEEXT@: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@ 
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \
-         $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
+         $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) \
+         $(LDAP_LIBS) @WINBIND_LIBS@
 
-bin/rpcclient@EXEEXT@: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@
+bin/rpcclient@EXEEXT@: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \
                $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
-               $(KRB5LIBS) $(LDAP_LIBS)
+               $(KRB5LIBS) $(LDAP_LIBS) @WINBIND_LIBS@
 
-bin/smbclient@EXEEXT@: $(BINARY_PREREQS) $(CLIENT_OBJ) @BUILD_POPT@
+bin/smbclient@EXEEXT@: $(BINARY_PREREQS) $(CLIENT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) \
+               $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
+               $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(DNSSD_LIBS) @WINBIND_LIBS@
 
-bin/net@EXEEXT@: $(BINARY_PREREQS) $(NET_OBJ) @BUILD_POPT@
+bin/net@EXEEXT@: $(BINARY_PREREQS) $(NET_OBJ) @BUILD_POPT@ @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@
+       @$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
+               @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) \
+               $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @INIPARSERLIBS@ @WINBIND_LIBS@
 
 bin/profiles@EXEEXT@: $(BINARY_PREREQS) $(PROFILES_OBJ) @BUILD_POPT@
        @echo Linking $@
@@ -1196,7 +1278,7 @@ bin/umount.cifs@EXEEXT@: $(BINARY_PREREQS) $(CIFS_UMOUNT_OBJ) @BUILD_POPT@
 bin/cifs.spnego@EXEEXT@: $(BINARY_PREREQS) $(CIFS_SPNEGO_OBJ) $(LIBSMBCLIENT_OBJ) @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(CIFS_SPNEGO_OBJ) $(DYNEXP) $(LDFLAGS) -lkeyutils $(LIBS) \
-               $(LIBSMBCLIENT_OBJ) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
+               $(LIBSMBCLIENT_OBJ) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBWBCLIENT_SHARED@
 
 bin/testparm@EXEEXT@: $(BINARY_PREREQS) $(TESTPARM_OBJ) @BUILD_POPT@
        @echo Linking $@
@@ -1213,22 +1295,25 @@ bin/smbcontrol@EXEEXT@: $(BINARY_PREREQS) $(SMBCONTROL_OBJ) @BUILD_POPT@
        $(SMBCONTROL_OBJ) $(DYNEXP) $(LDFLAGS) \
        $(LIBS) $(LDAP_LIBS) @LIBUNWIND_PTRACE@ @POPTLIBS@
 
-bin/smbtree@EXEEXT@: $(BINARY_PREREQS) $(SMBTREE_OBJ) @BUILD_POPT@
+bin/smbtree@EXEEXT@: $(BINARY_PREREQS) $(SMBTREE_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBTREE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBTREE_OBJ) $(LDFLAGS) $(DYNEXP) \
+               $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
-bin/smbpasswd@EXEEXT@: $(BINARY_PREREQS) $(SMBPASSWD_OBJ) @BUILD_POPT@
+bin/smbpasswd@EXEEXT@: $(BINARY_PREREQS) $(SMBPASSWD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(PASSDB_LIBS) \
-               $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
+               $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) @WINBIND_LIBS@
 
-bin/pdbedit@EXEEXT@: $(BINARY_PREREQS) $(PDBEDIT_OBJ) @BUILD_POPT@
+bin/pdbedit@EXEEXT@: $(BINARY_PREREQS) $(PDBEDIT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
+               @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS) @WINBIND_LIBS@
 
-bin/smbget@EXEEXT@: $(BINARY_PREREQS) $(SMBGET_OBJ) @BUILD_POPT@
+bin/smbget@EXEEXT@: $(BINARY_PREREQS) $(SMBGET_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBGET_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@  $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBGET_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
+               @POPTLIBS@  $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
 bin/samtest@EXEEXT@: $(SAMTEST_OBJ) @BUILD_POPT@
        @echo Linking $@
@@ -1260,15 +1345,15 @@ bin/msgtest@EXEEXT@: $(BINARY_PREREQS) $(MSGTEST_OBJ) @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
 
-bin/smbcacls@EXEEXT@: $(BINARY_PREREQS) $(SMBCACLS_OBJ) @BUILD_POPT@
+bin/smbcacls@EXEEXT@: $(BINARY_PREREQS) $(SMBCACLS_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ \
-       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
+       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
-bin/smbcquotas@EXEEXT@: $(BINARY_PREREQS) $(SMBCQUOTAS_OBJ) @BUILD_POPT@
+bin/smbcquotas@EXEEXT@: $(BINARY_PREREQS) $(SMBCQUOTAS_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBCQUOTAS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ \
-       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
+       $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
 bin/eventlogadm@EXEEXT@: $(BINARY_PREREQS) $(EVTLOGADM_OBJ) @BUILD_POPT@
        @echo Linking $@
@@ -1288,11 +1373,11 @@ bin/nsstest@EXEEXT@: $(BINARY_PREREQS) $(NSSTEST_OBJ) @BUILD_POPT@
 
 bin/pdbtest@EXEEXT@: $(BINARY_PREREQS) $(PDBTEST_OBJ) @BUILD_POPT@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(PDBTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(PDBTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@ @LIBWBCLIENT_SHARED@
 
 bin/vfstest@EXEEXT@: $(BINARY_PREREQS) $(VFSTEST_OBJ) @BUILD_POPT@
        @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)
+       @$(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@
 
 bin/smbiconv@EXEEXT@: $(BINARY_PREREQS) $(SMBICONV_OBJ) @BUILD_POPT@
        @echo Linking $@
@@ -1319,25 +1404,45 @@ bin/smbfilter@EXEEXT@: $(BINARY_PREREQS) $(SMBFILTER_OBJ) @BUILD_POPT@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@
 
-bin/ldbedit: $(BINARY_PREREQS) $(LDBEDIT_OBJ) @BUILD_POPT@
+bin/ldbedit: $(BINARY_PREREQS) $(LDBEDIT_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDBEDIT_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(LDBEDIT_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
+               @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
-bin/ldbsearch: $(BINARY_PREREQS) $(LDBSEARCH_OBJ) @BUILD_POPT@
+bin/ldbsearch: $(BINARY_PREREQS) $(LDBSEARCH_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDBSEARCH_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(LDBSEARCH_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
+               @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
-bin/ldbadd: $(BINARY_PREREQS) $(LDBADD_OBJ) @BUILD_POPT@
+bin/ldbadd: $(BINARY_PREREQS) $(LDBADD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDBADD_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(LDBADD_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
+               @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
-bin/ldbmodify: $(BINARY_PREREQS) $(LDBMODIFY_OBJ) @BUILD_POPT@
+bin/ldbmodify: $(BINARY_PREREQS) $(LDBMODIFY_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDBMODIFY_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(LDBMODIFY_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
+               @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
-bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@
+bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDBDEL_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS)
+       @$(CC) $(FLAGS) -o $@ $(LDBDEL_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
+               @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
+               $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+
+bin/libwbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ)
+       @echo Linking shared library $@
+       @$(SHLD_DSO) $(LIBWBCLIENT_OBJ) \
+               @SONAMEFLAG@`basename $@`.$(SONAME_VER)
+       @ln -s -f `basename $@` $@.$(SONAME_VER)
+
+bin/libwbclient.a: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ0)
+       @echo Linking non-shared library $@
+       @-$(AR) -rc $@ $(LIBWBCLIENT_OBJ0)
 
 bin/libaddns.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
        @echo Linking shared library $@
@@ -1349,9 +1454,19 @@ bin/libaddns.a: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
        @echo Linking non-shared library $@
        @-$(AR) -rc $@ $(LIBADDNS_OBJ)
 
+bin/libnetapi.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBNETAPI_OBJ)
+       @echo Linking shared library $@
+       @$(SHLD_DSO) $(LIBNETAPI_OBJ) @LIBWBCLIENT_SHARED@ $(LIBS) \
+               $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) \
+               @SONAMEFLAG@`basename $@`.$(SONAME_VER)
+
+bin/libnetapi.a: $(BINARY_PREREQS) $(LIBNETAPI_OBJ)
+       @echo Linking non-shared library $@
+       @-$(AR) -rc $@ $(LIBNETAPI_OBJ)
+
 bin/libsmbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
        @echo Linking shared library $@
-       @$(SHLD_DSO) $(LIBSMBCLIENT_OBJ) $(LIBS) \
+       @$(SHLD_DSO) $(LIBSMBCLIENT_OBJ) @LIBWBCLIENT_SHARED@ $(LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
                @SONAMEFLAG@`basename $@`.$(SONAME_VER)
 
@@ -1385,6 +1500,8 @@ bin/libbigballofmud.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBBIGBALLOFMUD_OBJ)
 libsmbclient: $(LIBSMBCLIENT)
 libsmbsharemodes: $(LIBSMBSHAREMODES)
 libaddns: $(LIBADDNS)
+libwbclient: $(LIBWBCLIENT)
+libnetapi: $(LIBNETAPI)
 
 # Linker command to link a RPC, VFS, AUTH, CHARSET or PASSDB module.
 SHLD_MODULE = $(SHLD) $(LDSHFLAGS) $(MODULE_EXPORTS) \
@@ -1430,9 +1547,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 $@"
@@ -1450,15 +1567,16 @@ 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@
+bin/winbindd@EXEEXT@: $(BINARY_PREREQS) $(WINBINDD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
        @$(CC) $(FLAGS) -o $@ $(WINBINDD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
+               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) \
+               $(PASSDB_LIBS) @WINBIND_LIBS@
 
-bin/vlp@EXEEXT@: $(BINARY_PREREQS) $(VLP_OBJ)
+bin/vlp@EXEEXT@: $(BINARY_PREREQS) $(VLP_OBJ) @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
        @$(CC) $(FLAGS) -o $@ $(VLP_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
-               $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
+               $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @LIBWBCLIENT_SHARED@
 
 @WINBIND_NSS@: $(BINARY_PREREQS) $(WINBIND_NSS_OBJ)
        @echo "Linking $@"
@@ -1529,6 +1647,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
@@ -1588,6 +1710,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)
@@ -1604,6 +1730,10 @@ bin/afsacl.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_AFSACL_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_AFSACL_OBJ)
 
+bin/xattr_tdb.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_XATTR_TDB_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_XATTR_TDB_OBJ)
+
 bin/posixacl.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_POSIXACL_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_POSIXACL_OBJ)
@@ -1640,6 +1770,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)
@@ -1664,6 +1802,10 @@ 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)
@@ -1674,16 +1816,17 @@ bin/fileid.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_FILEID_OBJ)
 ## None here right now
 #########################################################
 
-bin/wbinfo@EXEEXT@: $(BINARY_PREREQS) $(WBINFO_OBJ) @BUILD_POPT@
+bin/wbinfo@EXEEXT@: $(BINARY_PREREQS) $(WBINFO_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(WBINFO_OBJ) $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(WBINFO_OBJ) $(DYNEXP) $(LIBS) \
+               $(LDAP_LIBS) @POPTLIBS@ @WINBIND_LIBS@
 
 bin/ntlm_auth@EXEEXT@: $(BINARY_PREREQS) $(NTLM_AUTH_OBJ) $(PARAM_OBJ) \
-       $(LIB_NONSMBD_OBJ) @BUILD_POPT@
+       $(LIB_NONSMBD_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(NTLM_AUTH_OBJ) \
                $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBS) \
-               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS)
+               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) @WINBIND_LIBS@
 
 bin/pam_smbpass.@SHLIBEXT@: $(BINARY_PREREQS) $(PAM_SMBPASS_OBJ)
        @echo "Linking shared library $@"
@@ -1721,8 +1864,10 @@ bin/timelimit@EXEEXT@: script/tests/timelimit.o
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(DYNEXP) script/tests/timelimit.o
 
-install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ installman installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ @INSTALL_LIBSMBCLIENT@ @INSTALL_PAM_MODULES@ @INSTALL_LIBSMBSHAREMODES@
-
+install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ installman \
+               installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ \
+               @INSTALL_LIBSMBCLIENT@ @INSTALL_PAM_MODULES@ \
+               @INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBWBCLIENT@ @INSTALL_LIBNETAPI@
 
 install-everything: install installmodules
 
@@ -1800,6 +1945,18 @@ installlibaddns: installdirs libaddns
        -$(INSTALLLIBCMD_SH) bin/libaddns.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
        -$(INSTALLLIBCMD_A) bin/libaddns.a $(DESTDIR)$(LIBDIR)
 
+installlibwbclient: installdirs libwbclient
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
+       -$(INSTALLLIBCMD_SH) bin/libwbclient.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) ${prefix}/include
+       -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/nsswitch/libwbclient/wbclient.h $(DESTDIR)${prefix}/include
+
+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)
+       -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/lib/netapi/netapi.h $(DESTDIR)${prefix}/include
+
 installpammodules: $(PAM_MODULES)
        @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(PAMMODULESDIR)
        @for module in $(PAM_MODULES); do \
@@ -1834,7 +1991,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: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ @UNINSTALL_LIBNETAPI@
 
 uninstallman:
        @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C
@@ -1884,6 +2041,11 @@ uninstalllibaddns:
        -$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/libaddns.@SHLIBEXT@
        -$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/libaddns.a
 
+uninstalllibnetapi:
+       -$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/libnetapi.@SHLIBEXT@
+       -$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/libnetapi.a
+       -rm -f $(DESTDIR)${prefix}/include/netapi.h
+
 uninstallpammodules:
        @for module in $(PAM_MODULES); do \
                echo "Removing $(DESTDIR)/$(PAMMODULESDIR)/$${module}.@SHLIBEXT@ "; \
@@ -1897,10 +2059,12 @@ clean: delheaders
        -rm -f $(PRECOMPILED_HEADER)
        -rm -f core */*~ *~ \
                */*.o */*/*.o */*/*/*.o \
+               ../testsuite/*/*.o \
                */*.@SHLIBEXT@ */*/*.@SHLIBEXT@ */*/*/*.@SHLIBEXT@ \
                $(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(ROOT_SBIN_PROGS) \
                $(MODULES) $(TORTURE_PROGS) $(LIBSMBCLIENT) $(LIBADDNS) \
-               $(LIBSMBSHAREMODES) $(EVERYTHING_PROGS) \
+               $(LIBSMBSHAREMODES) $(EVERYTHING_PROGS) $(LIBNETAPI) \
+               bin/libwbclient.so.0 bin/timelimit \
                .headers.stamp */src/*.o proto_exists
        -rm -rf t_dir
 
@@ -1910,6 +2074,7 @@ clean: delheaders
 # afterwards.
 proto_exists: include/proto.h include/build_env.h \
        winbindd/winbindd_proto.h web/swat_proto.h \
+       libnet/libnet_proto.h \
        client/client_proto.h utils/net_proto.h utils/ntlm_auth_proto.h smbd/build_options.c
        @touch proto_exists
 
@@ -1919,7 +2084,7 @@ delheaders:
                winbindd/winbindd_proto.h web/swat_proto.h \
                client/client_proto.h utils/net_proto.h \
                smbd/build_options.c utils/ntlm_auth_proto.h \
-               utils/passwd_proto.h
+               utils/passwd_proto.h libnet/libnet_proto.h
 
 MKPROTO_SH = $(srcdir)/script/mkproto.sh
 
@@ -1964,6 +2129,11 @@ utils/ntlm_auth_proto.h:
          -h _NTLM_AUTH_PROTO_H_ $(builddir)/utils/ntlm_auth_proto.h \
          $(NTLM_AUTH_OBJ1)
 
+libnet/libnet_proto.h:
+       @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
+         -h _LIBNET_PROTO_H_ $(builddir)/libnet/libnet_proto.h \
+         $(LIBNET_OBJ)
+
 # "make headers" or "make proto" calls a subshell because we need to
 # make sure these commands are executed in sequence even for a
 # parallel make.
@@ -1977,7 +2147,8 @@ headers:
        $(MAKE) client/client_proto.h; \
        $(MAKE) utils/ntlm_auth_proto.h; \
        $(MAKE) utils/net_proto.h; \
-       $(MAKE) utils/passwd_proto.h;
+       $(MAKE) utils/passwd_proto.h; \
+       $(MAKE) libnet/libnet_proto.h;
 
 proto: headers
 
@@ -2026,6 +2197,14 @@ Makefile: $(srcdir)/Makefile.in config.status
 ######################################################################
 # Samba Testing Framework
 
+# Check shared libs for unresolved symbols
+test_shlibs: $(SHLIBS)
+       @echo "Testing $(SHLIBS) "
+       @for module in $(SHLIBS); do \
+               ./script/tests/dlopen.sh bin/$${module}.@SHLIBEXT@ \
+                       || exit 1; \
+       done
+
 # Check for NSS module problems.
 test_nss_modules: nss_modules
        @echo "Testing $(NSS_MODULES) "
@@ -2043,16 +2222,18 @@ test_pam_modules: pam_modules
                        || exit 1; \
        done
 
+
 ##
 ## Targets for 'make test'
 ##
 test: all torture timelimit
        @echo Running Test suite
-       @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}/st all "${smbtorture4_path}"
 
 valgrindtest: all torture timelimit
        @echo Running Test suite with valgrind
-       @NMBD_VALGRIND="xterm -n nmbd -e valgrind -q --db-attach=yes --num-callers=30" \
+       @LIB_PATH_VAR=$(LIB_PATH_VAR) \
+        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" \
index b2c87174fd332baa33dcc1cfef282dadbf043952..40a29856002338e07c913e90603eac7a38cd55b0 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;
@@ -270,7 +270,9 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
                                                &info3);
 
                if (NT_STATUS_IS_OK(nt_status)) {
-                       (*server_info)->was_mapped |= user_info->was_mapped;
+                       if (user_info->was_mapped) {
+                               (*server_info)->was_mapped = user_info->was_mapped;
+                       }
 
                        if ( ! (*server_info)->guest) {
                                /* if a real user check pam account restrictions */
index 9f90ef8ccd21e5e47414c288420a19db9ad130ef..095f0b9fb83b7d0a1453eed2212f2515a4eb3859 100644 (file)
@@ -75,6 +75,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
                   connection (tridge) */
 
                if (!grab_server_mutex(desthost)) {
+                       cli_shutdown(cli);
                        return NULL;
                }
 
index 4fca5bcbe4c79b819e499179b01e3c2c989fe578..58c765226d633c707d05a9923e6588eb987da44b 100644 (file)
@@ -92,7 +92,7 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
        struct passwd *pass = NULL;
 
        become_root();
-       pass = Get_Pwnam(user_info->internal_username);
+       pass = Get_Pwnam_alloc(talloc_tos(), user_info->internal_username);
 
        
        /** @todo This call assumes a ASCII password, no charset transformation is 
@@ -123,6 +123,7 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
                }
        }
 
+       TALLOC_FREE(pass);
        return nt_status;
 }
 
index 1e33869ea943b68de243fc0490f8c7c8cb5d9db7..ce47e94eb54f3279e8b2b200625bb94e665f9ff6 100644 (file)
@@ -549,11 +549,13 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info,
                                "for gid %d!\n", gids[i]));
                        continue;
                }
-               if (!add_sid_to_array_unique( result, &unix_group_sid,
-                               &result->sids, &result->num_sids )) {
+               status = add_sid_to_array_unique(result, &unix_group_sid,
+                                                &result->sids,
+                                                &result->num_sids);
+               if (!NT_STATUS_IS_OK(status)) {
                        result->sam_account = NULL; /* Don't free on error exit. */
                        TALLOC_FREE(result);
-                       return NT_STATUS_NO_MEMORY;
+                       return status;
                }
        }
 
@@ -895,9 +897,9 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                                "for gid %d!\n", gids[i]));
                        continue;
                }
-               if (!add_sid_to_array_unique(tmp_ctx, &unix_group_sid,
-                               &group_sids, &num_group_sids )) {
-                       result = NT_STATUS_NO_MEMORY;
+               result = add_sid_to_array_unique(tmp_ctx, &unix_group_sid,
+                                                &group_sids, &num_group_sids);
+               if (!NT_STATUS_IS_OK(result)) {
                        goto done;
                }
        }
@@ -1074,11 +1076,12 @@ NTSTATUS make_server_info_pw(auth_serversupplied_info **server_info,
                return NT_STATUS_NO_SUCH_USER;
        }
 
-       if (!add_sid_to_array_unique(result, &u_sid,
-                                       &result->sids,
-                                       &result->num_sids)) {
+       status = add_sid_to_array_unique(result, &u_sid,
+                                        &result->sids,
+                                        &result->num_sids);
+       if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(result);
-               return NT_STATUS_NO_MEMORY;
+               return status;
        }
 
        /* For now we throw away the gids and convert via sid_to_gid
@@ -1103,7 +1106,7 @@ static NTSTATUS make_new_server_info_guest(auth_serversupplied_info **server_inf
        struct samu *sampass = NULL;
        DOM_SID guest_sid;
        bool ret;
-       static const char zeros[16] = { 0, };
+       char zeros[16];
 
        if ( !(sampass = samu_new( NULL )) ) {
                return NT_STATUS_NO_MEMORY;
@@ -1138,6 +1141,7 @@ static NTSTATUS make_new_server_info_guest(auth_serversupplied_info **server_inf
 
        /* annoying, but the Guest really does have a session key, and it is
           all zeros! */
+       ZERO_STRUCT(zeros);
        (*server_info)->user_session_key = data_blob(zeros, sizeof(zeros));
        (*server_info)->lm_session_key = data_blob(zeros, sizeof(zeros));
 
@@ -1420,10 +1424,10 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                                auth_serversupplied_info **server_info, 
                                NET_USER_INFO_3 *info3) 
 {
-       static const char zeros[16] = { 0, };
+       char zeros[16];
 
        NTSTATUS nt_status = NT_STATUS_OK;
-       char *found_username;
+       char *found_username = NULL;
        const char *nt_domain;
        const char *nt_username;
        struct samu *sam_account = NULL;
@@ -1431,8 +1435,8 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
        DOM_SID group_sid;
        bool username_was_mapped;
 
-       uid_t uid;
-       gid_t gid;
+       uid_t uid = (uid_t)-1;
+       gid_t gid = (gid_t)-1;
 
        auth_serversupplied_info *result;
 
@@ -1624,7 +1628,9 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                                            &(info3->uni_logon_srv));
 
        /* ensure we are never given NULL session keys */
-       
+
+       ZERO_STRUCT(zeros);
+
        if (memcmp(info3->user_sess_key, zeros, sizeof(zeros)) == 0) {
                result->user_session_key = data_blob_null;
        } else {
@@ -1731,17 +1737,17 @@ bool is_trusted_domain(const char* dom_name)
                        return True;
        }
        else {
-               NSS_STATUS result;
+               wbcErr result;
 
                /* If winbind is around, ask it */
 
                result = wb_is_trusted_domain(dom_name);
 
-               if (result == NSS_STATUS_SUCCESS) {
+               if (result == WBC_ERR_SUCCESS) {
                        return True;
                }
 
-               if (result == NSS_STATUS_NOTFOUND) {
+               if (result == WBC_ERR_DOMAIN_NOT_FOUND) {
                        /* winbind could not find the domain */
                        return False;
                }
index 959c550524be854bda7a6870de4c6e633ddcf7da..b24aa3a75b3a036c0d362d073000996ff210adcc 100644 (file)
@@ -134,7 +134,9 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
                        }
                        
                        if (NT_STATUS_IS_OK(nt_status)) {
-                               (*server_info)->was_mapped |= user_info->was_mapped;
+                               if (user_info->was_mapped) {
+                                       (*server_info)->was_mapped = user_info->was_mapped;
+                               }
                        }
                }
        } else if (NT_STATUS_IS_OK(nt_status)) {
index 27915bf4999281e4561c419d58e399af622034c5..813540d9fa822a15848badfa2de5d062a087235a 100644 (file)
 #define DBGC_CLASS DBGC_AUTH
 
 /* these are kept here to keep the string_combinations function simple */
-static fstring this_user;
-#if !defined(WITH_PAM) 
-static fstring this_salt;
-static fstring this_crypted;
+static char *ths_user;
+
+static const char *get_this_user(void)
+{
+       if (!ths_user) {
+               return "";
+       }
+       return ths_user;
+}
+
+#if defined(WITH_PAM) || defined(OSF1_ENH_SEC)
+static const char *set_this_user(const char *newuser)
+{
+       char *orig_user = ths_user;
+       ths_user = SMB_STRDUP(newuser);
+       SAFE_FREE(orig_user);
+       return ths_user;
+}
+#endif
+
+#if !defined(WITH_PAM)
+static char *ths_salt;
+/* This must be writable. */
+static char *get_this_salt(void)
+{
+       return ths_salt;
+}
+
+/* We may be setting a modified version of the same
+ * string, so don't free before use. */
+
+static const char *set_this_salt(const char *newsalt)
+{
+       char *orig_salt = ths_salt;
+       ths_salt = SMB_STRDUP(newsalt);
+       SAFE_FREE(orig_salt);
+       return ths_salt;
+}
+
+static char *ths_crypted;
+static const char *get_this_crypted(void)
+{
+       if (!ths_crypted) {
+               return "";
+       }
+       return ths_crypted;
+}
+
+static const char *set_this_crypted(const char *newcrypted)
+{
+       char *orig_crypted = ths_crypted;
+       ths_crypted = SMB_STRDUP(newcrypted);
+       SAFE_FREE(orig_crypted);
+       return ths_crypted;
+}
 #endif
 
 #ifdef WITH_AFS
@@ -113,7 +164,7 @@ static bool dfs_auth(char *user, char *password)
         * Assumes local passwd file is kept in sync w/ DCE RGY!
         */
 
-       if (strcmp((char *)crypt(password, this_salt), this_crypted))
+       if (strcmp((char *)crypt(password, get_this_salt()), get_this_crypted()))
        {
                return (False);
        }
@@ -492,29 +543,29 @@ core of password checking routine
 static NTSTATUS password_check(const char *password)
 {
 #ifdef WITH_PAM
-       return smb_pam_passcheck(this_user, password);
+       return smb_pam_passcheck(get_this_user(), password);
 #else
 
        bool ret;
 
 #ifdef WITH_AFS
-       if (afs_auth(this_user, password))
+       if (afs_auth(get_this_user(), password))
                return NT_STATUS_OK;
 #endif /* WITH_AFS */
 
 #ifdef WITH_DFS
-       if (dfs_auth(this_user, password))
+       if (dfs_auth(get_this_user(), password))
                return NT_STATUS_OK;
 #endif /* WITH_DFS */
 
 #ifdef OSF1_ENH_SEC
        
-       ret = (strcmp(osf1_bigcrypt(password, this_salt),
-                     this_crypted) == 0);
+       ret = (strcmp(osf1_bigcrypt(password, get_this_salt()),
+                     get_this_crypted()) == 0);
        if (!ret) {
                DEBUG(2,
                      ("OSF1_ENH_SEC failed. Trying normal crypt.\n"));
-               ret = (strcmp((char *)crypt(password, this_salt), this_crypted) == 0);
+               ret = (strcmp((char *)crypt(password, get_this_salt()), get_this_crypted()) == 0);
        }
        if (ret) {
                return NT_STATUS_OK;
@@ -525,7 +576,7 @@ static NTSTATUS password_check(const char *password)
 #endif /* OSF1_ENH_SEC */
        
 #ifdef ULTRIX_AUTH
-       ret = (strcmp((char *)crypt16(password, this_salt), this_crypted) == 0);
+       ret = (strcmp((char *)crypt16(password, get_this_salt()), get_this_crypted()) == 0);
        if (ret) {
                return NT_STATUS_OK;
         } else {
@@ -535,7 +586,7 @@ static NTSTATUS password_check(const char *password)
 #endif /* ULTRIX_AUTH */
        
 #ifdef LINUX_BIGCRYPT
-       ret = (linux_bigcrypt(password, this_salt, this_crypted));
+       ret = (linux_bigcrypt(password, get_this_salt(), get_this_crypted()));
         if (ret) {
                return NT_STATUS_OK;
        } else {
@@ -552,10 +603,10 @@ static NTSTATUS password_check(const char *password)
         * by crypt.
         */
 
-       if (strcmp(bigcrypt(password, this_salt), this_crypted) == 0)
+       if (strcmp(bigcrypt(password, get_this_salt()), get_this_crypted()) == 0)
                return NT_STATUS_OK;
        else
-               ret = (strcmp((char *)crypt(password, this_salt), this_crypted) == 0);
+               ret = (strcmp((char *)crypt(password, get_this_salt()), get_this_crypted()) == 0);
        if (ret) {
                return NT_STATUS_OK;
        } else {
@@ -564,7 +615,7 @@ static NTSTATUS password_check(const char *password)
 #else /* HAVE_BIGCRYPT && HAVE_CRYPT && USE_BOTH_CRYPT_CALLS */
        
 #ifdef HAVE_BIGCRYPT
-       ret = (strcmp(bigcrypt(password, this_salt), this_crypted) == 0);
+       ret = (strcmp(bigcrypt(password, get_this_salt()), get_this_crypted()) == 0);
         if (ret) {
                return NT_STATUS_OK;
        } else {
@@ -576,7 +627,7 @@ static NTSTATUS password_check(const char *password)
        DEBUG(1, ("Warning - no crypt available\n"));
        return NT_STATUS_LOGON_FAILURE;
 #else /* HAVE_CRYPT */
-       ret = (strcmp((char *)crypt(password, this_salt), this_crypted) == 0);
+       ret = (strcmp((char *)crypt(password, get_this_salt()), get_this_crypted()) == 0);
         if (ret) {
                return NT_STATUS_OK;
        } else {
@@ -621,7 +672,9 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
         * checks below and dive straight into the PAM code.
         */
 
-       fstrcpy(this_user, user);
+       if (set_this_user(user) == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
 
        DEBUG(4, ("pass_check: Checking (PAM) password for user %s (l=%d)\n", user, pwlen));
 
@@ -638,8 +691,12 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
        /* Copy into global for the convenience of looping code */
        /* Also the place to keep the 'password' no matter what
           crazy struct it started in... */
-       fstrcpy(this_crypted, pass->pw_passwd);
-       fstrcpy(this_salt, pass->pw_passwd);
+       if (set_this_crypted(pass->pw_passwd) == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
+       if (set_this_salt(pass->pw_passwd) == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
 
 #ifdef HAVE_GETSPNAM
        {
@@ -652,8 +709,12 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
 
                spass = getspnam(pass->pw_name);
                if (spass && spass->sp_pwdp) {
-                       fstrcpy(this_crypted, spass->sp_pwdp);
-                       fstrcpy(this_salt, spass->sp_pwdp);
+                       if (set_this_crypted(spass->sp_pwdp) == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+                       if (set_this_salt(spass->sp_pwdp) == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
                }
        }
 #elif defined(IA_UINFO)
@@ -671,8 +732,11 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
 #ifdef HAVE_GETPRPWNAM
        {
                struct pr_passwd *pr_pw = getprpwnam(pass->pw_name);
-               if (pr_pw && pr_pw->ufld.fd_encrypt)
-                       fstrcpy(this_crypted, pr_pw->ufld.fd_encrypt);
+               if (pr_pw && pr_pw->ufld.fd_encrypt) {
+                       if (set_this_crypted(pr_pw->ufld.fd_encrypt) == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+               }
        }
 #endif
 
@@ -680,8 +744,11 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
        {
                struct passwd_adjunct *pwret;
                pwret = getpwanam(s);
-               if (pwret && pwret->pwa_passwd)
-                       fstrcpy(this_crypted, pwret->pwa_passwd);
+               if (pwret && pwret->pwa_passwd) {
+                       if (set_this_crypted(pwret->pwa_passwd) == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+               }
        }
 #endif
 
@@ -692,8 +759,12 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
                          user));
                mypasswd = getprpwnam(user);
                if (mypasswd) {
-                       fstrcpy(this_user, mypasswd->ufld.fd_name);
-                       fstrcpy(this_crypted, mypasswd->ufld.fd_encrypt);
+                       if (set_this_user(mypasswd->ufld.fd_name) == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+                       if (set_this_crypted(mypasswd->ufld.fd_encrypt) == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
                } else {
                        DEBUG(5,
                              ("OSF1_ENH_SEC: No entry for user %s in protected database !\n",
@@ -706,7 +777,10 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
        {
                AUTHORIZATION *ap = getauthuid(pass->pw_uid);
                if (ap) {
-                       fstrcpy(this_crypted, ap->a_password);
+                       if (set_this_crypted(ap->a_password) == NULL) {
+                               endauthent();
+                               return NT_STATUS_NO_MEMORY;
+                       }
                        endauthent();
                }
        }
@@ -715,19 +789,28 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas
 #if defined(HAVE_TRUNCATED_SALT)
        /* crypt on some platforms (HPUX in particular)
           won't work with more than 2 salt characters. */
-       this_salt[2] = 0;
+       {
+               char *trunc_salt = get_this_salt();
+               if (!trunc_salt || strlen(trunc_salt) < 2) {
+                       return NT_STATUS_LOGON_FAILURE;
+               }
+               trunc_salt[2] = 0;
+               if (set_this_salt(trunc_salt) == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+               }
+       }
 #endif
 
-       if (!*this_crypted) {
+       if (!get_this_crypted() || !*get_this_crypted()) {
                if (!lp_null_passwords()) {
                        DEBUG(2, ("Disallowing %s with null password\n",
-                                 this_user));
+                                 get_this_user()));
                        return NT_STATUS_LOGON_FAILURE;
                }
                if (!*password) {
                        DEBUG(3,
                              ("Allowing access to %s with null password\n",
-                              this_user));
+                              get_this_user()));
                        return NT_STATUS_OK;
                }
        }
index 27c98c9581183bedf0ea54490ee02ef1ab4824ed..fc93060fc6a61e4cb235236db5862b90a11d7c42 100644 (file)
@@ -77,12 +77,19 @@ bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid )
 
 NT_USER_TOKEN *get_root_nt_token( void )
 {
-       static NT_USER_TOKEN *token = NULL;
+       struct nt_user_token *token = NULL;
        DOM_SID u_sid, g_sid;
        struct passwd *pw;
+       void *cache_data;
 
-       if ( token )
-               return token;
+       cache_data = memcache_lookup_talloc(
+               NULL, SINGLETON_CACHE_TALLOC,
+               data_blob_string_const("root_nt_token"));
+
+       if (cache_data != NULL) {
+               return talloc_get_type_abort(
+                       cache_data, struct nt_user_token);
+       }
 
        if ( !(pw = sys_getpwnam( "root" )) ) {
                DEBUG(0,("get_root_nt_token: getpwnam(\"root\") failed!\n"));
@@ -97,6 +104,11 @@ NT_USER_TOKEN *get_root_nt_token( void )
 
        token = create_local_nt_token(NULL, &u_sid, False,
                                      1, &global_sid_Builtin_Administrators);
+
+       memcache_add_talloc(
+               NULL, SINGLETON_CACHE_TALLOC,
+               data_blob_string_const("root_nt_token"), token);
+
        return token;
 }
 
@@ -128,22 +140,22 @@ NTSTATUS add_aliases(const DOM_SID *domain_sid,
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(10, ("pdb_enum_alias_memberships failed: %s\n",
                           nt_errstr(status)));
-               TALLOC_FREE(tmp_ctx);
-               return status;
+               goto done;
        }
 
        for (i=0; i<num_aliases; i++) {
                DOM_SID alias_sid;
                sid_compose(&alias_sid, domain_sid, aliases[i]);
-               if (!add_sid_to_array_unique(token, &alias_sid,
-                                       &token->user_sids,
-                                       &token->num_sids)) {
+               status = add_sid_to_array_unique(token, &alias_sid,
+                                                &token->user_sids,
+                                                &token->num_sids);
+               if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("add_sid_to_array failed\n"));
-                       TALLOC_FREE(tmp_ctx);
-                       return NT_STATUS_NO_MEMORY;
+                       goto done;
                }
        }
 
+done:
        TALLOC_FREE(tmp_ctx);
        return NT_STATUS_OK;
 }
@@ -154,6 +166,7 @@ NTSTATUS add_aliases(const DOM_SID *domain_sid,
 static NTSTATUS add_builtin_administrators( struct nt_user_token *token )
 {
        DOM_SID domadm;
+       NTSTATUS status;
 
        /* nothing to do if we aren't in a domain */
 
@@ -174,9 +187,11 @@ static NTSTATUS add_builtin_administrators( struct nt_user_token *token )
        /* Add Administrators if the user beloongs to Domain Admins */
 
        if ( nt_token_check_sid( &domadm, token ) ) {
-               if (!add_sid_to_array(token, &global_sid_Builtin_Administrators,
-                                        &token->user_sids, &token->num_sids)) {
-                       return NT_STATUS_NO_MEMORY;
+               status = add_sid_to_array(token,
+                                         &global_sid_Builtin_Administrators,
+                                         &token->user_sids, &token->num_sids);
+       if (!NT_STATUS_IS_OK(status)) {
+                       return status;
                }
        }
 
@@ -284,45 +299,55 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
        DEBUG(10, ("Create local NT token for %s\n",
                   sid_string_dbg(user_sid)));
 
-       if (!(result = TALLOC_ZERO_P(mem_ctx, NT_USER_TOKEN))) {
+       if (!(result = TALLOC_ZERO_P(mem_ctx, struct nt_user_token))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
 
        /* Add the user and primary group sid */
 
-       if (!add_sid_to_array(result, user_sid,
-                        &result->user_sids, &result->num_sids)) {
+       status = add_sid_to_array(result, user_sid,
+                                 &result->user_sids, &result->num_sids);
+       if (!NT_STATUS_IS_OK(status)) {
                return NULL;
        }
 
        /* For guest, num_groupsids may be zero. */
        if (num_groupsids) {
-               if (!add_sid_to_array(result, &groupsids[0],
-                                &result->user_sids, &result->num_sids)) {
+               status = add_sid_to_array(result, &groupsids[0],
+                                         &result->user_sids,
+                                         &result->num_sids);
+               if (!NT_STATUS_IS_OK(status)) {
                        return NULL;
                }
        }
 
        /* Add in BUILTIN sids */
 
-       if (!add_sid_to_array(result, &global_sid_World,
-                        &result->user_sids, &result->num_sids)) {
+       status = add_sid_to_array(result, &global_sid_World,
+                                 &result->user_sids, &result->num_sids);
+       if (!NT_STATUS_IS_OK(status)) {
                return NULL;
        }
-       if (!add_sid_to_array(result, &global_sid_Network,
-                        &result->user_sids, &result->num_sids)) {
+       status = add_sid_to_array(result, &global_sid_Network,
+                                 &result->user_sids, &result->num_sids);
+       if (!NT_STATUS_IS_OK(status)) {
                return NULL;
        }
 
        if (is_guest) {
-               if (!add_sid_to_array(result, &global_sid_Builtin_Guests,
-                                &result->user_sids, &result->num_sids)) {
+               status = add_sid_to_array(result, &global_sid_Builtin_Guests,
+                                         &result->user_sids,
+                                         &result->num_sids);
+               if (!NT_STATUS_IS_OK(status)) {
                        return NULL;
                }
        } else {
-               if (!add_sid_to_array(result, &global_sid_Authenticated_Users,
-                                &result->user_sids, &result->num_sids)) {
+               status = add_sid_to_array(result,
+                                         &global_sid_Authenticated_Users,
+                                         &result->user_sids,
+                                         &result->num_sids);
+               if (!NT_STATUS_IS_OK(status)) {
                        return NULL;
                }
        }
@@ -334,8 +359,10 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
         * first group sid as primary above. */
 
        for (i=1; i<num_groupsids; i++) {
-               if (!add_sid_to_array_unique(result, &groupsids[i],
-                                       &result->user_sids, &result->num_sids)) {
+               status = add_sid_to_array_unique(result, &groupsids[i],
+                                                &result->user_sids,
+                                                &result->num_sids);
+               if (!NT_STATUS_IS_OK(status)) {
                        return NULL;
                }
        }
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 d59af9e6cfb833bb2ff2504e8d8c76574b266187..c9343104911096214bd140346d2f9bf4c3790afe 100644 (file)
 #define REGISTER 0
 #endif
 
+extern int do_smb_browse(void); /* mDNS browsing */
+
 extern bool AllowDebugChange;
 extern bool override_logfile;
 extern char tar_type;
 extern bool in_client;
+
 static int port = 0;
 static char *service;
 static char *desthost;
 static char *calling_name;
 static bool grepable = false;
 static char *cmdstr = NULL;
+static const char *cmd_ptr = NULL;
 
 static int io_bufsize = 64512;
 
@@ -89,6 +93,9 @@ static unsigned int put_total_time_ms = 0;
 /* totals globals */
 static double dir_total;
 
+/* encrypted state. */
+static bool smb_encrypt;
+
 /* root cli_state connection */
 
 struct cli_state *cli;
@@ -422,7 +429,7 @@ static int cmd_cd(void)
        char *buf = NULL;
        int rc = 0;
 
-       if (next_token_nr_talloc(talloc_tos(), NULL, &buf,NULL)) {
+       if (next_token_talloc(talloc_tos(), &cmd_ptr, &buf,NULL)) {
                rc = do_cd(buf);
        } else {
                d_printf("Current directory is %s\n",client_get_cur_dir());
@@ -860,7 +867,7 @@ static int cmd_dir(void)
                return 1;
        }
 
-       if (next_token_nr_talloc(ctx, NULL,&buf,NULL)) {
+       if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                string_replace(buf,'/','\\');
                if (*buf == CLI_DIRSEP_CHAR) {
                        mask = talloc_strdup(ctx, buf + 1);
@@ -912,7 +919,7 @@ static int cmd_du(void)
                }
        }
 
-       if (next_token_nr_talloc(ctx, NULL,&buf,NULL)) {
+       if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                string_replace(buf,'/','\\');
                if (*buf == CLI_DIRSEP_CHAR) {
                        mask = talloc_strdup(ctx, buf);
@@ -938,8 +945,8 @@ static int cmd_echo(void)
        char *num;
        char *data;
 
-       if (!next_token_nr_talloc(ctx, NULL, &num, NULL)
-           || !next_token_nr_talloc(ctx, NULL, &data, NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr, &num, NULL)
+           || !next_token_talloc(ctx, &cmd_ptr, &data, NULL)) {
                d_printf("echo <num> <data>\n");
                return 1;
        }
@@ -1113,7 +1120,7 @@ static int cmd_get(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx, NULL,&fname,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&fname,NULL)) {
                d_printf("get <filename> [localname]\n");
                return 1;
        }
@@ -1126,7 +1133,7 @@ static int cmd_get(void)
                return 1;
        }
 
-       next_token_nr_talloc(ctx, NULL,&lname,NULL);
+       next_token_talloc(ctx, &cmd_ptr,&lname,NULL);
        if (!lname) {
                lname = fname;
        }
@@ -1274,7 +1281,7 @@ static int cmd_more(void)
        }
        close(fd);
 
-       if (!next_token_nr_talloc(ctx,NULL,&fname,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&fname,NULL)) {
                d_printf("more <filename>\n");
                unlink(lname);
                return 1;
@@ -1322,7 +1329,7 @@ static int cmd_mget(void)
 
        abort_mget = false;
 
-       while (next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       while (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                mget_mask = talloc_strdup(ctx, client_get_cur_dir());
                if (!mget_mask) {
                        return 1;
@@ -1439,7 +1446,7 @@ static int cmd_mkdir(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx, NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                if (!recurse) {
                        d_printf("mkdir <dirname>\n");
                }
@@ -1456,6 +1463,7 @@ static int cmd_mkdir(void)
                struct cli_state *targetcli;
                char *targetname = NULL;
                char *p = NULL;
+               char *saveptr;
 
                ddir2 = talloc_strdup(ctx, "");
                if (!ddir2) {
@@ -1471,7 +1479,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) {
@@ -1484,7 +1492,7 @@ static int cmd_mkdir(void)
                        if (!ddir2) {
                                return 1;
                        }
-                       p = strtok(NULL,"/\\");
+                       p = strtok_r(NULL, "/\\", &saveptr);
                }
        } else {
                do_mkdir(mask);
@@ -1508,7 +1516,7 @@ static int cmd_altname(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx, NULL, &buf, NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) {
                d_printf("altname <file>\n");
                return 1;
        }
@@ -1520,6 +1528,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.
 ****************************************************************************/
@@ -1674,12 +1768,12 @@ static int cmd_put(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx,NULL,&lname,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&lname,NULL)) {
                d_printf("put <filename>\n");
                return 1;
        }
 
-       if (next_token_nr_talloc(ctx, NULL,&buf,NULL)) {
+       if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                rname = talloc_asprintf_append(rname, buf);
        } else {
                rname = talloc_asprintf_append(rname, lname);
@@ -1759,7 +1853,7 @@ static int cmd_select(void)
 {
        TALLOC_CTX *ctx = talloc_tos();
        char *new_fs = NULL;
-       next_token_nr_talloc(ctx, NULL,&new_fs,NULL)
+       next_token_talloc(ctx, &cmd_ptr,&new_fs,NULL)
                ;
        if (new_fs) {
                client_set_fileselection(new_fs);
@@ -1845,7 +1939,7 @@ static int cmd_mput(void)
        TALLOC_CTX *ctx = talloc_tos();
        char *p = NULL;
 
-       while (next_token_nr_talloc(ctx, NULL,&p,NULL)) {
+       while (next_token_talloc(ctx, &cmd_ptr,&p,NULL)) {
                int ret;
                struct file_list *temp_list;
                char *quest, *lname, *rname;
@@ -1956,14 +2050,14 @@ static int cmd_cancel(void)
        char *buf = NULL;
        int job;
 
-       if (!next_token_nr_talloc(ctx, NULL, &buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr, &buf,NULL)) {
                d_printf("cancel <jobid> ...\n");
                return 1;
        }
        do {
                job = atoi(buf);
                do_cancel(job);
-       } while (next_token_nr_talloc(ctx,NULL,&buf,NULL));
+       } while (next_token_talloc(ctx, &cmd_ptr,&buf,NULL));
 
        return 0;
 }
@@ -1979,7 +2073,7 @@ static int cmd_print(void)
        char *rname = NULL;
        char *p = NULL;
 
-       if (!next_token_nr_talloc(ctx, NULL, &lname,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr, &lname,NULL)) {
                d_printf("print <filename>\n");
                return 1;
        }
@@ -2075,7 +2169,7 @@ static int cmd_del(void)
        if (!mask) {
                return 1;
        }
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("del <filename>\n");
                return 1;
        }
@@ -2101,14 +2195,14 @@ static int cmd_wdel(void)
        struct cli_state *targetcli;
        char *targetname = NULL;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("wdel 0x<attrib> <wcard>\n");
                return 1;
        }
 
        attribute = (uint16)strtol(buf, (char **)NULL, 16);
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("wdel 0x<attrib> <wcard>\n");
                return 1;
        }
@@ -2143,7 +2237,7 @@ static int cmd_open(void)
        struct cli_state *targetcli;
        int fnum;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("open <filename>\n");
                return 1;
        }
@@ -2174,6 +2268,49 @@ static int cmd_open(void)
        return 0;
 }
 
+static int cmd_posix_encrypt(void)
+{
+       TALLOC_CTX *ctx = talloc_tos();
+       NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+
+       if (cli->use_kerberos) {
+               status = cli_gss_smb_encryption_start(cli);
+       } else {
+               char *domain = NULL;
+               char *user = NULL;
+               char *password = NULL;
+
+               if (!next_token_talloc(ctx, &cmd_ptr,&domain,NULL)) {
+                       d_printf("posix_encrypt domain user password\n");
+                       return 1;
+               }
+
+               if (!next_token_talloc(ctx, &cmd_ptr,&user,NULL)) {
+                       d_printf("posix_encrypt domain user password\n");
+                       return 1;
+               }
+
+               if (!next_token_talloc(ctx, &cmd_ptr,&password,NULL)) {
+                       d_printf("posix_encrypt domain user password\n");
+                       return 1;
+               }
+
+               status = cli_raw_ntlm_smb_encryption_start(cli,
+                                                       user,
+                                                       password,
+                                                       domain);
+       }
+
+       if (!NT_STATUS_IS_OK(status)) {
+               d_printf("posix_encrypt failed with error %s\n", nt_errstr(status));
+       } else {
+               d_printf("encryption on\n");
+               smb_encrypt = true;
+       }
+
+       return 0;
+}
+
 /****************************************************************************
 ****************************************************************************/
 
@@ -2187,7 +2324,7 @@ static int cmd_posix_open(void)
        mode_t mode;
        int fnum;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("posix_open <filename> 0<mode>\n");
                return 1;
        }
@@ -2199,7 +2336,7 @@ static int cmd_posix_open(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("posix_open <filename> 0<mode>\n");
                return 1;
        }
@@ -2235,7 +2372,7 @@ static int cmd_posix_mkdir(void)
        mode_t mode;
        int fnum;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("posix_mkdir <filename> 0<mode>\n");
                return 1;
        }
@@ -2247,7 +2384,7 @@ static int cmd_posix_mkdir(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("posix_mkdir <filename> 0<mode>\n");
                return 1;
        }
@@ -2275,7 +2412,7 @@ static int cmd_posix_unlink(void)
        char *targetname = NULL;
        struct cli_state *targetcli;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("posix_unlink <filename>\n");
                return 1;
        }
@@ -2309,7 +2446,7 @@ static int cmd_posix_rmdir(void)
        char *targetname = NULL;
        struct cli_state *targetcli;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("posix_rmdir <filename>\n");
                return 1;
        }
@@ -2341,7 +2478,7 @@ static int cmd_close(void)
        char *buf = NULL;
        int fnum;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("close <fnum>\n");
                return 1;
        }
@@ -2420,17 +2557,30 @@ static int cmd_posix(void)
                        return 1;
                }
        }
+       if (caplow & CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP) {
+               caps = talloc_asprintf_append(caps, "posix_encrypt ");
+               if (!caps) {
+                       return 1;
+               }
+       }
+       if (caplow & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP) {
+               caps = talloc_asprintf_append(caps, "mandatory_posix_encrypt ");
+               if (!caps) {
+                       return 1;
+               }
+       }
 
        if (*caps && caps[strlen(caps)-1] == ' ') {
                caps[strlen(caps)-1] = '\0';
        }
+
+       d_printf("Server supports CIFS capabilities %s\n", caps);
+
        if (!cli_set_unix_extensions_capabilities(cli, major, minor, caplow, caphigh)) {
                d_printf("Can't set UNIX CIFS extensions capabilities. %s.\n", cli_errstr(cli));
                return 1;
        }
 
-       d_printf("Selecting server supported CIFS capabilities %s\n", caps);
-
        if (caplow & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
                CLI_DIRSEP_CHAR = '/';
                *CLI_DIRSEP_STR = '/';
@@ -2448,13 +2598,13 @@ static int cmd_lock(void)
        enum brl_type lock_type;
        int fnum;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n");
                return 1;
        }
        fnum = atoi(buf);
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n");
                return 1;
        }
@@ -2468,14 +2618,14 @@ static int cmd_lock(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n");
                return 1;
        }
 
        start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n");
                return 1;
        }
@@ -2496,20 +2646,20 @@ static int cmd_unlock(void)
        SMB_BIG_UINT start, len;
        int fnum;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("unlock <fnum> <hex-start> <hex-len>\n");
                return 1;
        }
        fnum = atoi(buf);
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("unlock <fnum> <hex-start> <hex-len>\n");
                return 1;
        }
 
        start = (SMB_BIG_UINT)strtol(buf, (char **)NULL, 16);
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("unlock <fnum> <hex-start> <hex-len>\n");
                return 1;
        }
@@ -2536,7 +2686,7 @@ static int cmd_rmdir(void)
        char *targetname = NULL;
        struct cli_state *targetcli;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("rmdir <dirname>\n");
                return 1;
        }
@@ -2575,8 +2725,8 @@ static int cmd_link(void)
        char *targetname = NULL;
        struct cli_state *targetcli;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL) ||
-           !next_token_nr_talloc(ctx,NULL,&buf2,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
+           !next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
                d_printf("link <oldname> <newname>\n");
                return 1;
        }
@@ -2626,8 +2776,8 @@ static int cmd_symlink(void)
        char *targetname = NULL;
        struct cli_state *targetcli;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL) ||
-           !next_token_nr_talloc(ctx,NULL,&buf2,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
+           !next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
                d_printf("symlink <oldname> <newname>\n");
                return 1;
        }
@@ -2679,8 +2829,8 @@ static int cmd_chmod(void)
        struct cli_state *targetcli;
        mode_t mode;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL) ||
-           !next_token_nr_talloc(ctx,NULL,&buf2,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
+           !next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
                d_printf("chmod mode file\n");
                return 1;
        }
@@ -2835,7 +2985,7 @@ static int cmd_getfacl(void)
        uint16 num_dir_acls = 0;
        uint16 i;
 
-       if (!next_token_nr_talloc(ctx,NULL,&name,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&name,NULL)) {
                d_printf("getfacl filename\n");
                return 1;
        }
@@ -3001,7 +3151,7 @@ static int cmd_stat(void)
        SMB_STRUCT_STAT sbuf;
        struct tm *lt;
 
-       if (!next_token_nr_talloc(ctx,NULL,&name,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&name,NULL)) {
                d_printf("stat file\n");
                return 1;
        }
@@ -3097,9 +3247,9 @@ static int cmd_chown(void)
        struct cli_state *targetcli;
        char *targetname = NULL;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL) ||
-           !next_token_nr_talloc(ctx,NULL,&buf2,NULL) ||
-           !next_token_nr_talloc(ctx,NULL,&buf3,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
+           !next_token_talloc(ctx, &cmd_ptr,&buf2,NULL) ||
+           !next_token_talloc(ctx, &cmd_ptr,&buf3,NULL)) {
                d_printf("chown uid gid file\n");
                return 1;
        }
@@ -3146,8 +3296,8 @@ static int cmd_rename(void)
        char *targetsrc;
        char *targetdest;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL) ||
-           !next_token_nr_talloc(ctx,NULL,&buf2,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
+           !next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
                d_printf("rename <src> <dest>\n");
                return 1;
        }
@@ -3221,8 +3371,8 @@ static int cmd_hardlink(void)
        struct cli_state *targetcli;
        char *targetname;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL) ||
-           !next_token_nr_talloc(ctx,NULL,&buf2,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
+           !next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
                d_printf("hardlink <src> <dest>\n");
                return 1;
        }
@@ -3278,7 +3428,7 @@ static int cmd_newer(void)
        bool ok;
        SMB_STRUCT_STAT sbuf;
 
-       ok = next_token_nr_talloc(ctx,NULL,&buf,NULL);
+       ok = next_token_talloc(ctx, &cmd_ptr,&buf,NULL);
        if (ok && (sys_stat(buf,&sbuf) == 0)) {
                newer_than = sbuf.st_mtime;
                DEBUG(1,("Getting files newer than %s",
@@ -3304,7 +3454,7 @@ static int cmd_archive(void)
        TALLOC_CTX *ctx = talloc_tos();
        char *buf;
 
-       if (next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                archive_level = atoi(buf);
        } else {
                d_printf("Archive level is %d\n",archive_level);
@@ -3383,7 +3533,7 @@ static int cmd_lcd(void)
        char *buf;
        char *d;
 
-       if (next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                chdir(buf);
        }
        d = TALLOC_ARRAY(ctx, char, PATH_MAX+1);
@@ -3414,7 +3564,7 @@ static int cmd_reget(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx, NULL, &fname, NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr, &fname, NULL)) {
                d_printf("reget <filename>\n");
                return 1;
        }
@@ -3428,7 +3578,7 @@ static int cmd_reget(void)
        }
 
        local_name = fname;
-       next_token_nr_talloc(ctx, NULL, &p, NULL);
+       next_token_talloc(ctx, &cmd_ptr, &p, NULL);
        if (p) {
                local_name = p;
        }
@@ -3456,7 +3606,7 @@ static int cmd_reput(void)
                return 1;
        }
 
-       if (!next_token_nr_talloc(ctx, NULL, &local_name, NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr, &local_name, NULL)) {
                d_printf("reput <filename>\n");
                return 1;
        }
@@ -3466,7 +3616,7 @@ static int cmd_reput(void)
                return 1;
        }
 
-       if (next_token_nr_talloc(ctx, NULL, &buf, NULL)) {
+       if (next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) {
                remote_name = talloc_asprintf_append(remote_name,
                                                buf);
        } else {
@@ -3640,7 +3790,7 @@ static int cmd_vuid(void)
        TALLOC_CTX *ctx = talloc_tos();
        char *buf;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                d_printf("Current VUID is %d\n", cli->vuid);
                return 0;
        }
@@ -3658,12 +3808,12 @@ static int cmd_logon(void)
        TALLOC_CTX *ctx = talloc_tos();
        char *l_username, *l_password;
 
-       if (!next_token_nr_talloc(ctx,NULL,&l_username,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&l_username,NULL)) {
                d_printf("logon <username> [<password>]\n");
                return 0;
        }
 
-       if (!next_token_nr_talloc(ctx,NULL,&l_password,NULL)) {
+       if (!next_token_talloc(ctx, &cmd_ptr,&l_password,NULL)) {
                char *pass = getpass("Password: ");
                if (pass) {
                        l_password = talloc_strdup(ctx,pass);
@@ -3726,17 +3876,29 @@ int cmd_iosize(void)
        char *buf;
        int iosize;
 
-       if (!next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
-               d_printf("iosize <n> or iosize 0x<n>. "
-                       "Minimum is 16384 (0x4000), "
-                       "max is 16776960 (0xFFFF00)\n");
+       if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
+               if (!smb_encrypt) {
+                       d_printf("iosize <n> or iosize 0x<n>. "
+                               "Minimum is 16384 (0x4000), "
+                               "max is 16776960 (0xFFFF00)\n");
+               } else {
+                       d_printf("iosize <n> or iosize 0x<n>. "
+                               "(Encrypted connection) ,"
+                               "Minimum is 16384 (0x4000), "
+                               "max is 130048 (0x1FC00)\n");
+               }
                return 1;
        }
 
        iosize = strtol(buf,NULL,0);
-       if (iosize < 0 || iosize > 0xFFFF00) {
+       if (smb_encrypt && (iosize < 0x4000 || iosize > 0xFC00)) {
+               d_printf("iosize out of range for encrypted "
+                       "connection (min = 16384 (0x4000), "
+                       "max = 130048 (0x1FC00)");
+               return 1;
+       } else if (!smb_encrypt && (iosize < 0x4000 || iosize > 0xFFFF00)) {
                d_printf("iosize out of range (min = 16384 (0x4000), "
-                       "max = 16776960 (0x0xFFFF00)");
+                       "max = 16776960 (0xFFFF00)");
                return 1;
        }
 
@@ -3764,6 +3926,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}},
@@ -3799,6 +3963,7 @@ static struct {
   {"newer",cmd_newer,"<file> only mget files newer than the specified local file",{COMPL_LOCAL,COMPL_NONE}},
   {"open",cmd_open,"<mask> open a file",{COMPL_REMOTE,COMPL_NONE}},
   {"posix", cmd_posix, "turn on all POSIX capabilities", {COMPL_REMOTE,COMPL_NONE}},
+  {"posix_encrypt",cmd_posix_encrypt,"<domain> <user> <password> start up transport encryption",{COMPL_REMOTE,COMPL_NONE}},
   {"posix_open",cmd_posix_open,"<name> 0<mode> open_flags mode open a file using POSIX interface",{COMPL_REMOTE,COMPL_NONE}},
   {"posix_mkdir",cmd_posix_mkdir,"<name> 0<mode> creates a directory using POSIX interface",{COMPL_REMOTE,COMPL_NONE}},
   {"posix_rmdir",cmd_posix_rmdir,"<name> removes a directory using POSIX interface",{COMPL_REMOTE,COMPL_NONE}},
@@ -3879,7 +4044,7 @@ static int cmd_help(void)
        int i=0,j;
        char *buf;
 
-       if (next_token_nr_talloc(ctx,NULL,&buf,NULL)) {
+       if (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
                if ((i = process_tok(buf)) >= 0)
                        d_printf("HELP %s:\n\t%s\n\n",
                                commands[i].name,commands[i].description);
@@ -3911,7 +4076,8 @@ static int process_command_string(const char *cmd_in)
        /* establish the connection if not already */
 
        if (!cli) {
-               cli = cli_cm_open(talloc_tos(), NULL, desthost, service, true);
+               cli = cli_cm_open(talloc_tos(), NULL, desthost,
+                               service, true, smb_encrypt);
                if (!cli) {
                        return 1;
                }
@@ -3919,7 +4085,6 @@ static int process_command_string(const char *cmd_in)
 
        while (cmd[0] != '\0')    {
                char *line;
-               const char *ptr;
                char *p;
                char *tok;
                int i;
@@ -3934,8 +4099,8 @@ static int process_command_string(const char *cmd_in)
                }
 
                /* and get the first part of the command */
-               ptr = line;
-               if (!next_token_nr_talloc(ctx,&ptr,&tok,NULL)) {
+               cmd_ptr = line;
+               if (!next_token_talloc(ctx, &cmd_ptr,&tok,NULL)) {
                        continue;
                }
 
@@ -4252,16 +4417,22 @@ static void readline_callback(void)
        timeout.tv_usec = 0;
        sys_select_intr(cli->fd+1,&fds,NULL,NULL,&timeout);
 
-       /* We deliberately use receive_smb instead of
+       /* We deliberately use receive_smb_raw instead of
           client_receive_smb as we want to receive
           session keepalives and then drop them here.
        */
        if (FD_ISSET(cli->fd,&fds)) {
-               if (!receive_smb(cli->fd,cli->inbuf,0,&cli->smb_rw_error)) {
+               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"));
                        return;
                }
+               if(CVAL(cli->inbuf,0) != SMBkeepalive) {
+                       DEBUG(0, ("Read from server "
+                               "returned unexpected packet!\n"));
+                       return;
+               }
+
                goto again;
        }
 
@@ -4279,7 +4450,6 @@ static void readline_callback(void)
 
 static int process_stdin(void)
 {
-       const char *ptr;
        int rc = 0;
 
        while (1) {
@@ -4310,8 +4480,8 @@ static int process_stdin(void)
                }
 
                /* and get the first part of the command */
-               ptr = line;
-               if (!next_token_nr_talloc(frame,&ptr,&tok,NULL)) {
+               cmd_ptr = line;
+               if (!next_token_talloc(frame, &cmd_ptr,&tok,NULL)) {
                        TALLOC_FREE(frame);
                        SAFE_FREE(line);
                        continue;
@@ -4338,7 +4508,8 @@ static int process(const char *base_directory)
 {
        int rc = 0;
 
-       cli = cli_cm_open(talloc_tos(), NULL, desthost, service, true);
+       cli = cli_cm_open(talloc_tos(), NULL,
+                       desthost, service, true, smb_encrypt);
        if (!cli) {
                return 1;
        }
@@ -4367,7 +4538,8 @@ static int process(const char *base_directory)
 
 static int do_host_query(const char *query_host)
 {
-       cli = cli_cm_open(talloc_tos(), NULL, query_host, "IPC$", true);
+       cli = cli_cm_open(talloc_tos(), NULL,
+                       query_host, "IPC$", true, smb_encrypt);
        if (!cli)
                return 1;
 
@@ -4380,7 +4552,8 @@ static int do_host_query(const char *query_host)
 
                cli_cm_shutdown();
                cli_cm_set_port( 139 );
-               cli = cli_cm_open(talloc_tos(), NULL, query_host, "IPC$", true);
+               cli = cli_cm_open(talloc_tos(), NULL,
+                               query_host, "IPC$", true, smb_encrypt);
        }
 
        if (cli == NULL) {
@@ -4405,7 +4578,8 @@ static int do_tar_op(const char *base_directory)
 
        /* do we already have a connection? */
        if (!cli) {
-               cli = cli_cm_open(talloc_tos(), NULL, desthost, service, true);
+               cli = cli_cm_open(talloc_tos(), NULL,
+                       desthost, service, true, smb_encrypt);
                if (!cli)
                        return 1;
        }
@@ -4512,6 +4686,7 @@ static int do_message_op(void)
                { "send-buffer", 'b', POPT_ARG_INT, &io_bufsize, 'b', "Changes the transmit/send buffer", "BYTES" },
                { "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" },
                { "grepable", 'g', POPT_ARG_NONE, NULL, 'g', "Produce grepable output" },
+                { "browse", 'B', POPT_ARG_NONE, NULL, 'B', "Browse SMB servers using DNS" },
                POPT_COMMON_SAMBA
                POPT_COMMON_CONNECTION
                POPT_COMMON_CREDENTIALS
@@ -4538,7 +4713,7 @@ static int do_message_op(void)
        set_global_myworkgroup( "" );
        set_global_myname( "" );
 
-        /* set default debug level to 0 regardless of what smb.conf sets */
+        /* set default debug level to 1 regardless of what smb.conf sets */
        setup_logging( "smbclient", true );
        DEBUGLEVEL_CLASS[DBGC_ALL] = 1;
        if ((dbf = x_fdup(x_stderr))) {
@@ -4654,6 +4829,12 @@ static int do_message_op(void)
                case 'g':
<