ira/wip.git
10 years agos3: Add tdb_data_equal
Volker Lendecke [Thu, 3 Dec 2009 17:43:49 +0000 (18:43 +0100)]
s3: Add tdb_data_equal

10 years agos3:torture: add a test LOCAL-DBTRANS to torture dbwrap with transactions.
Volker Lendecke [Fri, 11 Dec 2009 14:37:52 +0000 (15:37 +0100)]
s3:torture: add a test LOCAL-DBTRANS to torture dbwrap with transactions.

10 years agos3:dbwrap_ctdb: start rewrite of transactions using the global lock (g_lock)
Michael Adam [Thu, 3 Dec 2009 16:29:54 +0000 (17:29 +0100)]
s3:dbwrap_ctdb: start rewrite of transactions using the global lock (g_lock)

This simplifies the transaction code a lot:

* transaction_start essentially consists of acquiring a global lock.

* No write operations at all are performed on the local database
  until the transaction is committed: Every store operation is just
  going into the marshall buffer.

* The commit operation calls a new simplified TRANS3_COMMIT control
  in ctdb which rolls out thae changes to all nodes including the
  node that is performing the transaction.

Michael

10 years agos3: setup debug for smbtorture
Volker Lendecke [Sun, 6 Dec 2009 23:36:51 +0000 (00:36 +0100)]
s3: setup debug for smbtorture

10 years agos3: Add ctdb_conn_msg_ctx()
Volker Lendecke [Fri, 4 Dec 2009 12:22:30 +0000 (13:22 +0100)]
s3: Add ctdb_conn_msg_ctx()

10 years agos3: Implement global locks in a g_lock tdb
Volker Lendecke [Sun, 25 Oct 2009 15:12:12 +0000 (16:12 +0100)]
s3: Implement global locks in a g_lock tdb

This is the basis to implement global locks in ctdb without depending on a
shared file system. The initial goal is to make ctdb persistent transactions
deterministic without too many timeouts.

10 years agos4:kdc Fill in created_by principal field
Simo Sorce [Fri, 12 Feb 2010 21:24:22 +0000 (16:24 -0500)]
s4:kdc Fill in created_by principal field

10 years agos4:kdc Fix double free and uninitialized memory.
Simo Sorce [Fri, 12 Feb 2010 19:54:18 +0000 (14:54 -0500)]
s4:kdc Fix double free and uninitialized memory.

In samba_kdc_trust_message2entry() on error, hdb_free_entry()
may end up trying to access uninitialized memory or double
free the hdb_entry.

10 years agotestprogs: print all printerinfo levels in spoolss test.
Günther Deschner [Fri, 12 Feb 2010 19:31:46 +0000 (20:31 +0100)]
testprogs: print all printerinfo levels in spoolss test.

Guenther

10 years agos4:auth/credentials/credentials.c - Initialise the "lm_response" and "nt_response...
Matthias Dieter Wallnöfer [Fri, 12 Feb 2010 13:58:27 +0000 (14:58 +0100)]
s4:auth/credentials/credentials.c - Initialise the "lm_response" and "nt_response" structures

In some cases those structures are not initialised and the whole authentication
system crashes with a SIGSEGV. Bug discovered by Matthieu Patou in bug #6755.

10 years agos4:getopt.py - set the password callback only when no password has been provided
Matthias Dieter Wallnöfer [Fri, 12 Feb 2010 12:55:14 +0000 (13:55 +0100)]
s4:getopt.py - set the password callback only when no password has been provided

Previously the "no_pass" and "no_pass2" variables weren't handled correctly.
Since at the initialisation of the "CredentialsOptions" we don't have any
password at all. Only afterwards we could get one through "set_password".

If a password is specified, use it. If no password is specified, consider the
use fo an input mask on STDOUT. But if the loadparm context contains one prefer
it over the input.

10 years agos4:net_drs_bind: make some more stuff static
Stefan Metzmacher [Fri, 12 Feb 2010 11:20:03 +0000 (12:20 +0100)]
s4:net_drs_bind: make some more stuff static

metze

10 years agos4:net/drs: use the full path to "utils/net/drs/net_drs*.h"
Stefan Metzmacher [Fri, 12 Feb 2010 11:19:15 +0000 (12:19 +0100)]
s4:net/drs: use the full path to "utils/net/drs/net_drs*.h"

This fixes the build with automatic dependecies.

metze

10 years agos3: notify_onelevel does not use seqnums, so don't open asking for it
Volker Lendecke [Fri, 12 Feb 2010 11:06:50 +0000 (12:06 +0100)]
s3: notify_onelevel does not use seqnums, so don't open asking for it

10 years agospoolss: regenerate hand-marshalled ndr_pull_spoolss_DriverInfo101 after ndr64 changes.
Günther Deschner [Fri, 12 Feb 2010 10:32:08 +0000 (11:32 +0100)]
spoolss: regenerate hand-marshalled ndr_pull_spoolss_DriverInfo101 after ndr64 changes.

Guenther

10 years agospoolss: make sure hand-marshalled spoolss_DriverInfo101 handles relative_highest_offset.
Günther Deschner [Thu, 11 Feb 2010 17:58:11 +0000 (18:58 +0100)]
spoolss: make sure hand-marshalled spoolss_DriverInfo101 handles relative_highest_offset.

Guenther

10 years agospoolss: regenerate hand-marshalled ndr_push_spoolss_DriverInfo101 after ndr64 changes.
Günther Deschner [Fri, 12 Feb 2010 10:25:59 +0000 (11:25 +0100)]
spoolss: regenerate hand-marshalled ndr_push_spoolss_DriverInfo101 after ndr64 changes.

Guenther

10 years agoRemove the code replaced by widelinks warning.
Jeremy Allison [Thu, 11 Feb 2010 23:59:41 +0000 (15:59 -0800)]
Remove the code replaced by widelinks warning.

Jeremy.

10 years agoRemove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from Volker.
Jeremy Allison [Thu, 11 Feb 2010 23:16:23 +0000 (15:16 -0800)]
Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from Volker.

Create widelinks_warning(int snum) to cover the message needed in make_connection.

Jeremy.

10 years agos3 test: Make the netbios name test pass again
Kai Blin [Tue, 2 Feb 2010 14:18:01 +0000 (15:18 +0100)]
s3 test: Make the netbios name test pass again

10 years agos4: Switch to S3-style id mapping data types.
Kai Blin [Thu, 23 Apr 2009 14:37:11 +0000 (16:37 +0200)]
s4: Switch to S3-style id mapping data types.

10 years agos4 idmap: Make the sid_to_xid and xid_to_sid calls static.
Kai Blin [Wed, 22 Apr 2009 16:10:12 +0000 (18:10 +0200)]
s4 idmap: Make the sid_to_xid and xid_to_sid calls static.

Looking at the winbind interface, we should only be using the bulk conversion calls.

10 years agolibwbclient: Test wbcLookupName async functions
Kai Blin [Fri, 29 Jan 2010 11:09:18 +0000 (12:09 +0100)]
libwbclient: Test wbcLookupName async functions

10 years agolibwbclient: Implement wbcLookupName_send/recv
Kai Blin [Wed, 27 May 2009 22:57:32 +0000 (00:57 +0200)]
libwbclient: Implement wbcLookupName_send/recv

10 years agolibwbclient: Implement wbcAuthenticateUserEx_send/recv
Kai Blin [Wed, 27 May 2009 22:55:57 +0000 (00:55 +0200)]
libwbclient: Implement wbcAuthenticateUserEx_send/recv

10 years agolibwbclient: Implement wbcLookupSid_send/recv
Kai Blin [Fri, 24 Apr 2009 14:24:56 +0000 (16:24 +0200)]
libwbclient: Implement wbcLookupSid_send/recv

10 years agolibwbclient: Implement wbcGidToSid_send/recv
Kai Blin [Thu, 2 Apr 2009 07:45:39 +0000 (09:45 +0200)]
libwbclient: Implement wbcGidToSid_send/recv

10 years agolibwbclient: Implement wbcSidToGid_send/recv
Kai Blin [Thu, 2 Apr 2009 07:22:43 +0000 (09:22 +0200)]
libwbclient: Implement wbcSidToGid_send/recv

10 years agolibwbclient: Implement wbcUidToSid_send/recv
Kai Blin [Thu, 2 Apr 2009 07:57:40 +0000 (09:57 +0200)]
libwbclient: Implement wbcUidToSid_send/recv

10 years agolibwbclient: Implement wbcSidToUid_send/recv
Kai Blin [Tue, 31 Mar 2009 21:10:48 +0000 (23:10 +0200)]
libwbclient: Implement wbcSidToUid_send/recv

10 years agolibwbclient: Add wbcInterfaceDetails_send/recv
Kai Blin [Sun, 15 Feb 2009 10:01:44 +0000 (11:01 +0100)]
libwbclient: Add wbcInterfaceDetails_send/recv

10 years agolibwbclient: Add wbcDomainInfo_send/recv calls
Kai Blin [Sat, 14 Feb 2009 09:06:05 +0000 (10:06 +0100)]
libwbclient: Add wbcDomainInfo_send/recv calls

10 years agolibwbclient: Add wbcDomainName_send/recv call
Kai Blin [Fri, 13 Feb 2009 21:51:52 +0000 (22:51 +0100)]
libwbclient: Add wbcDomainName_send/recv call

10 years agolibwbclient: Add wbcNetbiosName_send/recv calls
Kai Blin [Fri, 13 Feb 2009 21:37:56 +0000 (22:37 +0100)]
libwbclient: Add wbcNetbiosName_send/recv calls

10 years agolibwbclient: Add async wbcInfo_send()/wbcInfo_recv() calls
Kai Blin [Wed, 25 Mar 2009 09:08:10 +0000 (10:08 +0100)]
libwbclient: Add async wbcInfo_send()/wbcInfo_recv() calls

10 years agolibwbclient: add wbcInterfaceVersion send/recv calls
Kai Blin [Wed, 11 Feb 2009 23:11:45 +0000 (00:11 +0100)]
libwbclient: add wbcInterfaceVersion send/recv calls

10 years agolibwbclient: torture-test wbcPing async functions.
Kai Blin [Fri, 29 Jan 2010 10:22:14 +0000 (11:22 +0100)]
libwbclient: torture-test wbcPing async functions.

10 years agolibwbclient: Add async wbcPing_send/_recv
Kai Blin [Tue, 24 Mar 2009 21:51:11 +0000 (22:51 +0100)]
libwbclient: Add async wbcPing_send/_recv

10 years agolibwbclient: Zero out context on initialization
Kai Blin [Fri, 29 Jan 2010 10:54:33 +0000 (11:54 +0100)]
libwbclient: Zero out context on initialization

This prevents a segfault when using wbcDebug without prior call to wbcSetDebug

10 years agoFinal part of jumbo patch for bug #7104 - "wide links" and "unix extensions" are...
Jeremy Allison [Thu, 11 Feb 2010 22:45:53 +0000 (14:45 -0800)]
Final part of jumbo patch for bug #7104 - "wide links" and "unix extensions" are incompatible.

Volker pointed out that the preexec scripts get passed the conn->connectpath
as a parameter, so call canonicalize_connect_path() both *before* and after
the preexec scripts. Ignore errors on the call before the preexec scripts,
as the path may not exist until created by the preexec scripts.

Jeremy.

10 years agoIntroduce lp_safe_widelinks()
Simo Sorce [Thu, 11 Feb 2010 21:12:29 +0000 (16:12 -0500)]
Introduce lp_safe_widelinks()

This way we avoid any chance that a configuration reload may turn
back on wide links when unix extensions are enabled.

10 years agoFine changes to previous fix for bug #7104 - "wide links" and "unix extensions" are...
Jeremy Allison [Thu, 11 Feb 2010 19:00:45 +0000 (11:00 -0800)]
Fine changes to previous fix for bug #7104 - "wide links" and "unix extensions" are incompatible.

Make sure we match the previous allow widelinks behavior, in that
non-root preexec scripts can create share directories for a share
definition.

Jeremy

10 years agoSuplementary patch for bug #7104 - "wide links" and "unix extensions" are incompatible.
Jeremy Allison [Thu, 11 Feb 2010 18:19:33 +0000 (10:19 -0800)]
Suplementary patch for bug #7104 - "wide links" and "unix extensions" are incompatible.

Bug reported by Ralf Zimmermann <r.zimmermann@siegnetz.de>. Reproduced by jra.

If the target directory of a share doesn't exist, but is designed to
be created by a "root preexec" script call, then the widelinks check
is done too early - thus preventing the user from connecting to the
share.

Fix is to re-arrange the order of checks in make_connection_snum()
to always do the following order of operations:

(1). Turn off wide links if unix extensions = yes.
(2). Call any root preexec scripts.
(3). Canonicalize the share path to remove any symlinks (ie. end
up with the realpath in the connection_struct).

Jeremy.

10 years agoldb_match - Ignore ":dn" part of extended matches for now
Matthias Dieter Wallnöfer [Thu, 11 Feb 2010 14:42:48 +0000 (15:42 +0100)]
ldb_match - Ignore ":dn" part of extended matches for now

It's not fully clear what this ":dn" part means for us. What we know is that
older AD implementations (Windows Server 2000, 2003) need it to have extended
matches working in the expected way.

To be able to interoperate with s3's winbind and other tools I and gd decided
to transform this into a warning until we know what to do.

This should fix bug #6511.

10 years agos4-provision: import the R2 functional level
Andrew Tridgell [Thu, 11 Feb 2010 13:33:13 +0000 (00:33 +1100)]
s4-provision: import the R2 functional level

this makes it easier to modify the script to set us at R2 level in
provision. We should make this a parameter.

10 years agos4-build: avoid finding python symlinks
Andrew Tridgell [Thu, 11 Feb 2010 13:11:11 +0000 (00:11 +1100)]
s4-build: avoid finding python symlinks

emacs creates symlinks to .py files while you are editing them. This
could cause build failures.

10 years agos4-provision: fixed --function-level option to provision
Andrew Tridgell [Thu, 11 Feb 2010 12:39:56 +0000 (23:39 +1100)]
s4-provision: fixed --function-level option to provision

we need the DS_DOMAIN_* levels imported

10 years agos4-script: make enablerecyclebin use system_session
Andrew Tridgell [Thu, 11 Feb 2010 12:38:23 +0000 (23:38 +1100)]
s4-script: make enablerecyclebin use system_session

This allows it to work against our local ldb

10 years agos4-pyldb: null terminate string ldb message elements from python
Andrew Tridgell [Thu, 11 Feb 2010 12:37:44 +0000 (23:37 +1100)]
s4-pyldb: null terminate string ldb message elements from python

We need to eventually get rid of ldb_msg_find_attr_as_string() (or add
a mem_ctx to it), but meanwhile we have too many places that break if
we don't add a nul to the end of ldb msg strings from python.

10 years agolibds: added recyclebin feature GUID
Andrew Tridgell [Thu, 11 Feb 2010 12:35:31 +0000 (23:35 +1100)]
libds: added recyclebin feature GUID

10 years agos3: re-run make samba3-idl.
Günther Deschner [Thu, 11 Feb 2010 12:32:44 +0000 (13:32 +0100)]
s3: re-run make samba3-idl.

Guenther

10 years agospoolss: allow to set server architecture via parametric option.
Günther Deschner [Thu, 11 Feb 2010 12:07:38 +0000 (13:07 +0100)]
spoolss: allow to set server architecture via parametric option.

This allows to set "spoolss:architecture = 'Windows x64'" for debugging purpose.

Guenther

10 years agos3-spoolss: implement spoolss_EnumJobs level 3.
Günther Deschner [Wed, 10 Feb 2010 23:44:06 +0000 (00:44 +0100)]
s3-spoolss: implement spoolss_EnumJobs level 3.

Level 3 has been added with NT 4.0 and Windows 7 (at least 64bit version) makes
use of it in order to display queued jobs. Windows 7 will *not* fall back to
level 2 if we just return WERR_UNKNOWN_LEVEL, instead there will be no printjobs
displayed at all.

Guenther

10 years agotestprogs: one more error code for spoolss test.
Günther Deschner [Thu, 11 Feb 2010 00:24:12 +0000 (01:24 +0100)]
testprogs: one more error code for spoolss test.

Guenther

10 years agotestprogs: print secdesc->Control in spoolss test.
Günther Deschner [Wed, 10 Feb 2010 23:06:20 +0000 (00:06 +0100)]
testprogs: print secdesc->Control in spoolss test.

Guenther

10 years agotestprogs: use ConvertSidToStringSid in order to print sids in spoolss test.
Günther Deschner [Wed, 10 Feb 2010 23:04:53 +0000 (00:04 +0100)]
testprogs: use ConvertSidToStringSid in order to print sids in spoolss test.

Guenther

10 years agos4-drs: Add DRSUAPI_DRS_NONGC_RO_REP bit to DRS_OPTIONS
Fernando J V da Silva [Fri, 5 Feb 2010 18:33:03 +0000 (16:33 -0200)]
s4-drs: Add DRSUAPI_DRS_NONGC_RO_REP bit to DRS_OPTIONS

Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
10 years agos4-net-drs: fix some coding style issues
Andrew Tridgell [Thu, 11 Feb 2010 10:28:48 +0000 (21:28 +1100)]
s4-net-drs: fix some coding style issues

We should use the system/*.h headers for system includes. We also try
to avoid C++ comments.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4/net_drs: 'net drs kcc' command implementation
Kamen Mazdrashki [Sat, 6 Feb 2010 01:13:33 +0000 (03:13 +0200)]
s4/net_drs: 'net drs kcc' command implementation

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4/net_drs: 'net drs bind' command implementation
Kamen Mazdrashki [Fri, 5 Feb 2010 20:36:36 +0000 (22:36 +0200)]
s4/net_drs: 'net drs bind' command implementation

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4/net_drs: 'net drs' utility initial creation
Kamen Mazdrashki [Fri, 5 Feb 2010 20:36:10 +0000 (22:36 +0200)]
s4/net_drs: 'net drs' utility initial creation

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4/idl: regenerating drsuapi.idl
Kamen Mazdrashki [Fri, 5 Feb 2010 20:37:54 +0000 (22:37 +0200)]
s4/idl: regenerating drsuapi.idl

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4/idl: Naming reserved flags for DRSUAPI_SUPPORTED_EXTENSION_ field
Kamen Mazdrashki [Fri, 5 Feb 2010 20:37:27 +0000 (22:37 +0200)]
s4/idl: Naming reserved flags for DRSUAPI_SUPPORTED_EXTENSION_ field

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agoprovision: Use short name for assignee of ACE (BA, SA, CO, ...)
Matthieu Patou [Tue, 26 Jan 2010 23:03:15 +0000 (02:03 +0300)]
provision: Use short name for assignee of ACE (BA, SA, CO, ...)

  Use short name (shortcut for wellknown SID/RID) for assignee in each entry of ACL (when possible)
  of sysvol files (GPO objects and netlogon folders).
  This avoid error prone substitution of DOMAINSID in ACL and make ACL clearer by using shortname
  for assignee accordingly with SDDL synthax rules. Translation to real SID is handled internaly by the
  from_sddl function.

Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
10 years agopython-s4: use secrets.ldb instead of sam.ldb for reading domain SID
Matthieu Patou [Tue, 26 Jan 2010 22:32:29 +0000 (01:32 +0300)]
python-s4: use secrets.ldb instead of sam.ldb for reading domain SID

  This allow to be able to run net acl set xxx yyy on DC, but also on domain
  member.

Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
10 years agoprovision: Fix an error with eadb when using not default install dir and running...
Matthieu Patou [Mon, 8 Feb 2010 12:36:07 +0000 (15:36 +0300)]
provision: Fix an error with eadb when using not default install dir and running as a non root user

Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
10 years agos4-dns: don't leave behind a tmp file
Andrew Tridgell [Thu, 11 Feb 2010 09:49:29 +0000 (20:49 +1100)]
s4-dns: don't leave behind a tmp file

If the dns update file doesn't need updating we need to delete the tmp
file

10 years agos4-selftest: don't run rndc reload in selftest
Andrew Tridgell [Thu, 11 Feb 2010 09:48:47 +0000 (20:48 +1100)]
s4-selftest: don't run rndc reload in selftest

We don't want rndc calls on the build farm

10 years agos4-dns: added a dns update task
Andrew Tridgell [Thu, 11 Feb 2010 09:21:15 +0000 (20:21 +1100)]
s4-dns: added a dns update task

This task watches for changes in the list of DCs, and creates a bind9
formatted file that grants update permission to all DCs, plus to the
administration, and machines update for their own names.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

10 years agos4-provision: cope with umask in creating private/dns
Andrew Tridgell [Thu, 11 Feb 2010 09:20:11 +0000 (20:20 +1100)]
s4-provision: cope with umask in creating private/dns

10 years agoutil: added file_compare() utility function
Andrew Tridgell [Thu, 11 Feb 2010 09:19:40 +0000 (20:19 +1100)]
util: added file_compare() utility function

file_compare() returns true if two files are the same. It is meant for
small files.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

10 years agolibreplace: added replacements for dprintf() and vdprintf()
Andrew Tridgell [Thu, 11 Feb 2010 09:18:50 +0000 (20:18 +1100)]
libreplace: added replacements for dprintf() and vdprintf()

these are very useful for writing files with formatted writes

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

10 years agos4-provision: pre-create a named.conf.update file
Andrew Tridgell [Thu, 11 Feb 2010 04:25:13 +0000 (15:25 +1100)]
s4-provision: pre-create a named.conf.update file

The named.conf.update file will be filled in at runtime by Samba to
contain the list of bind9 grant rules for granting DNS dynamic update
permissions on the domain.

10 years agos4-provision: move zone file to dns subdirectory
Andrew Tridgell [Thu, 11 Feb 2010 02:17:09 +0000 (13:17 +1100)]
s4-provision: move zone file to dns subdirectory

This allows the permissions to be correctly set for bind to write to
a journal file. It also sets the right group ownership and permissions
on the files that bind needs to access.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

10 years agos4:provision Be more polite to long-suffering Samba testers.
Andrew Bartlett [Thu, 11 Feb 2010 06:13:42 +0000 (17:13 +1100)]
s4:provision Be more polite to long-suffering Samba testers.

Our testers put up with a lot of odd things when testing out Samba4.

Andrew Bartlett

10 years agoFix unused variable warning after change to new DLINK macros.
Jeremy Allison [Thu, 11 Feb 2010 01:20:21 +0000 (17:20 -0800)]
Fix unused variable warning after change to new DLINK macros.

Jeremy.

10 years agoFix bad use when freeing linked list. Todd Stecher (Original author) please check !
Jeremy Allison [Thu, 11 Feb 2010 00:23:33 +0000 (16:23 -0800)]
Fix bad use when freeing linked list. Todd Stecher (Original author) please check !

Jeremy.

10 years agotest:local added LOCAL-DLINKLIST testsuite
Andrew Tridgell [Sun, 7 Feb 2010 05:06:31 +0000 (16:06 +1100)]
test:local added LOCAL-DLINKLIST testsuite
(cherry picked from commit 95a5bee2c30a67a35604b0456ab7836f6dc67702)

10 years agoutil: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)
Andrew Tridgell [Wed, 10 Feb 2010 23:53:58 +0000 (15:53 -0800)]
util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)

This changes the meaning of the ->prev pointer in our doubly linked
lists to point at the end of the list from the front of the list. That
allows us to implement DLIST_ADD_END() and related functions in O(1)
time, which can be a huge saving in many places in Samba.

This also means that the 'type' argument to various DLIST_*() macros
is no longer needed, but I have left it in for now to keep the
patchset small, which will make it easier to revert if any problems
are found. In the future we should remove the 'type' arguments.

(jra. Move the one use of DLIST_TAIL over to the new macros).

10 years agos3-smbd: update to use new DLIST macros
Andrew Tridgell [Sat, 6 Feb 2010 01:42:29 +0000 (12:42 +1100)]
s3-smbd: update to use new DLIST macros
(cherry picked from commit 365b408c458c848a818637d9b36a0423aeb1ba54)

10 years agos3-registry: update to use new DLIST macros
Andrew Tridgell [Sat, 6 Feb 2010 01:41:57 +0000 (12:41 +1100)]
s3-registry: update to use new DLIST macros
(cherry picked from commit 3437713ad7e5bccafde30553a8232119fd2a9eb9)

10 years agos3-perfcount: update to use new DLIST macros
Andrew Tridgell [Sat, 6 Feb 2010 01:41:39 +0000 (12:41 +1100)]
s3-perfcount: update to use new DLIST macros
(cherry picked from commit a13b507f2d8be7f90c8872094cd0732926a6fcbb)

10 years agos3-locking: update to use DLIST_ADD_AFTER()
Andrew Tridgell [Sat, 6 Feb 2010 01:41:07 +0000 (12:41 +1100)]
s3-locking: update to use DLIST_ADD_AFTER()
(cherry picked from commit 6c6df527e14514027cbcaa6deac25adf04363926)

10 years agos3-libsmb: update libsmb to use new DLIST macros
Andrew Tridgell [Sat, 6 Feb 2010 01:40:38 +0000 (12:40 +1100)]
s3-libsmb: update libsmb to use new DLIST macros

manipulating p->prev directly is not safe any more
(cherry picked from commit 3c650ac1e3e1cdbbabecfddcd29325f20b5dcb48)

10 years agos3-memcache: update memcache to use new DLIST macros
Andrew Tridgell [Sat, 6 Feb 2010 01:40:03 +0000 (12:40 +1100)]
s3-memcache: update memcache to use new DLIST macros

we don't need a separate lru pointer any more
(cherry picked from commit 4ffd7aca3e38728077bd80c2a65c4efbcfd216fc)

10 years agos3-ldb: update the old ldb in s3 to use new DLIST macros
Andrew Tridgell [Sat, 6 Feb 2010 01:38:47 +0000 (12:38 +1100)]
s3-ldb: update the old ldb in s3 to use new DLIST macros
(cherry picked from commit a7d8bfd373392eecf4fff33d39b85e1b55ad901d)

10 years agos3-nmbd: update nmbd to use new DLIST_ macros
Andrew Tridgell [Sat, 6 Feb 2010 01:38:24 +0000 (12:38 +1100)]
s3-nmbd: update nmbd to use new DLIST_ macros
(cherry picked from commit 4d23d777bc6d4fad20d0f3084fe658635812bee9)

10 years agos4-ldb: update ldb_tdb to use new DLIST_ macros
Andrew Tridgell [Sat, 6 Feb 2010 01:37:48 +0000 (12:37 +1100)]
s4-ldb: update ldb_tdb to use new DLIST_ macros
(cherry picked from commit 6ede911654566a7e21ded70dacac68df3b6a1bca)

10 years agos4-dsdb: update repl_meta_data.c to use new DLIST_ macros
Jeremy Allison [Wed, 10 Feb 2010 23:35:38 +0000 (15:35 -0800)]
s4-dsdb: update repl_meta_data.c to use new DLIST_ macros

10 years agoTemporary changes to dlinklist to keep the implementation static whilst
Jeremy Allison [Wed, 10 Feb 2010 23:30:59 +0000 (15:30 -0800)]
Temporary changes to dlinklist to keep the implementation static whilst
uses of (list)->prev are moved over to DLIST_PREV. This will be replaced
when the final (new) version of the dlinklist.h header is added.

Jeremy.

10 years agoRevert "Change the default of "nmbd bind explicit broadcast" to "no""
Jeremy Allison [Wed, 10 Feb 2010 20:42:27 +0000 (12:42 -0800)]
Revert "Change the default of "nmbd bind explicit broadcast" to "no""

This reverts commit 84fba3c1bc962804259f201d465acfdf0cd3c6a8.

Now we have a "processed packet queue" in nmbd we can go back
to doing this by default.

Jeremy.

10 years agoMore of the fix for bug #7118 - nmbd problems with socket address.
Jeremy Allison [Wed, 10 Feb 2010 20:32:05 +0000 (12:32 -0800)]
More of the fix for bug #7118 - nmbd problems with socket address.

Add a simple "processed packet queue" cache to stop nmbd responding to
packets received on the broadcast and non-broadcast socket (which
it has opened when "nmbd bind explicit broadcast = yes").

This is a very simple packet queue - it only keeps the packets
processed during a single call to listen_for_packets() (i.e. one
select call). This means that if the delivery notification for a
packet received on both broadcast and non-broadcast addresses
is done in two different select calls, the packet will still be
processed twice. This is a very rare occurrance and we can just
live with it when it does as the protocol is stateless. If this
is ever flagged as a repeatable problem then we can add a longer
lived cache, using timeout processing to clear etc. etc. But without
storing all packets processed we can never be *sure* we've eliminated
the race condition so I'm going to go with this simple solution until
someone proves a more complex one is needed :-).

Jeremy.

10 years agoChange the default of "nmbd bind explicit broadcast" to "no"
Jeremy Allison [Wed, 10 Feb 2010 16:39:37 +0000 (08:39 -0800)]
Change the default of "nmbd bind explicit broadcast" to "no"
until the double processing problem in bug #7118 is fixed.

Jeremy.

10 years agotestprogs: add more error codes for spoolss test.
Günther Deschner [Wed, 10 Feb 2010 12:17:36 +0000 (13:17 +0100)]
testprogs: add more error codes for spoolss test.

Guenther

10 years agos3: change ldap filter to what really was intended
Björn Jacke [Wed, 10 Feb 2010 12:48:11 +0000 (13:48 +0100)]
s3: change ldap filter to what really was intended

10 years agotdb: fix recovery reuse after crash
Rusty Russell [Thu, 4 Feb 2010 13:29:54 +0000 (23:59 +1030)]
tdb: fix recovery reuse after crash

If a process (or the machine) dies after just after writing the
recovery head (pointing at the end of file), the recovery record will filled
with 0x42.  This will not invoke a recovery on open, since rec.magic
!= TDB_RECOVERY_MAGIC.

Unfortunately, the first transaction commit will happily reuse that
area: tdb_recovery_allocate() doesn't check the magic.  The recovery
record has length 0x42424242, and it writes that back into the
now-valid-looking transaction header) for the next comer (which
happens to be tdb_wipe_all in my tests).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years agotdb: give a name to the invalid recovery area constant (0)
Rusty Russell [Thu, 4 Feb 2010 13:30:24 +0000 (00:00 +1030)]
tdb: give a name to the invalid recovery area constant (0)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years agos4:provision Just 'do the right thing' with empty smb.conf files
Andrew Bartlett [Wed, 10 Feb 2010 02:56:24 +0000 (13:56 +1100)]
s4:provision Just 'do the right thing' with empty smb.conf files

For some reason, JHT keeps on creating an empty smb.conf file,
expecting it to be the same as a non-existant one.  It is easier to
just realise what he meant.

Andrew Bartlett

10 years agos4-smbtorture: use test_GetPrinter_level in RPC-SPOOLSS-NOTIFY.
Günther Deschner [Tue, 9 Feb 2010 23:43:51 +0000 (00:43 +0100)]
s4-smbtorture: use test_GetPrinter_level in RPC-SPOOLSS-NOTIFY.

Guenther

10 years agoFix bug #7122 - Reading a large browselist fails (server returns invalid values in...
Jeremy Allison [Tue, 9 Feb 2010 23:14:38 +0000 (15:14 -0800)]
Fix bug #7122 - Reading a large browselist fails (server returns invalid values in subsequent SMBtrans replies)

There are two problems:

1). The server is off-by-one in the end of buffer space test.
2). The server returns 0 in the totaldata (smb_vwv1) and totalparams (smb_vwv0)
fields in the second and subsequent SMBtrans replies.

This patch fixes both.

Jeremy.