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

86742 Commits

Author SHA1 Message Date
Aurélien Aptel
e236d5df13 test_smbclient_tarmode.pl: add extraction regex tests, verbose flag
* reset_remote() now removes the whole share content
* verbose flag to control stdout of each test
* extraction with regex test

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
24067dc243 test_smbclient_tarmode.pl: test regex flag behaviour
[ddiss@samba.org: split from clitar implementation commit]
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
4eecb46bce test_smbclient_tarmode.pl: add large file and long path tests
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
bd4cde803c test_smbclient_tarmode.pl: add simple wildcard test
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
f77f63ed28 test_smbclient_tarmode.pl: test interactive command
[ddiss@samba.org: split from clitar implementation commit]
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
70e80532b0 test_smbclient_tarmode.pl: whitespace
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
363601e277 test_smbclient_tarmode.pl: let --test run multiple tests
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
45bee9901b test_smbclient_tarmode.pl: sanitize input, use File::Temp instead of hardcoding temp dir
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:42 -05:00
Aurélien Aptel
2f30482e7b test_smbclient_tarmode.pl: cosmetic changes
- Add whitespace around paren in if/for/while/... blocks
- Don't split if/elsif/else cascade

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
8540032527 test_smbclient_tarmode.pl: add copyright header
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
98fa4bc03e test_smbclient_tarmode.pl: samba 3.6.9 can print a empty attribute string
While changing my setup, I discovered that for some unknown reasons
samba (serv/client) doesn't print any attributes for normal files.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
03e1557728 test_smbclient_tarmode.pl: disable failing tests for now
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
97c34f3e6f test_smbclient_tarmode.pl: make script work on older Perl (now only need 5.14)
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
David Disseldorp
e879580f1c test_smbclient_tarmode.pl: fix a few minor typos
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
bfd6b7bf09 test_smbclient_tarmode.pl: refactor, cleanup and document in POD
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
60edcc7905 test_smbclient_tarmode.pl: add tests for wildcard pattern (cI, cX, cF, xF).
* add some test for wildcard pattern and r switch, when possible (-r
  is very buggy)
* change default DIR to "tar_test_dir"
* add tests for attributes (nohidden, nosystem which are undocumented)

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
581d128ef3 test_smbclient_tarmode.pl: add a first simple wildcard test
* File::list() now takes an absolute path
* check_remote() now takes the dir to check
* added an optional File destructor
* added cleanpath() to remove unecessary slashes
* File::new_remote() can take an absolute path
* File->{dir} is now absolute from the localpath

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
a8b1d58edb test_smbclient_tarmode.pl: add a clean option to erase the local path
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
ea04ae30e1 test_smbclient_tarmode.pl: add test for xF
Add test for extracting from a file list.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
aaf59c9db6 test_smbclient_tarmode.pl: add test for creation w/ filelist
* add test_creation_list()
* add parameter to File::new_local() to provide file content

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:41 -05:00
Aurélien Aptel
fa067e8e2d test_smbclient_tarmode.pl: add extraction test for I and X.
* add test for xI and xX
* fix bug in check_remote(): print filename instead of ref
* replace hash by list in test_extraction_normal()

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
f764c39a59 test_smbclient_tarmode.pl: add tests for X and I.
Found a bug while doing so. X doesn't exclude file path.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
3a10b8803a test_smbclient_tarmode.pl: add option to choose and run a single test
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
cb0803444a test_smbclient_tarmode.pl: add first extraction test
* add normal extraction test
* add (or bring back)
  - File::list() -- return list of File in a path
  - File::tree() -- same but recursive
  - File::walk() -- high order function to iterate on a File hierarchy
* compute md5 sum when not cached
* add check_remote(), will be useful for all extraction tests
* fix consecutive slashes bug in some File::xxxpath()

At this point, the script can replace the old
test_smbclient_tarmode.sh in terms of features.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
c5ae61f3eb test_smbclient_tarmode.pl: remove unused functions
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
d07d89a11e test_smbclient_tarmode.pl: add nested dirs test
add a test to check that the backup handles nested directories.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
1624382c98 test_smbclient_tarmode.pl: refactored file related function to a File package
all the localpath(), remotepath() and all file related functions were
getting out of hand. The tests are now simpler to write.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
e70b6dead7 test_smbclient_tarmode.pl: add test for "newer than" (N flag)
add test for the N FILE flag which makes smbclient only backup files
newer or as new as FILE.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
2ef7909dd0 test_smbclient_tarmode.pl: add test for reset mode
add a new test for the reset mode which can be triggered via `-a` or
`tarmode reset`.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
be54395832 test_smbclient_tarmode.pl: improve incremental test
instead of using archived and non-archived files for the test, use
archive and various flags (system, hidden, readonly).

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:40 -05:00
Aurélien Aptel
947775ee00 test_smbclient_tarmode.pl: add proper argument parsing for configuration.
documentation is included in the script in POD format.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:39 -05:00
Aurélien Aptel
f5325f5e3e initial commit of the new tarmode test script.
This script will hopefully replace and improve test_smbclient_tarmode.sh.
Right now it only does normal and incremental tests.

Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
2013-11-05 08:42:39 -05:00
Jeremy Allison
65882152cc Add regression test for bug #10229 - No access check verification on stream files.
Checks against a file with attribute READONLY, and
a security descriptor denying WRITE_DATA access.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov  4 23:10:10 CET 2013 on sn-devel-104
2013-11-04 23:10:10 +01:00
Jeremy Allison
60f922bf1b Fix bug #10229 - No access check verification on stream files.
https://bugzilla.samba.org/show_bug.cgi?id=10229

We need to check if the requested access mask
could be used to open the underlying file (if
it existed), as we're passing in zero for the
access mask to the base filename.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-11-04 12:10:18 -08:00
Volker Lendecke
4061954990 torture: Add smb2.rename.rename_dir_bench
This is a little benchmark test excercising parallel directory renames. With
lots of open files directory renames get pretty slow against some SMB server
implementations.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-04 12:06:05 -08:00
Andreas Schneider
03e4037c5e testparm: Add warning for socket options.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Nov  4 16:52:25 CET 2013 on sn-devel-104
2013-11-04 16:52:25 +01:00
Andreas Schneider
8ae0f8c598 testparm: Reformat text and add a newline.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-11-04 15:04:23 +01:00
Andreas Schneider
d35d6a2dfa vfs: Fix some build warnings in glusterfs.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-11-04 15:04:20 +01:00
Andreas Schneider
25d62dda5c vfs: Fix building the glusterfs module.
Using calloc directly throws an error. This fixes building the glusterfs
module.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-11-04 15:04:18 +01:00
Gregor Beck
e2d6431cd4 s3:rpc_server: rpc_create_tcpip_sockets() may leak talloc_stackframe on failure
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10241

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Nov  4 12:30:27 CET 2013 on sn-devel-104
2013-11-04 12:30:26 +01:00
Gregor Beck
73062533e0 s3:rpcclient: fix a leaked talloc_stackframe in cmd_epmapper
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10241

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-11-04 10:38:51 +01:00
Gregor Beck
412af28e1e s3:rpc_client: fix a leaked talloc_stackframe
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10241

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-11-04 10:38:50 +01:00
Jeremy Allison
d4a5c832f1 smbd: Invalidate the session correctly.
When a session is invalidated then we must also ensure it isn't used in
any pending requests being processed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-11-04 09:46:45 +01:00
Nadezhda Ivanova
8a50509021 s4-dsdb: instanceType NC_HEAD is only allowed combined with WRITE for an originating add operation
As described in MS-ATDS 3.1.1.5.2.8.

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): Sun Nov  3 16:17:30 CET 2013 on sn-devel-104
2013-11-03 16:17:30 +01:00
Björn Jacke
22945de430 doc/msdfs proxy: extend example for multi target config
Signed-off-by: Björn Jacke <bj@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Nov  1 00:12:19 CET 2013 on sn-devel-104
2013-11-01 00:12:18 +01:00
Volker Lendecke
85b5bedd43 smbd: Support multiple dfs targets for msdfs proxy shares
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>
2013-10-31 11:54:48 +01:00
Stefan Metzmacher
127fc670a3 libcli/smb: fix smb2cli_ioctl*() against Windows 2008.
The subsections of [MS-SMB2] "3.2.5.14 Receiving an SMB2 IOCTL Response"
say the client should ignore the InputOffset/InputCount.

We do that only if we ask for max_input_length = 0.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 31 01:16:10 CET 2013 on sn-devel-104
2013-10-31 01:16:09 +01:00
Gregor Beck
71dc7e593e s3:libsmb: SMBC_getatr() if no method worked, try all methods again on next attempt
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-30 15:23:51 -07:00
Gregor Beck
f959dd44a0 client: use cli_qpathinfo3 for allinfo
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-30 15:23:51 -07:00
Gregor Beck
569722ee40 s3:libsmb: cli_qpathinfo3 use cli_qpathinfo2 for smb2
cli_qpathinfo3 only works (and is only needed as fallback so far) for smb1.
Use cli_qpathinfo2 in the smb2 case to make it universally usable.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-30 15:23:51 -07:00