obnox/samba-ctdb.git
14 years agos3:net: add a command "net registry setsd_sdd" 3.4.7-ctdb-1 v3-4-ctdb-latest-release
Michael Adam [Tue, 2 Mar 2010 13:43:53 +0000 (14:43 +0100)]
s3:net: add a command "net registry setsd_sdd"

This permits to set the security descriptor of a registry
key from the unix command line.

Michael
(cherry picked from commit 27ae935a8df409ce7557bd369250fa450120fdfe)

14 years agos3:net: add new subcommand "net registry getsd_sddl" to print secdesc in sddl format
Michael Adam [Fri, 26 Feb 2010 08:37:45 +0000 (09:37 +0100)]
s3:net: add new subcommand "net registry getsd_sddl" to print secdesc in sddl format

Michael
(cherry picked from commit caa27bb165a69766585ec4a13a6c09fa774d3b48)

14 years agos3:net: refactor getting of secdesc out of net_registry_getsd()
Michael Adam [Fri, 26 Feb 2010 08:31:03 +0000 (09:31 +0100)]
s3:net: refactor getting of secdesc out of net_registry_getsd()

New net_registry_getsd_internal does the work(),
net_registry_getsd() just prints the result.
This in preparation to add support for other output formats
than the currently used display_sec_desc().

Michael

14 years agos3:smbcacls: forbid change of debug level from config file
Michael Adam [Tue, 11 Aug 2009 21:35:48 +0000 (23:35 +0200)]
s3:smbcacls: forbid change of debug level from config file

Michael
(cherry picked from commit a038f1e05b8b7acb5e99257e59178e1ece4ce156)

14 years agos3:smbcacls: also honour the "--sddl" flag when setting ACLs.
Michael Adam [Mon, 15 Mar 2010 11:16:52 +0000 (12:16 +0100)]
s3:smbcacls: also honour the "--sddl" flag when setting ACLs.

Michael

14 years agos3:smbcacls: add switch "--sddl" to output acls as sddl encoded strings
Michael Adam [Sun, 28 Feb 2010 21:20:03 +0000 (22:20 +0100)]
s3:smbcacls: add switch "--sddl" to output acls as sddl encoded strings
(cherry picked from commit 9cea4d5969d3061689e7399e0a97f7f83ed31976)

14 years agos3: build sddl.c in samba3
Michael Adam [Sun, 28 Feb 2010 21:15:23 +0000 (22:15 +0100)]
s3: build sddl.c in samba3

14 years agolibcli/security: fix sddl.c to be able to build it from source3
Michael Adam [Sun, 28 Feb 2010 21:01:49 +0000 (22:01 +0100)]
libcli/security: fix sddl.c to be able to build it from source3
(cherry picked from commit f37030b33afa989adaafa6d3d02751bd286f879b)

14 years agos4:move the sddl code down to the top level
Michael Adam [Fri, 26 Feb 2010 17:32:21 +0000 (18:32 +0100)]
s4:move the sddl code down to the top level

Michael

14 years agos3: Add "net registry increment"
Volker Lendecke [Fri, 12 Mar 2010 14:48:35 +0000 (15:48 +0100)]
s3: Add "net registry increment"

A convenience function to increment a DWORD value under a (cluster-wide) lock

14 years agos3: Add "g_lock_do" as a convenience wrapper function
Volker Lendecke [Fri, 12 Mar 2010 13:22:54 +0000 (14:22 +0100)]
s3: Add "g_lock_do" as a convenience wrapper function

14 years agos3: Actually use mem_ctx in net_g_lock_init()
Volker Lendecke [Fri, 12 Mar 2010 11:12:25 +0000 (12:12 +0100)]
s3: Actually use mem_ctx in net_g_lock_init()

14 years agos3: Fix a long-standing problem with recycled PIDs
Volker Lendecke [Tue, 2 Mar 2010 16:02:01 +0000 (17:02 +0100)]
s3: Fix a long-standing problem with recycled PIDs

When a samba server process dies hard, it has no chance to clean up its entries
in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb.

For locking.tdb and brlock.tdb Samba is robust by checking every time we read
an entry from the database if the corresponding process still exists. If it
does not exist anymore, the entry is deleted. This is not 100% failsafe though:
On systems with a limited PID space there is a non-zero chance that between the
smbd's death and the fresh access, the PID is recycled by another long-running
process. This renders all files that had been locked by the killed smbd
potentially unusable until the new process also dies.

This patch is supposed to fix the problem the following way: Every process ID
in every database is augmented by a random 64-bit number that is stored in a
serverid.tdb. Whenever we need to check if a process still exists we know its
PID and the 64-bit number. We look up the PID in serverid.tdb and compare the
64-bit number. If it's the same, the process still is a valid smbd holding the
lock. If it is different, a new smbd has taken over.

I believe this is safe against an smbd that has died hard and the PID has been
taken over by a non-samba process. This process would not have registered
itself with a fresh 64-bit number in serverid.tdb, so the old one still exists
in serverid.tdb. We protect against this case by the parent smbd taking care of
deregistering PIDs from serverid.tdb and the fact that serverid.tdb is
CLEAR_IF_FIRST.

CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not
work when all smbds are restarted. For this, "net serverid wipe" has to be run
before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up
sessionid.tdb and connections.tdb.

While there, this also cleans up overloading connections.tdb with all the
process entries just for messaging_send_all().

Volker

14 years agos3:release-scripts: fix create-tarball to treat vendor patch level correctly
Michael Adam [Mon, 8 Mar 2010 22:35:17 +0000 (23:35 +0100)]
s3:release-scripts: fix create-tarball to treat vendor patch level correctly

14 years agopackaging(RHEL-CTDB): explicitly build the tsm vfs module.
Volker Lendecke [Mon, 8 Mar 2010 16:59:35 +0000 (17:59 +0100)]
packaging(RHEL-CTDB): explicitly build the tsm vfs module.

14 years agopackaging(RHEL-CTDB): Fix the RPM build
Volker Lendecke [Fri, 5 Mar 2010 15:10:49 +0000 (16:10 +0100)]
packaging(RHEL-CTDB): Fix the RPM build

14 years agos3:build: Fix automatic building of vfs_tsmsm if gpfs and dmapi are present.
Michael Adam [Mon, 8 Mar 2010 21:32:41 +0000 (22:32 +0100)]
s3:build: Fix automatic building of vfs_tsmsm if gpfs and dmapi are present.

Michael

14 years agos3: Make "smbcontrol xx debuglevel" print the correct cluster pid
Volker Lendecke [Fri, 5 Mar 2010 16:06:08 +0000 (17:06 +0100)]
s3: Make "smbcontrol xx debuglevel" print the correct cluster pid

14 years agov3-4-ctdb: Fix the build of vfs_gpfs_prefetch.c
Volker Lendecke [Fri, 5 Mar 2010 11:28:59 +0000 (12:28 +0100)]
v3-4-ctdb: Fix the build of vfs_gpfs_prefetch.c

14 years agos3: Fix timeout calculation if g_lock_lock is given a timeout < 60s
Volker Lendecke [Tue, 16 Feb 2010 14:21:25 +0000 (15:21 +0100)]
s3: Fix timeout calculation if g_lock_lock is given a timeout < 60s

Detected while showing this code to obnox :-)

14 years agos3: Slightly increase parallelism in g_lock
Volker Lendecke [Tue, 16 Feb 2010 11:31:58 +0000 (12:31 +0100)]
s3: Slightly increase parallelism in g_lock

There's no need to still hold the g_lock tdb-level lock while telling the
waiters to retry

14 years agos3: Avoid starving locks when many processes die at the same time
Volker Lendecke [Tue, 16 Feb 2010 11:28:53 +0000 (12:28 +0100)]
s3: Avoid starving locks when many processes die at the same time

In g_lock_unlock we have a little race between the process_exists and
messaging_send call: We only send to 5 waiters now, they all might have died
between us checking their existence and sending the message. This change makes
g_lock_lock retry at least once every minute.

14 years agos3: Avoid a thundering herd in g_lock_unlock
Volker Lendecke [Tue, 16 Feb 2010 11:22:08 +0000 (12:22 +0100)]
s3: Avoid a thundering herd in g_lock_unlock

Only notify the first 5 pending lock waiters. This avoids a thundering herd
problem that is really nasty in a cluster. It also makes acquiring a lock a bit
more FIFO, lock waiters are added to the end of the array.

14 years agos3: Optimize g_lock_lock for a heavily contended case
Volker Lendecke [Mon, 15 Feb 2010 15:57:16 +0000 (16:57 +0100)]
s3: Optimize g_lock_lock for a heavily contended case

Only check the existence of the lock owner in g_lock_parse, check the rest of
the records only when we got the lock successfully. This reduces the load on
process_exists which can involve a network roundtrip in the clustered case.

14 years agos3: Fix handling of processes that died in g_lock
Volker Lendecke [Mon, 15 Feb 2010 15:49:46 +0000 (16:49 +0100)]
s3: Fix handling of processes that died in g_lock

g_lock_parse might have thrown away entries from the locks array because the
processes were not around anymore. Don't store the orphaned entries.

14 years agos3: Fix a typo
Volker Lendecke [Mon, 15 Feb 2010 15:35:06 +0000 (16:35 +0100)]
s3: Fix a typo

14 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

14 years agos3-events: make the old timed events compatible with tevent
Andrew Tridgell [Fri, 5 Feb 2010 03:25:03 +0000 (14:25 +1100)]
s3-events: make the old timed events compatible with tevent

tevent ensures that a timed event is only called once. The old events
code relied on the called handler removing the event itself. If the
handler removed the event after calling a function which invoked the
event loop then the timed event could loop forever.

This change makes the two timed event systems more compatible, by
allowing the handler to free the te if it wants to, but ensuring it is
off the linked list of events before the handler is called, and
ensuring it is freed even if the handler doesn't free it.

14 years agos3-smbd: add a rate limited cleanup of brl, connections and locking db
Andrew Tridgell [Fri, 5 Feb 2010 01:42:06 +0000 (12:42 +1100)]
s3-smbd: add a rate limited cleanup of brl, connections and locking db

On unclean shutdown we can end up with stale entries in the brlock,
connections and locking db. Previously we would do the cleanup on
every unclean exit, but that can cause smbd to be completely
unavailable for several minutes when a large number of child smbd
processes exit.

This adds a rate limited cleanup of the databases, with the default
that cleanup happens at most every 20s

14 years agos3-brlock: we don't need these MSG_SMB_UNLOCK calls now
Andrew Tridgell [Thu, 4 Feb 2010 07:02:52 +0000 (18:02 +1100)]
s3-brlock: we don't need these MSG_SMB_UNLOCK calls now

These have been replaced with the min timeout in blocking.c

14 years agos3-brlock: add a minimim retry time for pending blocking locks
Andrew Tridgell [Sat, 6 Feb 2010 04:59:43 +0000 (20:59 -0800)]
s3-brlock: add a minimim retry time for pending blocking locks

When we are waiting on a pending byte range lock, another smbd might
exit uncleanly, and therefore not notify us of the removal of the
lock, and thus not trigger the lock to be retried.

We coped with this up to now by adding a message_send_all() in the
SIGCHLD and cluster reconfigure handlers to send a MSG_SMB_UNLOCK to
all smbd processes. That would generate O(N^2) work when a large
number of clients disconnected at once (such as on a network outage),
which could leave the whole system unusable for a very long time (many
minutes, or even longer).

By adding a minimum re-check time for pending byte range locks we
avoid this problem by ensuring that pending locks are retried at a
more regular interval.

14 years agopackaging(RHEL-CTDB): adapt configure.rpm to match the spec-file configure call
Michael Adam [Tue, 9 Feb 2010 07:00:06 +0000 (08:00 +0100)]
packaging(RHEL-CTDB): adapt configure.rpm to match the spec-file configure call

Michael

14 years agos3: Add a vfs_time_audit module
Abhidnya P Chirmule [Wed, 6 Jan 2010 18:45:24 +0000 (19:45 +0100)]
s3: Add a vfs_time_audit module

This warns if a file system is slow

14 years agos3:registry: eliminate race condition in creating/scanning sorted subkeys
Michael Adam [Mon, 8 Feb 2010 10:01:47 +0000 (11:01 +0100)]
s3:registry: eliminate race condition in creating/scanning sorted subkeys

Called, from key_exists, scan_sorted_subkeys re-creates the sorted
subkeys record of the given key and then searches through it.
The race is that between creation and parsing of the sorted subkey
record, another process that stores some other subkey of the same
parent key will delete the sorted subkey record, resulting in an
WERR_BADFILE of an operation that should actually succeed.

This patch fixes the issue by wrapping the creation and parsing
into a transaction.

Michael

14 years agos3:make "net conf addshare" atomic by wrapping all writes in one transaction
Michael Adam [Fri, 29 Jan 2010 14:04:25 +0000 (15:04 +0100)]
s3:make "net conf addshare" atomic by wrapping all writes in one transaction

Michael

14 years agos3:g_lock: remove a nested event loop, replacing the inner loop by select
Michael Adam [Sat, 23 Jan 2010 00:17:06 +0000 (01:17 +0100)]
s3:g_lock: remove a nested event loop, replacing the inner loop by select

This made smbd crash in g_lock_lock() when trying to start a
transaction on a db with an already started transaction,
e.g. in a tcon_and_X where the share_info.tdb was not yet
initialized but share_info.tdb was already locked by another
process or writing acces to the winreg rpc pipe where the
registry tdb was already locked by another process.

What we really _want_ to do here by design is to react to
MSG_DBWRAP_G_LOCK_RETRY messages that are either sent
by a client doing g_lock_unlock or by ourselves when
we receive a CTDB_SRVID_SAMBA_NOTIFY or
CTDB_SRVID_RECONFIGURE message from ctdbd, i.e. when
either a client holding a lock or a complete node
has died.

Doing this properly involves calling tevent_loop_once(),
but doing this here with the main ctdbd messaging context
creates a nested event loop when g_lock_lock() is called
from the main event loop.

So as a quick fix, we act a little corasely here: we do
a select on the ctdb connection fd and when it is readable
or we get EINTR, then we retry without actually parsing
any ctdb packages or dispatching messages. This means that
we retry more often than necessary and intended by design,
but this does not harm and it is unobtrusive. When we have
finished, the main loop will pick up all the messages and
ctdb packets. The only extra twist is that we cannot use
timed events here but have to handcode a timeout for select.

Michael

14 years agos3:ctdb_conn: add ctdbd_conn_get_fd() to get the fd out of the ctdb connection
Michael Adam [Fri, 22 Jan 2010 23:05:15 +0000 (00:05 +0100)]
s3:ctdb_conn: add ctdbd_conn_get_fd() to get the fd out of the ctdb connection

Michael

14 years agos3:g_lock: remove an unreached code path.
Michael Adam [Fri, 22 Jan 2010 14:56:28 +0000 (15:56 +0100)]
s3:g_lock: remove an unreached code path.

Michael

14 years agos3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__
Michael Adam [Mon, 18 Jan 2010 16:26:04 +0000 (17:26 +0100)]
s3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__

The key for reading and writing was inconsistent due to a
off by one data length.

Michael

14 years agov3-4-ctdb: Do not do any logrotation
Volker Lendecke [Thu, 14 Jan 2010 17:26:01 +0000 (18:26 +0100)]
v3-4-ctdb: Do not do any logrotation

14 years agos3:dbwrap_ctdb: exit early when nothing has been written in transaction_commit.
Michael Adam [Wed, 13 Jan 2010 22:53:54 +0000 (23:53 +0100)]
s3:dbwrap_ctdb: exit early when nothing has been written in transaction_commit.

This skips update of the __db_sequence_number__ record when nothing else has
been written. There are transactions that are just openend and then nothing
is written until transaction_commit is called. This is for instance the case
with registry initialization routines: They start a transaction and only
write somthing when the registry has not been initialized yet.
So this change will skip many db_seqnum bumps and TRANS3_COMMIT roundtrips.

Michael

14 years agos3:dbwrap_ctdb: fix brown paperbag bug in ctdb_transaction_commit.
Michael Adam [Wed, 13 Jan 2010 22:51:34 +0000 (23:51 +0100)]
s3:dbwrap_ctdb: fix brown paperbag bug in ctdb_transaction_commit.

I carefully prepared the return value only to "return 0;" at the bottom. :-(
This may well have hit us for instance in the nested cancel case
and produced random errors.

Michael

14 years agos3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().
Michael Adam [Tue, 5 Jan 2010 23:37:21 +0000 (00:37 +0100)]
s3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().

The logic bug was that if a record was found in the marshall buffer,
then always the ctdb header of tha last record in the marshall buffer
was returned, and not the ctdb header of the last occurrence of the
requested record.

This is fixed by introducing an additional temporary variable.

Michael

14 years agos3:dbwrap_ctdb: fix an uninitialized variable.
Michael Adam [Tue, 5 Jan 2010 15:17:27 +0000 (16:17 +0100)]
s3:dbwrap_ctdb: fix an uninitialized variable.

Michael

14 years agos3:dbwrap_ctdb: fix two "may be used uninitialized" warnings
Michael Adam [Fri, 11 Dec 2009 23:38:14 +0000 (00:38 +0100)]
s3:dbwrap_ctdb: fix two "may be used uninitialized" warnings

Michael

14 years agos3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.
Michael Adam [Fri, 11 Dec 2009 23:30:37 +0000 (00:30 +0100)]
s3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.

Don't treat this as an error but return seqnum 0 instead.

Michael

14 years agos3:dbwrap: If "-n" is given to dbwrap_torture, open db with CLEAR_IF_FIRST
Volker Lendecke [Fri, 11 Dec 2009 15:51:40 +0000 (16:51 +0100)]
s3:dbwrap: If "-n" is given to dbwrap_torture, open db with CLEAR_IF_FIRST

14 years agos3:build: remove checks for deprecated ctdb controls.
Michael Adam [Fri, 11 Dec 2009 15:45:38 +0000 (16:45 +0100)]
s3:build: remove checks for deprecated ctdb controls.

Michael

14 years agos3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions
Michael Adam [Fri, 11 Dec 2009 13:07:28 +0000 (14:07 +0100)]
s3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions

For persistent databases, 64bit integer is kept in a special record
__db_sequence_number__. This record is incremented with each completed
transaction.

The retry mechanism for failing TRANS3_COMMIT controls inside the
db_ctdb_transaction_commit() function now relies one a modified
behaviour of ctdbd's treatment of persistent databases in recoveries.
Recently, a special treatment for persistent databases had been
introduced in ctdb (1.0.108) to work around the problems with the
orinal design of persistent transactions.
Now with the rewrite we need to revert to the old behaviour that
ctdb always takes the newest copies of all records.

This change also paves the way for a next step, which will make
recovery use the db seqnum to tell which node has the newest copy
of a persistent db and use that node's copy. This will greatly
reduce the amount of data transferred with each recovery.

Michael

14 years agos3:dbwrap_ctdb: change db_ctdb_transaction_store() to return NTSTATUS.
Michael Adam [Fri, 11 Dec 2009 11:30:57 +0000 (12:30 +0100)]
s3:dbwrap_ctdb: change db_ctdb_transaction_store() to return NTSTATUS.

The return values calculated by the callers were wrong anyways since
the new marshalling code does not set the local tdbs tdb error code.

Michael

14 years agos3:dbwrap_ctdb: update (C)
Michael Adam [Fri, 11 Dec 2009 09:35:50 +0000 (10:35 +0100)]
s3:dbwrap_ctdb: update (C)

Michael

14 years agobuild: Add a configure check for CTDB_CONTROL_TRANS3_COMMIT.
Michael Adam [Fri, 4 Dec 2009 10:49:21 +0000 (11:49 +0100)]
build: Add a configure check for CTDB_CONTROL_TRANS3_COMMIT.

This is the new implementation of ctdb transactions using the
global lock feature. It is needed by the current dbwrap_ctdb code.

Michael

14 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.

14 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

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

14 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()

14 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.

14 years agos3: Add tdb_data_equal
Volker Lendecke [Thu, 3 Dec 2009 17:43:49 +0000 (18:43 +0100)]
s3: Add tdb_data_equal

14 years agos3: Correctly handle timeouts for the ping-dc operation
Volker Lendecke [Wed, 16 Dec 2009 16:22:48 +0000 (17:22 +0100)]
s3: Correctly handle timeouts for the ping-dc operation

When a DC is too slow responding to the logonCtrl operation, we have to
invalidate the connection. Right now we can not recover from that condition
very well.

14 years agos3: Add "net registry getvaluesraw"
Volker Lendecke [Tue, 15 Dec 2009 19:17:01 +0000 (20:17 +0100)]
s3: Add "net registry getvaluesraw"

14 years agostreamline some log levels for invalid servicenames
Christian Ambach [Wed, 2 Dec 2009 19:06:37 +0000 (20:06 +0100)]
streamline some log levels for invalid servicenames

I don't think we need to log the fact that a user gave a wrong sharename in Explorer with the highest log level.
The level of this was not very consistent:
service.c: DEBUG(3,("find_service() failed to find service %s\n", service));
service.c: DEBUG(0,("%s (%s) couldn't find service %s\n",
smb2_tcon.c: DEBUG(1,("smbd_smb2_tree_connect: couldn't find service %s\n",

This changes the last two to 3 as the first one.

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
14 years agopackaging(RHEL-CTDB): clean some commented out lines from the files sections
Michael Adam [Mon, 7 Dec 2009 13:27:28 +0000 (14:27 +0100)]
packaging(RHEL-CTDB): clean some commented out lines from the files sections

Michael

14 years agopackaging(RHEL-CTDB): explicitly list library versions in samba-winbind-32bit
Michael Adam [Mon, 7 Dec 2009 13:26:03 +0000 (14:26 +0100)]
packaging(RHEL-CTDB): explicitly list library versions in samba-winbind-32bit

Michael

14 years agopackaging(RHEL-CTDB): explicitly list library versions in samba-common
Michael Adam [Mon, 7 Dec 2009 13:25:32 +0000 (14:25 +0100)]
packaging(RHEL-CTDB): explicitly list library versions in samba-common

Michael

14 years agopackaging(RHEL-CTDB): explicitly list all packaged idmap/nss-info/charset modules
Michael Adam [Mon, 7 Dec 2009 13:20:24 +0000 (14:20 +0100)]
packaging(RHEL-CTDB): explicitly list all packaged idmap/nss-info/charset modules

in the samba-common package.
This is to  better be able to catch regressions or
build problems.

Michael

14 years agopackaging(RHEL-CTDB): explicitly list all the vfs modules in the main package
Michael Adam [Mon, 7 Dec 2009 13:16:15 +0000 (14:16 +0100)]
packaging(RHEL-CTDB): explicitly list all the vfs modules in the main package

Instead of the wildcard list, to better control regressions or
build problems.

Michael

14 years agopackaging(RHEL-CTDB): add some checks to test the built smbd
Michael Adam [Mon, 7 Dec 2009 13:12:05 +0000 (14:12 +0100)]
packaging(RHEL-CTDB): add some checks to test the built smbd

Test whether some required features have been built into smbd.
Can be extended...

Michael

14 years agopackaging(RHEL-CTDB): make everything instead of all in the build stage
Michael Adam [Mon, 7 Dec 2009 13:11:32 +0000 (14:11 +0100)]
packaging(RHEL-CTDB): make everything instead of all in the build stage

Michael

14 years agos3:build: fix detection of CTDB headers on systems without system-libtalloc
Michael Adam [Tue, 1 Dec 2009 14:22:20 +0000 (15:22 +0100)]
s3:build: fix detection of CTDB headers on systems without system-libtalloc

Michael

14 years agopackaging(RHEL-CTDB): package dbwrap_tool and dbwrap_torture in the common pkg
Michael Adam [Fri, 4 Dec 2009 22:29:22 +0000 (23:29 +0100)]
packaging(RHEL-CTDB): package dbwrap_tool and dbwrap_torture in the common pkg

Michael

14 years agos3:dbwrap_ctdb: increase the number of commit retries 5-->100
Michael Adam [Fri, 4 Dec 2009 13:53:05 +0000 (14:53 +0100)]
s3:dbwrap_ctdb: increase the number of commit retries 5-->100

This is to cope with timeouts when recoveries and transactions collide.
Maybe 100 is too hight, but 10 or even 20 have been too low in a
very busy environment.

Michael

14 years agos3:dbwrap_ctdb: increase the rsn of the __transaction_lock__ when storing
Michael Adam [Fri, 4 Dec 2009 13:49:53 +0000 (14:49 +0100)]
s3:dbwrap_ctdb: increase the rsn of the __transaction_lock__ when storing

so that it is correctly handled by recoveries.
Also set the dmaster explicitly.

Michael

14 years agos3: Fix the code to immediately disconnect from a non-working ctdbd
Volker Lendecke [Thu, 3 Dec 2009 00:55:52 +0000 (01:55 +0100)]
s3: Fix the code to immediately disconnect from a non-working ctdbd

14 years agoAdd a low-cost alternative to wbinfo -t: winfo --ping-dc
Volker Lendecke [Tue, 1 Dec 2009 10:45:03 +0000 (11:45 +0100)]
Add a low-cost alternative to wbinfo -t: winfo --ping-dc

14 years agos3: Do not connect to ctdb if it is blocked for some reason
Volker Lendecke [Mon, 16 Nov 2009 11:03:24 +0000 (12:03 +0100)]
s3: Do not connect to ctdb if it is blocked for some reason

14 years agos3: Fix the winbind piece of 58045: Correctly time out client smb requests
Volker Lendecke [Thu, 26 Nov 2009 16:58:01 +0000 (17:58 +0100)]
s3: Fix the winbind piece of 58045: Correctly time out client smb requests

14 years agos3:dbwrap_torture: use timeval_current/timeval_elapsed instead of start_timer/end_timer
Stefan Metzmacher [Tue, 24 Nov 2009 09:36:52 +0000 (10:36 +0100)]
s3:dbwrap_torture: use timeval_current/timeval_elapsed instead of start_timer/end_timer

metze

14 years agos3:fix the merged build of bin/smbtorture4
Michael Adam [Tue, 24 Nov 2009 10:43:56 +0000 (11:43 +0100)]
s3:fix the merged build of bin/smbtorture4

Michael

14 years agos3: Always try SamLogonEx
Volker Lendecke [Tue, 24 Nov 2009 15:51:30 +0000 (16:51 +0100)]
s3: Always try SamLogonEx

Required for cluster systems working in a Samba domain. With NT4 this won't
work, but real NT4 DCs should not be around in environments that pay big bucks
for a cluster... And if they are, they can always install a Samba DC trusting
that NT4 domain.

14 years agos3: add dbwrap_torture - a tool to stress test tdb transactions through dbwrap
Michael Adam [Mon, 23 Nov 2009 14:40:36 +0000 (15:40 +0100)]
s3: add dbwrap_torture - a tool to stress test tdb transactions through dbwrap

This can be used to also test tdb transactions on clustered installations
throught ctdb. The test is modeled after the ctdb_transaction.c test program
from the ctdb source code. It runs transactions in a tight loop on a test
database called "transactions.tdb" (by default), increasing a counter in each
iteration. In a clustered environment, a counter is maintained for each node.

Michael

14 years agos3:torture: move the torture-specific headers to new torture/torture.h
Michael Adam [Fri, 20 Nov 2009 16:47:21 +0000 (17:47 +0100)]
s3:torture: move the torture-specific headers to new torture/torture.h

Michael

14 years agogpfs: fix logic when gpfs:winattr is false (the default!)
Rusty Russell [Fri, 20 Nov 2009 09:39:57 +0000 (10:39 +0100)]
gpfs: fix logic when gpfs:winattr is false (the default!)

On my autocluster setup, it's not set.  Maybe it should be?  Otherwise
smbclient and some Windows client programs will get errors like:

        # smbclient //localhost/data -Uadministrator%XXX
        Domain=[VSOFS1] OS=[Unix] Server=[Samba 3.4.2-ctdb-10]
        smb: \> put /etc/resolv.conf resolv.conf
        NT_STATUS_ACCESS_DENIED closing remote file \resolv.conf
        smb: \>

Caused by attempting to update the time on close.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Avoid races to change the machine password in winbind
Volker Lendecke [Thu, 19 Nov 2009 16:22:27 +0000 (17:22 +0100)]
s3: Avoid races to change the machine password in winbind

The machine password handler has code to deal with every node in the cluster
trying to change the machine password at the same time. However, it is not very
nice to the DC if everyone tries this simultaneously. This adds a random 0-255
second offset to our timed event. When this fires a bit later than strictly
calculated, someone else might have stepped in and have already changed it. The
timed event handler will handle this gracefully, it won't even try to do it
again.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Protect against flooding the DC with pwchange requests
Volker Lendecke [Thu, 19 Nov 2009 16:20:47 +0000 (17:20 +0100)]
s3: Protect against flooding the DC with pwchange requests

When there is a temporary problem changing passwords we flooded the DC with
pwchange requests. This gives the DC a 60-second break to recover.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Deal with races for password changes
Volker Lendecke [Thu, 19 Nov 2009 16:16:54 +0000 (17:16 +0100)]
s3: Deal with races for password changes

When two winbinds (in a cluster) change the password at the same time, the
later one gets an NT_STATUS_ACCESS_DENIED. The netlogon session works fine, but
the next time we retry the pwchange, we again get NT_STATUS_ACCESS_DENIED. This
code deals with this race by dropping just the NETLOGON pipe. The next caller
will re-open it automatically with the changed machine credentials.

With this race in place, we also have to recalculate the timeout for the next
pwchange event.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Re-check the timeout in machine_password_change_handler()
Volker Lendecke [Thu, 19 Nov 2009 16:14:40 +0000 (17:14 +0100)]
s3: Re-check the timeout in machine_password_change_handler()

Someone else might have come in between and changed the password since we
created that timed request

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Add some debugs to the winbind machine pwchange machinery
Volker Lendecke [Thu, 19 Nov 2009 16:11:32 +0000 (17:11 +0100)]
s3: Add some debugs to the winbind machine pwchange machinery

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Factor timeval_string out of current_timestring()
Volker Lendecke [Thu, 19 Nov 2009 10:50:13 +0000 (11:50 +0100)]
s3: Factor timeval_string out of current_timestring()

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3-netlogon: setup NETLOGON credential chain in rpccli_netlogon_set_trust_password...
Günther Deschner [Mon, 5 Oct 2009 15:04:52 +0000 (17:04 +0200)]
s3-netlogon: setup NETLOGON credential chain in rpccli_netlogon_set_trust_password() only when needed.

Guenther

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Fix shadow copies after the change for in-path @GMT-
Volker Lendecke [Thu, 12 Nov 2009 11:30:58 +0000 (12:30 +0100)]
s3: Fix shadow copies after the change for in-path @GMT-

14 years agos3: Fix check_reduced_name for access to the share root itself
Volker Lendecke [Thu, 12 Nov 2009 11:29:19 +0000 (12:29 +0100)]
s3: Fix check_reduced_name for access to the share root itself

14 years agos3: Fix debug messages in check_reduced_name
Volker Lendecke [Thu, 12 Nov 2009 10:07:15 +0000 (11:07 +0100)]
s3: Fix debug messages in check_reduced_name

14 years agos3:vfs_fs_capabilities: fix a debug message
Michael Adam [Tue, 10 Nov 2009 23:13:14 +0000 (00:13 +0100)]
s3:vfs_fs_capabilities: fix a debug message

Michael

14 years agos3: Try to avoid dns searches with an empty site
Volker Lendecke [Mon, 9 Nov 2009 16:06:48 +0000 (17:06 +0100)]
s3: Try to avoid dns searches with an empty site

14 years agos3: Fix in-path shadowcopy2 module
Volker Lendecke [Mon, 9 Nov 2009 10:06:30 +0000 (11:06 +0100)]
s3: Fix in-path shadowcopy2 module

14 years agoadd e2fsprogs-devel as build dependency this is needed for AD because it contains...
Christian Ambach [Mon, 6 Jul 2009 12:08:57 +0000 (14:08 +0200)]
add e2fsprogs-devel as build dependency this is needed for AD because it contains libcom/libcom_err files and headers

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
Signed-off-by: Michael Adam <obnox@samba.org>
14 years agos3: Fix a crash in notify_remove_onelevel when "change notify = no"
Volker Lendecke [Thu, 5 Nov 2009 14:06:21 +0000 (15:06 +0100)]
s3: Fix a crash in notify_remove_onelevel when "change notify = no"

14 years agos3: Add parameter "ctdb timeout"
Volker Lendecke [Tue, 3 Nov 2009 04:41:02 +0000 (05:41 +0100)]
s3: Add parameter "ctdb timeout"

When something in the cluster blocks, it can happen that we wait indefinitely
long for ctdb, just adding to the blocking condition. In theory, nothing should
block, but as someone said "In practice the difference between theory and
practice is larger than in theory". This adds a timeout parameter in seconds,
after which we stop waiting for ctdb and panic.

Signed-off-by: Michael Adam <obnox@samba.org>
14 years agopackaging(RHEL-CTDB): add the current githash to the rpm release number by default
Michael Adam [Wed, 4 Nov 2009 11:26:46 +0000 (12:26 +0100)]
packaging(RHEL-CTDB): add the current githash to the rpm release number by default

Disable this (to build a release-rpm) by calling

USE_GITHASH=no makerpms.sh

Michael

14 years agos3:registry: add an extra check for dsize==0 to regdb_fetch_keys_internal()
Michael Adam [Mon, 2 Nov 2009 23:51:27 +0000 (00:51 +0100)]
s3:registry: add an extra check for dsize==0 to regdb_fetch_keys_internal()

Don't only rely on dptr == NULL.
I stumbled over this one when rewriting some of the dbwrap_ctdb code.

Michael