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

57968 Commits

Author SHA1 Message Date
Andrew Tridgell
ced3eef776 s4-drsutil: fixed a memory leak in samdb_search_count
In general functions that don't return any memory should not take a memory context.
Otherwise it is too easy to have a bug like this where memory is leaked
2009-12-04 17:49:19 +11:00
Zachary Loafman
4f6d5d0b86 s4 torture: Convert create_complex_file to use BASIC_INFO instead of deprecated command
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-12-03 20:46:29 -08:00
Zachary Loafman
3507350ad2 s4 torture: Fix call to smbcli_open
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-12-03 20:46:29 -08:00
Zachary Loafman
a3df55b26f s4 torture: Make RAW-SEARCH pass against win7
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-12-03 20:46:25 -08:00
Zachary Loafman
2dc5bd19d4 s4 torture: Parameterize WRITE_AND_CLOSE support
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-12-03 20:21:22 -08:00
Zachary Loafman
f26a500d9f s4 torture: Add lockread_supported based off of CAP_LOCK_AND_READ
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-12-03 20:21:22 -08:00
Zachary Loafman
5882282dea s4 torture: Allow READ to be parameterized, add more readx tests
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-12-03 20:21:22 -08:00
Zachary Loafman
60d9828ade s4-torture: Allow the legacy DENY_FCB/DENY_DOS share modes to be ignored
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-12-03 19:07:54 -08:00
Tim Prouty
5c857768d1 s4 selftest/quicktest: Update known failures for the sfileinfo and oplock changes
Two new samba4 bugs have been filed for the two corresponding known
failures.  For the short term raw.sfileinfo had to be removed from
quicktest.  It is no longer an individual test, but a test-suite and
quicktest can only run top level tests.
2009-12-03 18:54:52 -08:00
Tim Prouty
15e1c61027 s4 torture: Add a new RAW-OPLOCK test: BATCH26
Try a rename with a wide-open share mode on an already open file
and the there is still share mode contention.  For the reason why
see:

http://social.msdn.microsoft.com/Forums/en-US/os_fileservices/thread/3ca14dc9-da1f-4786-a8f7-a86e9903db0c

Msft's anser:

   After further review, The reason for server to fail with sharing
   violation is that the windows server that executes a path-based
   rename request opens the file for DELETE access, but only with
   FILE_SHARED_READ as ShareAccess .  Therefore, the existing
   open(frame 76), which has shared read/write/delete , is compatible
   with the Windows servers access mode (DELETE), but Windows servers
   open is not compatible with access mode in existing open.

   Note that it is correct to state that the logic in Windows server
   could have been written to allow shared read/write/delete in which
   case it would succeed as you mention. The behavior here is
   historical based on the existing implementation.
2009-12-03 18:54:52 -08:00
Tim Prouty
8f7e5732ef s4 torture: Close the third handle in RAW-OPLOCK-BATCH22 2009-12-03 18:54:52 -08:00
Tim Prouty
522d6bc588 s4 torture: Convert an error to a warning in RAW-OPLOCK-BATCH22
Some servers choose to mark a client as bad if they fail an oplock
break request by timing out (win7 is an example).  Once the client is
marked as bad, future oplock requests will timeout instantly.  This
causes subsequent runs of this test to fail, so rather than erroring
out as a failure, a warning is printed instead.

There is also a bug in w2k3 where it was incorrectly returning
contending a share mode lock.  It worked in XP and has been re-fixed
in win7.

This can also now be run against samba3.
2009-12-03 18:54:52 -08:00
Tim Prouty
b14da4f7c5 s4 torture: Add a few more windows target types 2009-12-03 18:54:52 -08:00
Tim Prouty
fc7832602d s4 torture: Convert to a more modern version of read in RAW-OPLOCK-BATCH4 2009-12-03 18:54:52 -08:00
Tim Prouty
af8b7857ca s4 torture: Allow some implementations to break from level1 to none with two breaks 2009-12-03 18:54:52 -08:00
Jeremy Allison
66c968778d Make sure we're not using the old smb_fname data.
Jeremy.
2009-12-03 17:44:38 -08:00
Jeremy Allison
3fe7dfd1d9 Remove smb_fname duplicates that just keep the same information as in fsp->fsp_name.
Moving towards making VFS_OPEN/VFS_MKDIR/VFS_RMDIR
handle based...
Jeremy.
2009-12-03 16:45:35 -08:00
Günther Deschner
459a968fb4 s3-spoolss: handle SEC_FLAG_MAXIMUM_ALLOWED in spoolss_OpenPrinterEx.
In case someone (smbtorture4) requests SEC_FLAG_MAXIMUM_ALLOWED, translate it
to a request of PRINTER_ACCESS_ADMINISTER.

Guenther
2009-12-03 23:49:03 +01:00
Günther Deschner
2f0548fd98 s4-smbtorture: check more WERRORs in RPC-SPOOLSS.
Guenther
2009-12-03 23:48:59 +01:00
Günther Deschner
4e20a6f83b s4-smbtorture: call test_EnumPrinterDrivers with architecture in RPC-SPOOLSS.
Guenther
2009-12-03 22:16:24 +01:00
Jeremy Allison
91e0bdd86c Refactor reply_rmdir to use handle based code. All
calls are now handle based. Put rmdir into close.c
and make it private.
Jeremy.
2009-12-03 13:01:10 -08:00
Matthias Dieter Wallnöfer
80e066112c s4:operational LDB module - Fix usage of LDB constants 2009-12-03 12:51:16 +01:00
Matthias Dieter Wallnöfer
fed6ac05d0 s4:ntvfs/posix/pvfs_streams - Fix "discard const" warning
I removed one "const" in front of a string declaration to achieve this.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-03 21:46:31 +11:00
Matthias Dieter Wallnöfer
1a855eb741 s4:ntvfs/posix/pvfs_resolve - Fix "discard const" warning
I removed two "const"s in front of string declarations to achieve this.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-03 21:46:31 +11:00
Bo Yang
cdb68bd2b6 s3: Fix crash in winbindd;(bug#6879).
Signed-off-by: Bo Yang <boyang@samba.org>
2009-12-03 12:54:19 +08:00
Jeremy Allison
dfcc4115dd Remove unneeded argument from can_set_delete_on_close(). Ensure
can_set_delete_on_close() is correctly called before any setting
of the disposition bit (clean up the do_unlink() call).
Jeremy.
2009-12-02 18:06:40 -08:00
Steven Danneman
76be0f6a11 s4/selftest: knownfail some locking tests until bugs are fixed 2009-12-02 17:55:34 -08:00
Björn Jacke
7c938d16a9 ѕ3: remove superfluous option check
this function is only called when strict alloc is set, no reason to check that twice.
2009-12-03 02:36:19 +01:00
Steven Danneman
48358b3eaa s4/torture: add multiple lock cancel test
See what happens when we have multiple outstanding lock requests and
we try to cancel both of them within a single LockingAndX.

On Windows, it seems only the first lock in the array is cancelled,
and the second is left pending.  Though, this behavior goes against
the MS-CIFS spec.
2009-12-02 17:28:52 -08:00
Steven Danneman
ad9c5a7b88 s4/torture: add addition multiple lock tests
* test that 2 locks in a single LockAndX are transactional
* test that 1 unlock and 1 lock in a single LockAndX are not
  transactional
* test that SMB2 doesn't like mixed lock/unlock in a single
  PDU
2009-12-02 17:28:52 -08:00
Steven Danneman
dfbb92e2a1 s4/torture: fix build warnings by removing unecessary const 2009-12-02 17:28:51 -08:00
Steven Danneman
438b7c41ae s4/torture: Add target functionality parameters to SMBv1 BRL tests
Abstract the server requirements to pass some BRL tests.

* The new default for >64bit lock tests, is that the server should
  return STATUS_INVALID_LOCK_RANGE.
* Add parameter for targets that don't implement DENY_DOS
2009-12-02 17:28:51 -08:00
Günther Deschner
9a3d9abdd8 s3-selftest: run LOCAL-NDR when running make selftest.
Guenther
2009-12-03 01:04:02 +01:00
Günther Deschner
450211b610 s4-smbtorture: be very strict in checking spools_EnumPrinterKey results.
Guenther
2009-12-03 01:04:02 +01:00
Günther Deschner
f32ccc321a spoolss: hand-marshall the spoolss_StringArray2 struct for spoolss_EnumPrinterKey.
This call is just driving me nuts :-)

Guenther
2009-12-03 01:04:02 +01:00
Andrew Tridgell
8d7a43fed7 s4-drs: fixed UDV and overlapping sync calls in DRS
When windows abandons a DRS sync, it will sometimes re-use the same bind handle for
a new sync. This means we need to check the DN of the sync and blank the getnc_state
if the DN has changed.

This also fixes the UDV to use the highest uSN for the partition, not for
the whole SAM.
2009-12-03 10:27:59 +11:00
Andrew Tridgell
b65b88740c s4-drs: fixed updating of uSNChanged in replmd_modify
Updating of uSNChanged broke in a recent change
2009-12-03 10:27:59 +11:00
Björn Jacke
a2929a638f s3:build: remove redundant qnx block size definition 2009-12-03 00:14:16 +01:00
Jeremy Allison
365c6b4ce0 Restructure the ACL code some more, get the internal semantics
right. The previous bugs were due to the fact that get_nt_acl_internal()
could return an NTSTATUS error if there was no stored ACL blob, but
otherwise would return the underlying ACL from the filysystem. Fix
this so it always returns a valid acl if it can, and if it does not
its an error to be reported back to the client. This then changes
the inherit acl code. Previously we were trying to match Windows
by setting a minimal ACL on a new file that didn't inherit anything
from a parent directory. This is silly - the returned ACL wouldn't
match the underlying UNIX permissions. The current code will correctly
inherit from a parent if a parent has any inheritable ACE entries
that apply to the new object, but will return a mapping from the
underlying UNIX permissions if the parent has no inheritable entries.
This makes much more sense for new files/directories.
Jeremy.
2009-12-02 15:02:28 -08:00
Björn Jacke
1d013fd032 s3:build: fix shared library build on QNX
Fixes #6860. Thanks to Matt Kraai!
2009-12-03 00:02:44 +01:00
Jeremy Allison
148e79d156 Ensure check_parent_acl_common() only looks at stored
blobs - returns NT_STATUS_OK if there aren't any.
Jeremy.
2009-12-02 12:29:16 -08:00
Björn Jacke
95c1862610 s3: prefer posix_fallocate for doing "strict allocate"
posix_fallocate is more efficient than manual zero'ing the file. When
preallocation in kernel space is supported it's extremely fast. Support for
preallocation at fs layer via posix_fallocate and fallocate at kernel site
can be found in Linux kernel 2.6.23/glibc 2.10 with ext4, XFS and OCFS2. Other
systems that I know of which support fast preallocation in kernel space are
AIX 6.1 with JFS2 and recent Solaris versions with ZFS maybe UFS2, too.

People who have a system with preallocation in kernel space might want to set
"strict allocate = yes". This reduces file fragentation and it's also safer for
setups with quota being turned on.

As of today most systems still don't have preallocation in kernel space, and
that's why "strict allocate = no" will stay the default for now.
2009-12-02 21:21:43 +01:00
Jeremy Allison
486c8d57ec Ensure get_nt_acl_internal() only looks at the ACL blobs, not
reads off the underlying filesystem. Ensure that vfs_acl_tdb.c
returns NT_STATUS_NOT_FOUND, not NT_STATUS_OBJECT_NAME_NOT_FOUND
when it can't find a blob matching the file.
Jeremy.
2009-12-02 12:09:48 -08:00
Jeremy Allison
b6fdecd112 Fix bug #6837 - "Too many open files" when trying to access large number of files
from Windows 7. Original patch by me fixed up with the correct open files number
by jmaggard10@hotmail.com.
Jeremy.
2009-12-02 10:01:14 -08:00
Günther Deschner
5f60855ba2 samba-spoolss: use spoolss_StringArray2 in spoolss_EnumPrinterKey.
This should finally resolve the endian issues we were seeing on sparc and is
much cleaner for spoolss clients and servers.

Guenther
2009-12-02 14:56:17 +01:00
Günther Deschner
292af4fc04 spoolss: add spoolss_StringArray2.
The difference to spoolss_StringArray is that in spoolss_StringArray2 the string
array is put into a subcontext of _ndr_size.

Guenther
2009-12-02 14:37:02 +01:00
Günther Deschner
91bb065977 s3-spoolss: move MAXDEVICENAME to spoolss idl.
Guenther
2009-12-02 14:36:36 +01:00
Volker Lendecke
53744f01dc s3: Cope with older external libtdb 2009-12-02 00:38:03 +01:00
Günther Deschner
ecb071ca2a Revert "s3-build: taise tdb version when building against system libtdb library."
This reverts commit ea20678c55.

Just one new error code does probably not justify raising the required tdb version.

Guenther
2009-12-02 00:38:03 +01:00
Jeremy Allison
8dda4cea66 Ensure we don't see the xattr used to store NT security (visible when xattr_tdb
is used). Allows make test to pass with acl_xattr.so prepended to the vfs modules.
Jeremy.
2009-12-01 14:08:16 -08:00