samba.git
7 years agos4-idmap: Add mapping using uidNumber and gidNumber like idmap_ad
Andrew Bartlett [Sun, 10 Jun 2012 05:52:14 +0000 (15:52 +1000)]
s4-idmap: Add mapping using uidNumber and gidNumber like idmap_ad

This is a solution for users who are upgrading from Samba 3.x in
particuar, or have clients that will be using idmap_ad.  This avoids
needing to have duplicate values in idmap.ldb and in the directory.

No check for conflicts is made with the idmap.ldb - the AD store always wins.

Andrew Bartlett

7 years agoSame fix as bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does...
Jeremy Allison [Sat, 16 Jun 2012 04:10:59 +0000 (21:10 -0700)]
Same fix as bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does not send correct responses to NT Transact Secondary when no data and no params

for the Trans2 calls. See MS-CIFS 2.2.4.47.2 for details.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 16 07:59:19 CEST 2012 on sn-devel-104

7 years agoFix Bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does not send...
Jeremy Allison [Sat, 16 Jun 2012 04:10:37 +0000 (21:10 -0700)]
Fix Bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does not send correct responses to NT Transact Secondary when no data and no params

Found by Richard Sharpe <realrichardsharpe@gmail.com>. The correct
command code in a reply to NT Transact Secondary (0xa1) is
NT Transact (0xa0).

7 years agos3: Slightly simplify grant_fsp_oplock_type
Volker Lendecke [Wed, 30 May 2012 09:28:19 +0000 (11:28 +0200)]
s3: Slightly simplify grant_fsp_oplock_type

The "else" is not necessary, we did a return in the if-branch

Signed-off-by: Jeremy Allison <jra@samba.org>
7 years agos4-selftest: Add tests for dbcheck on an old database that needs repair
Andrew Bartlett [Sat, 16 Jun 2012 01:56:53 +0000 (11:56 +1000)]
s4-selftest: Add tests for dbcheck on an old database that needs repair

We changed a lot since alpha13, so there are lots of legitimate errors to fix.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 16 05:44:15 CEST 2012 on sn-devel-104

7 years agos4-dbcheck: Always specify the dhcheck control
Andrew Bartlett [Sat, 16 Jun 2012 01:51:22 +0000 (11:51 +1000)]
s4-dbcheck: Always specify the dhcheck control

This will then allow us to make schema modifications, overriding the default ban.

Andrew Bartlett

7 years agoselftest: Add targetdir and tdbrestore parameters to undump.sh
Andrew Bartlett [Sat, 16 Jun 2012 01:06:59 +0000 (11:06 +1000)]
selftest: Add targetdir and tdbrestore parameters to undump.sh

7 years agobuild: Remove support for non-64bit sendfile()
Andrew Bartlett [Tue, 5 Jun 2012 04:43:24 +0000 (14:43 +1000)]
build: Remove support for non-64bit sendfile()

Some early Linux 2.6 platforms can not handle sendfile and _FILE_OFFSET_BITS == 64

This disables sendfile() on these platforms.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 16 02:21:28 CEST 2012 on sn-devel-104

7 years agoselftest/flapping: mark samba4.nss.test using winbind(s3dc) as flakey
Stefan Metzmacher [Fri, 15 Jun 2012 16:30:43 +0000 (18:30 +0200)]
selftest/flapping: mark samba4.nss.test using winbind(s3dc) as flakey

I saw this at least 10 times in the last weeks.

[1425/1517 in 1h12m22s] samba4.nss.test using winbind(s3dc)
UNEXPECTED(failure): samba4.nss.test using winbind(s3dc).run nsstest(s3dc)
REASON: _StringException: _StringException: ERROR setpwent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR getpwent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR endpwent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR setgrent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR getgrent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR endgrent: NSS_STATUS=-1  1 (nss_errno=0)
ERROR Non existent user gave error -1
ERROR Non existent uid gave error -1
ERROR Non existent group gave error -1
ERROR Non existent gid gave error -1
total_errors=10

FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 15 20:24:11 CEST 2012 on sn-devel-104

7 years agodocs-xml: vfs_gpfs: add comment "per share option"
Björn Baumbach [Fri, 15 Jun 2012 10:33:32 +0000 (12:33 +0200)]
docs-xml: vfs_gpfs: add comment "per share option"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agodocs-xml: vfs_gpfs: fix typo
Björn Baumbach [Fri, 15 Jun 2012 10:33:32 +0000 (12:33 +0200)]
docs-xml: vfs_gpfs: fix typo

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agodocs-xml: add gpfs:acl option to vfs_gpfs man page
Björn Baumbach [Fri, 15 Jun 2012 10:33:32 +0000 (12:33 +0200)]
docs-xml: add gpfs:acl option to vfs_gpfs man page

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:vfs_gpfs: add "gpfs:acl" option
Björn Baumbach [Thu, 14 Jun 2012 12:15:44 +0000 (14:15 +0200)]
s3:vfs_gpfs: add "gpfs:acl" option

With "gpfs:acl=no" you can pass the acl calls to the next SMB_VFS module.

Based on a patch from Hans-Dieter Schuster <hans-dieter.schuster@ts.fujitsu.com>

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

7 years agodbwrap: Remove an unnecessary ZERO_STRUCT
Volker Lendecke [Tue, 5 Jun 2012 09:28:44 +0000 (11:28 +0200)]
dbwrap: Remove an unnecessary ZERO_STRUCT

We assign the only struct member one line down

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3-winbindd: fix the build of idmap_ad modules.
Günther Deschner [Thu, 14 Jun 2012 10:55:55 +0000 (12:55 +0200)]
s3-winbindd: fix the build of idmap_ad modules.

Guenther

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jun 15 18:16:11 CEST 2012 on sn-devel-104

7 years agos3-lib: Fix conversion of lib/events.c to modern tevent names
Andrew Bartlett [Fri, 15 Jun 2012 11:52:35 +0000 (21:52 +1000)]
s3-lib: Fix conversion of lib/events.c to modern tevent names

This corrects an error in 8e31d97c8b62d34aff5d52bfe46dbcc5805dae03.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun 15 16:25:20 CEST 2012 on sn-devel-104

7 years agodbwrap: dbwrap_trans_store_uint32->dbwrap_trans_store_uint32_bystring
Volker Lendecke [Fri, 15 Jun 2012 07:51:21 +0000 (09:51 +0200)]
dbwrap: dbwrap_trans_store_uint32->dbwrap_trans_store_uint32_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun 15 14:20:04 CEST 2012 on sn-devel-104

7 years agodbwrap: dbwrap_trans_store_int32->dbwrap_trans_store_int32_bystring
Volker Lendecke [Fri, 15 Jun 2012 07:48:20 +0000 (09:48 +0200)]
dbwrap: dbwrap_trans_store_int32->dbwrap_trans_store_int32_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_trans_change_int32_atomic->dbwrap_trans_change_int32_atomic_bystring
Volker Lendecke [Fri, 15 Jun 2012 07:45:18 +0000 (09:45 +0200)]
dbwrap: dbwrap_trans_change_int32_atomic->dbwrap_trans_change_int32_atomic_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_change_int32_atomic->dbwrap_change_int32_atomic_bystring
Volker Lendecke [Fri, 15 Jun 2012 07:43:13 +0000 (09:43 +0200)]
dbwrap: dbwrap_change_int32_atomic->dbwrap_change_int32_atomic_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_trans_change_uint32_atomic->dbwrap_trans_change_uint32_atomic_bystring
Volker Lendecke [Fri, 15 Jun 2012 07:20:25 +0000 (09:20 +0200)]
dbwrap: dbwrap_trans_change_uint32_atomic->dbwrap_trans_change_uint32_atomic_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_change_uint32_atomic->dbwrap_change_uint32_atomic_bystring
Volker Lendecke [Fri, 15 Jun 2012 07:18:17 +0000 (09:18 +0200)]
dbwrap: dbwrap_change_uint32_atomic->dbwrap_change_uint32_atomic_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_store_uint32->dbwrap_store_uint32_bystring
Volker Lendecke [Fri, 15 Jun 2012 07:09:57 +0000 (09:09 +0200)]
dbwrap: dbwrap_store_uint32->dbwrap_store_uint32_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_fetch_uint32->dbwrap_fetch_uint32_bystring
Volker Lendecke [Thu, 14 Jun 2012 18:39:27 +0000 (20:39 +0200)]
dbwrap: dbwrap_fetch_uint32->dbwrap_fetch_uint32_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_store_int32->dbwrap_store_int32_bystring
Volker Lendecke [Thu, 14 Jun 2012 18:30:16 +0000 (20:30 +0200)]
dbwrap: dbwrap_store_int32->dbwrap_store_int32_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agodbwrap: dbwrap_fetch_int32->dbwrap_fetch_int32_bystring
Volker Lendecke [Thu, 14 Jun 2012 18:26:28 +0000 (20:26 +0200)]
dbwrap: dbwrap_fetch_int32->dbwrap_fetch_int32_bystring

Signed-off-by: Michael Adam <obnox@samba.org>
7 years agos3-build: Do not write loadparm generated files into the build tree
Andrew Bartlett [Fri, 15 Jun 2012 02:34:28 +0000 (12:34 +1000)]
s3-build: Do not write loadparm generated files into the build tree

We need to keep these files away from where waf might see them.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun 15 11:10:14 CEST 2012 on sn-devel-104

7 years agos3-lib: Convert lib/events.c to modern tevent names
Andrew Bartlett [Mon, 11 Jun 2012 04:53:20 +0000 (14:53 +1000)]
s3-lib: Convert lib/events.c to modern tevent names

7 years agodocs: document new server role values
Andrew Bartlett [Mon, 11 Jun 2012 01:40:17 +0000 (11:40 +1000)]
docs: document new server role values

7 years agos3-auth: rework default auth methods around the lp_server_role() parameter
Andrew Bartlett [Mon, 11 Jun 2012 00:51:47 +0000 (10:51 +1000)]
s3-auth: rework default auth methods around the lp_server_role() parameter

To cover all the enum values, ROLE_ACTIVE_DIRECTORY_DOMAIN_CONTROLLER
is mapped to the samba4 auth module, and this is no longer required to
be specified in fileserver.conf.

Andrew Bartlett

7 years agolib/param: Use server role = 'standalone server' to be consistant with member server
Andrew Bartlett [Mon, 11 Jun 2012 00:50:08 +0000 (10:50 +1000)]
lib/param: Use server role = 'standalone server' to be consistant with member server

standalne is left as an alias.

Andrew Bartlett

7 years agolib/param: make security=domain and security=ads conflict with being a DC
Andrew Bartlett [Mon, 11 Jun 2012 00:40:32 +0000 (10:40 +1000)]
lib/param: make security=domain and security=ads conflict with being a DC

This simplifies our supported configurations down to those that we test and expect
to work.  security=domain and domain logons = yes has never made much sense, and
security=ads and domain logons = yes was only ever used in early experiments for
our AD support using smbd.

The correct way to be an AD DC is to set "server role = active directory domain controller"

Andrew Bartlett

7 years agolib/param: Create a seperate server role for "active directory domain controller"
Andrew Bartlett [Sun, 10 Jun 2012 12:08:20 +0000 (22:08 +1000)]
lib/param: Create a seperate server role for "active directory domain controller"

This will allow us to detect from the smb.conf if this is a Samba4 AD
DC which will allow smarter handling of (for example) accidentially
starting smbd rather than samba.

To cope with upgrades from existing Samba4 installs, 'domain
controller' is a synonym of 'active directory domain controller' and
new parameters 'classic primary domain controller' and 'classic backup
domain controller' are added.

Andrew Bartlett

7 years agos3-auth: Merge SEC_DOMAIN and SEC_ADS cases in creating the default auth module list
Andrew Bartlett [Sun, 10 Jun 2012 06:05:58 +0000 (16:05 +1000)]
s3-auth: Merge SEC_DOMAIN and SEC_ADS cases in creating the default auth module list

7 years agos3-auth: Fix system info3 return to be just SID_NT_SYSTEM
Andrew Bartlett [Wed, 13 Jun 2012 23:35:10 +0000 (09:35 +1000)]
s3-auth: Fix system info3 return to be just SID_NT_SYSTEM

The SID for the SYSTEM token should be a fixed value, and not the
administrator.  Note however that it will be replaced by the SID of
sec_initial_uid() by the create_local_token() code.  Fixing this
requires fixes the other parts of the code that cannot cope with a
token of just SID_NT_SYSTEM.

Andrew Bartlett

7 years agos3-auth: Fix system token generation not to dereference pointer as an integer
Andrew Bartlett [Wed, 13 Jun 2012 23:30:37 +0000 (09:30 +1000)]
s3-auth: Fix system token generation not to dereference pointer as an integer

This continues on from commit caaebb455cf955f66c2f662c53998c480cb2d6c9
which is marked as being part of bug #8944, ldapsam:trusted and ipasam
and an additional fix for bug #8567
(0528cb5f3a15b72dcb34ece21a3ffb3e7b8d6eb9).

The problem here was that the primary_gid was simply the pointer result
of dom_sid_parse_talloc() cast to a uint32_t (found by the IRIX cc on
the build farm).

Andrew Bartlett

7 years agos3-auth: Give the SYSTEM token all privileges
Andrew Bartlett [Thu, 14 Jun 2012 23:14:26 +0000 (09:14 +1000)]
s3-auth: Give the SYSTEM token all privileges

7 years agos3:smb2_server: remember the request_time on an incoming request
Stefan Metzmacher [Wed, 11 Apr 2012 14:54:17 +0000 (16:54 +0200)]
s3:smb2_server: remember the request_time on an incoming request

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 15 09:17:33 CEST 2012 on sn-devel-104

7 years agos3:smbd: remember the request_time on an incoming request
Stefan Metzmacher [Wed, 11 Apr 2012 14:54:17 +0000 (16:54 +0200)]
s3:smbd: remember the request_time on an incoming request

metze

7 years agoheimdal:lib/hdb: <config.h> needs to be the first header
Stefan Metzmacher [Thu, 14 Jun 2012 20:15:24 +0000 (22:15 +0200)]
heimdal:lib/hdb: <config.h> needs to be the first header

This should fix build problems on AIX.

metze

7 years agoauth.idl: mark confidential attributes as [noprint]
Stefan Metzmacher [Thu, 14 Jun 2012 15:52:23 +0000 (17:52 +0200)]
auth.idl: mark confidential attributes as [noprint]

We should allow NDR_PRINT_DEBUG() to log them.

TODO: we could add some more magic which logs it at level 100.

metze

7 years agos3:vfs: change files_struct.fnum from int to uint64_t
Michael Adam [Thu, 14 Jun 2012 11:34:46 +0000 (13:34 +0200)]
s3:vfs: change files_struct.fnum from int to uint64_t

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 15 05:22:41 CEST 2012 on sn-devel-104

7 years agos3:smbd: change trans2.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:31:43 +0000 (13:31 +0200)]
s3:smbd: change trans2.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_write.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:28:17 +0000 (13:28 +0200)]
s3:smbd: change smb2_write.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_setinfo.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:26:39 +0000 (13:26 +0200)]
s3:smbd: change smb2_setinfo.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_read.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:25:29 +0000 (13:25 +0200)]
s3:smbd: change smb2_read.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_notify.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:23:11 +0000 (13:23 +0200)]
s3:smbd: change smb2_notify.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_lock.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:22:27 +0000 (13:22 +0200)]
s3:smbd: change smb2_lock.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_ioctl.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:20:08 +0000 (13:20 +0200)]
s3:smbd: change smb2_ioctl.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_getinfo.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:18:55 +0000 (13:18 +0200)]
s3:smbd: change smb2_getinfo.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_flush.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:16:44 +0000 (13:16 +0200)]
s3:smbd: change smb2_flush.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_find.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:13:59 +0000 (13:13 +0200)]
s3:smbd: change smb2_find.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_close.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:13:06 +0000 (13:13 +0200)]
s3:smbd: change smb2_close.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change smb2_break.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:11:58 +0000 (13:11 +0200)]
s3:smbd: change smb2_break.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change reply.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 11:10:33 +0000 (13:10 +0200)]
s3:smbd: change reply.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change pipes.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:57:25 +0000 (12:57 +0200)]
s3:smbd: change pipes.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change oplock.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:55:59 +0000 (12:55 +0200)]
s3:smbd: change oplock.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change open.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:54:28 +0000 (12:54 +0200)]
s3:smbd: change open.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change nttrans.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:52:52 +0000 (12:52 +0200)]
s3:smbd: change nttrans.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change files.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:50:14 +0000 (12:50 +0200)]
s3:smbd: change files.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change fake_file.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:48:59 +0000 (12:48 +0200)]
s3:smbd: change fake_file.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change blocking.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:47:54 +0000 (12:47 +0200)]
s3:smbd: change blocking.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change aio.c to use fsp_fnum_dbg() for logging fsp->fnum.
Michael Adam [Thu, 14 Jun 2012 10:41:09 +0000 (12:41 +0200)]
s3:smbd: change aio.c to use fsp_fnum_dbg() for logging fsp->fnum.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:vfs_default: use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:37:21 +0000 (12:37 +0200)]
s3:vfs_default: use fsp_fnum_dbg() for fsp->fnum logging.

Note: it is actually wrong to access the fsp->fnum at all here,
since the fnum is part of the smb layer that should not be used
in the vfs layer. But this is subject be separated more cleanly
in later commits. This change only unifies the logging of fsp->fnum.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:locking: change locking.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:25:43 +0000 (12:25 +0200)]
s3:locking: change locking.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:locking: change brlock.c to use fsp_fnum_dbg() for fsp->fnum logging.
Michael Adam [Thu, 14 Jun 2012 10:14:32 +0000 (12:14 +0200)]
s3:locking: change brlock.c to use fsp_fnum_dbg() for fsp->fnum logging.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:lib: add a utility function "fsp_fnum_dbg" for logging the fnum of an fsp
Michael Adam [Wed, 13 Jun 2012 15:58:54 +0000 (17:58 +0200)]
s3:lib: add a utility function "fsp_fnum_dbg" for logging the fnum of an fsp

This is to unify logging of an files_struct.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:lib: elaborate the comment for fsp_str_debug a bit.
Michael Adam [Wed, 13 Jun 2012 15:43:18 +0000 (17:43 +0200)]
s3:lib: elaborate the comment for fsp_str_debug a bit.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:lib: remove part of a comment for fsp_str_dbg that does not apply any more.
Michael Adam [Wed, 13 Jun 2012 15:40:22 +0000 (17:40 +0200)]
s3:lib: remove part of a comment for fsp_str_dbg that does not apply any more.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: change FNUM_FIELD_INVALID from -1 to 0
Michael Adam [Wed, 13 Jun 2012 15:18:59 +0000 (17:18 +0200)]
s3:smbd: change FNUM_FIELD_INVALID from -1 to 0

This is in preparation for changing the type of files_struct.fnum
to unit64_t.

This can safely be done, since all checks have been converted to
using FNUM_FIELD_INVALID and fsp->fnum is only ever set to either
FNUM_FIELD_INVALID or some i + FILE_HANDLE_OFFSET with i >= 0 and
FILE_HANDLE_OFFSET > 0.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:smbd: use FNUM_FIELD_INVALID instead of literal -1
Michael Adam [Tue, 12 Jun 2012 15:56:43 +0000 (17:56 +0200)]
s3:smbd: use FNUM_FIELD_INVALID instead of literal -1

This is in preparation of changing fnum to uint64_t

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:include: define FNUM_FIELD_INVALID - the invalid value for the fnum
Michael Adam [Tue, 12 Jun 2012 12:35:39 +0000 (14:35 +0200)]
s3:include: define FNUM_FIELD_INVALID - the invalid value for the fnum

Signed-off-by: Stefan Metzmacher <metze@samba.org>
7 years agos3:files: factor fsp_free() out of file_free()
Michael Adam [Thu, 7 Jun 2012 14:31:14 +0000 (16:31 +0200)]
s3:files: factor fsp_free() out of file_free()

To be reused in the durable reconnect code.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

7 years agos3:files: reorder file_free() a bit
Michael Adam [Thu, 7 Jun 2012 14:27:24 +0000 (16:27 +0200)]
s3:files: reorder file_free() a bit

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

7 years agos3:smbd: refactor fsp_new() out of file_new()
Michael Adam [Thu, 7 Jun 2012 14:13:36 +0000 (16:13 +0200)]
s3:smbd: refactor fsp_new() out of file_new()

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

7 years agowaf: Update to newer upstream snapshot.
Jelmer Vernooij [Thu, 14 Jun 2012 21:02:28 +0000 (23:02 +0200)]
waf: Update to newer upstream snapshot.

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Fri Jun 15 03:12:35 CEST 2012 on sn-devel-104

7 years agoupdate-waf.sh: make mktemp happy by including anything Xes.
Jelmer Vernooij [Thu, 14 Jun 2012 21:02:06 +0000 (23:02 +0200)]
update-waf.sh: make mktemp happy by including anything Xes.

7 years agolib/util: Fix typo in comment.
Jelmer Vernooij [Sun, 13 May 2012 01:29:48 +0000 (03:29 +0200)]
lib/util: Fix typo in comment.

7 years agomake librpc/build_idl.sh more portable
Björn Jacke [Thu, 14 Jun 2012 17:58:00 +0000 (19:58 +0200)]
make librpc/build_idl.sh more portable

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Jun 14 23:57:40 CEST 2012 on sn-devel-104

7 years agos3:smbd: use fsp_persistent_id() as persistent_file_id part for SMB2 (bug #8995)
Stefan Metzmacher [Wed, 13 Jun 2012 10:13:01 +0000 (12:13 +0200)]
s3:smbd: use fsp_persistent_id() as persistent_file_id part for SMB2 (bug #8995)

It seems to be important to have unique persistent file ids,
because windows clients seem to index files by server_guid + persistent_file_id.
Which may break, if we just have a 16-bit range per connection
and the client connects multiple times.

Based on code from Ira Cooper. Use fsp->fh->gen_id as the persistent
fileid in SMB2.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun 14 22:04:13 CEST 2012 on sn-devel-104

7 years agos3:smbd: add a fsp_persistent_id() function
Stefan Metzmacher [Thu, 14 Jun 2012 08:32:43 +0000 (10:32 +0200)]
s3:smbd: add a fsp_persistent_id() function

This calculates a 64-bit value that most likely uniquely identifies
the files_struct globally to the server.

* 32-bit random gen_id
* 16-bit truncated open_time
* 16-bit fnum (valatile_id)

Based on code from Ira Cooper. Use fsp->fh->gen_id as the persistent
fileid in SMB2.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

metze

7 years agos3:smbd: only set fsp->fh->gen_id for a client connection
Stefan Metzmacher [Wed, 13 Jun 2012 13:40:23 +0000 (15:40 +0200)]
s3:smbd: only set fsp->fh->gen_id for a client connection

For faked connections, like dfs and printing, we leave it as 0.

metze

7 years agos3:smbd: try to make fsp->fh->gen_id as globally unique as possible
Stefan Metzmacher [Wed, 13 Jun 2012 10:11:51 +0000 (12:11 +0200)]
s3:smbd: try to make fsp->fh->gen_id as globally unique as possible

This makes sure the value is never 0, it's between 1 and UINT32_MAX.

While fsp->fh->gen_id is 'unsigned long' currently (which might by 8 bytes),
there's some oplock code which truncates it to uint32_t (using IVAL()).

Which means we could reuse fsp->fh->gen_id as persistent file id
until we have a final fix, which uses database.

See bug #8995 for more details.

Based on code from Ira Cooper. Ensure fsp->fh->gen_id starts from
a random point. We will use this as the SMB2 persistent_id.

metze

7 years agos3: Simplify tdb_data_is_cstr a bit
Volker Lendecke [Wed, 13 Jun 2012 07:48:25 +0000 (09:48 +0200)]
s3: Simplify tdb_data_is_cstr a bit

The original code contained rawmemchr for performance reasons. I
would expect the very common strlen routine to be not much worse
performance-wise than rawmemchr. On top, for me this patch simplifies
the expression a bit.

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jun 14 16:55:58 CEST 2012 on sn-devel-104

7 years agotdb2: remove unused debug_fprintf() macro that breaks the build
Stefan Metzmacher [Wed, 13 Jun 2012 14:31:58 +0000 (16:31 +0200)]
tdb2: remove unused debug_fprintf() macro that breaks the build

The IRIX compiler doesn't support '...' in a macro.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun 14 11:26:15 CEST 2012 on sn-devel-104

7 years agotdb: remove unused debug_fprintf() macro that breaks the build
Stefan Metzmacher [Wed, 13 Jun 2012 14:31:58 +0000 (16:31 +0200)]
tdb: remove unused debug_fprintf() macro that breaks the build

The IRIX compiler doesn't support '...' in a macro.

metze

7 years agolib/replace: define HAVE_WORKING_STRPTIME instead of REPLACE_STRPTIME
Stefan Metzmacher [Mon, 11 Jun 2012 07:11:17 +0000 (09:11 +0200)]
lib/replace: define HAVE_WORKING_STRPTIME instead of REPLACE_STRPTIME

That makes the logic in 'wscript' simpler.

metze

7 years agolib/replace: execute strptime.c tests
Stefan Metzmacher [Wed, 13 Jun 2012 11:17:46 +0000 (13:17 +0200)]
lib/replace: execute strptime.c tests

They need runtime verification.

metze

7 years agoRevert "replace: use replace for non 'samba' compliant strptime"
Stefan Metzmacher [Wed, 13 Jun 2012 10:41:57 +0000 (12:41 +0200)]
Revert "replace: use replace for non 'samba' compliant strptime"

This reverts commit 4ea7d4694a8353fc55ecd12cb09b9c91ffde7b3f.

A better fix will follow.

metze

7 years agolib/replace: add more condition to add snprintf.c
Stefan Metzmacher [Mon, 11 Jun 2012 07:07:06 +0000 (09:07 +0200)]
lib/replace: add more condition to add snprintf.c

metze

7 years agoRevert "lib/replace: Fix snprintf() override for systems with a broken snprintf()"
Stefan Metzmacher [Mon, 11 Jun 2012 06:56:09 +0000 (08:56 +0200)]
Revert "lib/replace: Fix snprintf() override for systems with a broken snprintf()"

This reverts commit bbc1b0c9853322da10483f72c020fe0dd83b28fa.

A more generic fix will follow.

metze

7 years agolib/replace: s/execute=1/execute=True
Stefan Metzmacher [Wed, 13 Jun 2012 11:17:13 +0000 (13:17 +0200)]
lib/replace: s/execute=1/execute=True

metze

7 years agos3: Fix a comment
Volker Lendecke [Wed, 13 Jun 2012 09:11:39 +0000 (11:11 +0200)]
s3: Fix a comment

The fd count is implicit

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 14 01:53:17 CEST 2012 on sn-devel-104

7 years agoreplace: fix unused variable warning
Björn Jacke [Wed, 13 Jun 2012 20:02:53 +0000 (22:02 +0200)]
replace: fix unused variable warning

e2747fc62c2acbab143c4971469e0a4fc36d8789 fixed ...

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Jun 13 23:57:58 CEST 2012 on sn-devel-104

7 years agoRevert "replace: fix unused variable warning"
Björn Jacke [Wed, 13 Jun 2012 19:55:42 +0000 (21:55 +0200)]
Revert "replace: fix unused variable warning"

This reverts commit e2747fc62c2acbab143c4971469e0a4fc36d8789.

one line slipped into a wrong ifndef ...

7 years agos3: fix build without ads support
Björn Jacke [Wed, 13 Jun 2012 17:28:06 +0000 (19:28 +0200)]
s3: fix build without ads support

when we have no ads support we don't have the ads_get_sid_token symbol used in
this unused code :-)

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Jun 13 21:20:15 CEST 2012 on sn-devel-104

7 years agoreplace: fix unused variable warning
Björn Jacke [Wed, 13 Jun 2012 16:55:56 +0000 (18:55 +0200)]
replace: fix unused variable warning

found by the IRIX compiler

7 years agodoc: fix typo uniq → unique
Björn Jacke [Tue, 12 Jun 2012 09:35:29 +0000 (11:35 +0200)]
doc: fix typo uniq → unique

7 years agos4:ntvfs: add '_fn' suffix to all ntvfs_ops function pointers
Stefan Metzmacher [Wed, 13 Jun 2012 07:11:42 +0000 (09:11 +0200)]
s4:ntvfs: add '_fn' suffix to all ntvfs_ops function pointers

This hopefully fixes the build on systems where _LARGE_FILES
triggers defines of syscalls e.g. '#define lseek lseek64'
on AIX.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jun 13 11:03:15 CEST 2012 on sn-devel-104

7 years agos3: Use talloc_tos() in more places in dbwrap_util
Volker Lendecke [Tue, 12 Jun 2012 09:17:58 +0000 (11:17 +0200)]
s3: Use talloc_tos() in more places in dbwrap_util

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun 12 15:37:16 CEST 2012 on sn-devel-104