1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

86517 Commits

Author SHA1 Message Date
Gregor Beck
a9331e482c s3:lib/netapi: do not use rpc_pipe_np_smb_conn()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:48 +13:00
Gregor Beck
7f863642db s3-net: do not use rpc_pipe_np_smb_conn()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:48 +13:00
Stefan Metzmacher
3b53566ebb s4:tortore:raw/qfileinfo: don't use dcerpc_pipe_open_smb() to open a named pipe
We can directly use smb_raw_open() to open a handle to a named pipe.
This avoids the need for the layer violation functions
dcerpc_smb_tree() and dcerpc_smb_fnum().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:47 +13:00
Stefan Metzmacher
a3074521d4 s4:torture/samba3rpc: let rpc.authcontext be more robust against low level changes (part2)
We now use smbXcli_conn_is_connected() and
dcerpc_binding_handle_is_connected() to verify only the dcerpc layer
got an error. The expected error is EIO mapped to NT_STATUS_IO_DEVICE_ERROR.

NT_STATUS_INVALID_HANDLE should only be visible at the SMB layer,
but we keep this as allowed return value for now, until
the dcerpc layer is fixed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:46 +13:00
Stefan Metzmacher
9d6b6dcd96 s4:torture/samba3rpc: let rpc.authcontext be more robust against low level code changes (part1)
Some code uses the low level smbXcli_session structure instead of
the smbcli_session structure and doesn't 'see' updates to the
smbcli_session structure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:46 +13:00
Stefan Metzmacher
872486bbd0 s3:rpc_client: pass object and table to rpccli_bh_create()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:45 +13:00
Stefan Metzmacher
d052528974 s4:librpc: implement dcerpc_binding_handle_auth_info()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:44 +13:00
Stefan Metzmacher
f773ed2cf7 s3:rpc_client: implement dcerpc_binding_handle_auth_info()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:44 +13:00
Stefan Metzmacher
a33b13bd61 librpc/rpc: add dcerpc_binding_handle_auth_info()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-17 08:48:41 +13:00
David Disseldorp
b92937e64e doc: add "spoolss: architecture" parameter usage
Windows spoolss print clients only allow association of server-side
drivers with printers when the driver architecture matches the
advertised print server architecture. Samba's spoolss print server
architecture can be changed using this parameter.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Oct 16 17:12:34 CEST 2013 on sn-devel-104
2013-10-16 17:12:34 +02:00
Andrew Bartlett
aca475b6bc lib/param: Add documentation on how loadparm works
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 16 11:39:41 CEST 2013 on sn-devel-104
2013-10-16 11:39:41 +02:00
Andrew Bartlett
361b51c13d proto: Remove manually written lp_ prototypes
This also ensures we remove prototypes from parameters we remove or
rename, and easily see how many special cases we have left.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-16 09:33:28 +02:00
Andrew Bartlett
033dc776de param: Autogenerate s3 lp_ctx glue table
This allows us to use more lpcfg_ functions without adding them
manually.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-16 09:31:41 +02:00
Andrew Bartlett
651cf89390 s3/param: Autogenerate parameters prototypes again after proto.h was frozen
This autogenerates the parameters so that we can keep everything in sync easier,
particularly when adding new parameters.  This will also make it easier to move
to a fully autogenerated system in the future, as it reduces special cases.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-16 09:31:01 +02:00
Andrew Bartlett
22ca0404fc param: Skip generating hooks for local and string parameters
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-16 09:29:54 +02:00
Andrew Bartlett
d711a01144 lib/param: Do not attempt to access the s3 function for allocated and subbed string parameters
This allows us not to generate array entries for these, which in turn allows
us to avoid initialising them.  The issue is that we do not have the
% macro sub context nor a talloc context handy (yet).

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-16 09:29:02 +02:00
Andrew Bartlett
6ac33b7f2e build: Move loadparm-related build rules to source3/param/wscript_build
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-16 09:28:02 +02:00
Andrew Bartlett
785e8d8c32 lib/param: lp_magicchar takes a const struct share_params *p so should be FN_LOCAL_PARM_CHAR
This was found when trying to autogenerate prototypes for lp_ functions again.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-16 09:27:47 +02:00
Hans Leidekker
a4c3553b5a Add NetWkstaGetInfo.
Modified to include common.h entry for netapitest_wksta function by Kai
Blin <kai@samba.org>

Signed-off-by: Hans Leidekker <hans@meelstraat.net>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct 16 07:00:45 CEST 2013 on sn-devel-104
2013-10-16 07:00:45 +02:00
Volker Lendecke
a1fcd71f9a smbd: Simplify open_file_ntcreate
Only one call to delay_for_oplocks left. Metze showed me the new logic:
BATCH is broken if we have a sharing violation. Exclusive is broken
otherwise. That's it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Oct 16 02:51:53 CEST 2013 on sn-devel-104
2013-10-16 02:51:53 +02:00
Volker Lendecke
4c0cf9fade smbd: Remove "file_existed" handling from open_mode_check
No clue what this does. In open_directory, "dir_existed" is not used after
open_mode_check. In open_file_ntcreate it's used, but I can't think of a case
right now where we would find a formerly nonexisting file to exist suddenly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-16 00:50:13 +02:00
Volker Lendecke
4263d16f13 smbd: Decouple grant_fsp_oplock_type from oplock validation
This makes grant_fsp_oplock_type independent from the values computed
in validate_oplock_types. It *might* make oplock calculation a bit
slower for heavily shared files, as we are walking the share mode array
twice. But we are doing so much stuff in open that I doubt the difference
is measurable. It clears up the code for me however, and I think that's
worth it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-16 00:45:43 +02:00
Volker Lendecke
00d84ad192 smbd: Reduce the complexity of open_file_ntcreate
This removes two variables in open_file_ntcreate based on the observation
that for exclusive and batch oplocks there can only be one entry. So
in these cases we don't need to keep pointers from find_oplock_types to
delay_for_oplocks. We can just reference the only share mode entry around.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-16 00:33:47 +02:00
Volker Lendecke
c938a1065f smbd: Factor out remove_stale_share_mode_entries
Will be used in the next commit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:46:11 +02:00
Volker Lendecke
4d85f91a5b smbd: Make find_oplock_types return bool
smb_panic() does not take a printf style argument. This improves debug
output by easily printing the index that we fell over. Also, doing
smb_panic deep down is bad style IMHO.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:44:37 +02:00
Volker Lendecke
0f71730d1b smbd: Make loop index type match loop limit
share_mode_data.num_share_modes is a uint32.

48 bytes less in .o text size for -O3 :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:43:30 +02:00
Volker Lendecke
388bf3643d smbd: Unify delay_for_*_oplocks
This is the same code in both routines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:42:41 +02:00
Volker Lendecke
c33015c069 smbd: Simplify find_oplock_types a bit
Define a variable to dereference lck->data just once. Believe it or not,
this saves a few bytes .o with -O3 :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:38:27 +02:00
Michael Adam
f50b6da7d5 s4:torture: add smb2.session.reauth6 : test failing reauth
This attempts reauth with invalid creds, hence
triggering the error path in the reauth code.
This invalidates the session and subsequente requests
on that connection fail.

https://bugzilla.samba.org/show_bug.cgi?id=10208

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 15 22:50:27 CEST 2013 on sn-devel-104
2013-10-15 22:50:27 +02:00
Michael Adam
f643961343 libcli/smb: add smb2cli_tcon_is_encryption_on()
https://bugzilla.samba.org/show_bug.cgi?id=10208

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 11:49:01 -07:00
Michael Adam
25494628a2 smbd:smb2: fix crash when smb2 session reauth fails
https://bugzilla.samba.org/show_bug.cgi?id=10208

Authentication error in smb2 session reauth invalidates
the session. In this case the session must in contrast
to successful session setup requests be torn down and live
no longer than the request.

The talloc move of the session from the global session
table to the request ensures that the session setup
reply can still be correctly signed, but subsequent
requests on the connection don't find a session any more.

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

Signed-off-by: Michael Adam <obnox@samba.org>
2013-10-15 11:48:19 -07:00
Volker Lendecke
9646dfcdf2 smbd: Inline break_level2_to_none_async
With the special case for bug 5980 in do_break_to_none we only have
one caller: process_oplock_async_level2_break_message. The further
goal is to merge process_oplock_async_level2_break_message with
process_oplock_break_message.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 15 03:42:53 CEST 2013 on sn-devel-104
2013-10-15 03:42:53 +02:00
Volker Lendecke
1d2c6f477b smbd: Remove a special case for level2 break
With the level2 indicator in brlock.tdb this race condition does not
exist anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Volker Lendecke
cc9cd5142a smbd: Remove some FAKE_LEVEL_II comments
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Volker Lendecke
47f65d5829 smbd: Add debugs to brlock.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Volker Lendecke
c92ac4c8ee torture: Extend raw.oplock.batch10
With FAKE_LEVEL_II_OPLOCKS around we did not grant LEVEL2 after
a NO_OPLOCK file got written to. Windows does grant LEVEL2 in this
case. With the have_level2_oplocks in brlocks.tdb we can now grant LEVEL2
in this case as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Volker Lendecke
fcafaf6022 smbd: Remove FAKE_LEVEL_II_OPLOCK
FAKE_LEVEL_II_OPLOCK was an indicator to break level2 oplock holders
on write.  This information is now being held in brlock.tdb, which makes
the FAKE_LEVEL_II_OPLOCK type unnecessary.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Volker Lendecke
eb50c18c4a smbd: Put "have_read_oplocks" into brlock.tdb
This implements an idea by metze: Right now Samba does not grant level2
oplocks where it should: After an initial no-oplock open that has been
written to, we don't have the FAKE_LEVEL2_OPLOCK entry in locking.tdb
around anymore, this downgraded to NO_OPLOCK. Windows in this case will
grant level2 if being asked, we don't.  Part of the reason for this
is that we don't have a proper mechanism to communicate the fact that
level2 needs to be broken to other smbds. Metze's insight was that we
have to look into brlock.tdb for every write anyway, so this might be
the right place to store this information.

My first reaction was that this is really hackish, but on further thought
this is not. oplocks depend on brlocks anyway, and we have the proper
mechanisms in place for brlocks.

The format for this change is to add one byte to the end of the brlock.tdb
record with value 1 if we have level2 oplocks around. Thus this patch
effectively reverts 8f41142 which I discovered while writing this
change. We now legally have unaligned records.

We can certainly talk about the format, but I'm not yet convinced we
need an idl for this yet. This is a potentially very hot code path,
and ndr marshalling has a cost.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Andrew Bartlett
54019ca9aa docs: Explain why this option should not be used
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 15 01:51:39 CEST 2013 on sn-devel-104
2013-10-15 01:51:39 +02:00
Andrew Bartlett
e512491552 s3-winbindd: Remove undocumented winbindd:socket dir parameter
This uses the documeted "winbindd socket directory" parameter instead.

This came about due to the merge of the two smb.conf tables in s3 and
s4 for the Samba 4.0 release.  The s4 code used a real parameter,
which caused this to be documented, whereas no automatic procedure
existed to notice the parametric option and the need to document that.
The fact that this was not used consistently in both codebases is one
of the many areas of technical debt we still need to pay off here.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-15 10:58:45 +13:00
Volker Lendecke
13495c7eb3 auth4: Remove an unused variable
Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-15 10:58:23 +13:00
Andreas Schneider
2343df451a talloc: Add a warning to talloc_reference() documentation.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 14 23:05:54 CEST 2013 on sn-devel-104
2013-10-14 23:05:54 +02:00
David Disseldorp
477e53a8cb param: disable print notify backchannel by default
In handling RemoteFindFirstPrinterChangeNotifyEx requests, the spoolss
server can establish a "backchannel" connection to the print client, as
a mechanism for sending print notifications. This behaviour is governed
by the "print notify backchannel" smb.conf parameter.

This change sets "print notify backchannel" to "no" by default, which
sees Samba respond to RemoteFindFirstPrinterChangeNotifyEx requests with
WERR_SERVER_UNAVAILABLE. In recieving such a response, print clients can
fall back to polling for print queue changes.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Oct 14 18:49:41 CEST 2013 on sn-devel-104
2013-10-14 18:49:41 +02:00
Jeff Layton
fec84112f3 asn1: fix use-after-free in asn1_write
On talloc_realloc failure, asn1_write calls talloc_free on an asn1_data
pointer and then tries to immediately set the has_error flag on it.

Skip the free and just set the has_error flag.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 14 16:54:35 CEST 2013 on sn-devel-104
2013-10-14 16:54:34 +02:00
Nadezhda Ivanova
13a10d4314 s4-samldb: Do not allow deletion of objects with RID < 1000
According to [MS-SAMR] 3.1.5.7 Delete Pattern we should not allow deletion
of security objects with RID < 1000. This patch will prevent deletion of
well-known accounts and groups.

Signed-off-by: Nadezhda Ivanova <nivanova@symas.com>
Reviewed-by:   Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date(master): Mon Oct 14 13:31:50 CEST 2013 on sn-devel-104
2013-10-14 13:31:50 +02:00
Volker Lendecke
064433f265 libcli4: Remove an unused variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Oct 13 17:58:23 CEST 2013 on sn-devel-104
2013-10-13 17:58:23 +02:00
Volker Lendecke
dd0e4c47e5 smbd: Remove unused create_options from open_mode_check
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Oct 13 14:35:26 CEST 2013 on sn-devel-104
2013-10-13 14:35:26 +02:00
Volker Lendecke
4c82e8358a smbd: Remove name_hash param from open_mode_check
This came from delete_on_close handling which was factored out.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-13 12:43:32 +02:00
Christof Schmitt
26b1103008 s3/time_audit: Add offline and durable functions
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Oct 12 13:00:02 CEST 2013 on sn-devel-104
2013-10-12 13:00:02 +02:00
Christof Schmitt
1c866461f0 vfs: Fix parentheses in SMB_VFS_NEXT_DURABLE_COOKIE
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-12 11:05:52 +02:00