metze/samba/wip.git
11 years agoFix problem found by Andrew Bartlett - correctly check encrypted flag.
Jeremy Allison [Mon, 23 Jul 2012 17:20:26 +0000 (10:20 -0700)]
Fix problem found by Andrew Bartlett - correctly check encrypted flag.

11 years agolibcli/smb: set should_encrypt = true if we got SMB2_SESSION_FLAG_ENCRYPT_DATA
Stefan Metzmacher [Mon, 23 Jul 2012 09:38:31 +0000 (11:38 +0200)]
libcli/smb: set should_encrypt = true if we got SMB2_SESSION_FLAG_ENCRYPT_DATA

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jul 23 20:14:07 CEST 2012 on sn-devel-104

11 years agolibcli/smb: encrypt SMB2 traffic if nedded/desired.
Stefan Metzmacher [Mon, 23 Jul 2012 08:14:53 +0000 (10:14 +0200)]
libcli/smb: encrypt SMB2 traffic if nedded/desired.

metze

11 years agolibcli/smb: increment nbt_len, when we have the fully created the SMB2 PDU
Stefan Metzmacher [Mon, 23 Jul 2012 08:07:19 +0000 (10:07 +0200)]
libcli/smb: increment nbt_len, when we have the fully created the SMB2 PDU

metze

11 years agolibcli/smb: maintain smb2.should_sign on smbXcli_req_state
Stefan Metzmacher [Mon, 23 Jul 2012 08:00:50 +0000 (10:00 +0200)]
libcli/smb: maintain smb2.should_sign on smbXcli_req_state

metze

11 years agolibcli/smb: make use of SMB2_HDR_BODY as header size
Stefan Metzmacher [Mon, 23 Jul 2012 07:44:06 +0000 (09:44 +0200)]
libcli/smb: make use of SMB2_HDR_BODY as header size

metze

11 years agolibcli/smb: parse the SMB2_TRANSFORM header and decrypt the SMB2 pdu
Stefan Metzmacher [Mon, 23 Jul 2012 07:16:05 +0000 (09:16 +0200)]
libcli/smb: parse the SMB2_TRANSFORM header and decrypt the SMB2 pdu

metze

11 years agolibcli/smb: create 4 iovecs per request in smb2cli_inbuf_parse_compound()
Stefan Metzmacher [Mon, 23 Jul 2012 06:11:59 +0000 (08:11 +0200)]
libcli/smb: create 4 iovecs per request in smb2cli_inbuf_parse_compound()

The first one might hold the SMB2_TRANSFORM Header later.

metze

11 years agolibcli/smb: prepare [en|de]cryption_key for SMB3
Stefan Metzmacher [Fri, 20 Jul 2012 07:30:05 +0000 (09:30 +0200)]
libcli/smb: prepare [en|de]cryption_key for SMB3

metze

11 years agolibcli/smb: copy the application_key in smb2cli_session_create_channel()
Stefan Metzmacher [Fri, 20 Jul 2012 07:22:17 +0000 (09:22 +0200)]
libcli/smb: copy the application_key in smb2cli_session_create_channel()

metze

11 years agolibcli/smb: check the buffer length in smbXcli_negprot_dispatch_incoming()
Stefan Metzmacher [Fri, 20 Jul 2012 07:20:43 +0000 (09:20 +0200)]
libcli/smb: check the buffer length in smbXcli_negprot_dispatch_incoming()

metze

11 years agolibcli/smb: only pass the smb2 buffer to smb2cli_inbuf_parse_compound()
Stefan Metzmacher [Fri, 20 Jul 2012 07:19:24 +0000 (09:19 +0200)]
libcli/smb: only pass the smb2 buffer to smb2cli_inbuf_parse_compound()

We should hide the transport as much as possible.

metze

11 years agolibcli/smb: add smb2_signing_[en|e]crypt_pdu()
Stefan Metzmacher [Fri, 20 Jul 2012 07:16:08 +0000 (09:16 +0200)]
libcli/smb: add smb2_signing_[en|e]crypt_pdu()

metze

11 years agolibcli/smb: construct the signing_key before forming the message
Stefan Metzmacher [Thu, 19 Jul 2012 09:16:16 +0000 (11:16 +0200)]
libcli/smb: construct the signing_key before forming the message

metze

11 years agolib/crypto: add aes_ccm_128
Stefan Metzmacher [Fri, 20 Jul 2012 05:37:48 +0000 (07:37 +0200)]
lib/crypto: add aes_ccm_128

metze

11 years agolibcli/smb: add SMB2_SESSION_FLAG_ENCRYPT_DATA
Stefan Metzmacher [Mon, 23 Jul 2012 08:46:21 +0000 (10:46 +0200)]
libcli/smb: add SMB2_SESSION_FLAG_ENCRYPT_DATA

metze

11 years agolibcli/smb: add SMB2_TRANSFORM macros
Stefan Metzmacher [Fri, 20 Jul 2012 07:11:30 +0000 (09:11 +0200)]
libcli/smb: add SMB2_TRANSFORM macros

metze

11 years agos3:test_smb2: copy the session_channel from the primary channel.
Stefan Metzmacher [Mon, 23 Jul 2012 11:34:05 +0000 (13:34 +0200)]
s3:test_smb2: copy the session_channel from the primary channel.

metze

11 years agos3:smb2_tcon: reject access to shares mark as "smb encrypt = required"
Stefan Metzmacher [Mon, 23 Jul 2012 11:47:24 +0000 (13:47 +0200)]
s3:smb2_tcon: reject access to shares mark as "smb encrypt = required"

We do not support SMB2 transport encryption yet.

metze

11 years agos3-winbind: Fix idmap initialization debug message.
Guenther Deschner [Mon, 23 Jul 2012 12:34:11 +0000 (14:34 +0200)]
s3-winbind: Fix idmap initialization debug message.

Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jul 23 18:19:00 CEST 2012 on sn-devel-104

11 years agos3:smbd: if a fsp has fsp->deferred_close, clients shouldn't be able to use it
Stefan Metzmacher [Mon, 23 Jul 2012 10:07:42 +0000 (12:07 +0200)]
s3:smbd: if a fsp has fsp->deferred_close, clients shouldn't be able to use it

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jul 23 16:22:03 CEST 2012 on sn-devel-104

11 years agos4-classicupgrade: Add unix attributes during upgrade
Geza Gemes [Sat, 21 Jul 2012 11:33:33 +0000 (13:33 +0200)]
s4-classicupgrade: Add unix attributes during upgrade

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Jul 22 13:20:20 CEST 2012 on sn-devel-104

11 years agos4 rfc2307 gids mapping fix
Sergey Urushkin [Fri, 20 Jul 2012 09:16:08 +0000 (13:16 +0400)]
s4 rfc2307 gids mapping fix

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
11 years agoUse ippGet/ippSet (accessors) for IPP API.
Jiri Popelka [Thu, 19 Jul 2012 17:17:28 +0000 (19:17 +0200)]
Use ippGet/ippSet (accessors) for IPP API.

CUPS 1.6 makes various structures private and
introduces these ippGet and ippSet functions
for all of the fields in these structures.
http://www.cups.org/str.php?L3928

We define our own accessors when CUPS < 1.6.

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 20 22:35:55 CEST 2012 on sn-devel-104

11 years agoRemove source3/lib/pidfile.c
Jeremy Allison [Thu, 19 Jul 2012 23:41:07 +0000 (16:41 -0700)]
Remove source3/lib/pidfile.c

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 20 03:57:20 CEST 2012 on sn-devel-104

11 years agoMove everything to use the common pidfile functions.
Jeremy Allison [Thu, 19 Jul 2012 23:36:18 +0000 (16:36 -0700)]
Move everything to use the common pidfile functions.

The extra code in source3/lib/pidfile.c is no longer needed.

11 years agoFix the configure build - add lib/util/pidfile.o into UTIL_OBJ.
Jeremy Allison [Thu, 19 Jul 2012 23:21:15 +0000 (16:21 -0700)]
Fix the configure build - add lib/util/pidfile.o into UTIL_OBJ.

11 years agoMake the s3 pidfile use the common code inside lib/util/pidfile.c
Jeremy Allison [Thu, 19 Jul 2012 23:08:49 +0000 (16:08 -0700)]
Make the s3 pidfile use the common code inside lib/util/pidfile.c

11 years agoAdd debugs to functions. Add pidfile_unlink().
Jeremy Allison [Thu, 19 Jul 2012 23:08:16 +0000 (16:08 -0700)]
Add debugs to functions. Add pidfile_unlink().

11 years agoMove source4/smbd/pidfile into lib/util in preparation for making it in common.
Jeremy Allison [Thu, 19 Jul 2012 22:41:52 +0000 (15:41 -0700)]
Move source4/smbd/pidfile into lib/util in preparation for making it in common.

11 years agos3-param: Remove special case for lp_ctdbd_socket(), set CTDB_PATH as default
Andrew Bartlett [Thu, 19 Jul 2012 03:36:37 +0000 (13:36 +1000)]
s3-param: Remove special case for lp_ctdbd_socket(), set CTDB_PATH as default

This changes the default based on the #ifdef rather than an override
on a parameter value of ""

The less special override functions we have the easier it is to merge
the loadparm tables.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jul 19 09:56:01 CEST 2012 on sn-devel-104

11 years agolib/param: bring lp_smb_ports() into common by making it a list everywhere
Andrew Bartlett [Wed, 18 Jul 2012 01:51:00 +0000 (11:51 +1000)]
lib/param: bring lp_smb_ports() into common by making it a list everywhere

11 years agos3-param: Make lp_name_resolve_order() return a list
Andrew Bartlett [Wed, 18 Jul 2012 05:19:15 +0000 (15:19 +1000)]
s3-param: Make lp_name_resolve_order() return a list

This allows this parameter, one of the few with differing declarations
between the loadparm systems, to be brought into common.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

11 years agos4-param: Remove unused "idmap trusted only"
Andrew Bartlett [Thu, 19 Jul 2012 01:56:59 +0000 (11:56 +1000)]
s4-param: Remove unused "idmap trusted only"

When we revamp the idmap layer, we will end up just following the s3
options, and this option is not used there either.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

11 years agolib/param: Add my copyright
Andrew Bartlett [Wed, 18 Jul 2012 03:39:58 +0000 (13:39 +1000)]
lib/param: Add my copyright

11 years agolib/param: bring lp_time_server() into common
Andrew Bartlett [Wed, 18 Jul 2012 01:50:31 +0000 (11:50 +1000)]
lib/param: bring lp_time_server() into common

11 years agos3-auth Use correct RID for domain guests primary group
Andrew Bartlett [Sun, 15 Jul 2012 04:38:18 +0000 (14:38 +1000)]
s3-auth Use correct RID for domain guests primary group

This was incorrect in commit 9dd7e7fc2d6d1aa7f3c3b741ac134e087ce808fd
as the RID was from the BUILTIN domain, but this creates a guest
account token for the real domain.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jul 19 05:56:28 CEST 2012 on sn-devel-104

11 years agos3-rpc_server: Remove make_server_info_info3() call from make_server_pipes_struct()
Andrew Bartlett [Sun, 15 Jul 2012 04:31:01 +0000 (14:31 +1000)]
s3-rpc_server: Remove make_server_info_info3() call from make_server_pipes_struct()

This codepath would only be executed if we provided a partial session_info token
across the named pipe forwarding code.

The smbd file server always fills this in, and if the ntvfs file server ever
wants to use an smbd hosted pipe, it can do the same.  Calling create_local_token
is always the wrong thing to do.

Andrew Bartlett

11 years agoauth/credentials: Remove extra newline
Andrew Bartlett [Sun, 15 Jul 2012 02:50:02 +0000 (12:50 +1000)]
auth/credentials: Remove extra newline

11 years agoselftest: Run unix.whomai against the machine acccount as well
Andrew Bartlett [Sun, 15 Jul 2012 01:34:06 +0000 (11:34 +1000)]
selftest: Run unix.whomai against the machine acccount as well

This shows that the machine account got an extra SID in the token for domain users.

Andrew Bartlett

11 years agoRevert "s3:auth make sure the primary group sid is usable"
Andrew Bartlett [Sun, 15 Jul 2012 02:22:44 +0000 (12:22 +1000)]
Revert "s3:auth make sure the primary group sid is usable"

This reverts commit 00089fd74af740f832573d904312854e494a869e.

The issue with this patch, which I did sign off on, is that for the
domain member case, we already know that the SID is reasonable and
valid, and we indeed rely on that, because we keep it as an additonal
group anyway.  The primary group is not so special that we need to do
extra validation.

Calling this function may put a user into the domain 'domain users'
group, even if they are not in that group to start with.

Andrew Bartlett

11 years agos4-torture: Move check of map-to-guest above SID list check
Andrew Bartlett [Thu, 12 Jul 2012 03:32:37 +0000 (13:32 +1000)]
s4-torture: Move check of map-to-guest above SID list check

This makes it easier to interpret failing output.

Andrew Bartlett

11 years agos4-torture: Allow unix.whoami to test against a member server
Andrew Bartlett [Thu, 12 Jul 2012 02:59:29 +0000 (12:59 +1000)]
s4-torture: Allow unix.whoami to test against a member server

This compares only the domain SIDs betwen the two servers, rather than
the full token, as well known and other SIDs may be added locally
in both cases.

This also expands the test environments this is run against to verify
this between our AD server and domain members.

Andrew Bartlett

11 years agos4-torture: Also print GID values in whoami test
Andrew Bartlett [Thu, 12 Jul 2012 01:31:31 +0000 (11:31 +1000)]
s4-torture: Also print GID values in whoami test

11 years agotorture: Print SIDs as additional debug output in unix.whoami
Christof Schmitt [Wed, 11 Jul 2012 20:48:55 +0000 (13:48 -0700)]
torture: Print SIDs as additional debug output in unix.whoami

11 years agos3-aio: Panic if we try to close a fsp with outstanding aio requests
Volker Lendecke [Tue, 17 Jul 2012 20:43:06 +0000 (22:43 +0200)]
s3-aio: Panic if we try to close a fsp with outstanding aio requests

The core smbd must have taken care of this. If we don't do this properly,
we have a race of the close(2) against a pwrite(2). We might end up
writing to the wrong file.

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 19 03:40:17 CEST 2012 on sn-devel-104

11 years agos3-smb2: Postpone close_file until all aio is handled
Volker Lendecke [Tue, 17 Jul 2012 20:24:51 +0000 (22:24 +0200)]
s3-smb2: Postpone close_file until all aio is handled

Thanks to Jeremy for this simple idea

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-smb1: Postpone close_file until all aio is handled
Volker Lendecke [Tue, 17 Jul 2012 20:24:51 +0000 (22:24 +0200)]
s3-smb1: Postpone close_file until all aio is handled

Thanks to Jeremy for this simple idea

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Add tevent_wait_send/recv
Volker Lendecke [Wed, 18 Jul 2012 09:25:42 +0000 (11:25 +0200)]
s3: Add tevent_wait_send/recv

To me it seems that we might have this functionality already somewere... I
just can't find it. Metze, do you have an idea?

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Slightly simplify reply_close()
Volker Lendecke [Tue, 17 Jul 2012 19:52:13 +0000 (21:52 +0200)]
s3: Slightly simplify reply_close()

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Compile with pthreadpool by default
Volker Lendecke [Mon, 16 Jul 2012 11:26:12 +0000 (13:26 +0200)]
s3: Compile with pthreadpool by default

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agoconfig: The AIO engine is indepent of HAVE_AIO now
Volker Lendecke [Mon, 16 Jul 2012 10:44:42 +0000 (12:44 +0200)]
config: The AIO engine is indepent of HAVE_AIO now

Compile the basic aio engine always, it works via libasys/pthreadpool_sync
in a sync fashion even if no pthreads are around. Everything else (linux
aio, posix aio, aio fork) is now compiled as modules based on specific
system capabilities

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Add aio_fsync to the aio_linux module
Volker Lendecke [Sun, 15 Jul 2012 10:08:59 +0000 (12:08 +0200)]
s3: Add aio_fsync to the aio_linux module

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Add aio_fsync to the aio_fork module
Volker Lendecke [Fri, 13 Jul 2012 12:05:11 +0000 (14:05 +0200)]
s3: Add aio_fsync to the aio_fork module

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-aio-fork: make "read_cmd" an enum
Volker Lendecke [Fri, 13 Jul 2012 11:59:52 +0000 (13:59 +0200)]
s3-aio-fork: make "read_cmd" an enum

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Add aio_fsync to the aio_posix module
Volker Lendecke [Fri, 13 Jul 2012 11:53:39 +0000 (13:53 +0200)]
s3: Add aio_fsync to the aio_posix module

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-aio: Make the strict sync after write async
Volker Lendecke [Fri, 13 Jul 2012 11:41:47 +0000 (13:41 +0200)]
s3-aio: Make the strict sync after write async

This restores cb405947caa9f4bdb962483860a9093a364ecbf2, which was
lost during the refactoring of aio.c and vfs_aio_pthread.c.

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Add a _nosync version of smb2_write_complete
Volker Lendecke [Fri, 13 Jul 2012 11:39:52 +0000 (13:39 +0200)]
s3: Add a _nosync version of smb2_write_complete

This will be used in aio.c to avoid a second fsync after write

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-vfs: async fsync
Volker Lendecke [Fri, 13 Jul 2012 08:22:25 +0000 (10:22 +0200)]
s3-vfs: async fsync

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Fix the build
Volker Lendecke [Fri, 13 Jul 2012 08:22:05 +0000 (10:22 +0200)]
s3: Fix the build

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-libasys: Add asys_fsync() implementation
Volker Lendecke [Fri, 13 Jul 2012 07:37:40 +0000 (09:37 +0200)]
s3-libasys: Add asys_fsync() implementation

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Make us survive base-delaywrite with aio enabled
Volker Lendecke [Thu, 12 Jul 2012 14:30:22 +0000 (16:30 +0200)]
s3: Make us survive base-delaywrite with aio enabled

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Move the aio_pthread read/write functionality to vfs_default
Volker Lendecke [Thu, 12 Jul 2012 08:32:39 +0000 (10:32 +0200)]
s3: Move the aio_pthread read/write functionality to vfs_default

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-aio: Remove unused VFS functions and more
Volker Lendecke [Mon, 9 Jul 2012 19:33:57 +0000 (21:33 +0200)]
s3-aio: Remove unused VFS functions and more

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-vfs: Add pwrite_send/recv to vfs modules
Volker Lendecke [Mon, 9 Jul 2012 15:17:25 +0000 (17:17 +0200)]
s3-vfs: Add pwrite_send/recv to vfs modules

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-vfs: Add pread_send/recv to vfs modules
Volker Lendecke [Mon, 9 Jul 2012 15:17:25 +0000 (17:17 +0200)]
s3-vfs: Add pread_send/recv to vfs modules

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Convert aio_linux to pread/pwrite_send/recv
Volker Lendecke [Mon, 9 Jul 2012 09:10:30 +0000 (11:10 +0200)]
s3: Convert aio_linux to pread/pwrite_send/recv

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Convert aio_fork to pread/pwrite_send/recv
Volker Lendecke [Mon, 9 Jul 2012 09:10:30 +0000 (11:10 +0200)]
s3: Convert aio_fork to pread/pwrite_send/recv

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-aio_fork: Convert get_idle_child from NTSTATUS to errno
Volker Lendecke [Mon, 9 Jul 2012 07:00:55 +0000 (09:00 +0200)]
s3-aio_fork: Convert get_idle_child from NTSTATUS to errno

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-aio_fork: Convert create_aio_child from NTSTATUS to errno
Volker Lendecke [Mon, 9 Jul 2012 07:00:55 +0000 (09:00 +0200)]
s3-aio_fork: Convert create_aio_child from NTSTATUS to errno

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Add vfs_aio_posix
Volker Lendecke [Fri, 6 Jul 2012 13:33:47 +0000 (15:33 +0200)]
s3: Add vfs_aio_posix

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Make smbd/aio.c not depend on aio.h anymore
Volker Lendecke [Fri, 6 Jul 2012 13:05:02 +0000 (15:05 +0200)]
s3: Make smbd/aio.c not depend on aio.h anymore

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3:vfs_aio_pthread: Convert to libasys
Volker Lendecke [Fri, 6 Jul 2012 11:19:20 +0000 (13:19 +0200)]
s3:vfs_aio_pthread: Convert to libasys

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Remove the unused completion handling from aio.c
Volker Lendecke [Fri, 6 Jul 2012 07:38:33 +0000 (09:38 +0200)]
s3: Remove the unused completion handling from aio.c

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Properly handle shutdown with the _send/_recv based aio
Volker Lendecke [Fri, 6 Jul 2012 07:37:57 +0000 (09:37 +0200)]
s3: Properly handle shutdown with the _send/_recv based aio

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Use SMB_VFS_PWRITE_SEND in schedule_smb2_aio_write
Volker Lendecke [Mon, 2 Jul 2012 10:46:03 +0000 (12:46 +0200)]
s3: Use SMB_VFS_PWRITE_SEND in schedule_smb2_aio_write

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Use SMB_VFS_PREAD_SEND in schedule_smb2_aio_read
Volker Lendecke [Mon, 2 Jul 2012 10:46:03 +0000 (12:46 +0200)]
s3: Use SMB_VFS_PREAD_SEND in schedule_smb2_aio_read

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Use SMB_VFS_PWRITE_SEND in schedule_aio_write_and_X
Volker Lendecke [Mon, 2 Jul 2012 10:46:03 +0000 (12:46 +0200)]
s3: Use SMB_VFS_PWRITE_SEND in schedule_aio_write_and_X

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3: Use SMB_VFS_PREAD_SEND in schedule_aio_read_and_X
Volker Lendecke [Mon, 2 Jul 2012 10:46:03 +0000 (12:46 +0200)]
s3: Use SMB_VFS_PREAD_SEND in schedule_aio_read_and_X

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-vfs: async pread
Volker Lendecke [Tue, 26 Jun 2012 12:30:59 +0000 (14:30 +0200)]
s3-vfs: async pread

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3-vfs: async pwrite
Volker Lendecke [Tue, 26 Jun 2012 12:30:59 +0000 (14:30 +0200)]
s3-vfs: async pwrite

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agolibasys
Volker Lendecke [Thu, 21 Jun 2012 10:51:12 +0000 (12:51 +0200)]
libasys

Signed-off-by: Jeremy Allison <jra@samba.org>
11 years agos3:Really ignore unknown special ids in NFSv4 ACLs.
Alexander Werth [Wed, 25 Apr 2012 13:10:54 +0000 (15:10 +0200)]
s3:Really ignore unknown special ids in NFSv4 ACLs.

Signed-off-by: Christian Ambach <ambi@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Jul 18 17:45:05 CEST 2012 on sn-devel-104

11 years agodocs-xml: document smbstatus --notify
Christian Ambach [Mon, 16 Jul 2012 15:09:24 +0000 (17:09 +0200)]
docs-xml: document smbstatus --notify

11 years agodocs-xml: document smbstatus --fast
Christian Ambach [Mon, 16 Jul 2012 15:06:11 +0000 (17:06 +0200)]
docs-xml: document smbstatus --fast

11 years agos3:smbstatus add --fast option
Christian Ambach [Fri, 13 Jul 2012 15:24:02 +0000 (17:24 +0200)]
s3:smbstatus add --fast option

this option skips all checks if the process for the record is still there
using it gives a huge performance benefit on busy systems and clusters while
it might display stale data if a smbd crashed

11 years agos3:smbstatus don't check if process exists twice
Christian Ambach [Fri, 13 Jul 2012 15:10:05 +0000 (17:10 +0200)]
s3:smbstatus don't check if process exists twice

is_valid_share_mode_entry() already calls serverid_exists which calls process_exists()

11 years agos3:smbstatus rename a function to make its purpose more clear
Christian Ambach [Fri, 13 Jul 2012 15:14:09 +0000 (17:14 +0200)]
s3:smbstatus rename a function to make its purpose more clear

traverse_fn1 does not really intuitively make clear that it is used to traverse connections

11 years agos3:smbstatus fix a compiler warning
Christian Ambach [Fri, 13 Jul 2012 15:32:19 +0000 (17:32 +0200)]
s3:smbstatus fix a compiler warning

about comparison of signed with unsigned

11 years agos4-lib/tls: Try socket_send() multiple times to send partial packets
Andrew Bartlett [Wed, 18 Jul 2012 05:28:50 +0000 (15:28 +1000)]
s4-lib/tls: Try socket_send() multiple times to send partial packets

This works around an artificial limitation in socket_wrapper that breaks
some versions of GnuTLS when we return a short write.

Instead, keep pushing until the OS will not take it.

The correct solution will be to use tls_tstream, but the client code
for this is not yet tested and needs the ldap client layer changed
to use it.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jul 18 11:23:55 CEST 2012 on sn-devel-104

11 years agos4-librpc: Ensure we do not call call the decrpc timeout handler during gensec_update()
Andrew Bartlett [Mon, 9 Jul 2012 04:37:28 +0000 (14:37 +1000)]
s4-librpc: Ensure we do not call call the decrpc timeout handler during gensec_update()

This avoids a situation where we could destroy pointers on the stack due to
a nested event loop.

This is certainly not a final, generic solution, but it is a minimal change
while we work to make gensec and gensec_gssapi async.

Andrew Bartlett

11 years agos4-dbcheck: Check for and correct incorrect instanceType values
Andrew Bartlett [Tue, 17 Jul 2012 01:10:41 +0000 (11:10 +1000)]
s4-dbcheck: Check for and correct incorrect instanceType values

11 years agodsdb: Allocate new OID to allow updates of a read-only replica
Andrew Bartlett [Wed, 18 Jul 2012 07:13:30 +0000 (17:13 +1000)]
dsdb: Allocate new OID to allow updates of a read-only replica

Normally this would be a very bad idea, but the specific case of fixing the instanceType
is the only case where this makes sense.

Andrew Bartlett

11 years agos4-dsdb: Allow dbcheck to correct an incorrect instanceType
Andrew Bartlett [Tue, 17 Jul 2012 01:10:12 +0000 (11:10 +1000)]
s4-dsdb: Allow dbcheck to correct an incorrect instanceType

11 years agos4-dsdb: Ensure we never write read-only objects onto a read-write replica
Andrew Bartlett [Tue, 17 Jul 2012 05:48:15 +0000 (15:48 +1000)]
s4-dsdb: Ensure we never write read-only objects onto a read-write replica

We should prevent this much further up the stack, but at least add a choke
at this point for now.

Additionally, this avoids administrator-forced replications causing
considerable damange to the directory.

Andrew Bartlett

11 years agosource4/torture: add talloc_stackframe()
Rusty Russell [Wed, 18 Jul 2012 05:37:28 +0000 (15:07 +0930)]
source4/torture: add talloc_stackframe()

We need a stackframe to call lp_load().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Wed Jul 18 09:31:07 CEST 2012 on sn-devel-104

11 years agosource3/netapi: fix only caller which doesn't set up a talloc_stackframe()
Rusty Russell [Wed, 18 Jul 2012 05:37:28 +0000 (15:07 +0930)]
source3/netapi: fix only caller which doesn't set up a talloc_stackframe()

libnetapi_free() needs a stackframe too; looked like Andrew and Günther
missed this in a37de9a95974c138d264d9cb0c7829bb426bb2d6.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agosource3/passdb/py_passdb.c: wrap all calls in talloc_stackframe()
Rusty Russell [Wed, 18 Jul 2012 05:37:28 +0000 (15:07 +0930)]
source3/passdb/py_passdb.c: wrap all calls in talloc_stackframe()

dbwrap needs it.  Some calls were already wrapped, but they checked the
talloc_stackframe() return unnecessarily: it can never be NULL.

This is the coccinelle patch I used:

// Add in a stackframe to every function: be sure to free it on (every) return
@rule0@
identifier func;
@@
func(...) {
+TALLOC_CTX *frame = talloc_stackframe();
<...
+talloc_free(frame);
return ...;
...>
}

// Get rid of tframe allocation/frees, replace usage with frame.
@rule1@
identifier func;
identifier oldframe;
@@
func(...) {
...
-TALLOC_CTX *oldframe;
...
-if ((oldframe = talloc_stackframe()) == NULL) {
-  ...
-}
<...
-talloc_free(oldframe);
...>
}

// Get rid of tframe (variant 2)
@rule2@
identifier func;
identifier oldframe;
@@
func(...) {
...
-TALLOC_CTX *oldframe;
...
-oldframe = talloc_stackframe();
-if (oldframe == NULL) {
-  ...
-}
<...
-talloc_free(oldframe);
...>
}

// Change tframe to frame
@rule3@
identifier func;
@@
func(...) {
<...
-tframe
+frame
...>
}

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agosource3/passdb/py_passdb.c: don't steal from talloc_stackframe().
Rusty Russell [Wed, 18 Jul 2012 05:37:28 +0000 (15:07 +0930)]
source3/passdb/py_passdb.c: don't steal from talloc_stackframe().

If you want a stack-style allocation, use talloc_stackframe().  If you
don't, don't use it.  In particular, talloc_stackframe() here is actually
inside a pool, and stealing from pools is a bad idea.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agosource3/torture/pdbtest: allocate talloc_stackframe()
Rusty Russell [Wed, 18 Jul 2012 05:37:28 +0000 (15:07 +0930)]
source3/torture/pdbtest: allocate talloc_stackframe()

Avoid talloc_tos() without a stackframe.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>