1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

43354 Commits

Author SHA1 Message Date
Volker Lendecke
0670975261 smbd: Fix an ancient oplock bug
If we get an oplock break response, we forgot to remove the oplock break
timeout.

Found by stopping raw.oplock.exclusive5 after the 2nd open and watching a debug
level 10 log. This amends 08a9de89 from 2007.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-04 11:35:59 -07:00
Jeremy Allison
bdab6f9431 Optimization. Don't do the retry logic if sitename_fetch() returned NULL, we already did a NULL query.
Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep  4 01:19:05 CEST 2013 on sn-devel-104
2013-09-04 01:19:05 +02:00
Jeremy Allison
68e7b1c944 Move the retry logic when site_name is passed in a NULL or "" to the wrapper function.
Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
2013-09-04 08:41:39 +12:00
Jeremy Allison
181c11066b Move the manipulation of site_name into the caller function dsgetdcname().
Leave dsgetdcname_internal() only using const char *site_name.

Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
2013-09-04 08:41:33 +12:00
Jeremy Allison
66006be7ef Refactor dsgetdcname to be called via a wrapper function.
Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
2013-09-04 08:41:25 +12:00
Jeremy Allison
dd12bfbcbf dsgetdcname_cache_fetch() doesn't use the site_name parameter so don't pass it.
Bug 5917 - Samba does not work on site with Read Only Domain Controller

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
2013-09-04 08:41:02 +12:00
Volker Lendecke
ade8477f98 torture3: Trigger a nasty cleanup bug in smbd
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): Tue Sep  3 19:13:14 CEST 2013 on sn-devel-104
2013-09-03 19:13:14 +02:00
Volker Lendecke
7d91ffc6fd smbd: Fix flawed share_mode_stale_pid API
The comment for this routine said:

> Modifies d->num_share_modes, watch out in routines iterating over
> that array.

Well, it turns out that *every* caller of this API got it wrong. So I
think it's better to change the routine.

This leaves the array untouched while iterating but filters out the
deleted ones while saving them back to disk.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03 17:13:53 +02:00
Volker Lendecke
5006db98aa smbd: Rename parameter "i" to "idx"
We'll need "i" in a later checkin ... :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03 17:13:53 +02:00
Volker Lendecke
696bc569b1 smbd: Don't store in-memory only flags in locking.tdb
Hey, pidl knows the [skip] attribute ... :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03 17:13:53 +02:00
Volker Lendecke
94b320527e smbd: Simplify find_oplock_types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03 17:13:52 +02:00
Christopher R. Hertel
ba04400d01 vfs_glusterfs: Fix excessive debug output from vfs_gluster_open().
The vfs_gluster_open() function generates a debug message (at level 0)
for every failed attempt to open a pathname.  This includes cases in
which attempts are made to open a directory as a file (those attempts
are retried calling vfs_gluster_opendir()).  The result is that the log
file fills with messages about failed attempts to open directories, just
because they are directories.

This latest version, of the patch completely removes logging from the
vfs_gluster_open() function.  The error code returned is handled in
upper layers, and the open function in the default VFS module does not
log any errors.

Signed-off-by: Christopher R. Hertel <crh@redhat.com>
Reviewed-by: susant palai <spalai@redhat.com>
Reviewed-by: raghavendra talur <rtalur@redhat.com>
Reviewed-by: Jose A. Rivera <jarrpa@redhat.com>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 30 02:43:48 CEST 2013 on sn-devel-104
2013-08-30 02:43:48 +02:00
Michael Adam
91910fe898 s3:winbind: fail ads_cached_connection_connect() if realm == NULL
This prevents segfaults when e.g. a previous SMB_STRDUP failed..

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Aug 29 18:54:28 CEST 2013 on sn-devel-104
2013-08-29 18:54:28 +02:00
Günther Deschner
9d08ac424c s3-winbindd: remove unneded include of secrets.h from idmap_ad.c
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-29 16:57:51 +02:00
Günther Deschner
77d7e2ad5a s3-winbindd: use get_trust_pw_clear() wrapper for AD connection code.
This avoids calling secrets functions directly.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-29 16:57:51 +02:00
Günther Deschner
b66ce754a3 s3-winbindd: make sure also the idmap code can deal with trusted domains.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-29 16:57:51 +02:00
Günther Deschner
576c597ae3 s3-winbindd: use find_domain_from_name() instead of find_domain_from_name_no_init().
Otherwise there is a good chance the domain has not been connected and we don't
know the realm name yet.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-29 16:57:51 +02:00
Günther Deschner
26ab2194f9 s3-winbindd: Fix winbind on DC crash with trusted AD domains.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-29 16:57:51 +02:00
Günther Deschner
57d5336969 s3-winbindd: Fix memory leak in ads_cached_connection().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-29 16:57:51 +02:00
Günther Deschner
edca1f9d48 s3-winbindd: remove pointless variable assigment, see the strdup below.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-29 16:57:51 +02:00
Volker Lendecke
1b1935b876 smbd: Correctly return INFO_LENGTH_MISMATCH for smb1
This is required if the client offered less buffer than the fixed portion
of the info level data requires

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
5634f240fd smbd: Fix error return for STREAM_INFO
The stream_info marshalling follows its own rules. This needs unifying
eventually...

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
b37edda329 smbd: Revert a93f9c3
This was too broad and has been replaced by finer-grained error checks

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
40f60024ca smbd: Correctly return BUFFER_OVERFLOW in smb2_getinfo
Also, don't overflow the client buffer

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
9193961476 smbd: Correctly return INFO_LENGTH_MISMATCH in smb2_getinfo
We have to return this error if the client offered less than the fixed
portion of the infolevel data requires

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
ac41df91a5 smbd: qfsinfo has fixed/variable buffers
The error message will have to change depending whether the buffer is
too small for the fixed or variable buffers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
5312399603 smbd: qfilepathinfo has fixed/variable buffers
The error message will have to change depending whether the buffer is
too small for the fixed or variable buffers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
e1843cd332 torture3: add clipathinfo-bufsize
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
1cae59ce11 dbwrap_ctdb: Treat empty records as non-existing
This is a patch implementing the workaround Christian mentioned in
https://bugzilla.samba.org/show_bug.cgi?id=10008#c5

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10008
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-08-28 23:37:08 +02:00
Abhidnya Joshi
91186fcf9d s3: fix missing braces in nfs4_acls.c
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 28 20:25:56 CEST 2013 on sn-devel-104
2013-08-28 20:25:55 +02:00
Volker Lendecke
323cccd35d smbd: Use #defines in smb2_getinfo_send
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Aug 27 15:08:08 CEST 2013 on sn-devel-104
2013-08-27 15:08:07 +02:00
Jeremy Allison
d1593a20f3 Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.
UNIX extensions calls must never deref links.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 26 20:19:46 CEST 2013 on sn-devel-104
2013-08-26 20:19:46 +02:00
Jeremy Allison
f1ff97fc02 Allow UNIX extensions client to act on open fsp instead of pathname if available.
Eliminates possible race condition on pathname op.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2013-08-26 09:01:22 -07:00
Jeremy Allison
bd0156988b Fix the erroneous masking of chmod requests via the UNIX extensions.
Changed from switch statement to if, as "create mask", "force create mode"
are only applied to new files, not existing ones. "directory mask",
"force directory mode" are only applied to new directories, not existing
ones.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2013-08-26 09:01:16 -07:00
Volker Lendecke
76142780fb smbd: Simplify dropbox special case in unix_convert
EACCESS needs special treatment: If we want to create a fresh file,
return OBJECT_PATH_NOT_FOUND, so that the client will continue creating
the file. If the client wants us to open a potentially existing file,
we need to correctly return ACCESS_DENIED.

This patch makes this behaviour hopefully a bit clearer than the code
before did.

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

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug 26 12:14:26 CEST 2013 on sn-devel-104
2013-08-26 12:14:26 +02:00
Jeremy Allison
84b8bddd7d Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."
Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

This reverts commit f124d6fbcd.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Aug 25 05:44:11 CEST 2013 on sn-devel-104
2013-08-25 05:44:10 +02:00
Jeremy Allison
8e299634d9 Revert "Allow UNIX extensions client to act on open fsp instead of pathname if available."
Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

This reverts commit ce776551ab.
2013-08-24 18:44:20 -07:00
Jeremy Allison
9cbd4fcd1e Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

Revert "Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN."

This reverts commit cf86adc441.
2013-08-24 18:43:29 -07:00
Jeremy Allison
cf86adc441 Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.
UNIX calls never deref links.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Aug 25 01:02:40 CEST 2013 on sn-devel-104
2013-08-25 01:02:40 +02:00
Jeremy Allison
ce776551ab Allow UNIX extensions client to act on open fsp instead of pathname if available.
Eliminates possible race condition on pathname op.

Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-24 14:04:47 -07:00
Jeremy Allison
f124d6fbcd Fix the erroneous masking of chmod requests via the UNIX extensions.
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-24 14:04:47 -07:00
Jeremy Allison
9423d5afb7 Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / winbind
Don't use talloc_tos() in something that can be linked to in pam_winbindd.so

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Sat Aug 24 02:28:28 CEST 2013 on sn-devel-104
2013-08-24 02:28:28 +02:00
Volker Lendecke
83d1495e58 smbd: Fix a debug message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-23 09:48:21 -07:00
Günther Deschner
a0b245c782 s3-pkgconfig: remove leftovers from autoconf build.
No worries, we still ship appropriate pc files for these libs.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2013-08-22 18:50:47 +02:00
Michael Adam
db1d0349c4 client: add missing newlines to error messages for invalid iosize parameter.
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): Wed Aug 21 21:49:45 CEST 2013 on sn-devel-104
2013-08-21 21:49:44 +02:00
Michael Adam
122609affb smbtree: use the correct count variable from NetShareEnum result.
Fixes potential segfault, as for rpcclient from bug #10100

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-21 10:31:19 -07:00
Jeremy Allison
d9c88a56dc Add new "timeout" command and -t option to smbclient to set the per-operation timeout.
This is needed as once SMB3 encryption is selected the server
response time can be very slow when requesting large numbers
(256) of large encrypted packets (1MB) from a Windows 2012
virtual machine. This allows clients to tune their allowable
wait time.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-21 17:28:55 +02:00
Jeremy Allison
81e1058e20 As SMB3 has transport level encryption, allow smbclient -e to force encryted SMB3 transport.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-21 17:28:55 +02:00
Jeremy Allison
25521c9085 Remove restrictions on setting iosize inside smbclient for SMB2 connections.
Also remove the SMB1 restriction to minimum iosize of 16384 (0x4000):
Now values >= 0 and <= 0xFFFF00 can be set for SMB1, 0 meaning server
defined behaviour. 0 is the new default for iosize, both for SMB1 and SMB2.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-21 17:28:54 +02:00
Jeremy Allison
6e82f70da0 Fix bug #10100 - rpcclient crashes when sending the 'netshareenum 502' command
We are using the wrong variable for the returned count.
Reported by <pisymbol@gmail.com>.

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

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Aug 21 17:30:33 CEST 2013 on sn-devel-104
2013-08-21 17:30:33 +02:00