ira/wip.git
10 years agos4-smbtorture: use test_SetPrinter call in spoolss security descriptor tests.
Günther Deschner [Mon, 15 Feb 2010 20:55:06 +0000 (21:55 +0100)]
s4-smbtorture: use test_SetPrinter call in spoolss security descriptor tests.

Guenther

10 years agos4-smbtorture: w2k8r2 allows to add printers w/o defining printprocessor.
Günther Deschner [Mon, 15 Feb 2010 18:23:35 +0000 (19:23 +0100)]
s4-smbtorture: w2k8r2 allows to add printers w/o defining printprocessor.

Guenther

10 years agotestprogs: fix EnumJobs debug output in spoolss test.
Günther Deschner [Mon, 15 Feb 2010 20:45:59 +0000 (21:45 +0100)]
testprogs: fix EnumJobs debug output in spoolss test.

Found by Kai, thanks!

Guenther

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

10 years agos4-rootdse: we don't need DSDB_FLAG_OWN_MODULE here
Andrew Tridgell [Mon, 15 Feb 2010 12:49:26 +0000 (23:49 +1100)]
s4-rootdse: we don't need DSDB_FLAG_OWN_MODULE here

10 years agos4-drs: enable the recyclebin optional feature
Eduardo Lima [Fri, 12 Feb 2010 16:18:27 +0000 (14:18 -0200)]
s4-drs: enable the recyclebin optional feature

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4-kcc: remove C++ comment
Andrew Tridgell [Mon, 15 Feb 2010 12:05:33 +0000 (23:05 +1100)]
s4-kcc: remove C++ comment

10 years agos4-kcc: initial code for the topology algorithm
Crístian Deives [Wed, 10 Feb 2010 05:42:28 +0000 (03:42 -0200)]
s4-kcc: initial code for the topology algorithm

this patch contains the data structures declarations and the functions to
setup the graph.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4-dsdb: don't change replPropertyMetaData if the value hasn't changed
Andrew Tridgell [Mon, 15 Feb 2010 11:49:35 +0000 (22:49 +1100)]
s4-dsdb: don't change replPropertyMetaData if the value hasn't changed

When updating replPropertyMetaData, check if the value being stored is
the same as the current value, and skip the update if it is.

This is based on a patch by Fernando J V da Silva <fernandojvsilva@yahoo.com.br>

10 years agos4-heimdal: Fix typos in comment.
Karolin Seeger [Mon, 15 Feb 2010 11:23:11 +0000 (12:23 +0100)]
s4-heimdal: Fix typos in comment.

Karolin

10 years agos4-test: use local ldb for urgent_replication test
Andrew Tridgell [Mon, 15 Feb 2010 10:21:55 +0000 (21:21 +1100)]
s4-test: use local ldb for urgent_replication test

This test only currently works on a local ldb, as it needs system
access.

10 years agos4-ldb: fixed permissions on urgent_replication.py
Andrew Tridgell [Mon, 15 Feb 2010 10:18:13 +0000 (21:18 +1100)]
s4-ldb: fixed permissions on urgent_replication.py

10 years agos4-test: minor fixes to urgent_replication.py
Andrew Tridgell [Mon, 15 Feb 2010 10:14:42 +0000 (21:14 +1100)]
s4-test: minor fixes to urgent_replication.py

- fix usage name
- remove unnecessary python functions
- remote unused gc ldb

10 years agos4-drs: Test situations for Urgent Replication
Fernando J V da Silva [Thu, 4 Feb 2010 19:03:41 +0000 (17:03 -0200)]
s4-drs: Test situations for Urgent Replication

Checks if the partition's uSNUrgent is updated or not, depending
on the class of the object which is created, modified or deleted.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4-drs: Function for accessing dsdb_load_partition_usn from Python
Fernando J V da Silva [Thu, 4 Feb 2010 18:58:31 +0000 (16:58 -0200)]
s4-drs: Function for accessing dsdb_load_partition_usn from Python

Returns both uSNHighest and uSNUrgent as a dict object in Python
from a given partition dn.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agos4-drs: Fixes bugs regarding Urgent Replication on wrong situations
Fernando J V da Silva [Thu, 4 Feb 2010 18:46:52 +0000 (16:46 -0200)]
s4-drs: Fixes bugs regarding Urgent Replication on wrong situations

It fixes the bug which causes an urgent replication to be enabled
incorrectly when an object is modified, but it should happen only
when it was created. This patch also fixes the bug that enable an
urgent replication when an object is deleted, but it should happen
only when it was modified and fixes the bug that does not enable
an urgent replication when an object is deleted and it should happen
only when it is deleted (not when it is modified).

Signed-off-by: Andrew Tridgell <tridge@samba.org>
10 years agospoolss: disable GetPrinterDriver level 101 (as called by XP).
Günther Deschner [Thu, 11 Feb 2010 11:54:57 +0000 (12:54 +0100)]
spoolss: disable GetPrinterDriver level 101 (as called by XP).

We still dont get the marshalling right, disable and XP will just fall back to
level 6.

Guenther

10 years agos4-smbtorture: add some security descriptor tests to RPC-SPOOLSS and RPC-SPOOLSS...
Günther Deschner [Sat, 13 Feb 2010 01:11:31 +0000 (02:11 +0100)]
s4-smbtorture: add some security descriptor tests to RPC-SPOOLSS and RPC-SPOOLSS-PRINTER.

Guenther

10 years agos4:provision.c - "provsion_store_self_join" - don't set the realm if it's NULL
Matthias Dieter Wallnöfer [Mon, 15 Feb 2010 09:29:47 +0000 (10:29 +0100)]
s4:provision.c - "provsion_store_self_join" - don't set the realm if it's NULL

The realm can be NULL when this function is called by "libnet_Join_primary_domain".
This seems to be a valid value since "libnet_JoinDomain" is allowed to return an
empty realm if we are not in a ADS domain.

10 years agos4-drs: replace manual checks with dsdb_modify_permissive()
Andrew Tridgell [Mon, 15 Feb 2010 06:39:20 +0000 (17:39 +1100)]
s4-drs: replace manual checks with dsdb_modify_permissive()

Much simpler to use the permissive control instead of manually munging
the SPN list.

10 years agos4-drs: use a permissive modify in addentry
Andrew Tridgell [Mon, 15 Feb 2010 06:38:47 +0000 (17:38 +1100)]
s4-drs: use a permissive modify in addentry

It is not an error if entries already exist.

10 years agos4-dsdb: added dsdb_modify_permissive()
Andrew Tridgell [Mon, 15 Feb 2010 06:38:16 +0000 (17:38 +1100)]
s4-dsdb: added dsdb_modify_permissive()

This will be used in the drsuapi server

10 years agos3: eventlogadm.c: add -s option to use alternative config file.
Holger Hetterich [Sun, 14 Feb 2010 18:05:00 +0000 (19:05 +0100)]
s3: eventlogadm.c: add -s option to use alternative config file.

Update the manpage accordingly.

10 years agos3: Fix initgroups return check
Peter Watkins [Sun, 14 Feb 2010 11:43:13 +0000 (12:43 +0100)]
s3: Fix initgroups return check

A return code of 1 from initgroups() is OK since apparently it means
the gid has already been set. The man page doesn't mention this.

10 years agos4:dcesrv_lsa.c - remove a superfluous empty line
Matthias Dieter Wallnöfer [Sun, 14 Feb 2010 09:48:13 +0000 (10:48 +0100)]
s4:dcesrv_lsa.c - remove a superfluous empty line

One empty line is enough for code part divisions.

10 years agos4-rpcserver: teach the rpc server to cope with bad sig_size estimates
Andrew Tridgell [Sun, 14 Feb 2010 06:09:55 +0000 (17:09 +1100)]
s4-rpcserver: teach the rpc server to cope with bad sig_size estimates

10 years agoa4-dcerpc: another attempt at dcerpc auth padding
Andrew Tridgell [Sun, 14 Feb 2010 00:56:28 +0000 (11:56 +1100)]
a4-dcerpc: another attempt at dcerpc auth padding

The last change broke net vampire against w2k8r2

10 years agoutil: update three other copies of our dlinklist.h macros
Andrew Tridgell [Sat, 6 Feb 2010 01:25:06 +0000 (12:25 +1100)]
util: update three other copies of our dlinklist.h macros

ldb and tevent have their own copies of these macros. This brings them
in sync with the master copy of dlinklist.h

10 years agos3: last part of TYPESAFE_QSORT() conversion
Andrew Tridgell [Sat, 13 Feb 2010 23:03:55 +0000 (10:03 +1100)]
s3: last part of TYPESAFE_QSORT() conversion

convert smbcacls, sharesec and web/

10 years agos3-smbd: convert lanman and notify code to TYPESAFE_QSORT()
Andrew Tridgell [Sat, 13 Feb 2010 23:03:12 +0000 (10:03 +1100)]
s3-smbd: convert lanman and notify code to TYPESAFE_QSORT()

10 years agos3-rpc: convert wkssvc to use TYPESAFE_QSORT()
Andrew Tridgell [Sat, 13 Feb 2010 23:02:54 +0000 (10:02 +1100)]
s3-rpc: convert wkssvc to use TYPESAFE_QSORT()

10 years agos3-locking: convert brlock to TYPESAFE_QSORT()
Andrew Tridgell [Sat, 13 Feb 2010 23:02:35 +0000 (10:02 +1100)]
s3-locking: convert brlock to TYPESAFE_QSORT()

10 years agos3: convert registry and printing code to TYPESAFE_QSORT()
Andrew Tridgell [Sat, 13 Feb 2010 23:02:19 +0000 (10:02 +1100)]
s3: convert registry and printing code to TYPESAFE_QSORT()

10 years agos3-nmbd: note TODO item for qsort
Andrew Tridgell [Sat, 13 Feb 2010 23:01:49 +0000 (10:01 +1100)]
s3-nmbd: note TODO item for qsort

This uses another char* cast hack. Left alone for now.

10 years agos3-vfs: use TYPESAFE_QSORT() in s3 VFS modules
Andrew Tridgell [Sat, 13 Feb 2010 23:01:17 +0000 (10:01 +1100)]
s3-vfs: use TYPESAFE_QSORT() in s3 VFS modules

10 years agos3-lib: use TYPESAFE_QSORT() in remaining s3 library code
Andrew Tridgell [Sat, 13 Feb 2010 23:00:49 +0000 (10:00 +1100)]
s3-lib: use TYPESAFE_QSORT() in remaining s3 library code

the sort_query_replies() in nmblib.c is a TODO. It uses a hack that
treats a char* as a structure. I've left that one alone for now.

10 years agos3-libsmb: use TYPESAFE_QSORT() in namequery code
Andrew Tridgell [Sat, 13 Feb 2010 22:59:26 +0000 (09:59 +1100)]
s3-libsmb: use TYPESAFE_QSORT() in namequery code

This one was a bit trickier. I'd appreciate it if someone else can
look over this.

10 years agos3-lib: use TYPESAFE_QSORT() in s3 interfaces code
Andrew Tridgell [Sat, 13 Feb 2010 22:58:33 +0000 (09:58 +1100)]
s3-lib: use TYPESAFE_QSORT() in s3 interfaces code

10 years agolib: use TYPESAFE_QSORT() in lib/ and libcli/
Andrew Tridgell [Sat, 13 Feb 2010 22:58:13 +0000 (09:58 +1100)]
lib: use TYPESAFE_QSORT() in lib/ and libcli/

10 years agos3-includes: enable TYPESAFE_QSORT() in s3
Andrew Tridgell [Sat, 13 Feb 2010 22:57:36 +0000 (09:57 +1100)]
s3-includes: enable TYPESAFE_QSORT() in s3

10 years agos4-ldb: use TYPESAFE_QSORT() in the rest of the ldb code
Andrew Tridgell [Sat, 13 Feb 2010 23:37:20 +0000 (10:37 +1100)]
s4-ldb: use TYPESAFE_QSORT() in the rest of the ldb code

10 years agos4:loadparm.c - prevent memory leaks
Matthias Dieter Wallnöfer [Sat, 13 Feb 2010 19:05:22 +0000 (20:05 +0100)]
s4:loadparm.c - prevent memory leaks

If a "logfile" was already set, free the content up before setting a new
location. This can happen on a loadparm reload.

10 years agos4:loadparm.c - the logfile parameter value needs to be duplicated
Matthias Dieter Wallnöfer [Sat, 13 Feb 2010 18:41:43 +0000 (19:41 +0100)]
s4:loadparm.c - the logfile parameter value needs to be duplicated

Otherwise the "logfile" pointer tracks all changes of "pszParmValue" which
content is only temporal. This was the cause of bug #6212.

10 years agos4:popt_common.c - fix intendation
Matthias Dieter Wallnöfer [Sat, 13 Feb 2010 18:19:02 +0000 (19:19 +0100)]
s4:popt_common.c - fix intendation

10 years agos4:util.c - Corrected the location of the "Directory Service" object
Matthias Dieter Wallnöfer [Sat, 13 Feb 2010 17:20:54 +0000 (18:20 +0100)]
s4:util.c - Corrected the location of the "Directory Service" object

I wonder why nobody noticed this since for sure this "tombstone" functionality
was broken till now.

10 years agos4:server.c - use always "return" instead of "exit" in the "binary_smbd_main" function
Matthias Dieter Wallnöfer [Sat, 13 Feb 2010 17:03:08 +0000 (18:03 +0100)]
s4:server.c - use always "return" instead of "exit" in the "binary_smbd_main" function

Just to be consistent - no functional change

10 years agolibwbclient: Fix s4 build failure by fixing up includes.
Kai Blin [Sat, 13 Feb 2010 16:54:27 +0000 (17:54 +0100)]
libwbclient: Fix s4 build failure by fixing up includes.

Sorry about this, folks.

10 years agos3: Fix Coverity ID 629: DEADCODE
Volker Lendecke [Sat, 13 Feb 2010 16:42:24 +0000 (17:42 +0100)]
s3: Fix Coverity ID 629: DEADCODE

We have already returned if (argc < 1) above

10 years agos3: Fix bug 5198 -- parse chfn(1)-change gecos field
Volker Lendecke [Sat, 6 Feb 2010 12:26:06 +0000 (13:26 +0100)]
s3: Fix bug 5198 -- parse chfn(1)-change gecos field

10 years agos3: Fix typo found by jhell <jhell@DataIX.net>
Volker Lendecke [Sat, 13 Feb 2010 15:38:25 +0000 (16:38 +0100)]
s3: Fix typo found by jhell <jhell@DataIX.net>

10 years agolibwbclient: Separate out the async functions
Kai Blin [Sat, 13 Feb 2010 12:42:56 +0000 (13:42 +0100)]
libwbclient: Separate out the async functions

10 years agos3: Remove unused comparison fn from "struct sorted_tree"
Volker Lendecke [Sun, 7 Feb 2010 14:49:13 +0000 (15:49 +0100)]
s3: Remove unused comparison fn from "struct sorted_tree"

10 years agos3: Make adt_tree data definitions private to adt_tree.c
Volker Lendecke [Sun, 7 Feb 2010 14:47:07 +0000 (15:47 +0100)]
s3: Make adt_tree data definitions private to adt_tree.c

10 years agos3: SORTED_TREE -> struct sorted_tree
Volker Lendecke [Sun, 7 Feb 2010 14:45:42 +0000 (15:45 +0100)]
s3: SORTED_TREE -> struct sorted_tree

10 years agos3: TREE_NODE -> struct tree_node
Volker Lendecke [Sun, 7 Feb 2010 14:42:26 +0000 (15:42 +0100)]
s3: TREE_NODE -> struct tree_node

10 years agos3: Fix some nonempty blank lines
Volker Lendecke [Sun, 7 Feb 2010 14:01:57 +0000 (15:01 +0100)]
s3: Fix some nonempty blank lines

10 years agouse ZERO_STRUCT
Volker Lendecke [Sun, 7 Feb 2010 16:57:56 +0000 (17:57 +0100)]
use ZERO_STRUCT

10 years agoUse ZERO_STRUCTP
Volker Lendecke [Sun, 7 Feb 2010 16:59:51 +0000 (17:59 +0100)]
Use ZERO_STRUCTP

10 years agos3: Fix a typo
Volker Lendecke [Sun, 7 Feb 2010 16:53:29 +0000 (17:53 +0100)]
s3: Fix a typo

10 years agos3: Fix a C++ warning
Volker Lendecke [Sat, 13 Feb 2010 12:02:15 +0000 (13:02 +0100)]
s3: Fix a C++ warning

10 years agos4-smbd: fix crash in notify code on client termination
Andrew Tridgell [Sat, 13 Feb 2010 12:09:59 +0000 (23:09 +1100)]
s4-smbd: fix crash in notify code on client termination

We need to free the lp_ctx after we free the event context, otherwise
the teardown code in the notify backend dies when it tries to use the
iconv_convenience ptr

Fixes bug 7053

10 years agos4-rpc: be more careful about DCERPC auth padding
Andrew Tridgell [Sat, 13 Feb 2010 04:32:23 +0000 (15:32 +1100)]
s4-rpc: be more careful about DCERPC auth padding

Cope with a wider range of auth padding in dcerpc bind_ack and
alter_context packets. We now use a helper function that calculates
the right auth padding.

10 years agos4: use LDB_TYPESAFE_QSORT() instead of ldb_qsort()
Andrew Tridgell [Sat, 13 Feb 2010 02:26:51 +0000 (13:26 +1100)]
s4: use LDB_TYPESAFE_QSORT() instead of ldb_qsort()

10 years agos4-ldb: added LDB_TYPESAFE_QSORT()
Andrew Tridgell [Sat, 13 Feb 2010 02:26:16 +0000 (13:26 +1100)]
s4-ldb: added LDB_TYPESAFE_QSORT()

Like TYPESAFE_QSORT() but for the ldb_qsort() function

10 years agos4-wrepl: use TYPESAFE_QSORT() in wins repl code
Andrew Tridgell [Sat, 13 Feb 2010 02:01:22 +0000 (13:01 +1100)]
s4-wrepl: use TYPESAFE_QSORT() in wins repl code

10 years agos4-torture: use TYPESAFE_QSORT() in smbtorture
Andrew Tridgell [Sat, 13 Feb 2010 02:01:08 +0000 (13:01 +1100)]
s4-torture: use TYPESAFE_QSORT() in smbtorture

10 years agos4-rpcserver: use TYPESAFE_QSORT() in rpc servers
Andrew Tridgell [Sat, 13 Feb 2010 02:00:55 +0000 (13:00 +1100)]
s4-rpcserver: use TYPESAFE_QSORT() in rpc servers

10 years agos4-ntvfs: use TYPESAFE_QSORT() in notify code
Andrew Tridgell [Sat, 13 Feb 2010 02:00:41 +0000 (13:00 +1100)]
s4-ntvfs: use TYPESAFE_QSORT() in notify code

10 years agos4-socket: use TYPESAFE_QSORT() in netif code
Andrew Tridgell [Sat, 13 Feb 2010 02:00:22 +0000 (13:00 +1100)]
s4-socket: use TYPESAFE_QSORT() in netif code

10 years agos4-auth: use TYPESAFE_QSORT() in gensec
Andrew Tridgell [Sat, 13 Feb 2010 02:00:03 +0000 (13:00 +1100)]
s4-auth: use TYPESAFE_QSORT() in gensec

10 years agos4-dsdb: use TYPESAFE_QSORT() in dsdb code
Andrew Tridgell [Sat, 13 Feb 2010 01:59:43 +0000 (12:59 +1100)]
s4-dsdb: use TYPESAFE_QSORT() in dsdb code

10 years agotdb: use fdatasync() instead of fsync() in transactions
Andrew Tridgell [Sat, 13 Feb 2010 01:57:37 +0000 (12:57 +1100)]
tdb: use fdatasync() instead of fsync() in transactions

This might help on some filesystems

10 years agolibreplace: add fdatasync() if not available
Andrew Tridgell [Sat, 13 Feb 2010 01:57:13 +0000 (12:57 +1100)]
libreplace: add fdatasync() if not available

10 years agoutil: added TYPESAFE_QSORT() macro
Andrew Tridgell [Sat, 13 Feb 2010 01:53:15 +0000 (12:53 +1100)]
util: added TYPESAFE_QSORT() macro

This makes it much harder to get the type of a qsort comparison
function wrong.

10 years agotdb: Apply some const, just for clarity
Volker Lendecke [Sat, 13 Feb 2010 11:17:00 +0000 (12:17 +0100)]
tdb: Apply some const, just for clarity

10 years agoUse sec_initial_uid() in the places where being root doesn't matter,
Jeremy Allison [Sat, 13 Feb 2010 07:18:53 +0000 (23:18 -0800)]
Use sec_initial_uid() in the places where being root doesn't matter,
and 0 in the places where it does.

Jeremy

10 years agoSimplify the logic in make_connection_snum(), and make it match Windows behavior.
Jeremy Allison [Sat, 13 Feb 2010 06:45:37 +0000 (22:45 -0800)]
Simplify the logic in make_connection_snum(), and make it match Windows behavior.

Cause all exit paths to go through one place, where all cleanup is
done. change_to_root_user() for pathname operations that should succeed if
the path exists, even if the connecting user has no access.

For example, a share can now be defined with a path of /root/only/access
(where /root/only/access is a directory path with all components only
accessible to root e.g. root owned, permissions 700 on every component).
Non-root users will now correctly connect, but get ACCESS_DENIED on
all activities (which matches Windows behavior). Previously, non-root
users would get NT_STATUS_BAD_NETWORK_NAME on doing a TConX to this
share, even though it's a perfectly valid share path (just not accessible
to them).

This change was inspired by the research I did for bug #7126, which
was reported by bepi@adria.it.

As this is a change in a core function, I'm proposing to leave
this only in master for 3.6.0, not back-port to any existing releases.
This should give us enough time to decide if this is the way we want this to
behave (as Windows) or if we prefer the previous behavior.

Jeremy.

10 years agoFix warning messages on compile in g_lock.c Volker & Michael please check.
Jeremy Allison [Sat, 13 Feb 2010 06:21:19 +0000 (22:21 -0800)]
Fix warning messages on compile in g_lock.c Volker & Michael please check.

Jeremy.

10 years agoFix error in docs. Should be milliseconds, not microseconds.
Jeremy Allison [Sat, 13 Feb 2010 05:29:58 +0000 (21:29 -0800)]
Fix error in docs. Should be milliseconds, not microseconds.

10 years agos3/smbd: change locking behavior when "lock spin time = 0".
Steven Danneman [Fri, 12 Feb 2010 23:42:50 +0000 (15:42 -0800)]
s3/smbd: change locking behavior when "lock spin time = 0".

The "lock spin time" parameter mimics the following Windows
setting which by default is 250ms in Windows and 200ms in Samba.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\LockViolationDelay

When a client sends repeated, non-blocking, contending BRL requests
to a Windows server, after the first Windows starts treating these
requests as timed blocking locks with the above timeout.

As an efficiency, I've changed the behavior when this setting is 0,
to skip this logic and treat all requests as non-blocking locks.

This gives the smbd server behavior similar to the 3.0 release with
the do_spin_lock() implementation.

I've also changed the blocking lock parameter in the call from
push_blocking_lock_request() to true as all requests made in this
path are blocking by definition.

10 years agoRemove #if SOFTLINK_OPTIMIZATION code.
Jeremy Allison [Sat, 13 Feb 2010 02:50:54 +0000 (18:50 -0800)]
Remove #if SOFTLINK_OPTIMIZATION code.

This hasn't been turned on or been capable of doing so for
many years now. Makes this jumbo function smaller...
Jeremy.

10 years agoRevert "Fix bug #7126 - [SMBD] With access denied error smbd return wrong NT_STATUS_O...
Jeremy Allison [Sat, 13 Feb 2010 02:17:32 +0000 (18:17 -0800)]
Revert "Fix bug #7126 - [SMBD] With access denied error smbd return wrong NT_STATUS_OBJECT_PATH_INVALID error"

This reverts commit 2fdd8b10c6abadd27c579e772c0482214d2363a5.

This fix is incorrect. The original code works as desired,
I made a mistake here.

Jeremy.

10 years agoFix bug #7126 - [SMBD] With access denied error smbd return wrong NT_STATUS_OBJECT_PA...
Jeremy Allison [Fri, 12 Feb 2010 23:45:20 +0000 (15:45 -0800)]
Fix bug #7126 - [SMBD] With access denied error smbd return wrong NT_STATUS_OBJECT_PATH_INVALID error

As tridge's comment says, we should be ignoring ACCESS_DENIED
on the share path in a TconX call, instead allowing the mount
and having individual SMB calls fail (as Windows does). The
original code erroneously caught SMB_VFS_STAT != 0 and errored
out on that.

Jeremy.

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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