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

42678 Commits

Author SHA1 Message Date
Stefan Metzmacher
c8dda78e35 s3:libsmb: make use of samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:46 +01:00
Stefan Metzmacher
f7aa60175a lib/util: add samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:43 +01:00
Björn Jacke
ff8ba0628f build/autoconf: fix check for GNU ld version
we need to look for the version once in the stdout and once in the stderr
output. Some version of ld output to stdout, some output to stderr. redirecting
stderr to stdout messes the output up in our case, that's why we have to do two
runs. See also bug #7825.

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Tue Feb 19 20:56:12 CET 2013 on sn-devel-104
2013-02-19 20:56:12 +01:00
Christian Ambach
432dde0223 s3:build fix the build with --fake-kaserver
this fixes Bug 9643 - Build in source3 of bin/net fails when configure option
--with-fake-kaserver is used

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Feb 19 19:15:19 CET 2013 on sn-devel-104
2013-02-19 19:15:19 +01:00
Christian Ambach
e7f66f37a6 s3:lib/afs fix the build
Fix Bug 9644 - Compile of source3/lib/afs.c fails

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-02-19 17:31:32 +01:00
Michael Adam
31e4d6d2c7 s3:smbd: preserve file type mode bits in file_set_dosmode()
When translating between dos modes and unix modes, these bits were dropped from
the stat->st_ex_mode field.

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

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

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 19 15:45:31 CET 2013 on sn-devel-104
2013-02-19 15:45:31 +01:00
Michael Adam
f211b57dd2 gencache: fix an extra newline in a DEBUG message in gencache_set_data_blob()
by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:11 +01:00
Michael Adam
86d78dfa83 gencache: fix an extra newline in a DEBUG message in gencache_iterate_fn()
by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:10 +01:00
Michael Adam
f7525abf3b gencache: fix an extra newline in a DEBUG message in gencache_iterate_blobs_fn()
by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:09 +01:00
Michael Adam
4d3928a8f4 gencache: unify a DEBUG message in gencache_set_data_blob()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:06 +01:00
Michael Adam
56ee82e8a0 gencache: unify a DEBUG message in gencache_iterate_fn()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:05 +01:00
Michael Adam
ddf2aa3340 gencache: unify a DEBUG message in gencache_iterate_blobs_fn()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:04 +01:00
Michael Adam
7e36b1b8cb gencache: unify a DEBUG message in gencache_del()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:03 +01:00
Gregor Beck
5ab7725974 s3:net: new implementation of "servid wipedbs" with smbXsrv_*
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 19 13:56:57 CET 2013 on sn-devel-104
2013-02-19 13:56:57 +01:00
Gregor Beck
d8dd0ecc48 lib/util_tdb: factor out tdb_data_talloc_copy()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:24 +01:00
Gregor Beck
d23f19ab00 s3:smbXsrv_open: add smbXsrv_open_global_traverse()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:23 +01:00
Gregor Beck
60721a3782 s3:smbXsrv_tcon: pass record in smbXsrv_tcon_global_traverse()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:22 +01:00
Gregor Beck
93e22bb1c4 s3:smbXsrv_session: pass record in smbXsrv_session_global_traverse()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:21 +01:00
Michael Adam
bdb80aeb11 s3:smbd:smb2: fix segfault (access after free) in durable disconnect code
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

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

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 19 11:12:01 CET 2013 on sn-devel-104
2013-02-19 11:12:01 +01:00
Michael Adam
cfebce3c56 s3:smbd: add debugging to close code (regarding disconnect of a durable)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Feb 18 17:42:45 CET 2013 on sn-devel-104
2013-02-18 17:42:45 +01:00
Stefan Metzmacher
f0e6a9be00 s3:smbd: use smbXsrv_open_close() instead of smbXsrv_open_update()
This makes sure we store the correct disconnect_time for disconnected
durable handles.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-18 15:53:36 +01:00
Karolin Seeger
8adbd1cf75 srv_epmapper.c: Fix typo.
priviledge -> privilege

Signed-off-by: Karolin Seeger <kseeger@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Feb 18 13:57:40 CET 2013 on sn-devel-104
2013-02-18 13:57:39 +01:00
Karolin Seeger
75ca814f1e srv_netlog_nt.c: Fix typo in comment.
redundent -> redundant

Signed-off-by: Karolin Seeger <kseeger@samba.org>
2013-02-18 22:07:39 +11:00
Karolin Seeger
6eb59eb388 brlock.c: Fix typo in comment.
redundent -> redundant

Signed-off-by: Karolin Seeger <kseeger@samba.org>
2013-02-18 22:07:39 +11:00
Karolin Seeger
38cb1410f5 vfs_gpfs: Fix typos in comments.
Signed-off-by: Karolin Seeger <kseeger@samba.org>
2013-02-18 22:07:39 +11:00
Michael Adam
19c68f8025 s3:idmap_autorid: fix freeing of non-talloced memory (uninitialized pointer) (bug #9653)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Feb 13 09:51:53 CET 2013 on sn-devel-104
2013-02-13 09:51:53 +01:00
Jeremy Allison
fa3924f9ea Fix bug 9519 - Samba returns unexpected error on SMB posix open.
Explicitly ignore bare O_EXCL flags instead of returning INVALID_PARAMETER.
That's what the Linux kernel does.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jeff Layton <jlayton@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 12 22:59:21 CET 2013 on sn-devel-104
2013-02-12 22:59:21 +01:00
Jeremy Allison
f25debf2fb Fix bug #9642 - vfs_afsacl.c won't build.
Add missing mem_ctx argument.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Feb 11 20:24:00 CET 2013 on sn-devel-104
2013-02-11 20:24:00 +01:00
Richard Sharpe
c932b139c8 Improve the configure tests for aio_suspend to get rid of warnings. Timur provided the wscript method, I added the configure.in correction.
Signed-off-by: Timur Bakeyev <timur@freebsd.org>
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>

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

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Feb  9 09:24:06 CET 2013 on sn-devel-104
2013-02-09 09:24:06 +01:00
Ira Cooper
233b32b771 s3: Make SMB2_GETINFO multi-volume aware.
Not all shares are a single volume.  Some actually
expose multiple volumes under a single share.  In these
cases showing the amount of space free as the space free
at the base of the directory heirarchy is wrong.

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Feb  8 21:44:37 CET 2013 on sn-devel-104
2013-02-08 21:44:37 +01:00
Volker Lendecke
beb6c13e9a winbind: Fix an incompatible pointer type warning
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): Fri Feb  8 15:27:51 CET 2013 on sn-devel-104
2013-02-08 15:27:50 +01:00
Volker Lendecke
dc2e47508d torture: We use transactions for CLEAR_IF_FIRST db
This does not work in the ctdb case

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-08 12:58:12 +01:00
David Disseldorp
64eba0a842 BUG 9633: Recursive mget should continue on EPERM.
Regression introduced by 14ff2e8de9.
When downloading files recursively, smbclient halts if it encounters
a folder to which it does not have permission to traverse.

Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb  7 15:50:36 CET 2013 on sn-devel-104
2013-02-07 15:50:36 +01:00
Sumit Bose
62e6ea408a s3-rpc_server: Fix password encoding in _netr_ServerGetTrustInfo().
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-02-07 14:07:50 +01:00
Günther Deschner
823a25f6a4 s3-rpc_server: Dont wipe out ref pointers in _netr_ServerGetTrustInfo().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-02-07 14:07:15 +01:00
Alexander Bokovoy
ff496ef29f autoconf: rename pdb_ldap module to pdb_ldapsam
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Feb  6 13:32:53 CET 2013 on sn-devel-104
2013-02-06 13:32:53 +01:00
Alexander Bokovoy
e721e7132e source3/wscript: support 'pdb_ldap' module in configure
While PASSDB module ldapsam is called pdb_ldapsam internally,
support specifying 'pdb_ldap' during configure step.

This should make transition to pdb_ldapsam transparent to distributions.

Reviewed-by: Andreas Schneider <asn@samba.org>
2013-02-06 11:51:11 +01:00
Andreas Schneider
1b582c4bf8 Rename pdb_ldap to pdb_ldapsam
This patch moves pdb_ldap to pdb_ldapsam unconditionally
and makes possible to load ldapsam.so dynamically

Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-06 11:51:11 +01:00
Christian Ambach
6c2d6ada42 s3:auth small optimization in create_token_from_sid
save some calls to lp_idmap_default_range(), calling it
once is enough

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb  5 19:14:25 CET 2013 on sn-devel-104
2013-02-05 19:14:25 +01:00
Michael Adam
deea99ac36 s3:net: reduce indentation in net idmap delete for symmetry and consistency
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:35 +01:00
Michael Adam
50e3592ace s3:net: introduce a talloc stackframe for net idmap delete
this simplifies the freeing at the end

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:35 +01:00
Christian Ambach
8473764234 s3:net_idmap_delete do not lock two records at the same time
the lock order check will prohibit this and as we are running inside
a transaction there is no need to lock the records before deleting them

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Christian Ambach <ambi@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2013-02-05 17:36:34 +01:00
Michael Adam
9aa79c11f0 s3:net idmap: use lp_idmap_default_backend() now that we have it.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:34 +01:00
Michael Adam
c37a493902 s3:param: add new lp_idmap_default_backend()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:34 +01:00
Michael Adam
321401e7d1 s3:param: introduce new lp_idmap_backend() that takes the domain
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:34 +01:00
Michael Adam
4198e800d8 s3:param: add a comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:34 +01:00
Michael Adam
085b9767a6 s3:param: remove unused function lp_idmap_backend()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:33 +01:00
Michael Adam
cef05fbe8d s3:net idmap: remove call to lp_idmap_backend() - this is useless.
The variable behind lp_idmap_backend() is never set.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:33 +01:00
Michael Adam
600ba80246 s3:param: remove unused functions lp_idmap_uid() and lp_idmap_gid()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:33 +01:00
Michael Adam
4e52fa7b73 s3:auth: use new lp_idmap_default_range() instead of lp_idmap_gid() in create_token_from_sid()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:33 +01:00
Michael Adam
58b302d76a s3:param: add utility function lp_idmap_default_range()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:32 +01:00
Michael Adam
1342bdd55c s3:param: add a utility function lp_idmap_range() to get the configured range for a given domain.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:32 +01:00
Michael Adam
e7b39fba5e s3:param: remove an old comment (that is not up-to date any more)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05 17:36:32 +01:00
Michael Adam
ff65500f2b s3:dbrwap_ctdb: ZERO_STRUCT(rec) just to be sure in traverse_persistent_callback_read()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04 17:14:22 +01:00
Michael Adam
3949854549 s3:dbwrap_ctdb: ZERO_STRUCT(rec) just to be sure in traverse_read_callback()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04 17:14:22 +01:00
Stefan Metzmacher
a09f3a3551 s3:dbwrap_ctdb: add "db_context" to "db_record"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Stefan Metzmacher
25bdab9c61 s3:dbwrap_ctdb: setup result->name in db_open_ctdb()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Stefan Metzmacher
9292e5b743 s3: use generate_random_password() instead of generate_random_str()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Christian Ambach
4c1527b1ce s3:modules remove gpfs_getacl_alloc
last caller has gone

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Feb  4 14:10:08 CET 2013 on sn-devel-104
2013-02-04 14:10:06 +01:00
Christian Ambach
18bfcac810 s3:modules use vfs_gpfs_getacl in gpfsacl_get_posix_acl
as preparation to remove gpfs_getacl_alloc()

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
5388773d4b s3:modules use vfs_gpfs_getacl in gpfsacl_set_nt_acl_internal
as preparation to remove gpfs_getacl_alloc()

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
16940d8a8e s3:modules use vfs_gpfs_getacl in gpfs_get_nfs4_acl
as preparation to remove gpfs_getacl_alloc()

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
940b7ec78c s3:torture/vfstest add memreport option
this will run a talloc_report_full on the talloc stackframe after each command

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
8e571fd385 s3:torture/vfstest implement sys_acl_blob_get_fd
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
de676555ab s3:torture/vfstest implement sys_acl_blob_get_file
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
06219913ab s3:vfs_gpfs use non_posix_sys_acl_blob_get_*_helper
use the helper functions to return the blob based on the
raw GPFS ACL blob (if it is a NFSv4 ACL). If not, fall back
to the POSIX ACL code

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
f1ff845720 s3:vfs_gpfs add a generic vfs_gpfs_getacl function
in contrast to gpfs_getacl_alloc which always puts the
ACL on talloc_tos(), this one allows to specify the memory
context and if the caller is interested in the raw ACL blob
or a structured version

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
d9075e19ca s3:modules/vfs_gpfs add GPFS_GETACL_NATIVE define
this is not in the official GPFS header file, but can be found
in the GPL'd kernel module sources

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
b4be8d5073 s3:modules/non_posix_acls: only stat if we do not have it cached
most probably we already have the stat() information

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
7cd91ca0c4 s3:autoconf add non_posix_acls to NFS4ACL_OBJ
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
ea6ac284cb s3:autoconf introduce NFS4ACL_OBJ
use a definition instead of listing it separately

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Christian Ambach
d7ad24a3e7 s3-waf:modules add non_posix_acls dependency to vfs_gpfs
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
2a2dbf8259 vfs: Add helper function for non posix ACL modules
This handles the stat, and fills in the pre-supplied blob into a
wrapper sturcture that can then be returned to vfs_acl_common for
hashing.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
f0e49b015b vfs_acl_common: Do not fetch the underlying NT ACL unless we need it
This avoids asking for the posix ACL on disk twice, and avoids running
a good deal of mapping code if it is not needed.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
4e8c8952ad vfs: Whitespace fix only to get_nt_acl_internal indentation
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
25526ed3f5 vfs: Implement an improved vfs_acl_common that uses the hash of the system ACL
Where supported by the system ACL backend, this avoids hashing the
result of the ACL mapping, instead hashing the original ACL,
linearlised.

For maximum robustness, the hash of the NT and system ACL are stored,
along with the time and a description of the system ACL.  This variety
of extra metadata may assist some future implementation in determining
which hash to validate.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:30 +01:00
Andrew Bartlett
6a5f65b0e9 vfs: Add helper function hash_blob_sha256 to vfs_acl_common.c
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-04 12:19:29 +01:00
Volker Lendecke
5a8e04963f Fix typo in warning message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-By: Ira Cooper <ira@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Feb  4 11:48:25 CET 2013 on sn-devel-104
2013-02-04 11:48:25 +01:00
Günther Deschner
87157f04d1 s3-net: mention optional impersonation principal for PAC retrieval.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-01 19:38:07 +01:00
Stefan Metzmacher
009cf6e9ce s3:auth: wbcAuthenticateEx gives unix times (bug #9625)
We also need to convert last_logon, last_logoff and acct_expiry
from unix time to nt time.

Otherwise a windows member server will reject clients
using CAP_DYNAMIC_REAUTH or smb2) with STATUS_NETWORK_SESSION_EXPIRED,
if the logoff and kickoff time is expired.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb  1 18:42:42 CET 2013 on sn-devel-104
2013-02-01 18:42:42 +01:00
Volker Lendecke
7b0b1d6d48 smbd: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Jan 30 18:21:19 CET 2013 on sn-devel-104
2013-01-30 18:21:19 +01:00
Volker Lendecke
fa064140ed smbd: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2013-01-30 16:37:43 +01:00
Michael Adam
394622ef8c s3:winbindd: change getpwsid() to return a passwd struct for a group sid id-mapped with ID_TYPE_BOTH
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 29 23:46:19 CET 2013 on sn-devel-104
2013-01-29 23:46:19 +01:00
Michael Adam
b7095e9818 s3:winbindd: check the correct variable for talloc success in rpc_query_user()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:57:18 +01:00
Michael Adam
40e3df7c37 s3:winbindd:getgrnam: also produce a group struct for a user with ID_TYPE_BOTH
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:56:58 +01:00
Michael Adam
d2360fe56c s3:winbindd: create group structs for gids that are coming from a user sid id-mapped with ID_TYPE_BOTH
This "fake" group contains exctly one member, namely the user that the sid is
actually belonging to.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:54:48 +01:00
Michael Adam
729e2c3630 s3:winbindd: factor add_wbint_Principal_to_dict() out of wb_group_members_done()
for later reuse

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:48:01 +01:00
Michael Adam
3680cc4a11 s3:winbindd: fix a cut'n'paste comment typo in wb_fill_pwent
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:45:59 +01:00
Michael Adam
c0f47d43ec s3:winbindd: rename winbindd_getgrnam_lookupsid_done to winbindd_getgrnam_lookupname_done
That's what it is.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-29 21:45:46 +01:00
Christian Ambach
bab61a2159 s3:utils/net remove aclmapset command
this was made for the nfs4:sidmap code that has been removed, so
this subcommand can also go away

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jan 29 15:37:18 CET 2013 on sn-devel-104
2013-01-29 15:37:18 +01:00
Christian Ambach
3a4ed4803f s3:net_idmap_dump support dumping autorid backend
- remember the type of idmapping database (tdb or autorid)
  this allows to make rest of the code (e.g. dump) know which database-style it will encounter
- add a seperate dump function for autorid
- default to TDB if db-file is given on the command-line

Pair-Programmed-With: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>

Signed-off-by: Christian Ambach <ambi@samba.org>
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-29 13:46:35 +01:00
Christian Ambach
580008f307 s3:net_idmap_dump add missing braces
see README.Coding

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-29 12:56:47 +01:00
Christian Ambach
e0bd87ecc4 s3:net_idmap_dump remove obsolete support for tdb:idmap2.tdb parameter
this one got removed from idmap_tdb2 a while ago

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-29 12:56:31 +01:00
Christian Ambach
65268f482d s3:net_idmap_dump deal with idmap config * : backend config style
this is the new config style since Samba 3.6 and should be detected by net idmap dump

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-29 12:56:11 +01:00
Jeremy Allison
e104e5a819 Regression test for bug #9571 - Unlink after open causes smbd to panic
Replicates the protocol activity that triggers the crash.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jan 28 15:33:17 CET 2013 on sn-devel-104
2013-01-28 15:33:17 +01:00
Pavel Shilovsky
578909ae19 Fix bug #9571 - Unlink after open causes smbd to panic.
s3:smbd: fix wrong lock order in posix unlink

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-28 13:49:34 +01:00
Jeremy Allison
34854ae58f Fix bug #9588 - ACLs are not inherited to directories for DFS shares.
We can return with NT_STATUS_OK in an error code path. This
has a really strange effect in that it prevents the ACL editor
in Windows XP from recursively changing ACE entries on sub-directories
after a change in a DFS-root share (we end up returning a path
that looks like: \\IPV4\share1\xptest/testdir with a mixture
of Windows and POSIX pathname separators).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Jan 28 13:48:13 CET 2013 on sn-devel-104
2013-01-28 13:48:13 +01:00
Volker Lendecke
155fdc405a smbcontrol: Fix undefined serverid_traverse_read warning
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 28 11:51:12 CET 2013 on sn-devel-104
2013-01-28 11:51:12 +01:00
Volker Lendecke
dd9ed7bef4 smbcontrol: Fix the build with libunwind
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-28 10:08:00 +01:00
Jeremy Allison
d79485a566 Regression test for bug #9587 - archive flag is always set on directories.
Ensure we get the correct attributes on files
and directories after a rename.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jan 25 13:42:40 CET 2013 on sn-devel-104
2013-01-25 13:42:40 +01:00
Jeremy Allison
3d46a077dd Fix bug #9587 - archive flag is always set on directories.
Creating a directory to a Samba share sets the attributes to 'D' only
(correct) - only when creating a new file should the 'A' attribute
be set.

However, doing a rename of that directory sets the 'A' attribute in error.
This should only be done on a file rename. smbclient regression test to follow.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-25 12:01:41 +01:00
Volker Lendecke
da35cd7bd2 Avoid a very small memleak on talloc_tos()
"fname" did leak on talloc_tos(). Not really a bad memleak, but as I
just came across it I thought I might just fix it

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 25 00:54:01 CET 2013 on sn-devel-104
2013-01-25 00:54:01 +01:00
Jeremy Allison
996a10cdea Fix bug #9572 - File corruption during SMB1 read by Mac OSX 10.8.2 clients.
Accept a large read if we told the client we have UNIX extensions
and the client sent a non-zero upper 16-bit size.

Do the non-zero upper 16-bit size check first to save a function
call in what is a hot path.

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

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 24 21:01:51 CET 2013 on sn-devel-104
2013-01-24 21:01:51 +01:00
Jeremy Allison
033197958e Revert "s3:smbd: SMB ReadX with size > 0xffff should only possible for samba clients."
Part of fix for bug #9572 -  File corruption during SMB1 read by Mac OSX 10.8.2 clients

This reverts commit f8c26c16b8.

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

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-24 19:21:35 +01:00
Günther Deschner
21aa7fe633 s3-rpcclient: add cmd_spoolss_play_gdi_script_on_printer_ic.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24 17:42:26 +01:00
Günther Deschner
aab232cb2e s3-rpcclient: decode OsVersion{Ex} binary blobs when displaying printerdata.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24 17:42:26 +01:00
Günther Deschner
ce1a9ae8ab s3-spoolss: Make it easier to manipulate the returned OSVersion at runtime.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24 17:42:25 +01:00
Günther Deschner
11fba10208 spoolss: make spoolss deal with ndr64 StartDocPrinter by using proper container object.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24 17:42:25 +01:00
Jeremy Allison
497febfe36 Fix bug #9586 - smbd[29175]: disk_free: sys_popen() failed" message logged in /var/log/message many times.
Ensure when reading lines from an interruptible
pipe source we ignore EINTR.

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 24 10:45:48 CET 2013 on sn-devel-104
2013-01-24 10:45:48 +01:00
Volker Lendecke
f9868b7ffd smbd: Fix a NULL vs false return error
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-23 16:29:30 +01:00
Andreas Schneider
3d1abb9328 waf: Fix pdb_ldap which cannot be built as a module.
The module has two init functions, pdb_ldap_init() and
pdb_ldapsam_init(). As a shared module only one can be found until we
create a symlink.

Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jan 23 10:51:59 CET 2013 on sn-devel-104
2013-01-23 10:51:59 +01:00
Günther Deschner
d56b4560b5 s3-winbind: fix the build of idmap_ldap.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jan 22 14:43:40 CET 2013 on sn-devel-104
2013-01-22 14:43:40 +01:00
Günther Deschner
58fadf2f48 BUG 9474: Downgrade v4 printer driver requests to v3.
Guenther

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

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 21 16:11:02 CET 2013 on sn-devel-104
2013-01-21 16:11:02 +01:00
Andreas Schneider
c38fb0b106 BUG 9574: Fix a possible null pointer dereference in spoolss.
If the the client enumerates the printers and didn't specify a
servername we have a null pointer dereference, so the process serving
the connection crashes.

Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Jan 21 13:30:11 CET 2013 on sn-devel-104
2013-01-21 13:30:11 +01:00
Jeremy Allison
853360b8e5 Fix warnings with mismatched sizes in arguments to DEBUG statements.
This can cause compile errors on 32-bit systems.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jan 19 12:14:13 CET 2013 on sn-devel-104
2013-01-19 12:14:13 +01:00
Andrew Bartlett
d90b709ebb printing: Free talloc_stackframe() on all exit paths
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-19 09:42:02 +01:00
Volker Lendecke
a8fe624948 smbtorture: Satisfy a linker dependency
Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00
Volker Lendecke
15596a8d9c winbind: Handle child requests in a tevent_fd
This enables the use of standard tevent_loop_once in the child, which
now also uses epoll where available.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00
Volker Lendecke
5e75564377 winbind: Introduce "struct child_handler_state"
This will make the next patch simpler. child_handler_state contains the
information that the handler for the parent fde needs to pass to
process_child_request

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00
Volker Lendecke
3e830e44d3 winbind: Use standard tevent_context_init
This makes winbind use epoll instead of poll

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00
David Disseldorp
4f9cffbae6 BUG 9378: Add extra attributes for AD printer publishing.
Currently attempting to publish a printer in AD fails with "Object class
violation", due to a number of missing attributes in the LDAP request.

Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 18 17:27:35 CET 2013 on sn-devel-104
2013-01-18 17:27:35 +01:00
David Disseldorp
12a08d8ae2 printing: Remove invalid free from error path.
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-18 15:37:10 +01:00
Jeremy Allison
f0852a3483 Remove locking across the lifetime of the copychunk call.
Previous commit handles this around each read/write call.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jan 18 01:47:01 CET 2013 on sn-devel-104
2013-01-18 01:47:01 +01:00
Jeremy Allison
f2d028ef55 Move copychunk locking to be local to the read/write calls.
Eliminates the need to hold locks across the
entire lifetime of the call.

Next commit will remove these.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-18 00:06:52 +01:00
Jeremy Allison
d562e9006a Add additional copychunk checks.
For printer, ipc$ connections, and directory handles.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-18 00:06:52 +01:00
Jeremy Allison
d6e10f0066 Move handle checking code to copychunk_check_handles().
Planning to add extra checks to ensure we don't attempt
copychunk on printer or IPC$ handles.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-18 00:06:52 +01:00
Andreas Schneider
d34cd6d061 printing: Create default architecture directories on init.
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 17 20:36:17 CET 2013 on sn-devel-104
2013-01-17 20:36:17 +01:00
Günther Deschner
79fa78e285 s3-spoolss: use configurable spoolss architecture in compose_spoolss_server_path().
Guenther

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

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Jan 17 18:53:47 CET 2013 on sn-devel-104
2013-01-17 18:53:47 +01:00
Günther Deschner
3b94b64481 spoolss: make spoolss deal with ndr64 SetForm by using proper container object.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-17 17:11:37 +01:00
Günther Deschner
8304fe73f6 spoolss: make spoolss deal with ndr64 AddForm by using proper container object.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-17 17:11:37 +01:00
Günther Deschner
e8feca012e spoolss: make spoolss deal with ndr64 ULONG_PTR of devmode_ptr and secdesc_ptr.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-17 17:11:37 +01:00
David Disseldorp
8e63a72ec1 smb2_ioctl: copychunk request max output validation
Check that the copychunk ioctl request maximum output specified by the
client is large enough to hold copychunk response data.

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 17 00:59:44 CET 2013 on sn-devel-104
2013-01-17 00:59:44 +01:00
David Disseldorp
bf07c33dac smb2_ioctl: track copychunk response output state
Treat the response data independent to the status.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
David Disseldorp
cb323281c1 smb2_ioctl: copychunk CHECK_READ and CHECK_WRITE
[MS-SMB2] 3.3.5.15.6 Handling a Server-Side Data Copy Request, specifies
that the copychunk destination file handle be granted FILE_WRITE_DATA
and FILE_READ_DATA access.

FILE_READ_DATA access must also be granted on the copychunk source file,
which may be done implicitly with execute permission.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
David Disseldorp
c3cc51e8a2 smb2_ioctl: only pass through to VFS on a valid fsp
A null fsp is dereferenced on VFS call.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
David Disseldorp
a7c2f13d7a smb2_ioctl: perform locking around copychunk requests
For each chunk in a copychunk request, take a read and write lock on
the source and destination files respectively.

Also change the resume key format to use a combination of the persistent
and volatile handles. Thanks to Metze for his help on this.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
David Disseldorp
7ca8663e31 smbd: split out file_fsp_get from file_fsp_smb2
Obtain the files_struct from smb2req, persistent_id and
volatile_id.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
David Disseldorp
65983aac12 smb2_ioctl: remove ioctl error response assumptions
MS-SMB2 3.3.4.4 documents cases where a ntstatus indicating an error
should not be considered a failure. In such a case the output data
buffer should be sent to the client rather than an error response
packet.

Add a new fsctl copy_chunk test to confirm field limits are sent back
in response to an oversize chunk request.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
David Disseldorp
e38d9f71d9 smb2_ioctl: add support for FSCTL_SRV_COPYCHUNK
SMB2 clients can issue FSCTL_SRV_COPYCHUNK requests in order to copy
data between files on the server side only, rather than reading data
then writing back from the client. FSCTL_SRV_COPYCHUNK is used by
default for Explorer SMB2 file copies on Windows Server 2012.

2.2.32.1 SRV_COPYCHUNK_RESPONSE in [MS-SMB2] describes the requirement
for the server to provide maximum copychunk request size limits in ioctl
responses carrying STATUS_INVALID_PARAMETER.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
David Disseldorp
ef00eb90e5 s3-vfs: add copy_chunk vfs hooks
copy_chunk copies n bytes from a source file at a specific offset to a
destination file at a given offset. This interface will be used in
handling smb2 FSCTL_SRV_COPYCHUNK ioctl requests.

Use a pread/pwrite loop in vfs_default, so that requests referring to
the same src and dest file are possible.

Provide send and receive hooks for copy chunk VFS interface, allowing
asynchronous behaviour.

Check whether the request source offset + length exceeds the current
size. Return STATUS_INVALID_VIEW_SIZE under such a condition, matching
Windows server behaviour.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:06 +01:00
David Disseldorp
2bde963688 smb2_ioctl: add FSCTL_SRV_REQUEST_RESUME_KEY support
Use existing ioctl IDL infrastructure for marshalling. Support for this
ioctl is a prerequisite for FSCTL_SRV_COPYCHUNK handling.
The client-opaque resume key is constructed using the server side
dev/inode file identifier.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:06 +01:00
David Disseldorp
14bd6c8b09 smb2_ioctl: split ioctl handler code on device type
Add per device type ioctl handler source files for FSCTL_DFS,
FSCTL_FILESYSTEM, FSCTL_NAMED_PIPE and FSCTL_NETWORK_FILESYSTEM.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:06 +01:00
David Disseldorp
958b21c28d smb2_ioctl: split ioctl handlers into separate funtions
Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:06 +01:00
Michael Adam
9ba44cc610 build(waf): fix the abi_match for the pdb library
The global wildcard match is automatically added by the parsing code
if the global match list is empty. Specifying an explicit '*' as the only
global match lets the parsing code add a second '*' to the local list,
which is an error tolerated on my linux by ld (the GNU linker), but
not by the stricter GNU ELF linker "gold".

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Jan 16 21:31:00 CET 2013 on sn-devel-104
2013-01-16 21:31:00 +01:00
Günther Deschner
a4dcf7b94d spoolss: Make OpenPrinterEx work with NDR64 by using UserInfo Container.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-16 11:42:13 +01:00
Volker Lendecke
6bb7bf9ebb test: dbwrap_tool requires --persistent for the registry now
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jan 15 16:31:35 CET 2013 on sn-devel-104
2013-01-15 16:31:35 +01:00
Michael Adam
770b1aafa0 s3:dbwrap_tool: add --persistent switch and mode for non-persistent DBs
This changes the default for dbwrap_tool to open a DB as non-persistent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-01-15 14:49:20 +01:00
Volker Lendecke
a82db92a8a smbd: Fix bug 9544, part 2
Plug in async pwrite

Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 15 00:55:51 CET 2013 on sn-devel-104
2013-01-15 00:55:51 +01:00
Volker Lendecke
215427202a smbd: Fix bug 9544, part 1
Adapt the sync function names

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-14 13:45:00 -08:00
Volker Lendecke
0bafce02f8 smbd: Always compile vfs_commit
There's no reason not to

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-14 13:44:51 -08:00
Volker Lendecke
584402a71a configure: Fix bug 9546, aio_suspend detection on FreeBSD
NULL is not defined without some includes

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-14 13:21:58 -08:00
Volker Lendecke
d87ad906df samr: Make use of posix_openpt
Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-14 09:01:37 -08:00
Volker Lendecke
bef944166a samr: Split up an assignment from an if condition
Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-14 09:01:26 -08:00
Volker Lendecke
8ae1c4636e winbind: Fix some missing NULL checks
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jan 11 18:55:41 CET 2013 on sn-devel-104
2013-01-11 18:55:41 +01:00
Volker Lendecke
54e01f68e7 winbind: Fix error check in unpack_tdc_domains
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-11 17:10:49 +01:00
Volker Lendecke
aea49ed37a dbwrap: Use INCOMPATIBLE_HASH for dbwrap_watchers.tdb
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-11 17:10:48 +01:00
Andrew Bartlett
489ad498ab swat: move russian swat files alongside ja and tr
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-10 18:46:23 +11:00
Andrew Bartlett
b9fbce2061 passdb: Add discard_const_p() to pdb_samba_dsdb
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-10 18:46:22 +11:00
Andrew Bartlett
26bae894f2 vfs: Fix compilation of solaris ACL module
Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-10 18:46:22 +11:00
Andreas Schneider
3a7c2777ee s3-lib: Use new strict directory create function in create_pipe_sock().
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jan  9 10:55:23 CET 2013 on sn-devel-104
2013-01-09 10:55:23 +01:00
Andreas Schneider
1aa0503401 Use the new directory_create_or_exist_strict() function.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 09:11:20 +01:00
Stefan Metzmacher
5d721de7fd s3:smb2_negprot: set the 'remote_proto' value
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 09:11:20 +01:00
Ira Cooper
0615f68096 s3: Fix vfs_zfsacl to compile.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:51 +11:00
Andrew Bartlett
1002cc9a66 selftest: show that Samba honours "write list" and valid users
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-09 15:29:47 +11:00
Jeremy Allison
fcdd6092b1 Fixup the change_to_user_by_session() case as called from become_user_by_session()
Use inside source3/printing/nt_printing.c:get_correct_cversion().

Allow check_user_ok() to be called with vuid==UID_FIELD_INVALID.
All this should do is throw away one entry in the vuid cache.

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

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:47 +11:00
Volker Lendecke
296c0c34f1 smbd: Remove some ()
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:44 +11:00
Volker Lendecke
38b34cc3e5 smbd: Simplify an if-expression
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:41 +11:00
Volker Lendecke
17708821ff smbd: Fix a typo
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:38 +11:00
Jeremy Allison
b668c9077b Move create_share_access_mask() from smbd/service.c to smbd/uid.c.
Make it static. Only called from uid.c now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:35 +11:00
Jeremy Allison
86d1e1db8e Fix bug #9518 - conn->share_access appears not be be reset between users.
Ensure make_connection_snum() uses the same logic as
check_user_ok() to decide if a user can access a share.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:32 +11:00
Jeremy Allison
1abb5eb89b Factor code out of check_user_ok() into a call to check_user_share_access().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:29 +11:00
Jeremy Allison
ea86f4e100 Initialize stack variables. Prelude to factoring out calls to check_user_share_access().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:25 +11:00
Jeremy Allison
8475f206b2 Add check_user_share_access() which factors out the share security and read_only flag setting code.
Allows this to be called from both make_connection_snum() as well as check_user_ok().
Gives a consistent share security check function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:22 +11:00
Jeremy Allison
6d7bffa606 Correctly setup the conn->share_access based on the current user token.
Also use this to set conn->read_only. Cache the share_access in the
struct vuid_cache_entry struct so we only evaluate this once per new
user access on this share.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:18 +11:00
Jeremy Allison
5e9eebf5de Change API for create_share_access_mask() - remove conn struct.
Eventually this will be indepentent of conn, just pass in the
readonly flag.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:08 +11:00
Jeremy Allison
926d9307f7 Change API for create_share_access_mask() to pass in the token.
Don't automatically use the one from conn->session_info->security_token.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:29:00 +11:00
Jeremy Allison
00de188e1f Fix API for create_share_access_mask().
Return the uint32_t share_access rather than directly
changing the conn struct.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:53 +11:00
Jeremy Allison
f7464bbf72 Remove static from create_share_access_mask().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:50 +11:00
Jeremy Allison
4983d5838a Add uint32_t share_access to vuid_cache_entry.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:48 +11:00
Jeremy Allison
7d90ae123a Clean up struct connection_struct, make struct vuid_cache a pointer not inline.
Change VFS ABI to 31 for 4.1.0.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:45 +11:00
Jeremy Allison
5e483ab147 Remove unneeded variable "const struct auth_session_info *session_info"
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:42 +11:00
Jeremy Allison
2e2f46433c Remove dead code now vuser can no longer be NULL.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:39 +11:00
Jeremy Allison
0a09ffd188 Remove the second set of {} braces, no longer needed.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-09 15:28:34 +11:00
Jeremy Allison
45845f5ba1 Remove one set of enclosing {} braces, no longer needed.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:31 +11:00
Jeremy Allison
390a812ccb Move the definition of struct vuid_cache_entry *ent outside blocks.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:28 +11:00
Jeremy Allison
310c4cac90 Start to tidy-up check_user_ok().
Now we have removed "security=share" we cannot be
called with vuid == UID_FIELD_INVALID.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:23 +11:00
Jeremy Allison
5bffdac4ed torture/vfstest.c: Always use create_conn_struct(). Don't hand create connection structs.
Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 14:54:31 +11:00
Jeremy Allison
7ba6850904 source3/smbd/pysmbd.c: Always use create_conn_struct(). Don't hand create connection structs.
Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 14:54:29 +11:00
Jeremy Allison
a9730cb390 smbd/posix_acls.c: Use create_conn_struct(). Don't hand-create connection structs.
Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 14:54:26 +11:00
Jeremy Allison
b6fe9ec683 Allow create_conn_struct() to be called with snum == -1.
Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 14:54:23 +11:00
Andrew Bartlett
97eb0493fc smbd: Rework create_conn_struct to use conn_new()
This avoids issues with required structure elements not being initialised.

In particular, once conn->vuid_cache becomes a pointer, this ensures
that it is initalised in all cases.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-09 14:54:22 +11:00
Volker Lendecke
3d5c534f0c smbd: Fix bug 9549 -- Memleak in the async echo handler
Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan  8 23:30:41 CET 2013 on sn-devel-104
2013-01-08 23:30:41 +01:00
Andrew Bartlett
cef5f466af pysmbd: Change to keyword based arguments
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:23:24 -08:00
Andrew Bartlett
813a3f0df9 pysmbd: Convert pysmbd to take an optional service to connect to
This uses create_conn_struct to correctly call VFS_CONNECT(), but only
if a service has been specified.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:18:35 -08:00
Andrew Bartlett
5a3e915d20 smbd: Fix calls to create_conn_struct_cwd to be correctly indented.
These are whitespace changes only, left out of the previous commit to preserve clarity.

Andrew Bartlett.

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:18:14 -08:00
Andrew Bartlett
6c80cf747d smbd: Split create_conn_struct into a fn that does not change the working dir
The python bindings do not want the current working directory changed
during operations, so we provide two functions, one providing the
original behaviour, and other providing the python bindings with just
the memory allocation and initilisation stuff.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
2013-01-07 16:09:39 -08:00
Günther Deschner
6a5afa2442 spoolss: add stubs for new JobNamedProperty dcerpc calls.
Guenther

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

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan  7 19:06:25 CET 2013 on sn-devel-104
2013-01-07 19:06:25 +01:00
Andreas Schneider
94f11e9d16 s3-net: Fix rpc_service_list_internal() null pointer passing.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Found by Coverity.

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Jan  2 14:19:50 CET 2013 on sn-devel-104
2013-01-02 14:19:50 +01:00
Andreas Schneider
9b0c1ab07c s3-rpcclient: Fix cmd_eventlog_loginfo() null pointer passing.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Found by Coverity.
2013-01-02 12:35:37 +01:00
Andreas Schneider
30e1dc08df s3-rpcclient: Fix cmd_eventlog_readlog() null pointer passing.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Found by Coverity.
2013-01-02 12:35:36 +01:00