1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

47066 Commits

Author SHA1 Message Date
Stefan Metzmacher
f702a9e209 s3:librpc/gse: implement gensec_gse_max_{input,wrapped}_size()
This is important in order to support gensec_[un]wrap() with GENSEC_SEAL.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit dec9d085f3eea8d49fa129c05c030bdd779cba54)
2016-03-29 16:24:35 +02:00
Stefan Metzmacher
5a046d57df s3:librpc/gse: don't log gss_acquire_creds failed at level 0
Some callers just retry after a kinit.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 79bf88353488b5912435e0c7f8e77f2d075ce134)
2016-03-29 16:24:34 +02:00
Stefan Metzmacher
47272c3643 s3:librpc/gse: correctly support GENSEC_FEATURE_SESSION_KEY
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e4aebd7e28e7b00a13246b367eb2e7de5ae7b57b)
2016-03-29 16:24:34 +02:00
Stefan Metzmacher
2b351b7e3d s3:librpc/gse: set GSS_KRB5_CRED_NO_CI_FLAGS_X in gse_init_client() if available
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a8fa078f1acbd9fb1a1681033922731dce855aad)
2016-03-29 16:24:34 +02:00
Stefan Metzmacher
91e27173d0 s3:librpc/gse: fix debug message in gse_init_client()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 84c66f1a388c8b5105f3740a3cd5d4d5a27f6ee8)
2016-03-29 16:24:34 +02:00
Stefan Metzmacher
4357b220b4 s3:librpc/gse: make use of GSS_C_EMPTY_BUFFER in gse_init_client
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 46b92525181fa32c5797c914e8de92f3c226e3c7)
2016-03-29 16:24:34 +02:00
Stefan Metzmacher
0555445606 s3:libads: remove unused ads_connect_gc()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit cd8af25d4bf87a9156cb2afb3dd206c68b1bedd7)
2016-03-29 16:24:34 +02:00
Stefan Metzmacher
0d53d8a83d s3:selftest: run samba3.blackbox.smbclient_auth.plain also with $SERVER_IPV6
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2c9f9557e4d7e02b4f588aa0a6551a6881ac57af)
2016-03-29 16:24:33 +02:00
Stefan Metzmacher
16e14f9382 s3:test_smbclient_auth.sh: test using the ip address in the unc path (incl. ipv6-literal.net)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e906739553ee6112426af0cf29e33ef1920a316c)
2016-03-29 16:24:33 +02:00
Volker Lendecke
a70f6207f8 spnego: Correctly check asn1_tag_remaining retval
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 024c619fa82960ae4f8af029b6872102202ffd07)
2016-03-29 16:24:32 +02:00
Stefan Metzmacher
24c6d426b7 s3:pam_smbpass: remove unused dependency to LIBNTLMSSP
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2016-03-29 16:24:31 +02:00
Stefan Metzmacher
62e5169cd7 s3:clispnego: fix confusing warning in spnego_gen_krb5_wrap()
asn1_extract_blob() stops further asn1 processing by setting has_error.

Don't call asn1_has_error() after asn1_extract_blob() has been successful
otherwise we get an "Failed to build krb5 wrapper at" message
on success.

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

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 14f1a94b6fb3a55be1e60fe0d28740f04fd94b3f)
(cherry picked from commit c17b1f697c388bd2e0190c4a3574d951b8be483e)
2016-03-29 16:24:30 +02:00
Jeremy Allison
5bbf46e204 s3: smbclient: asn1_extract_blob() stops further asn1 processing by setting has_error.
Don't call asn1_has_error() after asn1_extract_blob() has been successful
otherwise we get an "Failed to build negTokenInit at offset" message
on success.

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

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

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan  7 16:00:02 CET 2016 on sn-devel-144

(cherry picked from commit 8108f0d320013c560339723d8d70ab601350d0c4)
2016-03-29 16:24:30 +02:00
Volker Lendecke
9c89afd873 lib: Use asn1_current_ofs()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b7f0e29fd2c30024d5a7da7aa6a1f0084612f9d2)
2016-03-29 16:24:30 +02:00
Volker Lendecke
2b11481b85 lib: Use asn1_extract_blob()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a93946b2fee6d6fedb9830d1dec593fca15fefc8)
2016-03-29 16:24:29 +02:00
Volker Lendecke
274c9a4461 lib: Use asn1_set_error()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8cfb6a313937964902940a7ebada7bacab7dbbb8)
2016-03-29 16:24:29 +02:00
Volker Lendecke
89d0afc13d lib: Use asn1_has_error()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 57a0bc9a9f3a02f809153dc19537110c4c796338)
2016-03-29 16:24:29 +02:00
Jeremy Allison
c68280d930 CVE-2015-7560: s3: torture3: Add new POSIX-SYMLINK-EA test.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:03 +01:00
Jeremy Allison
ceb6dcc5df CVE-2015-7560: s3: torture3: Add new POSIX-SYMLINK-ACL test.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:03 +01:00
Jeremy Allison
444ba8f420 CVE-2015-7560: s3: libsmb: Add SMB1-only POSIX cli_posix_setacl() functions. Needed for tests.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:03 +01:00
Jeremy Allison
25963b1be1 CVE-2015-7560: s3: libsmb: Rename cli_posix_getfaclXX() functions to cli_posix_getacl() as they operate on pathnames.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:02 +01:00
Jeremy Allison
63ae57f412 CVE-2015-7560: s3: smbd: Refuse to set EA's on a symlink.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:02 +01:00
Jeremy Allison
062876f6dd CVE-2015-7560: s3: smbd: Silently return no EA's available on a symlink.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:01 +01:00
Jeremy Allison
e27f9a4194 CVE-2015-7560: s3: smbd: Set return values early, allows removal of code duplication.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:01 +01:00
Jeremy Allison
2907193961 CVE-2015-7560: s3: smbd: Refuse to get a POSIX ACL on a symlink.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:01 +01:00
Jeremy Allison
0be03f1b14 CVE-2015-7560: s3: smbd: Refuse to set a POSIX ACL on a symlink.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:00 +01:00
Jeremy Allison
774e210f89 CVE-2015-7560: s3: smbd: Refuse to set an ACL from a POSIX file handle on a symlink.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:40:00 +01:00
Jeremy Allison
fa1c482083 CVE-2015-7560: s3: smbd: Refuse to get an ACL from a POSIX file handle on a symlink.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:39:59 +01:00
Jeremy Allison
76f6cf5bbf CVE-2015-7560: s3: smbd: Add refuse_symlink() function that can be used to prevent operations on a symlink.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-24 11:39:59 +01:00
Hemanth Thummala
11b89bdc25 loadparm: Fix memory leak issue.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11708

Signed-off-by: Hemanth Thummala <hemanth.thummala@nutanix.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb  4 12:39:14 CET 2016 on sn-devel-144

(cherry picked from commit 8247d93701ed838190fe74044a63a56d63d37bf5)
2016-02-15 11:24:24 +01:00
Jeremy Allison
4526ba628e s3: smbd: posix_acls: Fix check for setting u:g:o entry on a filesystem with no ACL support.
Since 4.0.x we add 2 additional ACE entries, one SMB_ACL_USER
and SMB_ACL_GROUP to match the existing SMB_ACL_USER_OBJ and
SMB_ACL_GROUP_OBJ entries. The two additional entries break
the simple "must have 3 entries" check done inside convert_canon_ace_to_posix_perms().
Replace this with a more complete test.

Problem and initial fix provided by <tcleamy@ucdavis.edu>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Thu Feb 11 11:14:53 CET 2016 on sn-devel-144

(cherry picked from commit 5172bf0c5b0672c1479c2ad776460956aa469bca)
2016-02-15 11:24:24 +01:00
Jose A. Rivera
ebb7d6602b s3:smbd:open: Skip redundant call to file_set_dosmode when creating a new file.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11727

Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Pair-programmed-with: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb  5 04:37:43 CET 2016 on sn-devel-144

(cherry picked from commit aec07b8b60ff9589a3c84eef6adeca464e6c01f6)
2016-02-15 11:24:23 +01:00
Jeremy Allison
3e600d6113 s3: smbd: Fix timestamp rounding inside SMB2 create.
Setting "dos filetime resolution = yes" should round
to 2 second increments. Fix missing path inside smbd.

Fix confirmed by reporter Hubert Gilch <hg@sepag.de>.

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

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

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 29 10:41:01 CET 2016 on sn-devel-144

(cherry picked from commit 8024f532e6bcb6cbd8179817fafdd0f12929d629)

Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-3-test): Tue Feb  2 15:33:08 CET 2016 on sn-devel-104
2016-02-02 15:33:08 +01:00
Uri Simchoni
830f003c86 smbd: show correct disk size for different quota and dfree block sizes
When file system stats (VFS disk_free_fn) and quota (VFS get_quota_fn)
return different block sizes, normalize values before comparing.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 67c89715d00abc588239d8220f09cf51a58db05a)
2016-02-02 12:07:23 +01:00
Christian Ambach
67db3036a0 s3:utils/smbget fix recursive download
get_auth_data is called multiple times (once for the directory listing and then
for every file to be downloaded). Save the obtained values across multiple calls
to make smbclient use the correct username for each download.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=6482
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit ec802d27ce4dc6dd9b5e5ebd6992f90364d855a2)
2016-02-02 12:07:23 +01:00
Andreas Schneider
155d821b7b waf: Only build smb_krb5_wrapper if we have CUPS
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 192f1516c378ae942d14921bfcc1e11173da36e6)
2016-02-02 12:07:22 +01:00
Andreas Schneider
2b218c3b97 s3-client: Add a KRB5 wrapper for smbspool
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11690

We need a wrapper for smbspool to be able to authenticate with Kerberos.
This needs to replace the cups smb backend. The permission need to be
0700 and the owner root.

Note that Kerberos support is broken in CUPS 2.1.2 maybe earlier
versions. It works with 1.6.3.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 25 19:58:46 CET 2016 on sn-devel-144

(cherry picked from commit 62c68bd8c8f7a7e057e38a461707f1c195e62df0)
2016-02-02 12:07:22 +01:00
Alexander Bokovoy
756b4525d7 s3-parm: clean up defaults when removing global parameters
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11693

When globals are re-initialized, they are cleared and globals' talloc
context is freed. However, parm_table still contains a reference to the
global value in the defaults. This confuses lpcfg_string_free() after
commit 795c543d858b2452f062a02846c2f908fe4cffe4 because it tries to
free already freed pointer which is passed by lp_save_defaults():

....
    case P_STRING:
    case P_USTRING:
                  lpcfg_string_set(Globals.ctx,
                                   &parm_table[i].def.svalue,
                                   *(char **)lp_parm_ptr(NULL, &parm_table[i]));
....

here &parm_table[i].def.svalue is passed to lpcfg_string_free() but it
is a pointer to a value allocated with previous Globals.ctx which
already was freed.

This specifically affects registry backend of smb.conf in lp_load_ex()
where init_globals() called explicitly to re-init globals after
lp_save_defaults() if we have registry backend defined.

Reviewed-by: Uri Simchoni <uri@samba.org>
Signed-off-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Mon Jan 25 23:58:42 CET 2016 on sn-devel-144

(cherry picked from commit 500bc01478881cab89f0e691427e34a405bb0003)

Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-3-test): Tue Jan 26 12:58:53 CET 2016 on sn-devel-104
2016-01-26 12:58:52 +01:00
Ralph Boehme
57654eefe0 s3:smbd: Ignore initial allocation size for directory creation
We reject directory creation with an initial allocation size > 0 with
NT_STATUS_ACCESS_DENIED. Windows servers ignore the initial allocation
size on directories.

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

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 78ccbb07170c3e49a084d31434310f973e3d6158)
2016-01-26 09:50:12 +01:00
Uri Simchoni
6d82bdde57 smbcacls: fix uninitialized variable
An uninitialized variable causes "numeric" mode to be
used without the -n option.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jan 20 12:12:12 CET 2016 on sn-devel-144

(cherry picked from commit 6cff00954763a7b266db5bab229b989e89abcee0)

Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-3-test): Thu Jan 21 13:01:16 CET 2016 on sn-devel-104
2016-01-21 13:01:16 +01:00
Christof Schmitt
2c729567a0 Revert "winbind: Retry after SESSION_EXPIRED error in ping-dc"
This reverts commit a2670f15dea27c10e3827216adf572f9c3894f85.

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

cm_connect_netlogon now handles the retry for an expired session.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 13 03:35:57 CET 2016 on sn-devel-144

(cherry picked from commit 6f3656c47d8ae6a3ac10591ffd7a60797775b469)

Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-3-test): Thu Jan 14 13:21:52 CET 2016 on sn-devel-104
2016-01-14 13:21:52 +01:00
Christof Schmitt
52b563627b winbindd: Retry on expired session in cm_connect_netlogon
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit aa3883eae6e7891efb1e6f9ec74e6073bee43250)
2016-01-14 10:13:24 +01:00
Christof Schmitt
dded9027ed winbindd: Retry on expired session in cm_connect_sam
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 276d604aa5ccc32d18b69c04ae13e2dc7c21f3ee)
2016-01-14 10:13:24 +01:00
Christof Schmitt
423120f176 winbindd: Retry on expired session in cm_connect_lsa
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 3b6b5456424be6997b32c23b7c149c8060c3102d)
2016-01-14 10:13:24 +01:00
Christof Schmitt
a0f2f52f3c winbindd: Remove double retry from some ADS methods
The retry through the new reconnect_ads layer is enough. This structure
also makes the distinction between retry layer and actual methods call a
bit clearer.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 4c6804e414087fb61e66133cefbe5590d1d9b283)
2016-01-14 10:13:24 +01:00
Christof Schmitt
fa875e3d95 winbindd: Add retry also for ADS method calls
RPC calls can return IO_DEVICE_ERROR on expired SMB2 sessions. Retrying
on a new connection avoids surfacing this error to winbindd clients.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e4adf55e242aa5f000570bf554fcd15d7e86c126)
2016-01-14 10:13:24 +01:00
Christof Schmitt
39e6b5b8d5 winbindd: Reset connection for expired session before reconnecting
A RPC call on a expired SMB2 session returns IO_DEVICE_ERROR. In this
case, reset the connection before issuing the same call
again.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit fb5b0cec3c0c2e0cf9cb04f8b52ee910ac245aeb)
2016-01-14 10:13:24 +01:00
Uri Simchoni
40bc9b04a0 vfs_shadow_copy2: add a blackbox test suite
Add a blackbox test suite for vfs_shadow_copy2, testing
parameters mountpoint, basedir, snapdir, snapdirseverywhere,
and testing correct wide-link processing.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jan 13 17:11:38 CET 2016 on sn-devel-144

(cherry picked from commit 7362c27a62e3802fc8df975ce50115b683811f4a)
2016-01-14 10:13:24 +01:00
Uri Simchoni
0998c4093e vfs_shadow_copy2: fix case where snapshots are outside the share
Adjust the connect path to the root of the share in the snapshot,
or to the root of the snapshot if the snapshot is "inside" the
share.

This way snapshot symlink regarded as "wide links" if and only if
they point outside the snapshot or they were wide links when
the snapshot was taken.

This allows mounting the snapshots outside the share's root.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 8a49a63a5a5d8014d32179df1789186223443b35)
2016-01-14 10:13:23 +01:00
Uri Simchoni
a453c78e43 vfs_shadow_copy2: add shadow_copy2_do_convert()
Add a new routine shadow_copy2_do_convert() which is
like shadow_copy2_convert(), but beside calculating the
path of the snapshot file, it also returns the minimum length
of the subpath which is both inside the share and inside the
same snapshot as the file in question, i.e. (at least in the
classical case) the subdirectory of the the snapshot file's
snapshot directory that corresponds to the file's share root.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 3703bca4d9e494aec0b40243add3e076cf353601)
2016-01-14 10:13:23 +01:00