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

1621 Commits

Author SHA1 Message Date
Michael Adam
0fbd854204 s3:vfs:aio_pthread: use smbXsrv_connection for schedule_deferred_open_message_smb
This fixes an incompatible pointer warning which uncovered
a real bug. This caller was missed when converting the function.

This fix is only temporary, since we use fsp->sconn->client->connections
which is supposed to be the start of the list of transport connections
by a given client treated by this smbd process. Currently there is only
one such connection, but with multi-channel there might be more. So
we will need to improve this in the future.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Oct 23 23:10:35 CEST 2014 on sn-devel-104
2014-10-23 23:10:35 +02:00
Volker Lendecke
3a7fd8b0e9 vfs: fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 21 04:58:44 CEST 2014 on sn-devel-104
2014-10-21 04:58:44 +02:00
Ralph Boehme
f593835e54 vfs_posixacl: catch ACL_EVERYONE on FreeBSD
Using POSIX ACL API on FreeBSD may return NFSv4 style tag type
ACL_EVERYONE. Catch the error and issue a helpful log message telling
users to enable zfsacl VFS module.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Oct 12 00:22:19 CEST 2014 on sn-devel-104
2014-10-12 00:22:19 +02:00
Jeremy Allison
57bcb8055e s3: lib, s3: modules: Fix compilation on Solaris.
Based on work from YOUZHONG YANG <youzhong@gmail.com>.
Code needs fixing when HAVE_STRUCT_MSGHDR_MSG_CONTROL is
not defined. Also Solaris doesn't have msg_flags field
(which we set to zero anyway, so if we initialize
the entire struct to zero, we never need to refer to it).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct  6 12:33:36 CEST 2014 on sn-devel-104
2014-10-06 12:33:35 +02:00
Ralph Boehme
1ef2be68f8 vfs_fruit: deal with vfs_catia not being loaded
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Oct  1 01:59:25 CEST 2014 on sn-devel-104
2014-10-01 01:59:25 +02:00
Ralph Boehme
b2626c2d23 vfs_fruit: remove redundant assignment
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:09 +02:00
Ralph Boehme
04ebed1386 vfs_fruit: fix possible uninitialized use
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Ralph Boehme
b6ec190e74 vfs_fruit: update rfork size in AppleDouble header
Update the AppleDouble entry with the new size when ftruncating a
resource fork.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 25 23:43:35 CEST 2014 on sn-devel-104
2014-09-25 23:43:35 +02:00
Ralph Boehme
168191d9bf vfs_fruit: ad_write: path may be NULL for rfork
In preperation of the next commit where we want to call ad_write() on
a resource fork without having a name, just an fsp, which is fine for
resource forks.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-25 21:19:12 +02:00
Ralph Boehme
87347f9772 vfs_fruit: fix resource fork length calculation
Don't add the AppleDouble header size to the resource fork size.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-25 21:19:12 +02:00
Ralph Boehme
ef4b415510 vfs_fruit: fix unpacking of AppleDouble files
OS X AppleDouble files may contain a FinderInfo AppleDouble entry
larger then 32 bytes containing additional packed xattrs. ad_unpack()
must deal with this in a way that allows callers to possibly fixup
the entry.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-25 21:19:12 +02:00
Abhidnya Joshi
9fca4f71c0 s3: vfs module: Adding new vfs module for Symantec VxFS.
This mainly handles ACL related functions.

Modified to add requirement for -DCFLAGS=-DXATTR_USER_NTACL="user.NTACL"
and to hide access to XATTR_USER_NTACL by jra.

Signed-off-by: Abhidnya Joshi <abhidnya_joshi@symantec.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 18 02:30:06 CEST 2014 on sn-devel-104
2014-09-18 02:30:06 +02:00
Jeremy Allison
0519088c53 s3: smbd: Change the function signature of srvstr_push() from returning a length to returning an NTSTATUS with a length param.
srvstr_push_fn() now returns an NTSTATUS reporting any
string conversion failure.

We need to get serious about returning character set conversion errors
inside smbd.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Volker Lendecke
c56a88da6e vfs_gpfs: Fix the build with profiling-data
This fails with -Werror=declaration-after-statement

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 16 01:55:57 CEST 2014 on sn-devel-104
2014-09-16 01:55:57 +02:00
Volker Lendecke
8c1b1435fe media_harmony: Fix a crash bug
Now that the dust has settled, fix a crash bug that was hidden behind
the warnings...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Sep 12 02:45:40 CEST 2014 on sn-devel-104
2014-09-12 02:45:40 +02:00
Volker Lendecke
4038eb8968 media_harmony: Fix warnings
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-12 00:17:21 +02:00
Ralph Boehme
0c53b293ab vfs_acl_common: dacl size must be updated
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 11 03:54:42 CEST 2014 on sn-devel-104
2014-09-11 03:54:42 +02:00
Jeremy Allison
7f976f42c4 s3: smbd: vfs_dirsort module.
Fix an off-by-one check that would cause seekdir to
seek off the end of the cached array.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg.gmail.com>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep  3 19:59:54 CEST 2014 on sn-devel-104
2014-09-03 19:59:54 +02:00
Ralph Boehme
4df557e3ce New VFS module vfs_fruit
This module provides enhanced compatibility with Apple SMB clients and
interoperability with a Netatalk 3 AFP fileserver.

The module intercepts the OS X special streams "AFP_AfpInfo" and
"AFP_Resource" and handles them in a special way. All other named
streams are deferred to vfs_streams_xattr.

The OS X client maps all NTFS illegal characters to the Unicode
private range. This module optionally stores the charcters using their
native ASCII encoding.

Open modes are optionally checked against Netatalk AFP share modes.

The "AFP_AfpInfo" named stream is a binary blob containing OS X
extended metadata for files and directories. This module optionally
reads and stores this metadata in a way compatible with Netatalk 3
which stores the metadata in an EA "org.netatalk.metadata". Cf
source3/include/MacExtensions.h for a description of the binary blobs
content.

The "AFP_Resource" named stream may be arbitrarily large, thus it
can't be stored in an EA on most filesystem. ZFS on Solaris is an
exception to the rule, because it there EAs can be of any size and EAs
are first-class filesystem objects that can be used with normal file
syscalls like open(), read(), write(), fcntl() asf. This module stores
the AFP_Resource stream in an AppleDouble file, prepending "._" to the
filename. On Solaris and ZFS the stream is optionally stored in an EA
"org.netatalk.ResourceFork".

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-18 17:42:50 +02:00
Volker Lendecke
446de4f680 vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 21:11:16 +02:00
Volker Lendecke
4d9432fd24 vfs_full_audit: Optionally log security descriptors in FSET_NT_ACL
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
221afae9ae vfs_full_audit: Add "full_audit:syslog"
Defaults to true (for compatibility)

With full_audit:syslog=false we DEBUG the messages with level 1.

You can explicitly [en|dis]able this with debug class full_audit:0/1

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
b76bc4b713 vfs_full_audit: Save full_audit:priority in private_data
lp_parm_enum can become expensive

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
7efee03c84 vfs_full_audit: Save full_audit:facility in private_data
lp_parm_enum can become expensive

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Volker Lendecke
02d22d6a61 vfs_full_audit: Pass "vfs_full_audit_private_data" to log_failure/success()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-07 22:12:12 +02:00
Stefan Metzmacher
3afdd77bea s3:smbd: move libasys state from smbXsrv_connection to smbd_server_connection
This doesn't belong to a connection, it's state used within the VFS stack.
And smbd_server_connection is the legacy structure we're using for
global VFS state.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Michael Adam
eb0577dca0 s3:vfs:gpfs: remove a block and reduce indentation in gpfs_is_offline()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-24 11:56:10 +02:00
Michael Adam
d87d13f4c2 s3:vfs:gpfs: remove all writing uses of stat_ex.vfs_private from vfs_gpfs.
Now that the vfs_private cache is never read in vfs_gpfs, there is
no need any more to write it.

With this change, vfs_gpfs does not use vfs_private any more.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-24 11:56:09 +02:00
Michael Adam
16a040f8ef s3:vfs:gpfs: Remove all reading uses of stat_ex.vfs_private from vfs_gfs.
This was used as a cache for offline-info in the stat buffer.
But as the implementation of gpfs_is_offline() showed, this cache
does not always carry valid information when the stat itself is valid
(since at least one call goes to fstatat() directly, circumventing
 the vfs).

So the correct thing is to always call SMB_VFS_IS_OFFLINE()
when checking whether a file is offline. For the pread and pwrite
calls, we need to call IS_OFFLINE before the actual read
and check afterwards if the file was offline before (as a basis
whether to send notifications).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-24 11:56:09 +02:00
Michael Adam
44e9ab21dd Revert "s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offline"
This reverts commit 8f44883db94314c007c197927a9dd0809076754d.

The next commits will be removing all access to stat_ex.vfs_private from
vfs_gpfs. This revert of the last addition is a preparation.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-24 11:56:09 +02:00
Michael Adam
26290ba8a4 s3:vfs:gpfs: log when winAttr-garbage is detected (by heuristics) in is_offline
In is_offline(), check whether the winAttrs are filled with bits
outside 0xFFFF and log it prominently: Since GPFS only
fills 0xFFFF, this could be due to an uninitialized buffer
(or another vfs module filling vfs_private? ...).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-13 08:59:11 +02:00
Michael Adam
31e6750714 s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline
There is a problem of flapping offline due to uninitialized
stat buffers. Due to a optimization in vfswrap_readdir which
directly calling fastatat (i.e. not through vfs), marking the
stat buffer valid, there is nothing this module can do about
it and hence can not currently not rely on the vaildity of
the stat buffer.

By always calling out to GPFS even when the stat buffer is
flagged valid, we can always return correct offline information,
thereby sacrificing the readdir optimization.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-13 08:59:11 +02:00
Michael Adam
573ca6ef6b s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in vfs_gpfs_fstat()
This may (e.g.) have lead to some occurrences of flapping offline bits.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-07-13 08:59:11 +02:00
Michael Adam
e7c683ba69 s3:vfs:gpfs: remove extra empty lines.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 10 02:50:44 CEST 2014 on sn-devel-104
2014-07-10 02:50:44 +02:00
Jeremy Allison
c6baacd7f0 s3: VFS modules: Ignore EPERM errors on [f]chmod in crossrename module.
This is already done for [f]chown errors. Fix from CurlyMo <curlymoo1@gmail.com>

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-07-08 07:49:37 +02:00
Volker Lendecke
6f8fd3d5ab smbd: Remove unused blocking_lock_record* from VFS_BRL_CANCEL_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
b08fe2d98d smbd: Remove unused blocking_lock_record* from VFS_BRL_LOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
David Disseldorp
f0f18c56c6 vfs_snapper: use a talloc hierarchy for arrays
Currently the config and snapshot array entries are freed individually.
A talloc hierarchy can be used to avoid this behaviour.

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jun 30 21:41:13 CEST 2014 on sn-devel-104
2014-06-30 21:41:12 +02:00
David Disseldorp
224e1c105b vfs_snapper: don't redefine GMT_FORMAT macro
Use existing header definition.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30 19:25:15 +02:00
David Disseldorp
377a1c860e vfs: add previous file version support for vfs_snapper
Windows attempts to access previous file versions by first issuing an
FSCTL_SRV_ENUMERATE_SNAPSHOTS request, and then using the corresponding
snapshot timestamps in subsequent path based requests.

This change sees vfs_snapper provide snapshot enumeration data via the
get_shadow_copy_data VFS hook. Path based operations are also
intercepted, with @GMT-$time components converted to snapper .snapshot/#
paths.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30 19:25:15 +02:00
David Disseldorp
9261f7c6a0 vfs: add vfs_snapper module
Provides an interface for accessing snapshots exposed by Snapper. The
module communicates with snapperd on the local machine using the D-Bus
interface.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30 19:25:15 +02:00
Volker Lendecke
9c19532134 s3-shadow-copy2: Protect against already converted names
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 27 09:03:53 CEST 2014 on sn-devel-104
2014-06-27 09:03:53 +02:00
Volker Lendecke
1d488270a1 s3-shadow-copy2: Add more debugs
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-06-27 06:49:10 +02:00
Volker Lendecke
87cad88230 s3-shadow-copy2: Fix incorrect case submounts
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-06-27 06:49:10 +02:00
Christof Schmitt
b053d4b3f9 s3-shadow-copy2: Remove TODO and fix comments
The patch "s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of
paths" takes care of a case marked as TODO, remove it and adjust the
comments accordingly.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-06-27 06:49:10 +02:00
Volker Lendecke
16a6181289 s3-shadow-copy2: Fix dir/@GMT-2012.10.15-13.48.43 form of paths
The previous clause in shadow_copy2_strip_snapshot would only handle @GMT-
at the end of a pathname if it was the *only* pathname component. XP
seems to send @GMT- at the end under certain circumstances even with a
path prefix.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-06-27 06:49:10 +02:00
Volker Lendecke
68c7b339cc s3-shadow-copy2: Add extreme debug output to shadow_copy2_strip_snapshot
This is sooo hairy to debug when things go wrong :-(

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-06-27 06:49:10 +02:00
Michael Adam
0e9d4f68f9 build: fix the test and define for msg_accrights
It must be "msg_accrights" not "msg_acctrights" ...
                                       ^

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jun 16 18:18:04 CEST 2014 on sn-devel-104
2014-06-16 18:18:04 +02:00
Michael Adam
c709328278 vfs:gpfs: fix a debug message
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 13 19:54:23 CEST 2014 on sn-devel-104
2014-06-13 19:54:23 +02:00
Ralph Boehme
634bcb09a0 vfs_streams_xattr: add options "prefix" and "store_stream_type"
Add module options that can be used to configure the stream prefix the
module uses (option "prefix", a string) and whether the stream type
"$DATA" is appended to the xattr name on disk (option
"store_stream_type", a boolean).

The default "prefix" is "user.DosStream" and the default for
"store_stream_type" is true, this gives unchanged default behaviour
when not specifying this option.

OS X SMB clients will send xattrs as named streams over the wire, by
setting the options to the following values

  streams_xattr:prefix = user.
  streams_xattr:store_stream_type = no

OS X xattrs will be stored on disk on the server with their unmodified
names and as such provide interoperability with other protocols like
AFP.

In order to prevent access to our internal Samba xattrs, check the
xattr name with the function samba_private_attr_name() made public by
the previous commit.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-13 13:22:18 +02:00