Merge branch 'master' of ssh://git.samba.org/data/git/samba into selftest
authorJelmer Vernooij <jelmer@samba.org>
Sat, 11 Oct 2008 01:12:21 +0000 (03:12 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 11 Oct 2008 01:12:21 +0000 (03:12 +0200)
Conflicts:
selftest/selftest.pl

781 files changed:
.gitignore
README.Coding
docs-xml/manpages-3/idmap_adex.8.xml [new file with mode: 0644]
docs-xml/manpages-3/idmap_hash.8.xml [new file with mode: 0644]
docs-xml/manpages-3/pam_winbind.7.xml
docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml [new file with mode: 0644]
docs-xml/smbdotconf/printing/cupsconnectiontimeout.xml [new file with mode: 0644]
docs-xml/smbdotconf/winbind/winbindnormalizenames.xml
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
examples/pam_winbind/pam_winbind.conf
lib/crypto/arcfour.c [moved from source4/lib/crypto/arcfour.c with 98% similarity]
lib/crypto/arcfour.h [new file with mode: 0644]
lib/crypto/config.mk [moved from source4/lib/crypto/config.mk with 100% similarity]
lib/crypto/crc32.c [moved from source4/lib/crypto/crc32.c with 100% similarity]
lib/crypto/crc32.h [moved from source4/lib/crypto/crc32.h with 100% similarity]
lib/crypto/crypto.h [moved from source4/libcli/drsblobs.h with 70% similarity]
lib/crypto/hmacmd5.c [moved from source4/lib/crypto/hmacmd5.c with 99% similarity]
lib/crypto/hmacmd5.h [moved from source4/lib/crypto/hmacmd5.h with 96% similarity]
lib/crypto/hmacmd5test.c [moved from source4/lib/crypto/hmacmd5test.c with 99% similarity]
lib/crypto/hmacsha256.c [moved from source4/lib/crypto/hmacsha256.c with 98% similarity]
lib/crypto/hmacsha256.h [moved from source4/lib/crypto/hmacsha256.h with 100% similarity]
lib/crypto/md4.c [moved from source4/lib/crypto/md4.c with 100% similarity]
lib/crypto/md4.h [moved from source4/lib/crypto/md4.h with 100% similarity]
lib/crypto/md4test.c [moved from source4/lib/crypto/md4test.c with 98% similarity]
lib/crypto/md5.c [moved from source4/lib/crypto/md5.c with 100% similarity]
lib/crypto/md5.h [moved from source4/lib/crypto/md5.h with 100% similarity]
lib/crypto/md5test.c [moved from source4/lib/crypto/md5test.c with 98% similarity]
lib/crypto/sha256.c [moved from source4/lib/crypto/sha256.c with 100% similarity]
lib/crypto/sha256.h [moved from source4/lib/crypto/sha256.h with 100% similarity]
lib/replace/Makefile.in
lib/replace/build_macros.m4 [new file with mode: 0644]
lib/replace/configure.ac
lib/replace/libreplace.m4
lib/replace/test/main.c [new file with mode: 0644]
lib/replace/test/testsuite.c
lib/socket_wrapper/socket_wrapper.c
lib/subunit/harness2subunit.pl [moved from source4/script/harness2subunit.pl with 77% similarity]
lib/subunit/python/subunit/__init__.py [moved from source4/scripting/python/subunit/__init__.py with 100% similarity]
lib/subunit/python/subunit/tests/TestUtil.py [new file with mode: 0644]
lib/subunit/python/subunit/tests/__init__.py [new file with mode: 0644]
lib/subunit/python/subunit/tests/sample-script.py [new file with mode: 0755]
lib/subunit/python/subunit/tests/sample-two-script.py [new file with mode: 0755]
lib/subunit/python/subunit/tests/test_test_protocol.py [new file with mode: 0644]
lib/talloc/Makefile.in
lib/talloc/build_macros.m4 [new file with mode: 0644]
lib/talloc/configure.ac
lib/talloc/talloc.mk
lib/talloc/talloc_guide.txt
lib/talloc/testsuite.c
lib/talloc/testsuite_main.c [new file with mode: 0644]
lib/tdb/Makefile.in
lib/tdb/build_macros.m4 [new file with mode: 0644]
lib/tdb/configure.ac
lib/tdb/include/tdb.h
lib/tdb/tdb.i
lib/tdb/tdb.py
lib/tdb/tdb_wrap.c
libcli/nbt/libnbt.h [moved from source3/libcli/nbt/libnbt.h with 96% similarity]
libcli/nbt/namequery.c [moved from source4/libcli/nbt/namequery.c with 96% similarity]
libcli/nbt/namerefresh.c [moved from source4/libcli/nbt/namerefresh.c with 94% similarity]
libcli/nbt/nameregister.c [moved from source4/libcli/nbt/nameregister.c with 95% similarity]
libcli/nbt/namerelease.c [moved from source4/libcli/nbt/namerelease.c with 94% similarity]
libcli/nbt/nbt_proto.h [new file with mode: 0644]
libcli/nbt/nbtname.c [moved from source4/libcli/nbt/nbtname.c with 96% similarity]
libcli/nbt/nbtsocket.c [moved from source4/libcli/nbt/nbtsocket.c with 91% similarity]
libcli/nbt/pynbt.c [moved from source4/libcli/nbt/pynbt.c with 94% similarity]
libcli/ndr_netlogon.c [moved from source4/libcli/ndr_netlogon.c with 99% similarity]
libcli/ndr_netlogon_proto.h [new file with mode: 0644]
libcli/netlogon.c [moved from source4/libcli/netlogon.c with 66% similarity]
libcli/netlogon.h [moved from source4/libcli/netlogon.h with 93% similarity]
libcli/netlogon_proto.h [new file with mode: 0644]
pidl/TODO
pidl/config.mk
pidl/lib/Parse/Pidl/ODL.pm
pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
pidl/lib/Parse/Pidl/Samba4/Python.pm
pidl/pidl
pidl/tests/samba3-srv.pl [changed mode: 0644->0755]
prog_guide4.txt
release-scripts/create-tarball
selftest/output/plain.pm
selftest/selftest.pl
selftest/target/Samba4.pm
source3/Makefile.in
source3/auth/auth_domain.c
source3/auth/auth_netlogond.c [new file with mode: 0644]
source3/autogen.sh
source3/client/client.c
source3/client/mount.cifs.c
source3/configure.in
source3/dynconfig.c
source3/groupdb/mapping_tdb.c
source3/include/charset.h
source3/include/dynconfig.h
source3/include/hmacmd5.h [deleted file]
source3/include/idmap.h
source3/include/includes.h
source3/include/libmsrpc.h [deleted file]
source3/include/libmsrpc_internal.h [deleted file]
source3/include/md5.h [deleted file]
source3/include/nameserv.h
source3/include/printing.h
source3/include/proto.h
source3/include/rpc_secdes.h
source3/include/secrets.h
source3/include/smb.h
source3/include/smb_macros.h
source3/include/vfs.h
source3/lib/async_sock.c
source3/lib/crc32.c [deleted file]
source3/lib/ctdbd_conn.c
source3/lib/dbwrap_ctdb.c
source3/lib/debug.c
source3/lib/display_sec.c
source3/lib/dummysmbd.c
source3/lib/errmap_unix.c
source3/lib/hmacmd5.c [deleted file]
source3/lib/ldb/common/ldb.c
source3/lib/md4.c [deleted file]
source3/lib/md5.c [deleted file]
source3/lib/messages_local.c
source3/lib/netapi/examples/user/user_modalsset.c
source3/lib/netapi/file.c
source3/lib/netapi/getdc.c
source3/lib/netapi/share.c
source3/lib/netapi/tests/Makefile.in
source3/lib/netapi/tests/common.h
source3/lib/netapi/tests/netapitest.c
source3/lib/netapi/tests/netfile.c [new file with mode: 0644]
source3/lib/netapi/user.c
source3/lib/readline.c
source3/lib/secace.c
source3/lib/secdesc.c
source3/lib/sharesec.c
source3/lib/util_seaccess.c
source3/libaddns/dnsmarshall.c
source3/libaddns/dnsrecord.c
source3/libads/authdata.c
source3/libads/cldap.c
source3/libads/ldap.c
source3/libads/util.c
source3/libcli/nbt/nbtname.c [deleted file]
source3/libgpo/gpext/scripts.c
source3/libgpo/gpext/security.c [new file with mode: 0644]
source3/libgpo/gpo_reg.c
source3/libnet/libnet_dssync_keytab.c
source3/libnet/libnet_join.c
source3/libnet/libnet_proto.h
source3/libnet/libnet_samsync.c
source3/librpc/gen_ndr/libnetapi.h
source3/librpc/gen_ndr/nbt.h
source3/librpc/gen_ndr/ndr_libnetapi.c
source3/librpc/gen_ndr/ndr_nbt.c
source3/librpc/gen_ndr/ndr_nbt.h
source3/librpc/gen_ndr/srv_dfs.c
source3/librpc/gen_ndr/srv_dssetup.c
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_netlogon.c
source3/librpc/gen_ndr/srv_ntsvcs.c
source3/librpc/gen_ndr/srv_samr.c
source3/librpc/gen_ndr/srv_srvsvc.c
source3/librpc/gen_ndr/srv_svcctl.c
source3/librpc/gen_ndr/srv_winreg.c
source3/librpc/gen_ndr/srv_wkssvc.c
source3/librpc/idl/libnetapi.idl
source3/librpc/idl/nbt.idl
source3/librpc/ndr/ndr.c
source3/librpc/rpc/binding.c
source3/librpc/rpc/dcerpc.c
source3/librpc/tools/ndrdump.c
source3/libsmb/async_smb.c
source3/libsmb/clidgram.c
source3/libsmb/clientgen.c
source3/libsmb/clierror.c
source3/libsmb/cliquota.c
source3/libsmb/dsgetdcname.c
source3/libsmb/libsmb_xattr.c
source3/libsmb/ntlmssp_sign.c
source3/libsmb/samlogon_cache.c
source3/libsmb/smbencrypt.c
source3/libsmb/trusts_util.c
source3/m4/check_path.m4
source3/modules/nfs4_acls.c
source3/modules/vfs_acl_xattr.c
source3/modules/vfs_afsacl.c
source3/modules/vfs_aixacl2.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_smb_traffic_analyzer.c [new file with mode: 0644]
source3/modules/vfs_xattr_tdb.c
source3/modules/vfs_zfsacl.c
source3/nmbd/nmbd_processlogon.c
source3/nsswitch/libwbclient/wbc_guid.c [new file with mode: 0644]
source3/nsswitch/libwbclient/wbc_idmap.c
source3/nsswitch/libwbclient/wbc_pam.c
source3/nsswitch/libwbclient/wbc_pwd.c
source3/nsswitch/libwbclient/wbc_sid.c
source3/nsswitch/libwbclient/wbc_util.c
source3/nsswitch/libwbclient/wbclient.h
source3/nsswitch/pam_winbind.c
source3/nsswitch/pam_winbind.h
source3/nsswitch/wbinfo.c
source3/nsswitch/winbind_krb5_locator.c
source3/nsswitch/winbind_struct_protocol.h
source3/param/loadparm.c
source3/param/test_lp_load.c [new file with mode: 0644]
source3/passdb/secrets.c
source3/printing/load.c
source3/printing/notify.c
source3/printing/nt_printing.c
source3/printing/pcap.c
source3/printing/print_cups.c
source3/registry/reg_dispatcher.c
source3/rpc_client/cli_netlogon.c
source3/rpc_client/init_netlogon.c
source3/rpc_client/ndr.c
source3/rpc_server/srv_lsa_nt.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpc_server/srv_svcctl_nt.c
source3/samba4.m4
source3/samba4.mk
source3/script/build_idl.sh
source3/script/tests/wb_pad.sh [new file with mode: 0755]
source3/services/services_db.c
source3/smbd/conn.c
source3/smbd/fake_file.c
source3/smbd/filename.c
source3/smbd/files.c
source3/smbd/ipc.c
source3/smbd/notify_internal.c
source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/server.c
source3/smbd/trans2.c
source3/utils/net_ads.c
source3/utils/net_dns.c
source3/utils/net_proto.h
source3/utils/net_rap.c
source3/utils/net_rpc.c
source3/utils/net_rpc_registry.c
source3/utils/net_util.c
source3/utils/sharesec.c
source3/utils/smbcacls.c
source3/utils/testparm.c
source3/web/statuspage.c
source3/winbindd/idmap_adex/cell_util.c [new file with mode: 0644]
source3/winbindd/idmap_adex/domain_util.c [new file with mode: 0644]
source3/winbindd/idmap_adex/gc_util.c [new file with mode: 0644]
source3/winbindd/idmap_adex/idmap_adex.c [new file with mode: 0644]
source3/winbindd/idmap_adex/idmap_adex.h [new file with mode: 0644]
source3/winbindd/idmap_adex/likewise_cell.c [new file with mode: 0644]
source3/winbindd/idmap_adex/provider_unified.c [new file with mode: 0644]
source3/winbindd/idmap_tdb2.c
source3/winbindd/idmap_util.c
source3/winbindd/winbindd_ads.c
source3/winbindd/winbindd_async.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_dual.c
source3/winbindd/winbindd_group.c
source3/winbindd/winbindd_locator.c
source3/winbindd/winbindd_pam.c
source3/winbindd/winbindd_proto.h
source3/winbindd/winbindd_rpc.c
source3/winbindd/winbindd_util.c
source4/BUGS [moved from BUGS4.txt with 100% similarity]
source4/Makefile
source4/NEWS [moved from NEWS4 with 100% similarity]
source4/TODO [moved from TODO4 with 98% similarity]
source4/auth/auth.py
source4/auth/auth_wrap.c
source4/auth/credentials/credentials.py
source4/auth/credentials/credentials_ntlm.c
source4/auth/credentials/credentials_wrap.c
source4/auth/gensec/cyrus_sasl.c
source4/auth/gensec/gensec.c
source4/auth/gensec/gensec.h
source4/auth/gensec/gensec_gssapi.c
source4/auth/gensec/gensec_krb5.c
source4/auth/gensec/schannel_sign.c
source4/auth/gensec/schannel_state.c
source4/auth/gensec/socket.c
source4/auth/gensec/spnego.c
source4/auth/kerberos/kerberos.c
source4/auth/kerberos/kerberos_util.c
source4/auth/kerberos/krb5_init_context.c
source4/auth/ntlm/auth_server.c
source4/auth/ntlm/ntlm_check.c
source4/auth/ntlmssp/ntlmssp.c
source4/auth/ntlmssp/ntlmssp_client.c
source4/auth/ntlmssp/ntlmssp_server.c
source4/auth/ntlmssp/ntlmssp_sign.c
source4/autogen.sh
source4/build/m4/check_path.m4
source4/build/smb_build/summary.pm
source4/cldap_server/cldap_server.c
source4/cldap_server/config.mk
source4/cldap_server/netlogon.c
source4/cldap_server/rootdse.c
source4/client/cifsdd.c
source4/client/cifsdd.h
source4/client/cifsddio.c
source4/client/client.c
source4/client/smbmount.c
source4/cluster/ctdb/example/cluster_start.sh
source4/configure.ac
source4/dsdb/common/util.c
source4/dsdb/config.mk
source4/dsdb/repl/drepl_partitions.c
source4/dsdb/repl/replicated_objects.c
source4/dsdb/samdb/cracknames.c
source4/dsdb/samdb/ldb_modules/anr.c
source4/dsdb/samdb/ldb_modules/extended_dn.c
source4/dsdb/samdb/ldb_modules/instancetype.c
source4/dsdb/samdb/ldb_modules/kludge_acl.c
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/local_password.c
source4/dsdb/samdb/ldb_modules/naming_fsmo.c
source4/dsdb/samdb/ldb_modules/normalise.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/objectguid.c
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
source4/dsdb/samdb/ldb_modules/proxy.c
source4/dsdb/samdb/ldb_modules/ranged_results.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/ldb_modules/schema_fsmo.c
source4/dsdb/samdb/ldb_modules/show_deleted.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/dsdb/samdb/ldb_modules/subtree_delete.c
source4/dsdb/samdb/ldb_modules/subtree_rename.c
source4/dsdb/samdb/ldb_modules/tests/samba3sam.py
source4/dsdb/samdb/ldb_modules/update_keytab.c
source4/dsdb/samdb/samdb.c
source4/dsdb/samdb/samdb.h
source4/dsdb/schema/schema_description.c
source4/dsdb/schema/schema_init.c
source4/dsdb/schema/schema_set.c
source4/dynconfig/config.mk
source4/dynconfig/dynconfig.c
source4/heimdal/kdc/krb5tgs.c
source4/heimdal/lib/hdb/hdb.c
source4/heimdal/lib/hdb/hdb.h
source4/kdc/config.mk
source4/kdc/hdb-samba4.c [moved from source4/kdc/hdb-ldb.c with 94% similarity]
source4/kdc/kdc.c
source4/ldap_server/config.mk
source4/ldap_server/ldap_backend.c
source4/ldap_server/ldap_bind.c
source4/ldap_server/ldap_server.c
source4/lib/appweb/README [deleted file]
source4/lib/appweb/config.m4 [deleted file]
source4/lib/appweb/config.mk [deleted file]
source4/lib/appweb/ejs-2.0/.bashrc [deleted file]
source4/lib/appweb/ejs-2.0/.exrc [deleted file]
source4/lib/appweb/ejs-2.0/.ignore [deleted file]
source4/lib/appweb/ejs-2.0/.loginrc [deleted file]
source4/lib/appweb/ejs-2.0/ejs/.ignore [deleted file]
source4/lib/appweb/ejs-2.0/ejs/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/.ignore [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/ejsArray.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/ejsDate.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/ejsError.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/ejsObject.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/ejsStndClasses.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/ejsString.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/classes/ejsXml.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejs.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejs.h [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejsClass.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejsCmd.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejsGarbage.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejsLex.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejsParser.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejsVar.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/ejsVar.h [deleted file]
source4/lib/appweb/ejs-2.0/ejs/lib/event.js [deleted file]
source4/lib/appweb/ejs-2.0/ejs/lib/global.js [deleted file]
source4/lib/appweb/ejs-2.0/ejs/lib/startup.js [deleted file]
source4/lib/appweb/ejs-2.0/ejs/lib/timer.js [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/.ignore [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/README.TXT [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/UNIX/.ignore [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/UNIX/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/UNIX/ejsFile.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/UNIX/ejsFileSystem.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/UNIX/ejsHTTP.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/WIN/.ignore [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/WIN/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFile.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFileSystem.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsHTTP.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/ejsGC.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/ejsGlobal.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/ejsSystem.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/ejsSystemApp.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/ejsSystemDebug.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/ejsSystemLog.c [deleted file]
source4/lib/appweb/ejs-2.0/ejs/system/ejsSystemMemory.c [deleted file]
source4/lib/appweb/ejs-2.0/exml/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/exml/exml.h [deleted file]
source4/lib/appweb/ejs-2.0/exml/exmlParser.c [deleted file]
source4/lib/appweb/ejs-2.0/exml/files [deleted file]
source4/lib/appweb/ejs-2.0/mpr/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/mpr/UNIX/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/mpr/UNIX/mprFile.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/UNIX/mprPlatform.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/UNIX/mprTime.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/VXWORKS/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/mpr/VXWORKS/mprFile.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/VXWORKS/mprPlatform.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/VXWORKS/mprTime.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/WIN/Makefile [deleted file]
source4/lib/appweb/ejs-2.0/mpr/WIN/mprFile.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/WIN/mprPlatform.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/WIN/mprTime.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/files [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mpr.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mpr.h [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprAlloc.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprArray.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprBuf.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprGenFile.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprGenTime.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprLock.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprLog.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprOs.h [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprPrintf.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprString.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprSymbol.c [deleted file]
source4/lib/appweb/ejs-2.0/mpr/mprUnix.h [deleted file]
source4/lib/appweb/ejs/config.h [deleted file]
source4/lib/appweb/ejs/ejs.h [deleted file]
source4/lib/appweb/ejs/ejsInternal.h [deleted file]
source4/lib/appweb/ejs/ejsLex.c [deleted file]
source4/lib/appweb/ejs/ejsLib.c [deleted file]
source4/lib/appweb/ejs/ejsParser.c [deleted file]
source4/lib/appweb/ejs/ejsProcs.c [deleted file]
source4/lib/appweb/esp/esp.c [deleted file]
source4/lib/appweb/esp/esp.h [deleted file]
source4/lib/appweb/esp/espEnv.h [deleted file]
source4/lib/appweb/esp/espProcs.c [deleted file]
source4/lib/appweb/mpr/miniMpr.c [deleted file]
source4/lib/appweb/mpr/miniMpr.h [deleted file]
source4/lib/appweb/mpr/var.c [deleted file]
source4/lib/appweb/mpr/var.h [deleted file]
source4/lib/charset/charset.h
source4/lib/charset/util_unistr.c
source4/lib/com/com.h
source4/lib/com/config.mk
source4/lib/com/main.c
source4/lib/com/pycom.c [new file with mode: 0644]
source4/lib/com/rot.c
source4/lib/crypto/crypto.h [deleted file]
source4/lib/events/Makefile.in
source4/lib/events/autogen.sh
source4/lib/events/build_macros.m4 [new file with mode: 0644]
source4/lib/events/configure.ac
source4/lib/events/events.i
source4/lib/events/events.mk
source4/lib/events/events.py
source4/lib/events/events_wrap.c
source4/lib/events/libevents.m4
source4/lib/events/libtalloc.m4 [new file with mode: 0644]
source4/lib/events/pkg.m4 [new file with mode: 0644]
source4/lib/ldb/Makefile.in
source4/lib/ldb/autogen.sh
source4/lib/ldb/build_macros.m4 [new file with mode: 0644]
source4/lib/ldb/common/ldb.c
source4/lib/ldb/common/ldb_dn.c
source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/configure.ac
source4/lib/ldb/examples/ldbreader.c
source4/lib/ldb/external/libevents.m4
source4/lib/ldb/external/libtalloc.m4
source4/lib/ldb/external/libtdb.m4
source4/lib/ldb/include/ldb.h
source4/lib/ldb/include/ldb_private.h
source4/lib/ldb/ldb.i
source4/lib/ldb/ldb.mk
source4/lib/ldb/ldb.py
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/ldb_ldap/ldb_ldap.c
source4/lib/ldb/ldb_map/ldb_map.c
source4/lib/ldb/ldb_map/ldb_map.h
source4/lib/ldb/ldb_map/ldb_map_inbound.c
source4/lib/ldb/ldb_map/ldb_map_outbound.c
source4/lib/ldb/ldb_map/ldb_map_private.h
source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
source4/lib/ldb/ldb_tdb/ldb_index.c
source4/lib/ldb/ldb_tdb/ldb_search.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/ldb_tdb/ldb_tdb.h
source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
source4/lib/ldb/ldb_wrap.c
source4/lib/ldb/libldb.m4
source4/lib/ldb/modules/asq.c
source4/lib/ldb/modules/operational.c
source4/lib/ldb/modules/paged_results.c
source4/lib/ldb/modules/paged_searches.c
source4/lib/ldb/modules/rdn_name.c
source4/lib/ldb/modules/sort.c
source4/lib/ldb/nssldb/ldb-grp.c
source4/lib/ldb/nssldb/ldb-pwd.c
source4/lib/ldb/tests/python/api.py
source4/lib/ldb/tests/python/ldap.py
source4/lib/ldb/tools/ldbdel.c
source4/lib/ldb/tools/ldbedit.c
source4/lib/ldb/tools/ldbsearch.c
source4/lib/ldb/tools/ldbtest.c
source4/lib/ldb_wrap.c
source4/lib/registry/ldb.c
source4/lib/registry/patchfile.c
source4/lib/registry/registry.i
source4/lib/registry/rpc.c
source4/lib/registry/tests/generic.c
source4/lib/registry/tools/regdiff.c
source4/lib/registry/tools/regshell.c
source4/lib/registry/tools/regtree.c
source4/lib/util/genrand.c
source4/lib/util/idtree.c
source4/lib/util/util_ldb.c
source4/lib/wmi/wmi.h
source4/lib/wmi/wmicore.c
source4/libcli/auth/credentials.c
source4/libcli/auth/smbencrypt.c
source4/libcli/cldap/cldap.h
source4/libcli/cliconnect.c
source4/libcli/clideltree.c
source4/libcli/composite/composite.c
source4/libcli/config.mk
source4/libcli/dgram/libdgram.h
source4/libcli/finddcs.c
source4/libcli/ldap/ldap_bind.c
source4/libcli/ldap/ldap_client.c
source4/libcli/nbt/libnbt.h [deleted file]
source4/libcli/nbt/man/nmblookup.1.xml [new file with mode: 0644]
source4/libcli/nbt/tools/nmblookup.c [moved from source4/utils/nmblookup.c with 99% similarity]
source4/libcli/raw/clisession.c
source4/libcli/raw/clitransport.c
source4/libcli/raw/clitree.c
source4/libcli/raw/interfaces.h
source4/libcli/raw/libcliraw.h
source4/libcli/raw/rawrequest.c
source4/libcli/raw/rawsetfileinfo.c
source4/libcli/raw/smb_signing.c
source4/libcli/resolve/bcast.c
source4/libcli/resolve/nbtlist.c
source4/libcli/resolve/resolve.c
source4/libcli/resolve/resolve.h
source4/libcli/resolve/wins.c
source4/libcli/security/access_check.c
source4/libcli/security/security.i
source4/libcli/security/security.py
source4/libcli/security/security_wrap.c
source4/libcli/security/tests/bindings.py
source4/libcli/smb2/connect.c
source4/libcli/smb2/request.c
source4/libcli/smb2/signing.c
source4/libcli/smb2/smb2.h
source4/libcli/smb2/util.c
source4/libcli/smb_composite/connect.c
source4/libcli/smb_composite/fetchfile.c
source4/libcli/smb_composite/fsinfo.c
source4/libcli/smb_composite/sesssetup.c
source4/libcli/smb_composite/smb_composite.h
source4/libcli/swig/libcli_smb.i
source4/libcli/swig/libcli_smb.py
source4/libcli/swig/libcli_smb_wrap.c
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_join.c
source4/libnet/libnet_passwd.c
source4/libnet/libnet_samdump_keytab.c
source4/libnet/libnet_site.c
source4/libnet/libnet_unbecome_dc.c
source4/librpc/config.mk
source4/librpc/idl/dcerpc.idl
source4/librpc/idl/drsblobs.idl
source4/librpc/idl/drsuapi.idl
source4/librpc/idl/lsa.idl
source4/librpc/idl/misc.idl
source4/librpc/idl/nbt.idl
source4/librpc/idl/netlogon.idl
source4/librpc/idl/security.idl
source4/librpc/ndr/ndr_drsblobs.c [moved from source4/libcli/drsblobs.c with 82% similarity]
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc_connect.c
source4/librpc/rpc/dcerpc_secondary.c
source4/librpc/rpc/dcerpc_sock.c
source4/librpc/tests/test_ndrdump.sh
source4/main.mk
source4/nbt_server/config.mk
source4/nbt_server/defense.c
source4/nbt_server/dgram/netlogon.c
source4/nbt_server/interfaces.c
source4/nbt_server/irpc.c
source4/nbt_server/nbt_server.h
source4/nbt_server/nodestatus.c
source4/nbt_server/packet.c
source4/nbt_server/query.c
source4/nbt_server/register.c
source4/nbt_server/wins/wins_dns_proxy.c
source4/nbt_server/wins/winsdb.c
source4/nbt_server/wins/winsserver.c
source4/nbt_server/wins/winswack.c
source4/nsswitch/tests/test_wbinfo.sh
source4/ntp_signd/config.mk
source4/ntp_signd/ntp_signd.c
source4/ntvfs/cifs/vfs_cifs.c
source4/ntvfs/ntvfs_generic.c
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_open.c
source4/ntvfs/posix/pvfs_xattr.c
source4/param/loadparm.c
source4/param/param.h
source4/param/param.py
source4/param/param_wrap.c
source4/param/share_ldb.c
source4/rpc_server/config.mk
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcesrv_auth.c
source4/rpc_server/drsuapi/dcesrv_drsuapi.c
source4/rpc_server/handles.c
source4/rpc_server/lsa/dcesrv_lsa.c
source4/rpc_server/lsa/lsa_init.c
source4/rpc_server/lsa/lsa_lookup.c
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/samr/dcesrv_samr.c
source4/rpc_server/samr/samr_password.c
source4/rpc_server/service_rpc.c
source4/script/build_smb_interfaces.pl [deleted file]
source4/script/find_unused_makefilevars.pl
source4/script/installlib.sh
source4/script/installmisc.sh
source4/script/installmodules.sh [deleted file]
source4/script/installscripts.sh [deleted file]
source4/script/uninstallheader.sh [deleted file]
source4/script/uninstallmodules.sh [deleted file]
source4/script/uninstallscripts.sh [deleted file]
source4/scripting/bin/autoidl [moved from source4/scripting/bin/autoidl.py with 100% similarity]
source4/scripting/bin/epdump [moved from source4/scripting/bin/epdump.py with 100% similarity, mode: 0755]
source4/scripting/bin/minschema [moved from source4/scripting/bin/minschema.py with 94% similarity]
source4/scripting/bin/smbstatus
source4/scripting/bin/subunitrun
source4/scripting/ejs/config.mk [deleted file]
source4/scripting/ejs/mprutil.c [deleted file]
source4/scripting/ejs/smbcalls.c [deleted file]
source4/scripting/ejs/smbcalls.h [deleted file]
source4/scripting/ejs/smbcalls_auth.c [deleted file]
source4/scripting/ejs/smbcalls_config.c [deleted file]
source4/scripting/ejs/smbcalls_creds.c [deleted file]
source4/scripting/ejs/smbcalls_ldb.c [deleted file]
source4/scripting/ejs/smbcalls_options.c [deleted file]
source4/scripting/ejs/smbcalls_string.c [deleted file]
source4/scripting/ejs/smbcalls_sys.c [deleted file]
source4/scripting/ejs/smbscript.c [deleted file]
source4/scripting/libjs/base.js [deleted file]
source4/scripting/python/config.m4
source4/scripting/python/config.mk
source4/scripting/python/misc.i
source4/scripting/python/misc_wrap.c
source4/scripting/python/samba/provision.py
source4/scripting/python/samba/tests/dcerpc/rpcecho.py
source4/selftest/config.mk
source4/selftest/quick
source4/selftest/skip
source4/selftest/test_win.sh
source4/selftest/tests.sh
source4/setup/provision_basedn_modify.ldif
source4/setup/provision_users.ldif
source4/setup/schema_samba4.ldif
source4/setup/secrets_dc.ldif
source4/smb_server/blob.c
source4/smb_server/config.mk
source4/smb_server/smb/request.c
source4/smb_server/smb/sesssetup.c
source4/smb_server/smb/signing.c
source4/smb_server/smb2/fileinfo.c
source4/smb_server/smb2/fileio.c
source4/smb_server/smb2/keepalive.c
source4/smb_server/smb2/negprot.c
source4/smb_server/smb2/receive.c
source4/smb_server/smb2/smb2_server.h
source4/smb_server/smb_samba3.c [new file with mode: 0644]
source4/smb_server/smb_server.h
source4/smbd/config.mk
source4/smbd/process_model.c
source4/smbd/process_model.h
source4/smbd/process_prefork.c
source4/smbd/process_single.c
source4/smbd/process_standard.c
source4/smbd/process_thread.c
source4/smbd/samba.8.xml [moved from source4/smbd/smbd.8.xml with 92% similarity]
source4/smbd/server.c
source4/smbd/service_stream.c
source4/smbd/service_task.c
source4/torture/basic/misc.c
source4/torture/basic/secleak.c
source4/torture/config.mk
source4/torture/gentest.c
source4/torture/ldap/cldap.c
source4/torture/ldap/schema.c
source4/torture/ldap/uptodatevector.c
source4/torture/local/dbspeed.c
source4/torture/local/local.c
source4/torture/locktest.c
source4/torture/locktest2.c
source4/torture/masktest.c
source4/torture/nbt/dgram.c
source4/torture/nbt/nbt.c
source4/torture/nbt/query.c
source4/torture/nbt/winsbench.c
source4/torture/nbt/winsreplication.c
source4/torture/ndr/lsa.c
source4/torture/raw/chkpath.c
source4/torture/raw/composite.c
source4/torture/raw/context.c
source4/torture/raw/lock.c
source4/torture/raw/lockbench.c
source4/torture/raw/notify.c
source4/torture/raw/open.c
source4/torture/raw/openbench.c
source4/torture/raw/oplock.c
source4/torture/raw/tconrate.c
source4/torture/rpc/drsuapi_cracknames.c
source4/torture/rpc/dssync.c
source4/torture/rpc/join.c
source4/torture/rpc/lsa.c
source4/torture/rpc/netlogon.c
source4/torture/rpc/object_uuid.c [new file with mode: 0644]
source4/torture/rpc/remote_pac.c
source4/torture/rpc/rpc.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/samlogon.c
source4/torture/rpc/samr.c
source4/torture/rpc/samsync.c
source4/torture/rpc/testjoin.c
source4/torture/rpc/winreg.c
source4/torture/rpc/wkssvc.c
source4/torture/smb2/create.c
source4/torture/unix/unix_info2.c
source4/torture/unix/whoami.c
source4/torture/util_smb.c
source4/utils/ad2oLschema.c
source4/utils/config.mk
source4/utils/man/ndrdump.1.xml [deleted file]
source4/web_server/config.mk
source4/web_server/http.c [deleted file]
source4/web_server/swat/__init__.py
source4/web_server/web_server.c
source4/web_server/web_server.h
source4/web_server/wsgi.c [new file with mode: 0644]
source4/winbind/config.mk
source4/winbind/idmap.c
source4/winbind/wb_server.c
source4/wrepl_server/config.mk
source4/wrepl_server/wrepl_in_call.c
source4/wrepl_server/wrepl_in_connection.c
source4/wrepl_server/wrepl_scavenging.c
source4/wrepl_server/wrepl_server.c
testprogs/blackbox/test_ldb.sh
testprogs/ejs/base.js [deleted file]
testprogs/ejs/bugs.js [deleted file]
testprogs/ejs/ldb.js [deleted file]
testprogs/ejs/minschema.js [deleted file]
testprogs/ejs/samba3sam.js [deleted file]
testprogs/ejs/sprintf.js [deleted file]

index b87f786678e7ac0496a7975063141b2985213415..e585504ce5e3c575a804d4a0725f5864226342c6 100644 (file)
@@ -252,10 +252,10 @@ source4/param/proto.h
 source4/param/secrets_proto.h
 source4/param/share_proto.h
 source4/passdb/proto.h
-source4/pidl/blib
-source4/pidl/cover_db
-source4/pidl/Makefile
-source4/pidl/pm_to_blib
+pidl/blib
+pidl/cover_db
+pidl/Makefile
+pidl/pm_to_blib
 source4/rpc_server/common/proto.h
 source4/rpc_server/dcerpc_server_proto.h
 source4/rpc_server/lsa/proto.h
index 8063ae8691a78996e372bb068abe17a3bce0f51e..c1b6641a5aebf7de4d5e85d28cfd10403599e53c 100644 (file)
@@ -1,6 +1,7 @@
-##
-## Coding conventions in the Samba 3 tree
-##
+Coding conventions in the Samba tree
+------------------------------------
+
+.. contents::
 
 ===========
 Quick Start
@@ -14,15 +15,13 @@ style should never outweigh coding itself and so the the guidelines
 described here are hopefully easy enough to follow as they are very
 common and supported by tools and editors.
 
-The basic style, also mentioned in the SAMBA_4_0/prog_guide.txt is the
-Linux kernel coding style (See Documentation/CodingStyle in the kernel
-source tree).  The closely matches what most Samba developers use already
-anyways.
+The basic style, also mentioned in prog_guide4.txt, is the Linux kernel coding 
+style (See Documentation/CodingStyle in the kernel source tree). This closely 
+matches what most Samba developers use already anyways.
 
 But to save you the trouble of reading the Linux kernel style guide, here
 are the highlights.
 
-
 * Maximum Line Width is 80 Characters
   The reason is not for people with low-res screens but rather sticking
   to 80 columns prevents you from easily nesting more than one level of
@@ -59,14 +58,14 @@ Vi
 --
 (Thanks to SATOH Fumiyasu <fumiyas@osstech.jp> for these hints):
 
-For the basic vi editor including with all variants of *nix, add the 
+For the basic vi editor including with all variants of \*nix, add the 
 following to $HOME/.exrc:
 
   set tabstop=8
   set shiftwidth=8
 
 For Vim, the following settings in $HOME/.vimrc will also deal with 
-displaying trailing whitespace:
+displaying trailing whitespace::
 
   if has("syntax") && (&t_Co > 2 || has("gui_running"))
        syntax on
@@ -91,7 +90,7 @@ FAQ & Statement Reference
 Comments
 --------
 
-Comments should always use the standard C syntax.  I.e. /* ... */.  C++ 
+Comments should always use the standard C syntax.  C++ 
 style comments are not currently allowed.
 
 
@@ -145,7 +144,7 @@ The exception to the ending rule is when the closing brace is followed by
 another language keyword such as else or the closing while in a do..while 
 loop.
 
-Good examples:
+Good examples::
 
        if (x == 1) {
                printf("good\n");
@@ -162,7 +161,7 @@ Good examples:
                printf("also good\n");
        } while (1);
 
-Bad examples:
+Bad examples::
 
        while (1)
        {
@@ -177,29 +176,29 @@ evil, they can greatly enhance readability and reduce memory leaks when used
 as the single exit point from a function.  But in no Samba world what so ever 
 is a goto outside of a function or block of code a good idea.
 
-Good Examples:
-
-int function foo(int y)
-{
-       int *z = NULL;
-       int ret = 0;
+Good Examples::
 
-       if ( y < 10 ) {
-               z = malloc(sizeof(int)*y);
-               if (!z) {
-                       ret = 1;
-                       goto done;
+       int function foo(int y)
+       {
+               int *z = NULL;
+               int ret = 0;
+
+               if ( y < 10 ) {
+                       z = malloc(sizeof(int)*y);
+                       if (!z) {
+                               ret = 1;
+                               goto done;
+                       }
                }
-       }
 
-       print("Allocated %d elements.\n", y);
+               print("Allocated %d elements.\n", y);
 
- done: 
-       if (z)
-               free(z);
       done: 
+               if (z)
+                       free(z);
 
-       return ret;
-}
+               return ret;
+       }
 
 
 Checking Pointer Values
@@ -207,13 +206,13 @@ Checking Pointer Values
 
 When invoking functions that return pointer values, either of the following 
 are acceptable.  Use you best judgement and choose the more readable option.
-Remember that many other people will review it.
+Remember that many other people will review it.::
 
        if ((x = malloc(sizeof(short)*10)) == NULL ) {
                fprintf(stderr, "Unable to alloc memory!\n");
        }
 
-or
+or::
 
        x = malloc(sizeof(short)*10);
        if (!x) {
diff --git a/docs-xml/manpages-3/idmap_adex.8.xml b/docs-xml/manpages-3/idmap_adex.8.xml
new file mode 100644 (file)
index 0000000..9eb2ff7
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<refentry id="idmap_adex.8">
+
+<refmeta>
+       <refentrytitle>idmap_adex</refentrytitle>
+       <manvolnum>8</manvolnum>
+       <refmiscinfo class="source">Samba</refmiscinfo>
+       <refmiscinfo class="manual">System Administration tools</refmiscinfo>
+       <refmiscinfo class="version">3.2</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+       <refname>idmap_adex</refname>
+       <refpurpose>Samba's idmap_adex Backend for Winbind</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+       <title>DESCRIPTION</title>
+       <para>
+         The idmap_adex plugin provides a way for Winbind to read
+         id mappings from an AD server that uses RFC2307 schema
+         extensions. This module implements both the idmap and nss_info
+         APIs and supports domain trustes as well as two-way cross
+         forest trusts.  It is a read-only plugin requiring that the
+         administrator provide mappings in advance by adding the
+         POSIX attribute information to the users and groups objects
+         in AD.  The most common means of doing this is using &quot;Identity
+         Services for Unix&quot; support on Windows 2003 R2 and later.
+       </para>
+
+       <para>
+         Note that you must add the uidNumber, gidNumber, and uid
+         attributes to the partial attribute set of the forest global
+         catalog servers.  This can be done using the Active Directory Schema
+         Management MMC plugin (schmmgmt.dll).
+       </para>
+</refsynopsisdiv>
+
+<refsynopsisdiv>
+       <title>NSS_INFO</title>
+       <para>
+         The nss_info plugin supports reading the unixHomeDirectory,
+         gidNumber, loginShell, and uidNumber attributes from the user
+         object and the gidNumber attribute from the group object to
+         fill in information required by the libc getpwnam() and
+         getgrnam() family of functions.  Group membership is filled in
+         according to the Windows group membership and not the
+         msSFU30PosixMember attribute.
+       </para>
+
+       <para>
+         Username aliases are implement by setting the uid attribute
+         on the user object.  While group name aliases are implemented
+         by reading the displayname attribute from the group object.
+       </para>
+</refsynopsisdiv>
+
+<refsect1>
+       <title>EXAMPLES</title>
+       <para>
+         The following example shows how to retrieve idmappings and NSS data
+         from our principal and trusted AD domains.
+       </para>
+
+       <programlisting>
+       [global]
+       idmap backend = adex
+       idmap uid = 1000-4000000000
+       idmap gid = 1000-4000000000
+
+       winbind nss info = adex
+       winbind normalize names = yes
+       </programlisting>
+</refsect1>
+
+<refsect1>
+       <title>AUTHOR</title>
+
+       <para>
+       The original Samba software and related utilities
+       were created by Andrew Tridgell. Samba is now developed
+       by the Samba Team as an Open Source project similar
+       to the way the Linux kernel is developed.
+       </para>
+</refsect1>
+
+</refentry>
diff --git a/docs-xml/manpages-3/idmap_hash.8.xml b/docs-xml/manpages-3/idmap_hash.8.xml
new file mode 100644 (file)
index 0000000..8e452b3
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<refentry id="idmap_hash.8">
+
+<refmeta>
+       <refentrytitle>idmap_hash</refentrytitle>
+       <manvolnum>8</manvolnum>
+       <refmiscinfo class="source">Samba</refmiscinfo>
+       <refmiscinfo class="manual">System Administration tools</refmiscinfo>
+       <refmiscinfo class="version">3.2</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+       <refname>idmap_hash</refname>
+       <refpurpose>Samba's idmap_hash Backend for Winbind</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+       <title>DESCRIPTION</title>
+       <para>The idmap_hash plugin implements a hashing algorithm used
+         map SIDs for domain users and groups to a 31-bit uid and gid.
+         This plugin also implements the nss_info API and can be used
+         to support a local name mapping files if enabled via the
+         &quot;winbind normlaize names&quot; and &quot;winbind nss info&quot;
+         parameters in smb.conf.
+       </para>
+</refsynopsisdiv>
+
+<refsect1>
+       <title>IDMAP OPTIONS</title>
+
+       <variablelist>
+               <varlistentry>
+               <term>name_map</term>
+               <listitem><para>
+                   Specifies the absolute path to the name mapping
+                   file used by the nss_info API.  Entries in the file
+                   are of the form &quot;<replaceable>unix name</replaceable>
+                   = <replaceable>qualified domain name</replaceable>&quote;.
+                   Mapping of both user and group names is supported.
+               </para></listitem>
+               </varlistentry>
+       </variablelist>
+</refsect1>
+
+<refsect1>
+       <title>EXAMPLES</title>
+       <para>The following example utilizes the idmap_hash plugin for
+         the idmap and nss_info information.
+       </para>
+
+       <programlisting>
+       [global]
+       idmap backend = hash
+       idmap uid = 1000-4000000000
+       idmap gid = 1000-4000000000
+
+       winbind nss info = hash
+       winbind normalize names = yes
+       idmap_hash:name_map = /etc/samba/name_map.cfg
+       </programlisting>
+</refsect1>
+
+<refsect1>
+       <title>AUTHOR</title>
+
+       <para>
+       The original Samba software and related utilities
+       were created by Andrew Tridgell. Samba is now developed
+       by the Samba Team as an Open Source project similar
+       to the way the Linux kernel is developed.
+       </para>
+</refsect1>
+
+</refentry>
index cf7fd5a0f63d149900175568349bf45c3e725bf9..7f233c13862c79b65b2a02810a4338311d283e8f 100644 (file)
                </para></listitem>
                </varlistentry>
 
+               <varlistentry>
+               <term>mkhomedir</term>
+               <listitem><para>
+               Create homedirectory for a user on-the-fly, option is valid in
+               PAM session block.
+               </para></listitem>
+               </varlistentry>
+
                </variablelist>
 
 
diff --git a/docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml b/docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml
new file mode 100644 (file)
index 0000000..28c8413
--- /dev/null
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<refentry id="vfs_smb_traffic_analyzer.8">
+
+<refmeta>
+       <refentrytitle>smb_traffic_analyzer</refentrytitle>
+       <manvolnum>8</manvolnum>
+       <refmiscinfo class="source">Samba</refmiscinfo>
+       <refmiscinfo class="manual">System Administration tools</refmiscinfo>
+       <refmiscinfo class="version">3.3</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+       <refname>vfs_smb_traffic_analyzer</refname>
+       <refpurpose>log Samba VFS read and write operations through a socket
+       to a helper application</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+       <cmdsynopsis>
+               <command>vfs objects = smb_traffic_analyzer</command>
+       </cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1>
+       <title>DESCRIPTION</title>
+
+       <para>This VFS module is part of the
+       <citerefentry><refentrytitle>samba</refentrytitle>
+       <manvolnum>7</manvolnum></citerefentry> suite.</para>
+
+       <para>The <command>vfs_smb_traffic_analyzer</command> VFS module logs
+       client write and read operations on a Samba server and sends this data
+       over a socket to a helper program, which feeds a SQL database. More
+       information on the helper programs can be obtained from the
+       homepage of the project at:
+       http://holger123.wordpress.com/smb-traffic-analyzer/
+       </para>
+       <para><command>vfs_smb_traffic_analyzer</command> currently is aware
+       of the following VFS operations:</para>
+
+       <simplelist>
+        <member>write</member>
+        <member>pwrite</member>
+       <member>read</member>
+       <member>pread</member>
+       </simplelist>
+
+       <para><command>vfs_smb_traffic_analyzer</command> sends the following data
+       in a fixed format seperated by a comma through either an internet or a
+       unix domain socket:</para>
+       <programlisting>
+       BYTES|USER|DOMAIN|READ/WRITE|SHARE|FILENAME|TIMESTAMP
+       </programlisting>
+
+       <para>Description of the records:
+
+       <itemizedlist>
+       <listitem><para><command>BYTES</command> - the length in bytes of the VFS operation</para></listitem>
+       <listitem><para><command>USER</command> - the user who initiated the operation</para></listitem>
+       <listitem><para><command>DOMAIN</command> - the domain of the user</para></listitem>
+       <listitem><para><command>READ/WRITE</command> - either "W" for a write operation or "R" for read</para></listitem>
+       <listitem><para><command>SHARE</command> - the name of the share on which the VFS operation occured</para></listitem>
+       <listitem><para><command>FILENAME</command> - the name of the file that was used by the VFS operation</para></listitem>
+       <listitem><para><command>TIMESTAMP</command> - a timestamp, formatted as "yyyy-mm-dd hh-mm-ss.ms" indicating when the VFS operation occured</para></listitem>
+       </itemizedlist>
+
+       </para>
+
+       <para>This module is stackable.</para>
+
+</refsect1>
+
+
+<refsect1>
+       <title>OPTIONS</title>
+
+       <variablelist>
+
+               <varlistentry>
+                <term>smb_traffic_analyzer:mode = STRING</term>
+                <listitem>
+                <para>If STRING matches to "unix_domain_socket", the module will
+               use a unix domain socket located at /var/tmp/stadsocket, if
+               STRING contains an different string or is not defined, the module will
+               use an internet domain socket for data transfer.</para>
+
+                </listitem>
+                </varlistentry>
+
+
+               <varlistentry>
+               <term>smb_traffic_analyzer:host = STRING</term>
+               <listitem>
+               <para>The module will send the data to the system named with
+               the hostname STRING.</para>
+
+               </listitem>
+               </varlistentry>
+
+               <varlistentry>
+               <term>smb_traffic_analyzer:port = STRING</term>
+               <listitem>
+               <para>The module will send the data using the TCP port given
+               in STRING
+               </para>
+
+               </listitem>
+               </varlistentry>
+
+
+       </variablelist>
+</refsect1>
+
+<refsect1>
+       <title>EXAMPLES</title>
+
+       <para>The module running on share "example_share", using a unix domain socket</para>
+       <programlisting>
+       <smbconfsection name="[example_share]"/>
+       <smbconfoption name="path">/data/example</smbconfoption>
+       <smbconfoption name="vfs objects">smb_traffic_analyzer</smbconfoption>
+       <smbconfoption name="smb_traffic_analyzer:mode">unix_domain_socket</smbconfoption>
+       </programlisting>
+
+       <para>The module running on share "example_share", using an internet domain socket,
+       connecting to host "examplehost" on port 3491.</para>
+       <programlisting>
+       <smbconfsection name="[example_share]"/>
+       <smbconfoption name="path">/data/example</smbconfoption>
+       <smbconfoption name="vfs objects">smb_traffic_analyzer</smbconfoption>
+       <smbconfoption name="smb_traffic_analyzer:host">examplehost</smbconfoption>
+       <smbconfoption name="smb_traffic_analyzer:port">3490</smbconfoption>
+       </programlisting>
+
+</refsect1>
+
+<refsect1>
+       <title>VERSION</title>
+       <para>This man page is correct for version 3.3 of the Samba suite.
+       </para>
+</refsect1>
+
+<refsect1>
+       <title>AUTHOR</title>
+
+       <para>The original Samba software and related utilities
+       were created by Andrew Tridgell. Samba is now developed
+       by the Samba Team as an Open Source project similar
+       to the way the Linux kernel is developed.</para>
+
+       <para>The original version of the VFS module and the
+       helper tools were created by Holger Hetterich.</para>
+</refsect1>
+
+</refentry>
diff --git a/docs-xml/smbdotconf/printing/cupsconnectiontimeout.xml b/docs-xml/smbdotconf/printing/cupsconnectiontimeout.xml
new file mode 100644 (file)
index 0000000..1c7df15
--- /dev/null
@@ -0,0 +1,20 @@
+<samba:parameter name="cups connection timeout"
+                 context="G"
+                type="integer"
+                print="1"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+    <para>
+    This parameter is only applicable if <smbconfoption name="printing"/> is set to <constant>cups</constant>.
+    </para>
+
+   <para>
+   If set, this option specifies the number of seconds that smbd will wait
+   whilst trying to contact to the CUPS server. The connection will fail
+   if it takes longer than this number of seconds.
+   </para>
+</description>
+
+<value type="default">30</value>
+<value type="example">60</value>
+</samba:parameter>
index 28826cf5f36260695f822e81f1973f25c0a933b9..5b68bca9124b9ba4959d0376137d9a50272ab206 100644 (file)
@@ -5,14 +5,25 @@
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
        <para>This parameter controls whether winbindd will replace
-       whitespace in user and group names with an underscore (_) character.
-       For example, whether the name &quot;Space Kadet&quot; should be
-       replaced with the string &quot;space_kadet&quot;.
-       Frequently Unix shell scripts will have difficulty with usernames 
-       contains whitespace due to the default field separator in the shell.
-       Do not enable this option if the underscore character is used in
-       account names within your domain
-       </para>
+         whitespace in user and group names with an underscore (_) character.
+         For example, whether the name &quot;Space Kadet&quot; should be
+         replaced with the string &quot;space_kadet&quot;.
+         Frequently Unix shell scripts will have difficulty with usernames
+         contains whitespace due to the default field separator in the shell.
+         If your domain possesses names containing the underscore character,
+         this option may cause problems unless the name aliasing feature
+         is supported by your nss_info plugin.
+        </para>
+
+       <para>This feature also enables the name aliasing API which can
+         be used to make domain user and group names to a non-qlaified
+         version.  Please refer to the manpage for the configured
+         idmap and nss_info plugin for the specifics on how to configure
+         name aliasing for a specific configuration.  Name aliasing takes
+         precendence (and is mutually exclusive) over the whitespace
+         replacement mechanism discussed previsouly.
+         </para>
+
 </description>
 
 <value type="default">no</value>
index 89d8ce5239a68a388607334ea2086dc930e5caf6..3df1fcd5bfb98d9c87191967e5824361a9d87eb3 100644 (file)
@@ -315,7 +315,7 @@ static size_t skel_get_nt_acl(vfs_handle_struct *handle,
 }
 
 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-       uint32 security_info_sent, SEC_DESC *psd)
+       uint32 security_info_sent, const SEC_DESC *psd)
 {
        errno = ENOSYS;
        return NT_STATUS_NOT_IMPLEMENTED;
index ea8530d855effd1ba701a5e749dfd93f338f50a9..e6dee97775b92070b19dedd2a144e6d154450e10 100644 (file)
@@ -302,7 +302,7 @@ static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
 }
 
 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-       uint32 security_info_sent, SEC_DESC *psd)
+       uint32 security_info_sent, const SEC_DESC *psd)
 {
        return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
 }
index a9e02a833a526f647ce7838a44e08a3ef5bd2dad..dd0b112f30424e8df3e956d9f9d6defd5a9435c2 100644 (file)
@@ -33,3 +33,6 @@
 
 # omit pam conversations
 ;silent = no
+
+# create homedirectory on the fly
+;mkhomedir = no
similarity index 98%
rename from source4/lib/crypto/arcfour.c
rename to lib/crypto/arcfour.c
index 94196fa1ee136953f7881a1ec86c059437fd9200..c57e05d0e9175c0d4615fea2952b50d25f89e23e 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 #include "includes.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/arcfour.h"
 
 /* initialise the arcfour sbox with key */
 _PUBLIC_ void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key) 
diff --git a/lib/crypto/arcfour.h b/lib/crypto/arcfour.h
new file mode 100644 (file)
index 0000000..501b3f2
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef ARCFOUR_HEADER_H
+#define ARCFOUR_HEADER_H
+
+struct arcfour_state {
+       uint8_t sbox[256];
+       uint8_t index_i;
+       uint8_t index_j;
+};
+
+void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key);
+void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data, int len);
+void arcfour_crypt_blob(uint8_t *data, int len, const DATA_BLOB *key);
+void arcfour_crypt(uint8_t *data, const uint8_t keystr[16], int len);
+
+#endif /* ARCFOUR_HEADER_H */
similarity index 70%
rename from source4/libcli/drsblobs.h
rename to lib/crypto/crypto.h
index 8fee4114beae50ca286bae44faeec882e05b14ca..0a43cbe7d44b1ae698d6abbbda92ca50365e55de 100644 (file)
@@ -1,9 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
 
-   Manually parsed structures found in the DRS protocol
-
-   Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008
+   Copyright (C) Andrew Tridgell 2004
    
    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
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef __LIBCLI_DRSBLOBS_H__
-#define __LIBCLI_DRSBLOBS_H__
+#include "../lib/crypto/crc32.h"
+#include "../lib/crypto/md4.h"
+#include "../lib/crypto/md5.h"
+#include "../lib/crypto/hmacmd5.h"
+#include "../lib/crypto/sha256.h"
+#include "../lib/crypto/hmacsha256.h"
+#include "../lib/crypto/arcfour.h"
 
-#include "librpc/gen_ndr/ndr_drsblobs.h"
 
-#include "libcli/drsblobs_proto.h"
-#endif /* __CLDAP_SERVER_PROTO_H__ */
similarity index 99%
rename from source4/lib/crypto/hmacmd5.c
rename to lib/crypto/hmacmd5.c
index 3a9ec38a27cb6b4e3db9aaf69d3815bcd33e6efb..0c8d1ab59835e77e79715009d9aa440c398c3b2c 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/hmacmd5.h"
 
 /***********************************************************************
  the rfc 2104 version of hmac_md5 initialisation.
similarity index 96%
rename from source4/lib/crypto/hmacmd5.h
rename to lib/crypto/hmacmd5.h
index 5769737fcd65184add820e28dd54c69a8b2536c9..91b8ca586c840cd3a07dc8f311b0c1ef845de4eb 100644 (file)
@@ -19,6 +19,9 @@
 */
 
 #ifndef _HMAC_MD5_H
+#define _HMAC_MD5_H
+
+#include "../lib/crypto/md5.h"
 
 typedef struct 
 {
similarity index 99%
rename from source4/lib/crypto/hmacmd5test.c
rename to lib/crypto/hmacmd5test.c
index 07ed54c98d2822dda3f63e9970e9b7a5a4381641..0a98404eda3a53b144e0d2ed12038717e787221b 100644 (file)
@@ -17,7 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include "includes.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
 
 struct torture_context;
 
similarity index 98%
rename from source4/lib/crypto/hmacsha256.c
rename to lib/crypto/hmacsha256.c
index 6b0af9ee8350ee1306c2c442dfca877e45dded22..53d4fe388396417dddba4aa56085dc7afaab93da 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 #include "includes.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
 
 /***********************************************************************
  the rfc 2104/2202 version of hmac_sha256 initialisation.
similarity index 100%
rename from source4/lib/crypto/md4.c
rename to lib/crypto/md4.c
similarity index 100%
rename from source4/lib/crypto/md4.h
rename to lib/crypto/md4.h
similarity index 98%
rename from source4/lib/crypto/md4test.c
rename to lib/crypto/md4test.c
index 5e0451973c8e07ca1f0eb44f10a0d77dbc88798f..dddf9e61a011707bbb3d9102fffffbcae8d429ed 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "includes.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
 
 struct torture_context;
 
similarity index 100%
rename from source4/lib/crypto/md5.c
rename to lib/crypto/md5.c
similarity index 100%
rename from source4/lib/crypto/md5.h
rename to lib/crypto/md5.h
similarity index 98%
rename from source4/lib/crypto/md5test.c
rename to lib/crypto/md5test.c
index 702e0fcf416c3ed36df36cc6e3e1d9179796398d..1244dca75377e3a79155d447cf67068227a80c48 100644 (file)
@@ -18,7 +18,7 @@
 */
 
 #include "includes.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
 
 struct torture_context;
 
index c989835a8d37b29cee7e63451be470f2a4dd6194..65f8125efdeb07c3f8fed6d918457cbf9f42fb8d 100644 (file)
@@ -9,7 +9,8 @@ libdir = @libdir@
 VPATH = @libreplacedir@
 srcdir = @srcdir@
 builddir = @builddir@
-INSTALL = @INSTALL@
+sharedbuilddir = @sharedbuilddir@
+INSTALLCMD = @INSTALL@
 LIBS = @LIBS@
 
 .PHONY: test all showflags install installcheck clean distclean realdistclean
@@ -29,8 +30,14 @@ showflags:
        @echo '  LIBS   = $(LIBS)'
 
 install: all
-       mkdir -p $(libdir)
-       $(INSTALL) libreplace.a $(libdir)
+       ${INSTALLCMD} -d $(libdir)
+       ${INSTALLCMD} -m 644 libreplace.a $(libdir)
+
+shared-build: all
+       ${INSTALLCMD} -d $(sharedbuilddir)/include
+       ${INSTALLCMD} -m 644 replace.h $(sharedbuilddir)/include
+       ${INSTALLCMD} -d $(sharedbuilddir)/lib
+       ${INSTALLCMD} -m 644 libreplace.a $(sharedbuilddir)/lib
 
 libreplace.a: $(OBJS)
        ar -rcsv $@ $(OBJS)
@@ -40,7 +47,7 @@ test: all
 
 installcheck: install test
 
-TEST_OBJS = test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
+TEST_OBJS = test/main.o test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
 
 testsuite: libreplace.a $(TEST_OBJS)
        $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS) $(LIBS)
diff --git a/lib/replace/build_macros.m4 b/lib/replace/build_macros.m4
new file mode 100644 (file)
index 0000000..c036668
--- /dev/null
@@ -0,0 +1,14 @@
+AC_DEFUN(BUILD_WITH_SHARED_BUILD_DIR,
+  [ AC_ARG_WITH([shared-build-dir],
+                [AC_HELP_STRING([--with-shared-build-dir=DIR],
+                                [temporary build directory where libraries are installed [$srcdir/sharedbuild]])])
+
+    sharedbuilddir="$srcdir/sharedbuild"
+    if test x"$with_shared_build_dir" != x; then
+        sharedbuilddir=$with_shared_build_dir
+        CFLAGS="$CFLAGS -I$with_shared_build_dir/include"
+        LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib"
+    fi
+    AC_SUBST(sharedbuilddir)
+  ])
+
index 81997e09b7d00f46de3433a3031ffce32a025f2f..0361825a022d992992da4c2998596c3397b32edb 100644 (file)
@@ -22,6 +22,9 @@ if test "$ac_cv_prog_gcc" = yes; then
    CFLAGS="$CFLAGS -Wno-format-y2k"
 fi
 
+m4_include(build_macros.m4)
+BUILD_WITH_SHARED_BUILD_DIR
+
 LIBS="${LIBREPLACE_NETWORK_LIBS}"
 AC_SUBST(LIBS)
 
index dc7d88e6e183b02f01486683a8466fca3f17cbd4..e563acfd794c2aee249a41ee1beb3a3d79f916ff 100644 (file)
@@ -5,7 +5,7 @@ echo "LIBREPLACE_LOCATION_CHECKS: START"
 dnl find the libreplace sources. This is meant to work both for 
 dnl libreplace standalone builds, and builds of packages using libreplace
 libreplacedir=""
-libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace"
+libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace $srcdir/../../../lib/replace"
 for d in $libreplacepaths; do
        if test -f "$d/replace.c"; then
                libreplacedir="$d"              
@@ -34,7 +34,7 @@ echo "LIBREPLACE_BROKEN_CHECKS: START"
 dnl find the libreplace sources. This is meant to work both for 
 dnl libreplace standalone builds, and builds of packages using libreplace
 libreplacedir=""
-libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace"
+libreplacepaths="$srcdir $srcdir/lib/replace $srcdir/libreplace $srcdir/../libreplace $srcdir/../replace $srcdir/../lib/replace $srcdir/../../../lib/replace"
 for d in $libreplacepaths; do
        if test -f "$d/replace.c"; then
                libreplacedir="$d"              
diff --git a/lib/replace/test/main.c b/lib/replace/test/main.c
new file mode 100644 (file)
index 0000000..9bd1284
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   libreplace tests
+
+   Copyright (C) Jelmer Vernooij 2006
+
+     ** NOTE! The following LGPL license applies to the talloc
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+
+struct torture_context;
+bool torture_local_replace(struct torture_context *ctx);
+
+int main(void)
+{
+       bool ret = torture_local_replace(NULL);
+       if (ret)
+               return 0;
+       return -1;
+}
index 1e8290906e18b039505582769b3e59b4495649a3..7929f11addf0a660ba9ca6e19ca4d02f420339eb 100644 (file)
@@ -1068,13 +1068,3 @@ bool torture_local_replace(struct torture_context *ctx)
 
        return ret;
 }
-
-#if _SAMBA_BUILD_<4
-int main(void)
-{
-       bool ret = torture_local_replace(NULL);
-       if (ret) 
-               return 0;
-       return -1;
-}
-#endif
index e8d27adc37fd8487a128c675aff582e009cc11c7..9d619769507792cef1984f36b20e67539180dd93 100644 (file)
@@ -750,7 +750,7 @@ static struct swrap_packet *swrap_packet_init(struct timeval *tval,
                                              int socket_type,
                                              const unsigned char *payload,
                                              size_t payload_len,
-                                             unsigned long tcp_seq,
+                                             unsigned long tcp_seqno,
                                              unsigned long tcp_ack,
                                              unsigned char tcp_ctl,
                                              int unreachable,
@@ -852,7 +852,7 @@ static struct swrap_packet *swrap_packet_init(struct timeval *tval,
        case SOCK_STREAM:
                packet->ip.p.tcp.source_port    = src_port;
                packet->ip.p.tcp.dest_port      = dest_port;
-               packet->ip.p.tcp.seq_num        = htonl(tcp_seq);
+               packet->ip.p.tcp.seq_num        = htonl(tcp_seqno);
                packet->ip.p.tcp.ack_num        = htonl(tcp_ack);
                packet->ip.p.tcp.hdr_length     = 0x50; /* 5 * 32 bit words */
                packet->ip.p.tcp.control        = tcp_ctl;
@@ -916,7 +916,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
 {
        const struct sockaddr_in *src_addr;
        const struct sockaddr_in *dest_addr;
-       unsigned long tcp_seq = 0;
+       unsigned long tcp_seqno = 0;
        unsigned long tcp_ack = 0;
        unsigned char tcp_ctl = 0;
        int unreachable = 0;
@@ -937,7 +937,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                src_addr = (const struct sockaddr_in *)si->myname;
                dest_addr = (const struct sockaddr_in *)addr;
 
-               tcp_seq = si->io.pck_snd;
+               tcp_seqno = si->io.pck_snd;
                tcp_ack = si->io.pck_rcv;
                tcp_ctl = 0x02; /* SYN */
 
@@ -951,7 +951,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                dest_addr = (const struct sockaddr_in *)si->myname;
                src_addr = (const struct sockaddr_in *)addr;
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x12; /** SYN,ACK */
 
@@ -966,7 +966,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                src_addr = (const struct sockaddr_in *)addr;
 
                /* Unreachable: resend the data of SWRAP_CONNECT_SEND */
-               tcp_seq = si->io.pck_snd - 1;
+               tcp_seqno = si->io.pck_snd - 1;
                tcp_ack = si->io.pck_rcv;
                tcp_ctl = 0x02; /* SYN */
                unreachable = 1;
@@ -979,7 +979,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                src_addr = (const struct sockaddr_in *)si->myname;
                dest_addr = (const struct sockaddr_in *)addr;
 
-               tcp_seq = si->io.pck_snd;
+               tcp_seqno = si->io.pck_snd;
                tcp_ack = si->io.pck_rcv;
                tcp_ctl = 0x10; /* ACK */
 
@@ -991,7 +991,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                dest_addr = (const struct sockaddr_in *)si->myname;
                src_addr = (const struct sockaddr_in *)addr;
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x02; /* SYN */
 
@@ -1005,7 +1005,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                src_addr = (const struct sockaddr_in *)si->myname;
                dest_addr = (const struct sockaddr_in *)addr;
 
-               tcp_seq = si->io.pck_snd;
+               tcp_seqno = si->io.pck_snd;
                tcp_ack = si->io.pck_rcv;
                tcp_ctl = 0x12; /* SYN,ACK */
 
@@ -1019,7 +1019,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                dest_addr = (const struct sockaddr_in *)si->myname;
                src_addr = (const struct sockaddr_in *)addr;
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x10; /* ACK */
 
@@ -1029,7 +1029,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                src_addr = (const struct sockaddr_in *)si->myname;
                dest_addr = (const struct sockaddr_in *)si->peername;
 
-               tcp_seq = si->io.pck_snd;
+               tcp_seqno = si->io.pck_snd;
                tcp_ack = si->io.pck_rcv;
                tcp_ctl = 0x18; /* PSH,ACK */
 
@@ -1047,7 +1047,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                                          buf, len, packet_len);
                }
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x14; /** RST,ACK */
 
@@ -1061,7 +1061,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                        return NULL;
                }
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x14; /* RST,ACK */
 
@@ -1071,7 +1071,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                dest_addr = (const struct sockaddr_in *)si->myname;
                src_addr = (const struct sockaddr_in *)si->peername;
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x18; /* PSH,ACK */
 
@@ -1087,7 +1087,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                        return NULL;
                }
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x14; /* RST,ACK */
 
@@ -1123,7 +1123,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                src_addr = (const struct sockaddr_in *)si->myname;
                dest_addr = (const struct sockaddr_in *)si->peername;
 
-               tcp_seq = si->io.pck_snd;
+               tcp_seqno = si->io.pck_snd;
                tcp_ack = si->io.pck_rcv;
                tcp_ctl = 0x11; /* FIN, ACK */
 
@@ -1137,7 +1137,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                dest_addr = (const struct sockaddr_in *)si->myname;
                src_addr = (const struct sockaddr_in *)si->peername;
 
-               tcp_seq = si->io.pck_rcv;
+               tcp_seqno = si->io.pck_rcv;
                tcp_ack = si->io.pck_snd;
                tcp_ctl = 0x11; /* FIN,ACK */
 
@@ -1151,7 +1151,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
                src_addr = (const struct sockaddr_in *)si->myname;
                dest_addr = (const struct sockaddr_in *)si->peername;
 
-               tcp_seq = si->io.pck_snd;
+               tcp_seqno = si->io.pck_snd;
                tcp_ack = si->io.pck_rcv;
                tcp_ctl = 0x10; /* ACK */
 
@@ -1164,7 +1164,7 @@ static struct swrap_packet *swrap_marshall_packet(struct socket_info *si,
 
        return swrap_packet_init(&tv, src_addr, dest_addr, si->type,
                                   (const unsigned char *)buf, len,
-                                  tcp_seq, tcp_ack, tcp_ctl, unreachable,
+                                  tcp_seqno, tcp_ack, tcp_ctl, unreachable,
                                   packet_len);
 }
 
similarity index 77%
rename from source4/script/harness2subunit.pl
rename to lib/subunit/harness2subunit.pl
index 9f2391ad6c30f4cfc390ed93fe569d7c6639b5ab..45f515540b0975738c060b24839f0fd873d1ae57 100755 (executable)
@@ -1,4 +1,8 @@
 #!/usr/bin/perl
+# Simple script that converts Perl test harness output to 
+# Subunit
+# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
+# Published under the GNU GPL, v3 or later
 
 my $firstline = 1;
 my $error = 0;
diff --git a/lib/subunit/python/subunit/tests/TestUtil.py b/lib/subunit/python/subunit/tests/TestUtil.py
new file mode 100644 (file)
index 0000000..1b5ba9c
--- /dev/null
@@ -0,0 +1,80 @@
+# Copyright (c) 2004 Canonical Limited
+#       Author: Robert Collins <robert.collins@canonical.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+import sys
+import logging
+import unittest
+
+
+class LogCollector(logging.Handler):
+    def __init__(self):
+        logging.Handler.__init__(self)
+        self.records=[]
+    def emit(self, record):
+        self.records.append(record.getMessage())
+
+
+def makeCollectingLogger():
+    """I make a logger instance that collects its logs for programmatic analysis
+    -> (logger, collector)"""
+    logger=logging.Logger("collector")
+    handler=LogCollector()
+    handler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+    logger.addHandler(handler)
+    return logger, handler
+
+
+def visitTests(suite, visitor):
+    """A foreign method for visiting the tests in a test suite."""
+    for test in suite._tests:
+        #Abusing types to avoid monkey patching unittest.TestCase.
+        # Maybe that would be better?
+        try:
+            test.visit(visitor)
+        except AttributeError:
+            if isinstance(test, unittest.TestCase):
+                visitor.visitCase(test)
+            elif isinstance(test, unittest.TestSuite):
+                visitor.visitSuite(test)
+                visitTests(test, visitor)
+            else:
+                print "unvisitable non-unittest.TestCase element %r (%r)" % (test, test.__class__)
+
+
+class TestSuite(unittest.TestSuite):
+    """I am an extended TestSuite with a visitor interface.
+    This is primarily to allow filtering of tests - and suites or
+    more in the future. An iterator of just tests wouldn't scale..."""
+
+    def visit(self, visitor):
+        """visit the composite. Visiting is depth-first.
+        current callbacks are visitSuite and visitCase."""
+        visitor.visitSuite(self)
+        visitTests(self, visitor)
+
+
+class TestLoader(unittest.TestLoader):
+    """Custome TestLoader to set the right TestSuite class."""
+    suiteClass = TestSuite
+
+class TestVisitor(object):
+    """A visitor for Tests"""
+    def visitSuite(self, aTestSuite):
+        pass
+    def visitCase(self, aTestCase):
+        pass
diff --git a/lib/subunit/python/subunit/tests/__init__.py b/lib/subunit/python/subunit/tests/__init__.py
new file mode 100644 (file)
index 0000000..544d0e7
--- /dev/null
@@ -0,0 +1,25 @@
+#
+#  subunit: extensions to python unittest to get test results from subprocesses.
+#  Copyright (C) 2005  Robert Collins <robertc@robertcollins.net>
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+from subunit.tests import TestUtil, test_test_protocol
+
+def test_suite():
+    result = TestUtil.TestSuite()
+    result.addTest(test_test_protocol.test_suite())
+    return result
diff --git a/lib/subunit/python/subunit/tests/sample-script.py b/lib/subunit/python/subunit/tests/sample-script.py
new file mode 100755 (executable)
index 0000000..223d2f5
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+import sys
+print "test old mcdonald"
+print "success old mcdonald"
+print "test bing crosby"
+print "failure bing crosby ["
+print "foo.c:53:ERROR invalid state"
+print "]"
+print "test an error"
+print "error an error"
+sys.exit(0)
diff --git a/lib/subunit/python/subunit/tests/sample-two-script.py b/lib/subunit/python/subunit/tests/sample-two-script.py
new file mode 100755 (executable)
index 0000000..d555084
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+import sys
+print "test old mcdonald"
+print "success old mcdonald"
+print "test bing crosby"
+print "success bing crosby"
+sys.exit(0)
diff --git a/lib/subunit/python/subunit/tests/test_test_protocol.py b/lib/subunit/python/subunit/tests/test_test_protocol.py
new file mode 100644 (file)
index 0000000..af31584
--- /dev/null
@@ -0,0 +1,730 @@
+#
+#  subunit: extensions to python unittest to get test results from subprocesses.
+#  Copyright (C) 2005  Robert Collins <robertc@robertcollins.net>
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+import unittest
+from StringIO import StringIO
+import os
+import subunit
+import sys
+
+try:
+    class MockTestProtocolServerClient(object):
+        """A mock protocol server client to test callbacks."""
+
+        def __init__(self):
+            self.end_calls = []
+            self.error_calls = []
+            self.failure_calls = []
+            self.start_calls = []
+            self.success_calls = []
+            super(MockTestProtocolServerClient, self).__init__()
+
+        def addError(self, test, error):
+            self.error_calls.append((test, error))
+
+        def addFailure(self, test, error):
+            self.failure_calls.append((test, error))
+
+        def addSuccess(self, test):
+            self.success_calls.append(test)
+
+        def stopTest(self, test):
+            self.end_calls.append(test)
+
+        def startTest(self, test):
+            self.start_calls.append(test)
+
+except AttributeError:
+    MockTestProtocolServer = None
+
+
+class TestMockTestProtocolServer(unittest.TestCase):
+
+    def test_start_test(self):
+        protocol = MockTestProtocolServerClient()
+        protocol.startTest(subunit.RemotedTestCase("test old mcdonald"))
+        self.assertEqual(protocol.start_calls,
+                         [subunit.RemotedTestCase("test old mcdonald")])
+        self.assertEqual(protocol.end_calls, [])
+        self.assertEqual(protocol.error_calls, [])
+        self.assertEqual(protocol.failure_calls, [])
+        self.assertEqual(protocol.success_calls, [])
+
+    def test_add_error(self):
+        protocol = MockTestProtocolServerClient()
+        protocol.addError(subunit.RemotedTestCase("old mcdonald"),
+                          subunit.RemoteError("omg it works"))
+        self.assertEqual(protocol.start_calls, [])
+        self.assertEqual(protocol.end_calls, [])
+        self.assertEqual(protocol.error_calls, [(
+                            subunit.RemotedTestCase("old mcdonald"),
+                            subunit.RemoteError("omg it works"))])
+        self.assertEqual(protocol.failure_calls, [])
+        self.assertEqual(protocol.success_calls, [])
+
+    def test_add_failure(self):
+        protocol = MockTestProtocolServerClient()
+        protocol.addFailure(subunit.RemotedTestCase("old mcdonald"),
+                            subunit.RemoteError("omg it works"))
+        self.assertEqual(protocol.start_calls, [])
+        self.assertEqual(protocol.end_calls, [])
+        self.assertEqual(protocol.error_calls, [])
+        self.assertEqual(protocol.failure_calls, [
+                            (subunit.RemotedTestCase("old mcdonald"),
+                             subunit.RemoteError("omg it works"))])
+        self.assertEqual(protocol.success_calls, [])
+
+    def test_add_success(self):
+        protocol = MockTestProtocolServerClient()
+        protocol.addSuccess(subunit.RemotedTestCase("test old mcdonald"))
+        self.assertEqual(protocol.start_calls, [])
+        self.assertEqual(protocol.end_calls, [])
+        self.assertEqual(protocol.error_calls, [])
+        self.assertEqual(protocol.failure_calls, [])
+        self.assertEqual(protocol.success_calls,
+                         [subunit.RemotedTestCase("test old mcdonald")])
+
+    def test_end_test(self):
+        protocol = MockTestProtocolServerClient()
+        protocol.stopTest(subunit.RemotedTestCase("test old mcdonald"))
+        self.assertEqual(protocol.end_calls,
+                         [subunit.RemotedTestCase("test old mcdonald")])
+        self.assertEqual(protocol.error_calls, [])
+        self.assertEqual(protocol.failure_calls, [])
+        self.assertEqual(protocol.success_calls, [])
+        self.assertEqual(protocol.start_calls, [])
+
+
+class TestTestImports(unittest.TestCase):
+
+    def test_imports(self):
+        from subunit import TestProtocolServer
+        from subunit import RemotedTestCase
+        from subunit import RemoteError
+        from subunit import ExecTestCase
+        from subunit import IsolatedTestCase
+        from subunit import TestProtocolClient
+
+
+class TestTestProtocolServerPipe(unittest.TestCase):
+
+    def test_story(self):
+        client = unittest.TestResult()
+        protocol = subunit.TestProtocolServer(client)
+        pipe = StringIO("test old mcdonald\n"
+                        "success old mcdonald\n"
+                        "test bing crosby\n"
+                        "failure bing crosby [\n"
+                        "foo.c:53:ERROR invalid state\n"
+                        "]\n"
+                        "test an error\n"
+                        "error an error\n")
+        protocol.readFrom(pipe)
+        mcdonald = subunit.RemotedTestCase("old mcdonald")
+        bing = subunit.RemotedTestCase("bing crosby")
+        an_error = subunit.RemotedTestCase("an error")
+        self.assertEqual(client.errors,
+                         [(an_error, 'RemoteException: \n\n')])
+        self.assertEqual(
+            client.failures,
+            [(bing, "RemoteException: foo.c:53:ERROR invalid state\n\n")])
+        self.assertEqual(client.testsRun, 3)
+
+
+class TestTestProtocolServerStartTest(unittest.TestCase):
+
+    def setUp(self):
+        self.client = MockTestProtocolServerClient()
+        self.protocol = subunit.TestProtocolServer(self.client)
+
+    def test_start_test(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.assertEqual(self.client.start_calls,
+                         [subunit.RemotedTestCase("old mcdonald")])
+
+    def test_start_testing(self):
+        self.protocol.lineReceived("testing old mcdonald\n")
+        self.assertEqual(self.client.start_calls,
+                         [subunit.RemotedTestCase("old mcdonald")])
+
+    def test_start_test_colon(self):
+        self.protocol.lineReceived("test: old mcdonald\n")
+        self.assertEqual(self.client.start_calls,
+                         [subunit.RemotedTestCase("old mcdonald")])
+
+    def test_start_testing_colon(self):
+        self.protocol.lineReceived("testing: old mcdonald\n")
+        self.assertEqual(self.client.start_calls,
+                         [subunit.RemotedTestCase("old mcdonald")])
+
+
+class TestTestProtocolServerPassThrough(unittest.TestCase):
+
+    def setUp(self):
+        from StringIO import StringIO
+        self.stdout = StringIO()
+        self.test = subunit.RemotedTestCase("old mcdonald")
+        self.client = MockTestProtocolServerClient()
+        self.protocol = subunit.TestProtocolServer(self.client, self.stdout)
+
+    def keywords_before_test(self):
+        self.protocol.lineReceived("failure a\n")
+        self.protocol.lineReceived("failure: a\n")
+        self.protocol.lineReceived("error a\n")
+        self.protocol.lineReceived("error: a\n")
+        self.protocol.lineReceived("success a\n")
+        self.protocol.lineReceived("success: a\n")
+        self.protocol.lineReceived("successful a\n")
+        self.protocol.lineReceived("successful: a\n")
+        self.protocol.lineReceived("]\n")
+        self.assertEqual(self.stdout.getvalue(), "failure a\n"
+                                                 "failure: a\n"
+                                                 "error a\n"
+                                                 "error: a\n"
+                                                 "success a\n"
+                                                 "success: a\n"
+                                                 "successful a\n"
+                                                 "successful: a\n"
+                                                 "]\n")
+
+    def test_keywords_before_test(self):
+        self.keywords_before_test()
+        self.assertEqual(self.client.start_calls, [])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_keywords_after_error(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("error old mcdonald\n")
+        self.keywords_before_test()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls,
+                         [(self.test, subunit.RemoteError(""))])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_keywords_after_failure(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("failure old mcdonald\n")
+        self.keywords_before_test()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls,
+                         [(self.test, subunit.RemoteError())])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_keywords_after_success(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("success old mcdonald\n")
+        self.keywords_before_test()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [self.test])
+
+    def test_keywords_after_test(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("failure a\n")
+        self.protocol.lineReceived("failure: a\n")
+        self.protocol.lineReceived("error a\n")
+        self.protocol.lineReceived("error: a\n")
+        self.protocol.lineReceived("success a\n")
+        self.protocol.lineReceived("success: a\n")
+        self.protocol.lineReceived("successful a\n")
+        self.protocol.lineReceived("successful: a\n")
+        self.protocol.lineReceived("]\n")
+        self.protocol.lineReceived("failure old mcdonald\n")
+        self.assertEqual(self.stdout.getvalue(), "test old mcdonald\n"
+                                                 "failure a\n"
+                                                 "failure: a\n"
+                                                 "error a\n"
+                                                 "error: a\n"
+                                                 "success a\n"
+                                                 "success: a\n"
+                                                 "successful a\n"
+                                                 "successful: a\n"
+                                                 "]\n")
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.failure_calls,
+                         [(self.test, subunit.RemoteError())])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_keywords_during_failure(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("failure: old mcdonald [\n")
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("failure a\n")
+        self.protocol.lineReceived("failure: a\n")
+        self.protocol.lineReceived("error a\n")
+        self.protocol.lineReceived("error: a\n")
+        self.protocol.lineReceived("success a\n")
+        self.protocol.lineReceived("success: a\n")
+        self.protocol.lineReceived("successful a\n")
+        self.protocol.lineReceived("successful: a\n")
+        self.protocol.lineReceived(" ]\n")
+        self.protocol.lineReceived("]\n")
+        self.assertEqual(self.stdout.getvalue(), "")
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.failure_calls,
+                         [(self.test, subunit.RemoteError("test old mcdonald\n"
+                                                  "failure a\n"
+                                                  "failure: a\n"
+                                                  "error a\n"
+                                                  "error: a\n"
+                                                  "success a\n"
+                                                  "success: a\n"
+                                                  "successful a\n"
+                                                  "successful: a\n"
+                                                  "]\n"))])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_stdout_passthrough(self):
+        """Lines received which cannot be interpreted as any protocol action
+        should be passed through to sys.stdout.
+        """
+        bytes = "randombytes\n"
+        self.protocol.lineReceived(bytes)
+        self.assertEqual(self.stdout.getvalue(), bytes)
+
+
+class TestTestProtocolServerLostConnection(unittest.TestCase):
+
+    def setUp(self):
+        self.client = MockTestProtocolServerClient()
+        self.protocol = subunit.TestProtocolServer(self.client)
+        self.test = subunit.RemotedTestCase("old mcdonald")
+
+    def test_lost_connection_no_input(self):
+        self.protocol.lostConnection()
+        self.assertEqual(self.client.start_calls, [])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_lost_connection_after_start(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lostConnection()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [
+            (self.test, subunit.RemoteError("lost connection during "
+                                            "test 'old mcdonald'"))])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_lost_connected_after_error(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("error old mcdonald\n")
+        self.protocol.lostConnection()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [
+            (self.test, subunit.RemoteError(""))])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_lost_connection_during_error(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("error old mcdonald [\n")
+        self.protocol.lostConnection()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [
+            (self.test, subunit.RemoteError("lost connection during error "
+                                            "report of test 'old mcdonald'"))])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_lost_connected_after_failure(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("failure old mcdonald\n")
+        self.protocol.lostConnection()
+        test = subunit.RemotedTestCase("old mcdonald")
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls,
+                         [(self.test, subunit.RemoteError())])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_lost_connection_during_failure(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("failure old mcdonald [\n")
+        self.protocol.lostConnection()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls,
+                         [(self.test,
+                           subunit.RemoteError("lost connection during "
+                                               "failure report"
+                                               " of test 'old mcdonald'"))])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [])
+
+    def test_lost_connection_after_success(self):
+        self.protocol.lineReceived("test old mcdonald\n")
+        self.protocol.lineReceived("success old mcdonald\n")
+        self.protocol.lostConnection()
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls, [])
+        self.assertEqual(self.client.success_calls, [self.test])
+
+
+class TestTestProtocolServerAddError(unittest.TestCase):
+
+    def setUp(self):
+        self.client = MockTestProtocolServerClient()
+        self.protocol = subunit.TestProtocolServer(self.client)
+        self.protocol.lineReceived("test mcdonalds farm\n")
+        self.test = subunit.RemotedTestCase("mcdonalds farm")
+
+    def simple_error_keyword(self, keyword):
+        self.protocol.lineReceived("%s mcdonalds farm\n" % keyword)
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [
+            (self.test, subunit.RemoteError(""))])
+        self.assertEqual(self.client.failure_calls, [])
+
+    def test_simple_error(self):
+        self.simple_error_keyword("error")
+
+    def test_simple_error_colon(self):
+        self.simple_error_keyword("error:")
+
+    def test_error_empty_message(self):
+        self.protocol.lineReceived("error mcdonalds farm [\n")
+        self.protocol.lineReceived("]\n")
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [
+            (self.test, subunit.RemoteError(""))])
+        self.assertEqual(self.client.failure_calls, [])
+
+    def error_quoted_bracket(self, keyword):
+        self.protocol.lineReceived("%s mcdonalds farm [\n" % keyword)
+        self.protocol.lineReceived(" ]\n")
+        self.protocol.lineReceived("]\n")
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [
+            (self.test, subunit.RemoteError("]\n"))])
+        self.assertEqual(self.client.failure_calls, [])
+
+    def test_error_quoted_bracket(self):
+        self.error_quoted_bracket("error")
+
+    def test_error_colon_quoted_bracket(self):
+        self.error_quoted_bracket("error:")
+
+
+class TestTestProtocolServerAddFailure(unittest.TestCase):
+
+    def setUp(self):
+        self.client = MockTestProtocolServerClient()
+        self.protocol = subunit.TestProtocolServer(self.client)
+        self.protocol.lineReceived("test mcdonalds farm\n")
+        self.test = subunit.RemotedTestCase("mcdonalds farm")
+
+    def simple_failure_keyword(self, keyword):
+        self.protocol.lineReceived("%s mcdonalds farm\n" % keyword)
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls,
+                         [(self.test, subunit.RemoteError())])
+
+    def test_simple_failure(self):
+        self.simple_failure_keyword("failure")
+
+    def test_simple_failure_colon(self):
+        self.simple_failure_keyword("failure:")
+
+    def test_failure_empty_message(self):
+        self.protocol.lineReceived("failure mcdonalds farm [\n")
+        self.protocol.lineReceived("]\n")
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls,
+                         [(self.test, subunit.RemoteError())])
+
+    def failure_quoted_bracket(self, keyword):
+        self.protocol.lineReceived("%s mcdonalds farm [\n" % keyword)
+        self.protocol.lineReceived(" ]\n")
+        self.protocol.lineReceived("]\n")
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.failure_calls,
+                         [(self.test, subunit.RemoteError("]\n"))])
+
+    def test_failure_quoted_bracket(self):
+        self.failure_quoted_bracket("failure")
+
+    def test_failure_colon_quoted_bracket(self):
+        self.failure_quoted_bracket("failure:")
+
+
+class TestTestProtocolServerAddSuccess(unittest.TestCase):
+
+    def setUp(self):
+        self.client = MockTestProtocolServerClient()
+        self.protocol = subunit.TestProtocolServer(self.client)
+        self.protocol.lineReceived("test mcdonalds farm\n")
+        self.test = subunit.RemotedTestCase("mcdonalds farm")
+
+    def simple_success_keyword(self, keyword):
+        self.protocol.lineReceived("%s mcdonalds farm\n" % keyword)
+        self.assertEqual(self.client.start_calls, [self.test])
+        self.assertEqual(self.client.end_calls, [self.test])
+        self.assertEqual(self.client.error_calls, [])
+        self.assertEqual(self.client.success_calls, [self.test])
+
+    def test_simple_success(self):
+        self.simple_success_keyword("failure")
+
+    def test_simple_success_colon(self):
+        self.simple_success_keyword("failure:")
+
+    def test_simple_success(self):
+        self.simple_success_keyword("successful")
+
+    def test_simple_success_colon(self):
+        self.simple_success_keyword("successful:")
+
+
+class TestRemotedTestCase(unittest.TestCase):
+
+    def test_simple(self):
+        test = subunit.RemotedTestCase("A test description")
+        self.assertRaises(NotImplementedError, test.setUp)
+        self.assertRaises(NotImplementedError, test.tearDown)
+        self.assertEqual("A test description",
+                         test.shortDescription())
+        self.assertEqual("subunit.RemotedTestCase.A test description",
+                         test.id())
+        self.assertEqual("A test description (subunit.RemotedTestCase)", "%s" % test)
+        self.assertEqual("<subunit.RemotedTestCase description="
+                         "'A test description'>", "%r" % test)
+        result = unittest.TestResult()
+        test.run(result)
+        self.assertEqual([(test, "RemoteException: "
+                                 "Cannot run RemotedTestCases.\n\n")],
+                         result.errors)
+        self.assertEqual(1, result.testsRun)
+        another_test = subunit.RemotedTestCase("A test description")
+        self.assertEqual(test, another_test)
+        different_test = subunit.RemotedTestCase("ofo")
+        self.assertNotEqual(test, different_test)
+        self.assertNotEqual(another_test, different_test)
+
+
+class TestRemoteError(unittest.TestCase):
+
+    def test_eq(self):
+        error = subunit.RemoteError("Something went wrong")
+        another_error = subunit.RemoteError("Something went wrong")
+        different_error = subunit.RemoteError("boo!")
+        self.assertEqual(error, another_error)
+        self.assertNotEqual(error, different_error)
+        self.assertNotEqual(different_error, another_error)
+
+    def test_empty_constructor(self):
+        self.assertEqual(subunit.RemoteError(), subunit.RemoteError(""))
+
+
+class TestExecTestCase(unittest.TestCase):
+
+    class SampleExecTestCase(subunit.ExecTestCase):
+
+        def test_sample_method(self):
+            """sample-script.py"""
+            # the sample script runs three tests, one each
+            # that fails, errors and succeeds
+
+
+    def test_construct(self):
+        test = self.SampleExecTestCase("test_sample_method")
+        self.assertEqual(test.script,
+                         subunit.join_dir(__file__, 'sample-script.py'))
+
+    def test_run(self):
+        runner = MockTestProtocolServerClient()
+        test = self.SampleExecTestCase("test_sample_method")
+        test.run(runner)
+        mcdonald = subunit.RemotedTestCase("old mcdonald")
+        bing = subunit.RemotedTestCase("bing crosby")
+        an_error = subunit.RemotedTestCase("an error")
+        self.assertEqual(runner.error_calls,
+                         [(an_error, subunit.RemoteError())])
+        self.assertEqual(runner.failure_calls,
+                         [(bing,
+                           subunit.RemoteError(
+                            "foo.c:53:ERROR invalid state\n"))])
+        self.assertEqual(runner.start_calls, [mcdonald, bing, an_error])
+        self.assertEqual(runner.end_calls, [mcdonald, bing, an_error])
+
+    def test_debug(self):
+        test = self.SampleExecTestCase("test_sample_method")
+        test.debug()
+
+    def test_count_test_cases(self):
+        """TODO run the child process and count responses to determine the count."""
+
+    def test_join_dir(self):
+        sibling = subunit.join_dir(__file__, 'foo')
+        expected = '%s/foo' % (os.path.split(__file__)[0],)
+        self.assertEqual(sibling, expected)
+
+
+class DoExecTestCase(subunit.ExecTestCase):
+
+    def test_working_script(self):
+        """sample-two-script.py"""
+
+
+class TestIsolatedTestCase(unittest.TestCase):
+
+    class SampleIsolatedTestCase(subunit.IsolatedTestCase):
+
+        SETUP = False
+        TEARDOWN = False
+        TEST = False
+
+        def setUp(self):
+            TestIsolatedTestCase.SampleIsolatedTestCase.SETUP = True
+
+        def tearDown(self):
+            TestIsolatedTestCase.SampleIsolatedTestCase.TEARDOWN = True
+
+        def test_sets_global_state(self):
+            TestIsolatedTestCase.SampleIsolatedTestCase.TEST = True
+
+
+    def test_construct(self):
+        test = self.SampleIsolatedTestCase("test_sets_global_state")
+
+    def test_run(self):
+        result = unittest.TestResult()
+        test = self.SampleIsolatedTestCase("test_sets_global_state")
+        test.run(result)
+        self.assertEqual(result.testsRun, 1)
+        self.assertEqual(self.SampleIsolatedTestCase.SETUP, False)
+        self.assertEqual(self.SampleIsolatedTestCase.TEARDOWN, False)
+        self.assertEqual(self.SampleIsolatedTestCase.TEST, False)
+
+    def test_debug(self):
+        pass
+        #test = self.SampleExecTestCase("test_sample_method")
+        #test.debug()
+
+
+class TestIsolatedTestSuite(unittest.TestCase):
+
+    class SampleTestToIsolate(unittest.TestCase):
+
+        SETUP = False
+        TEARDOWN = False
+        TEST = False
+
+        def setUp(self):
+            TestIsolatedTestSuite.SampleTestToIsolate.SETUP = True
+
+        def tearDown(self):
+            TestIsolatedTestSuite.SampleTestToIsolate.TEARDOWN = True
+
+        def test_sets_global_state(self):
+            TestIsolatedTestSuite.SampleTestToIsolate.TEST = True
+
+
+    def test_construct(self):
+        suite = subunit.IsolatedTestSuite()
+
+    def test_run(self):
+        result = unittest.TestResult()
+        suite = subunit.IsolatedTestSuite()
+        sub_suite = unittest.TestSuite()
+        sub_suite.addTest(self.SampleTestToIsolate("test_sets_global_state"))
+        sub_suite.addTest(self.SampleTestToIsolate("test_sets_global_state"))
+        suite.addTest(sub_suite)
+        suite.addTest(self.SampleTestToIsolate("test_sets_global_state"))
+        suite.run(result)
+        self.assertEqual(result.testsRun, 3)
+        self.assertEqual(self.SampleTestToIsolate.SETUP, False)
+        self.assertEqual(self.SampleTestToIsolate.TEARDOWN, False)
+        self.assertEqual(self.SampleTestToIsolate.TEST, False)
+
+
+class TestTestProtocolClient(unittest.TestCase):
+
+    def setUp(self):
+        self.io = StringIO()
+        self.protocol = subunit.TestProtocolClient(self.io)
+        self.test = TestTestProtocolClient("test_start_test")
+
+
+    def test_start_test(self):
+        """Test startTest on a TestProtocolClient."""
+        self.protocol.startTest(self.test)
+        self.assertEqual(self.io.getvalue(), "test: %s\n" % self.test.id())
+
+    def test_stop_test(self):
+        """Test stopTest on a TestProtocolClient."""
+        self.protocol.stopTest(self.test)
+        self.assertEqual(self.io.getvalue(), "")
+
+    def test_add_success(self):
+        """Test addSuccess on a TestProtocolClient."""
+        self.protocol.addSuccess(self.test)
+        self.assertEqual(
+            self.io.getvalue(), "successful: %s\n" % self.test.id())
+
+    def test_add_failure(self):
+        """Test addFailure on a TestProtocolClient."""
+        self.protocol.addFailure(self.test, subunit.RemoteError("boo"))
+        self.assertEqual(
+            self.io.getvalue(),
+            'failure: %s [\nRemoteException: boo\n]\n' % self.test.id())
+
+    def test_add_error(self):
+        """Test stopTest on a TestProtocolClient."""
+        self.protocol.addError(self.test, subunit.RemoteError("phwoar"))
+        self.assertEqual(
+            self.io.getvalue(),
+            'error: %s [\n'
+            "RemoteException: phwoar\n"
+            "]\n" % self.test.id())
+
+
+def test_suite():
+    loader = subunit.tests.TestUtil.TestLoader()
+    result = loader.loadTestsFromName(__name__)
+    return result
index 07b8fd4ff0fa8a1079a0c7f6d3f74581defb0b48..c28693e2db93ca7209b8622c137422f167d5d01d 100644 (file)
@@ -9,6 +9,7 @@ mandir = @mandir@
 VPATH = @srcdir@:@libreplacedir@
 srcdir = @srcdir@
 builddir = @builddir@
+sharedbuilddir = @sharedbuilddir@
 XSLTPROC = @XSLTPROC@
 INSTALLCMD = @INSTALL@
 CC = @CC@
@@ -31,6 +32,15 @@ include $(tallocdir)/talloc.mk
 $(TALLOC_SOLIB): $(LIBOBJ)
        $(SHLD) $(SHLD_FLAGS) -o $@ $(LIBOBJ) @SONAMEFLAG@$(TALLOC_SONAME)
 
+shared-build: all
+       ${INSTALLCMD} -d $(sharedbuilddir)/lib
+       ${INSTALLCMD} -m 644 libtalloc.a $(sharedbuilddir)/lib
+       ${INSTALLCMD} -m 755 $(TALLOC_SOLIB) $(sharedbuilddir)/lib
+       ln -sf $(TALLOC_SOLIB) $(sharedbuilddir)/lib/$(TALLOC_SONAME)
+       ln -sf $(TALLOC_SOLIB) $(sharedbuilddir)/lib/libtalloc.so
+       ${INSTALLCMD} -d $(sharedbuilddir)/include
+       ${INSTALLCMD} -m 644 $(srcdir)/talloc.h $(sharedbuilddir)/include
+
 check: test
 
 installcheck:: test install
diff --git a/lib/talloc/build_macros.m4 b/lib/talloc/build_macros.m4
new file mode 100644 (file)
index 0000000..c036668
--- /dev/null
@@ -0,0 +1,14 @@
+AC_DEFUN(BUILD_WITH_SHARED_BUILD_DIR,
+  [ AC_ARG_WITH([shared-build-dir],
+                [AC_HELP_STRING([--with-shared-build-dir=DIR],
+                                [temporary build directory where libraries are installed [$srcdir/sharedbuild]])])
+
+    sharedbuilddir="$srcdir/sharedbuild"
+    if test x"$with_shared_build_dir" != x; then
+        sharedbuilddir=$with_shared_build_dir
+        CFLAGS="$CFLAGS -I$with_shared_build_dir/include"
+        LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib"
+    fi
+    AC_SUBST(sharedbuilddir)
+  ])
+
index 4719aa04b59c0d5992856244886c5ca542bfa318..d2538f92221cf7a5452c3970c7174fbcf52b276c 100644 (file)
@@ -21,4 +21,7 @@ AC_LD_SONAMEFLAG
 AC_LIBREPLACE_SHLD
 AC_LIBREPLACE_SHLD_FLAGS
 
+m4_include(build_macros.m4)
+BUILD_WITH_SHARED_BUILD_DIR
+
 AC_OUTPUT(Makefile talloc.pc)
index e1fe88c84b66483b11da92cf9508b0f60fd02b9f..f183cd57ef4d7d607b658d0dc4fff6686905dff0 100644 (file)
@@ -5,8 +5,8 @@ TALLOC_SONAME = libtalloc.$(SHLIBEXT).1
 
 all:: libtalloc.a $(TALLOC_SOLIB) testsuite
 
-testsuite:: $(LIBOBJ) testsuite.o
-       $(CC) $(CFLAGS) -o testsuite testsuite.o $(LIBOBJ) $(LIBS)
+testsuite:: $(LIBOBJ) testsuite.o testsuite_main.o
+       $(CC) $(CFLAGS) -o testsuite testsuite.o testsuite_main.o $(LIBOBJ) $(LIBS)
 
 libtalloc.a: $(LIBOBJ)
        ar -rv $@ $(LIBOBJ)
@@ -22,13 +22,13 @@ install:: all
        ${INSTALLCMD} -m 644 talloc.pc $(DESTDIR)$(libdir)/pkgconfig
        if [ -f talloc.3 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man3; fi
        if [ -f talloc.3 ];then ${INSTALLCMD} -m 644 talloc.3 $(DESTDIR)$(mandir)/man3; fi
-       which swig >/dev/null 2>&1 && ${INSTALLCMD} -d $(DESTDIR)`swig -swiglib` || true
-       which swig >/dev/null 2>&1 && ${INSTALLCMD} -m 644 talloc.i $(DESTDIR)`swig -swiglib` || true
+       which swig >/dev/null 2>&1 && ${INSTALLCMD} -d $(DESTDIR)$(prefix)`swig -swiglib` || true
+       which swig >/dev/null 2>&1 && ${INSTALLCMD} -m 644 talloc.i $(DESTDIR)$(prefix)`swig -swiglib` || true
 
 doc:: talloc.3 talloc.3.html
 
 clean::
-       rm -f *~ $(LIBOBJ) $(TALLOC_SOLIB) libtalloc.a testsuite testsuite.o *.gc?? talloc.3 talloc.3.html
+       rm -f *~ $(LIBOBJ) $(TALLOC_SOLIB) libtalloc.a testsuite testsuite.o testsuite_main.o *.gc?? talloc.3 talloc.3.html
 
 test:: testsuite
        ./testsuite
index 18663b370d9dc4d8b9aaeae28ef40655cd4d97c4..3201fe6f0f01f511e38c8ac58204a42458598278 100644 (file)
@@ -1,5 +1,7 @@
 Using talloc in Samba4
-----------------------
+======================
+
+.. contents::
 
 Andrew Tridgell
 September 2004
@@ -18,7 +20,7 @@ get used to it.
 Perhaps the biggest change from Samba3 is that there is no distinction
 between a "talloc context" and a "talloc pointer". Any pointer
 returned from talloc() is itself a valid talloc context. This means
-you can do this:
+you can do this::
 
   struct foo *X = talloc(mem_ctx, struct foo);
   X->name = talloc_strdup(X, "foo");
@@ -271,7 +273,7 @@ equivalent to:
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 void *talloc_named_const(const void *context, size_t size, const char *name);
 
-This is equivalent to:
+This is equivalent to::
 
    ptr = talloc_size(context, size);
    talloc_set_name_const(ptr, name);
@@ -288,7 +290,7 @@ talloc_set_name() for details.
 void *talloc_init(const char *fmt, ...);
 
 This function creates a zero length named talloc context as a top
-level context. It is equivalent to:
+level context. It is equivalent to::
 
   talloc_named(NULL, 0, fmt, ...);
 
@@ -309,7 +311,7 @@ The talloc_realloc() macro changes the size of a talloc
 pointer. The "count" argument is the number of elements of type "type"
 that you want the resulting pointer to hold. 
 
-talloc_realloc() has the following equivalences:
+talloc_realloc() has the following equivalences::
 
   talloc_realloc(context, NULL, type, 1) ==> talloc(context, type);
   talloc_realloc(context, NULL, type, N) ==> talloc_array(context, type, N);
@@ -490,7 +492,7 @@ This disables tracking of the NULL memory context.
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 (type *)talloc_zero(const void *ctx, type);
 
-The talloc_zero() macro is equivalent to:
+The talloc_zero() macro is equivalent to::
 
   ptr = talloc(ctx, type);
   if (ptr) memset(ptr, 0, sizeof(type));
@@ -505,7 +507,7 @@ The talloc_zero_size() function is useful when you don't have a known type
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 void *talloc_memdup(const void *ctx, const void *p, size_t size);
 
-The talloc_memdup() function is equivalent to:
+The talloc_memdup() function is equivalent to::
 
   ptr = talloc_size(ctx, size);
   if (ptr) memcpy(ptr, p, size);
@@ -514,13 +516,14 @@ The talloc_memdup() function is equivalent to:
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 char *talloc_strdup(const void *ctx, const char *p);
 
-The talloc_strdup() function is equivalent to:
+The talloc_strdup() function is equivalent to::
 
   ptr = talloc_size(ctx, strlen(p)+1);
   if (ptr) memcpy(ptr, p, strlen(p)+1);
 
 This functions sets the name of the new pointer to the passed
-string. This is equivalent to:
+string. This is equivalent to::
+
    talloc_set_name_const(ptr, ptr)
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -540,7 +543,8 @@ The talloc_append_string() function appends the given formatted
 string to the given string.
 
 This function sets the name of the new pointer to the new
-string. This is equivalent to:
+string. This is equivalent to::
+
    talloc_set_name_const(ptr, ptr)
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -550,7 +554,8 @@ The talloc_vasprintf() function is the talloc equivalent of the C
 library function vasprintf()
 
 This functions sets the name of the new pointer to the new
-string. This is equivalent to:
+string. This is equivalent to::
+
    talloc_set_name_const(ptr, ptr)
 
 
@@ -561,7 +566,8 @@ The talloc_asprintf() function is the talloc equivalent of the C
 library function asprintf()
 
 This functions sets the name of the new pointer to the new
-string. This is equivalent to:
+string. This is equivalent to::
+
    talloc_set_name_const(ptr, ptr)
 
 
@@ -574,7 +580,8 @@ Use this varient when the string in the current talloc buffer may
 have been truncated in length.
 
 This functions sets the name of the new pointer to the new
-string. This is equivalent to:
+string. This is equivalent to::
+
    talloc_set_name_const(ptr, ptr)
 
 
@@ -587,14 +594,15 @@ Use this varient when the string in the current talloc buffer has
 not been changed.
 
 This functions sets the name of the new pointer to the new
-string. This is equivalent to:
+string. This is equivalent to::
+
    talloc_set_name_const(ptr, ptr)
 
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 ((type *)talloc_array(const void *ctx, type, uint_t count);
 
-The talloc_array() macro is equivalent to:
+The talloc_array() macro is equivalent to::
 
   (type *)talloc_size(ctx, sizeof(type) * count);
 
@@ -648,7 +656,7 @@ then the pointer is returned. It it doesn't then NULL is returned.
 
 This macro allows you to do type checking on talloc pointers. It is
 particularly useful for void* private pointers. It is equivalent to
-this:
+this::
 
    (type *)talloc_check_name(ptr, #type)
 
@@ -660,7 +668,8 @@ This macro allows you to force the name of a pointer to be a
 particular type. This can be used in conjunction with
 talloc_get_type() to do type checking on void* pointers.
 
-It is equivalent to this:
+It is equivalent to this::
+
    talloc_set_name_const(ptr, #type)
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
index 3f06eee5667d4b285afdcdbf6c1c986c297c6815..3d490ddf49319139093893caff827c9fd0346bc6 100644 (file)
@@ -1140,13 +1140,3 @@ bool torture_local_talloc(struct torture_context *tctx)
 
        return ret;
 }
-
-#if _SAMBA_BUILD_ < 4
-int main(void)
-{
-       bool ret = torture_local_talloc(NULL);
-       if (!ret)
-               return -1;
-       return 0;
-}
-#endif
diff --git a/lib/talloc/testsuite_main.c b/lib/talloc/testsuite_main.c
new file mode 100644 (file)
index 0000000..1b51333
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   local testing of talloc routines.
+
+   Copyright (C) Andrew Tridgell 2004
+
+     ** NOTE! The following LGPL license applies to the talloc
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+
+struct torture_context;
+bool torture_local_talloc(struct torture_context *tctx);
+
+int main(void)
+{
+       bool ret = torture_local_talloc(NULL);
+       if (!ret)
+               return -1;
+       return 0;
+}
index 090bb6e2dcfefe8e0fd5d7821f64d62e783fcbcd..9915d88264b9a486a3da092fe10b896330874655 100644 (file)
@@ -12,6 +12,8 @@ libdir = @libdir@
 VPATH = @srcdir@:@libreplacedir@
 srcdir = @srcdir@
 builddir = @builddir@
+sharedbuilddir = @sharedbuilddir@
+INSTALLCMD = @INSTALL@
 CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude 
 CFLAGS = $(CPPFLAGS) @CFLAGS@
 LDFLAGS = @LDFLAGS@
@@ -43,6 +45,15 @@ install:: all
 $(TDB_SOLIB): $(TDB_OBJ)
        $(SHLD) $(SHLD_FLAGS) -o $@ $(TDB_OBJ) @SONAMEFLAG@$(TDB_SONAME)
 
+shared-build: all
+       ${INSTALLCMD} -d $(sharedbuilddir)/lib
+       ${INSTALLCMD} -m 644 libtdb.a $(sharedbuilddir)/lib
+       ${INSTALLCMD} -m 755 $(TDB_SOLIB) $(sharedbuilddir)/lib
+       ln -sf $(TDB_SOLIB) $(sharedbuilddir)/lib/$(TDB_SONAME)
+       ln -sf $(TDB_SOLIB) $(sharedbuilddir)/lib/libtdb.so
+       ${INSTALLCMD} -d $(sharedbuilddir)/include
+       ${INSTALLCMD} -m 644 $(srcdir)/include/tdb.h $(sharedbuilddir)/include
+
 check: test
 
 test:: $(PYTHON_CHECK_TARGET)
diff --git a/lib/tdb/build_macros.m4 b/lib/tdb/build_macros.m4
new file mode 100644 (file)
index 0000000..c036668
--- /dev/null
@@ -0,0 +1,14 @@
+AC_DEFUN(BUILD_WITH_SHARED_BUILD_DIR,
+  [ AC_ARG_WITH([shared-build-dir],
+                [AC_HELP_STRING([--with-shared-build-dir=DIR],
+                                [temporary build directory where libraries are installed [$srcdir/sharedbuild]])])
+
+    sharedbuilddir="$srcdir/sharedbuild"
+    if test x"$with_shared_build_dir" != x; then
+        sharedbuilddir=$with_shared_build_dir
+        CFLAGS="$CFLAGS -I$with_shared_build_dir/include"
+        LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib"
+    fi
+    AC_SUBST(sharedbuilddir)
+  ])
+
index eaf70d30b4470f757a5366e4de7fcb63264f13dd..2feaa6f5f556359268430820b46cfc8704223c3a 100644 (file)
@@ -2,7 +2,7 @@ AC_PREREQ(2.50)
 AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
 AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
 AC_DEFUN([SMB_ENABLE], [echo -n ""])
-AC_INIT(tdb, 1.1.2)
+AC_INIT(tdb, 1.1.3)
 AC_CONFIG_SRCDIR([common/tdb.c])
 AC_CONFIG_HEADER(include/config.h)
 AC_LIBREPLACE_ALL_CHECKS
@@ -27,4 +27,8 @@ if test -z "$PYTHON_CONFIG"; then
        PYTHON_INSTALL_TARGET=""
        PYTHON_CHECK_TARGET=""
 fi
+
+m4_include(build_macros.m4)
+BUILD_WITH_SHARED_BUILD_DIR
+
 AC_OUTPUT(Makefile tdb.pc)
index 0008085de540b525bb02fc1ff178d06bc898a02d..c41c9941f0691074b59ec73e36f4ff003a9e9ef9 100644 (file)
@@ -30,6 +30,7 @@
 extern "C" {
 #endif
 
+#include "signal.h"
 
 /* flags to tdb_store() */
 #define TDB_REPLACE 1          /* Unused */
index 3d8b697732f08b06bfb58be63773b994210de8d4..4b529913d740bf1675d9dfa793cdfa83cd8b62a2 100644 (file)
@@ -321,3 +321,8 @@ typedef struct tdb_context {
     # TODO: any other missing methods for container types
     }
 } tdb;
+
+%pythoncode {
+__docformat__ = 'restructuredText'
+open = Tdb
+}
index 9f306bab8c475027f426067736c9bbd800c09f85..42129d20911ad804005bd72daadde1607c82c9ef 100644 (file)
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.35
+# Version 1.3.36
 #
 # Don't modify this file, modify the SWIG interface instead.
 
@@ -337,5 +337,8 @@ Tdb.name = new_instancemethod(_tdb.Tdb_name,None,Tdb)
 Tdb_swigregister = _tdb.Tdb_swigregister
 Tdb_swigregister(Tdb)
 
+__docformat__ = 'restructuredText'
+open = Tdb
+
 
 
index 32665d79fd967d16aeab5d2dd0fe2ee365806dbd..e997e88572a15bef92884bed1f2706ac7247cdb0 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 1.3.36
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
 # endif
 #endif
 
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
 #ifndef SWIGUNUSEDPARM
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
@@ -2518,7 +2524,7 @@ static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0};
 
 #define SWIG_name    "_tdb"
 
-#define SWIGVERSION 0x010335 
+#define SWIGVERSION 0x010336 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -2818,7 +2824,6 @@ SWIGINTERN PyObject *_wrap_new_Tdb(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
   int arg3 ;
   int arg4 ;
   mode_t arg5 ;
-  tdb *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
@@ -2838,6 +2843,7 @@ SWIGINTERN PyObject *_wrap_new_Tdb(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
   char *  kwnames[] = {
     (char *) "name",(char *) "hash_size",(char *) "tdb_flags",(char *) "flags",(char *) "mode", NULL 
   };
+  tdb *result = 0 ;
   
   arg2 = 0;
   arg3 = TDB_DEFAULT;
@@ -2895,10 +2901,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_error(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  enum TDB_ERROR result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  enum TDB_ERROR result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -2930,7 +2936,6 @@ SWIGINTERN PyObject *_wrap_delete_Tdb(PyObject *SWIGUNUSEDPARM(self), PyObject *
   }
   arg1 = (tdb *)(argp1);
   delete_tdb(arg1);
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -2941,10 +2946,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -2966,7 +2971,6 @@ SWIGINTERN PyObject *_wrap_Tdb_append(PyObject *SWIGUNUSEDPARM(self), PyObject *
   tdb *arg1 = (tdb *) 0 ;
   TDB_DATA arg2 ;
   TDB_DATA arg3 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
@@ -2975,6 +2979,7 @@ SWIGINTERN PyObject *_wrap_Tdb_append(PyObject *SWIGUNUSEDPARM(self), PyObject *
   char *  kwnames[] = {
     (char *) "self",(char *) "key",(char *) "new_dbuf", NULL 
   };
+  int result;
   
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Tdb_append",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 |  0 );
@@ -3013,10 +3018,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_errorstr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  char *result = 0 ;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3037,7 +3042,6 @@ SWIGINTERN PyObject *_wrap_Tdb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
   TDB_DATA arg2 ;
-  TDB_DATA result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
@@ -3045,6 +3049,7 @@ SWIGINTERN PyObject *_wrap_Tdb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
   char *  kwnames[] = {
     (char *) "self",(char *) "key", NULL 
   };
+  TDB_DATA result;
   
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_get",kwnames,&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 |  0 );
@@ -3079,7 +3084,6 @@ SWIGINTERN PyObject *_wrap_Tdb_delete(PyObject *SWIGUNUSEDPARM(self), PyObject *
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
   TDB_DATA arg2 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
@@ -3087,6 +3091,7 @@ SWIGINTERN PyObject *_wrap_Tdb_delete(PyObject *SWIGUNUSEDPARM(self), PyObject *
   char *  kwnames[] = {
     (char *) "self",(char *) "key", NULL 
   };
+  int result;
   
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_delete",kwnames,&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 |  0 );
@@ -3118,7 +3123,6 @@ SWIGINTERN PyObject *_wrap_Tdb_store(PyObject *SWIGUNUSEDPARM(self), PyObject *a
   TDB_DATA arg2 ;
   TDB_DATA arg3 ;
   int arg4 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val4 ;
@@ -3130,6 +3134,7 @@ SWIGINTERN PyObject *_wrap_Tdb_store(PyObject *SWIGUNUSEDPARM(self), PyObject *a
   char *  kwnames[] = {
     (char *) "self",(char *) "key",(char *) "dbuf",(char *) "flag", NULL 
   };
+  int result;
   
   arg4 = TDB_REPLACE;
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Tdb_store",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
@@ -3177,7 +3182,6 @@ SWIGINTERN PyObject *_wrap_Tdb_exists(PyObject *SWIGUNUSEDPARM(self), PyObject *
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
   TDB_DATA arg2 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
@@ -3185,6 +3189,7 @@ SWIGINTERN PyObject *_wrap_Tdb_exists(PyObject *SWIGUNUSEDPARM(self), PyObject *
   char *  kwnames[] = {
     (char *) "self",(char *) "key", NULL 
   };
+  int result;
   
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_exists",kwnames,&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 |  0 );
@@ -3213,10 +3218,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_firstkey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  TDB_DATA result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  TDB_DATA result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3242,7 +3247,6 @@ SWIGINTERN PyObject *_wrap_Tdb_nextkey(PyObject *SWIGUNUSEDPARM(self), PyObject
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
   TDB_DATA arg2 ;
-  TDB_DATA result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
@@ -3250,6 +3254,7 @@ SWIGINTERN PyObject *_wrap_Tdb_nextkey(PyObject *SWIGUNUSEDPARM(self), PyObject
   char *  kwnames[] = {
     (char *) "self",(char *) "key", NULL 
   };
+  TDB_DATA result;
   
   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_nextkey",kwnames,&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 |  0 );
@@ -3283,10 +3288,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_lock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3306,10 +3311,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_unlock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3329,10 +3334,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_read_lock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3352,10 +3357,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_read_unlock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3375,10 +3380,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_reopen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3398,10 +3403,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_transaction_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3421,10 +3426,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_transaction_commit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3444,10 +3449,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_transaction_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3467,10 +3472,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_transaction_recover(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3490,10 +3495,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_hash_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3513,10 +3518,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_map_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  size_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  size_t result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3536,10 +3541,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_get_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  int result;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
@@ -3592,10 +3597,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Tdb_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   tdb *arg1 = (tdb *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
+  char *result = 0 ;
   
   if (!args) SWIG_fail;
   swig_obj[0] = args;
similarity index 96%
rename from source3/libcli/nbt/libnbt.h
rename to libcli/nbt/libnbt.h
index d37a17c19211450a1716d56143ae7d0efde75079..4ef4e9d60d15766dad3eaacba24b30d1ef523ccc 100644 (file)
@@ -83,7 +83,7 @@ struct nbt_name_request {
        /* information on what to do on completion */
        struct {
                void (*fn)(struct nbt_name_request *);
-               void *_private;
+               void *private_data;
        } async;
 };
 
@@ -95,9 +95,8 @@ struct nbt_name_request {
 struct nbt_name_socket {
        struct socket_context *sock;
        struct event_context *event_ctx;
-/*
        struct smb_iconv_convenience *iconv_convenience;
-*/
+
        /* a queue of requests pending to be sent */
        struct nbt_name_request *send_queue;
 
@@ -114,14 +113,14 @@ struct nbt_name_socket {
        struct {
                void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
                                struct socket_address *);
-               void *_private;
+               void *private_data;
        } incoming;
 
        /* what to do with unexpected replies */
        struct {
                void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
                                struct socket_address *);
-               void *_private;
+               void *private_data;
        } unexpected;
 };
 
@@ -276,9 +275,8 @@ struct nbt_name_release {
 };
 
 struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx,
-                                            struct event_context *event_ctx);
-                                            /*,
-                                            struct smb_iconv_convenience *iconv_convenience);*/
+                                            struct event_context *event_ctx,
+                                            struct smb_iconv_convenience *iconv_convenience);
 struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nbtsock,
                                             struct nbt_name_query *io);
 NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
@@ -293,7 +291,7 @@ NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock,
                        TALLOC_CTX *mem_ctx, struct nbt_name_status *io);
 
 NTSTATUS nbt_name_dup(TALLOC_CTX *mem_ctx, struct nbt_name *name, struct nbt_name *newname);
-NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, struct nbt_name *name);
+NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, DATA_BLOB *blob, struct nbt_name *name);
 NTSTATUS nbt_name_from_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, struct nbt_name *name);
 void nbt_choose_called_name(TALLOC_CTX *mem_ctx, struct nbt_name *n, const char *name, int type);
 char *nbt_name_string(TALLOC_CTX *mem_ctx, const struct nbt_name *name);
@@ -325,7 +323,7 @@ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
 NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
                                  void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
                                                  struct socket_address *),
-                                 void *_private);
+                                 void *private_data);
 NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
                             struct socket_address *dest,
                             struct nbt_name_packet *request);
similarity index 96%
rename from source4/libcli/nbt/namequery.c
rename to libcli/nbt/namequery.c
index 2e1bcd818bebed7b65b8667ef25f9f4b142d236b..ed3d8a24925bbf535bee3fa573dccb005dfc7a32 100644 (file)
@@ -1,27 +1,27 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    make nbt name query requests
 
    Copyright (C) Andrew Tridgell 2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
-#include "libcli/nbt/libnbt.h"
-#include "libcli/nbt/nbt_proto.h"
+#include "../libcli/nbt/libnbt.h"
+#include "../libcli/nbt/nbt_proto.h"
 #include "lib/socket/socket.h"
 #include "param/param.h"
 
@@ -66,13 +66,13 @@ _PUBLIC_ struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nb
 
 failed:
        talloc_free(packet);
-       return NULL;    
+       return NULL;
 }
 
 /**
   wait for a name query reply
 */
-_PUBLIC_ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req, 
+_PUBLIC_ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
                             TALLOC_CTX *mem_ctx, struct nbt_name_query *io)
 {
        NTSTATUS status;
@@ -85,7 +85,7 @@ _PUBLIC_ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
                talloc_free(req);
                return status;
        }
-       
+
        packet = req->replies[0].packet;
        io->out.reply_from = talloc_steal(mem_ctx, req->replies[0].dest->addr);
 
@@ -109,16 +109,16 @@ _PUBLIC_ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
                talloc_free(req);
                return NT_STATUS_NO_MEMORY;
        }
-       
+
        for (i=0;i<io->out.num_addrs;i++) {
-               io->out.reply_addrs[i] = talloc_steal(io->out.reply_addrs, 
+               io->out.reply_addrs[i] = talloc_steal(io->out.reply_addrs,
                                                      packet->answers[0].rdata.netbios.addresses[i].ipaddr);
        }
        io->out.reply_addrs[i] = NULL;
 
        talloc_steal(mem_ctx, io->out.name.name);
        talloc_steal(mem_ctx, io->out.name.scope);
-           
+
        talloc_free(req);
 
        return NT_STATUS_OK;
@@ -127,7 +127,7 @@ _PUBLIC_ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
 /**
   wait for a name query reply
 */
-_PUBLIC_ NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock, 
+_PUBLIC_ NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock,
                        TALLOC_CTX *mem_ctx, struct nbt_name_query *io)
 {
        struct nbt_name_request *req = nbt_name_query_send(nbtsock, io);
@@ -170,13 +170,13 @@ _PUBLIC_ struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *n
 
 failed:
        talloc_free(packet);
-       return NULL;    
+       return NULL;
 }
 
 /**
   wait for a name status reply
 */
-_PUBLIC_ NTSTATUS nbt_name_status_recv(struct nbt_name_request *req, 
+_PUBLIC_ NTSTATUS nbt_name_status_recv(struct nbt_name_request *req,
                             TALLOC_CTX *mem_ctx, struct nbt_name_status *io)
 {
        NTSTATUS status;
@@ -189,7 +189,7 @@ _PUBLIC_ NTSTATUS nbt_name_status_recv(struct nbt_name_request *req,
                talloc_free(req);
                return status;
        }
-       
+
        packet = req->replies[0].packet;
        io->out.reply_from = talloc_steal(mem_ctx, req->replies[0].dest->addr);
 
@@ -216,7 +216,7 @@ _PUBLIC_ NTSTATUS nbt_name_status_recv(struct nbt_name_request *req,
                talloc_steal(io->out.status.names, io->out.status.names[i].name);
        }
 
-           
+
        talloc_free(req);
 
        return NT_STATUS_OK;
@@ -225,7 +225,7 @@ _PUBLIC_ NTSTATUS nbt_name_status_recv(struct nbt_name_request *req,
 /**
   wait for a name status reply
 */
-_PUBLIC_ NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock, 
+_PUBLIC_ NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock,
                        TALLOC_CTX *mem_ctx, struct nbt_name_status *io)
 {
        struct nbt_name_request *req = nbt_name_status_send(nbtsock, io);
similarity index 94%
rename from source4/libcli/nbt/namerefresh.c
rename to libcli/nbt/namerefresh.c
index b372e4a3f3b0e2d0012ea84f1b50903d9d35686c..37bf0fc8f121a4af0e75ae3b0c0105953a809c0a 100644 (file)
@@ -1,27 +1,27 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    send out a name refresh request
 
    Copyright (C) Andrew Tridgell 2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
-#include "libcli/nbt/libnbt.h"
-#include "libcli/nbt/nbt_proto.h"
+#include "../libcli/nbt/libnbt.h"
+#include "../libcli/nbt/nbt_proto.h"
 #include "libcli/composite/composite.h"
 #include "lib/socket/socket.h"
 #include "param/param.h"
@@ -65,11 +65,11 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock,
                                                                     struct nbt_rdata_address, 1);
        if (packet->additional[0].rdata.netbios.addresses == NULL) goto failed;
        packet->additional[0].rdata.netbios.addresses[0].nb_flags = io->in.nb_flags;
-       packet->additional[0].rdata.netbios.addresses[0].ipaddr = 
+       packet->additional[0].rdata.netbios.addresses[0].ipaddr =
                talloc_strdup(packet->additional, io->in.address);
 
-       dest = socket_address_from_strings(nbtsock, 
-                                          nbtsock->sock->backend_name, 
+       dest = socket_address_from_strings(nbtsock,
+                                          nbtsock->sock->backend_name,
                                           io->in.dest_addr, io->in.dest_port);
        if (dest == NULL) goto failed;
        req = nbt_name_request_send(nbtsock, dest, packet,
@@ -81,13 +81,13 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock,
 
 failed:
        talloc_free(packet);
-       return NULL;    
+       return NULL;
 }
 
 /*
   wait for a refresh reply
 */
-_PUBLIC_ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req, 
+_PUBLIC_ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
                               TALLOC_CTX *mem_ctx, struct nbt_name_refresh *io)
 {
        NTSTATUS status;
@@ -99,7 +99,7 @@ _PUBLIC_ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
                talloc_free(req);
                return status;
        }
-       
+
        packet = req->replies[0].packet;
        io->out.reply_from = talloc_steal(mem_ctx, req->replies[0].dest->addr);
 
@@ -116,7 +116,7 @@ _PUBLIC_ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
                talloc_free(req);
                return NT_STATUS_INVALID_NETWORK_RESPONSE;
        }
-       io->out.reply_addr = talloc_steal(mem_ctx, 
+       io->out.reply_addr = talloc_steal(mem_ctx,
                                          packet->answers[0].rdata.netbios.addresses[0].ipaddr);
        talloc_steal(mem_ctx, io->out.name.name);
        talloc_steal(mem_ctx, io->out.name.scope);
@@ -129,7 +129,7 @@ _PUBLIC_ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
 /*
   synchronous name refresh request
 */
-_PUBLIC_ NTSTATUS nbt_name_refresh(struct nbt_name_socket *nbtsock, 
+_PUBLIC_ NTSTATUS nbt_name_refresh(struct nbt_name_socket *nbtsock,
                           TALLOC_CTX *mem_ctx, struct nbt_name_refresh *io)
 {
        struct nbt_name_request *req = nbt_name_refresh_send(nbtsock, io);
@@ -159,9 +159,9 @@ struct refresh_wins_state {
 */
 static void name_refresh_wins_handler(struct nbt_name_request *req)
 {
-       struct composite_context *c = talloc_get_type(req->async.private
+       struct composite_context *c = talloc_get_type(req->async.private_data,
                                                      struct composite_context);
-       struct refresh_wins_state *state = talloc_get_type(c->private_data, 
+       struct refresh_wins_state *state = talloc_get_type(c->private_data,
                                                            struct refresh_wins_state);
        NTSTATUS status;
 
@@ -184,7 +184,7 @@ static void name_refresh_wins_handler(struct nbt_name_request *req)
                        c->status = NT_STATUS_NO_MEMORY;
                } else {
                        state->req->async.fn      = name_refresh_wins_handler;
-                       state->req->async.private = c;
+                       state->req->async.private_data = c;
                }
        } else if (!NT_STATUS_IS_OK(status)) {
                c->state = COMPOSITE_STATE_ERROR;
@@ -200,7 +200,7 @@ static void name_refresh_wins_handler(struct nbt_name_request *req)
                                c->status = NT_STATUS_NO_MEMORY;
                        } else {
                                state->req->async.fn      = name_refresh_wins_handler;
-                               state->req->async.private = c;
+                               state->req->async.private_data = c;
                        }
                } else {
                        c->state = COMPOSITE_STATE_DONE;
@@ -235,11 +235,11 @@ _PUBLIC_ struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_so
 
        state->wins_port = io->in.wins_port;
        state->wins_servers = str_list_copy(state, io->in.wins_servers);
-       if (state->wins_servers == NULL || 
+       if (state->wins_servers == NULL ||
            state->wins_servers[0] == NULL) goto failed;
 
        state->addresses = str_list_copy(state, io->in.addresses);
-       if (state->addresses == NULL || 
+       if (state->addresses == NULL ||
            state->addresses[0] == NULL) goto failed;
 
        state->io->in.name            = io->in.name;
@@ -259,7 +259,7 @@ _PUBLIC_ struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_so
        if (state->req == NULL) goto failed;
 
        state->req->async.fn      = name_refresh_wins_handler;
-       state->req->async.private = c;
+       state->req->async.private_data = c;
 
        c->private_data = state;
        c->state        = COMPOSITE_STATE_IN_PROGRESS;
@@ -281,7 +281,7 @@ _PUBLIC_ NTSTATUS nbt_name_refresh_wins_recv(struct composite_context *c, TALLOC
        NTSTATUS status;
        status = composite_wait(c);
        if (NT_STATUS_IS_OK(status)) {
-               struct refresh_wins_state *state = 
+               struct refresh_wins_state *state =
                        talloc_get_type(c->private_data, struct refresh_wins_state);
                io->out.wins_server = talloc_steal(mem_ctx, state->wins_servers[0]);
                io->out.rcode = state->io->out.rcode;
similarity index 95%
rename from source4/libcli/nbt/nameregister.c
rename to libcli/nbt/nameregister.c
index 9c5ae43d4076dd46314603f2db8b1a114106543c..d4728a8e021d3e693de37da044d24f9a941e3404 100644 (file)
@@ -1,27 +1,27 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    send out a name registration request
 
    Copyright (C) Andrew Tridgell 2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the&nbs