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

62 Commits

Author SHA1 Message Date
Jeremy Allison
32b1c74c27 s3: smbd: vfs: Remove any stale xattr values during file/directory create in vfs_xattr_tdb()
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-07-23 06:04:11 +02:00
Jeremy Allison
6ae59eb6d1 s3: smbd: Modify vfs_stat_smb_basename() to take a const struct smb_filename * instead of const char *.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-03-24 22:57:17 +01:00
Jeremy Allison
ce75fbf4e3 s3: smbd: Remove many common uses of lp_posix_pathnames().
Check the smb_filename->flags field, or req->posix_pathnames
instead, depending on what is available.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-03-24 22:57:16 +01:00
Jeremy Allison
dc5dad4813 s3: Filenames: Add uint32_t flags parameter to synthetic_smb_fname().
Get it from parent/deriving smb_filename if present.
Use 0 (as usually this a Windows-style lookup) if
not.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-03-24 22:57:16 +01:00
Jeremy Allison
e64ab0d72a s3: vfs: vfs_xattr_tdb - cleanup. Remove unneeded variable "path".
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): Tue Mar 15 11:45:19 CET 2016 on sn-devel-144
2016-03-15 11:45:19 +01:00
Jeremy Allison
cd1335e67d VFS: Modify rmdir to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames().

Uses the same techniques as commit 616d068f0c
(synthetic_smb_fname()) to cope with modules that
modify the incoming pathname.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Feb 25 20:46:49 CET 2016 on sn-devel-144
2016-02-25 20:46:49 +01:00
Jeremy Allison
ccb4f791fd s3: smbd: VFS: For all EA and ACL calls use synthetic_smb_fname(), not synthetic_smb_fname_split().
EA's and ACL paths are all post-stream name checks (and shouldn't
get stream names). This one took a *long* time to find.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-05-05 14:01:25 +02:00
Jeremy Allison
14f4e254bb s3: smbd: VFS: All the places that are currently calling vfs_stat_smb_fname() and vfs_lstat_smb_fname() should be calling vfs_stat_smb_basename().
They are all post-stream name processing.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-05-05 14:01:25 +02:00
Michael Adam
cf0cb0add9 dbwrap: add a dbwrap_flags argument to db_open()
This is in preparation to support handing flags to backends,
in particular activating read only record support for ctdb
databases. For a start, this does nothing but adding the
parameter, and all databases use DBWRAP_FLAG_NONE.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-02-07 16:06:06 +01:00
Volker Lendecke
7d57b8adf2 vfs: Convert xattr_tdb_get_file_id to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:58 -07:00
Volker Lendecke
2c733b2ffb vfs: Convert xattr_tdb_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Andrew Bartlett
450fcd79c7 s3-vfs: Remove extra calls to SMB_VFS_HANDLE_GET_DATA
Found by the talloc_stackframe() out of order checker!

Andrew Bartlett
2012-08-22 01:31:57 +02:00
Andrew Bartlett
9699c335fd s3-vfs: Allow vfs_xattr_tdb to work without a connected share
This is needed to that get_nt_acl_no_snum() can work.

Andrew Bartlett
2012-08-20 21:57:46 +10:00
Andrew Bartlett
820d1795d7 s3-vfs: Continue to make vfs_xattr_tdb non-recursive
We now always use _NEXT_ VFS calls, even to build the file id.

Andrew Bartlett
2012-08-16 15:25:38 +10:00
Andrew Bartlett
65976d680a s3-vfs: Set errno in xattr emulation
The caller may check this errno.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 15 18:05:33 CEST 2012 on sn-devel-104
2012-08-15 18:05:33 +02:00
Andrew Bartlett
cc3bdaaf0a s3-vfs: Avoid loops in VFS modules: call _NEXT functions in xattr emulation
We need to call the next module in the stack otherwise we will loop if
the stat call is in turn implemented in terms of extended attribute
lookup.

Andrew Bartlett
2012-08-15 16:28:03 +02:00
Andrew Bartlett
898c5e140d s3-vfs: ensure we strictly free the talloc_stackframe
We must do this when leaving the function or else in development, we
will panic.

Andrew Bartlett
2012-08-15 16:28:03 +02:00
Rusty Russell
bdc59fb538 source3/modules/vfs_xattr_tdb.c: fix stackframe leak
xattr_tdb_getxattr() doesn't free its stackframe.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 05:03:31 +09:30
Volker Lendecke
97a4901d6c s3: Same fix as 8576256, this time for fgetxattr
Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Jun  2 02:12:31 CEST 2012 on sn-devel-104
2012-06-02 02:12:31 +02:00
Volker Lendecke
8576256738 s3: Fix vfs_xattr_tdb.c
"size" is the maximum buffer, only copy what we actually got. For me, this
fixes valgrind errors in the DIR1 test that might potentially make DIR1
non-flaky again.

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

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon May 21 22:10:15 CEST 2012 on sn-devel-104
2012-05-21 22:10:15 +02:00
Andrew Bartlett
84ad848c86 s3-xattr_tdb: Remove dead code: talloc_stackframe() cannot fail
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 19 14:15:42 CEST 2012 on sn-devel-104
2012-04-19 14:15:41 +02:00
Andrew Bartlett
492942a66a s3-xattr_tdb: Be nice to xattr_tdb_getxattr callers, return the full blob
In this case, the blob is already in memory, so it is easier to return the full
blob to the caller, and let the caller decide if some interface restriction
stops the full blob from being passed all the way up the stack.

This allows us to quickly write a python wrapper for this xattr storage
mechanism.

Andrew Bartlett
2012-04-18 12:05:00 +10:00
Andrew Bartlett
351c78fc67 s3-xattr_tdb: make xattr_tdb a private library, for use outside vfs_xattr_tdb 2012-04-18 12:05:00 +10:00
Volker Lendecke
da0a7b2fcc s3-xattr_tdb: Fix listxattr
We have to tell the caller how many bytes we actually want
2012-02-02 20:35:28 +01:00
Volker Lendecke
45e61fcf61 s3: Add a "lock_order" argument to db_open
This will be used to enforce a lock hierarchy between the databases. We have
seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb.
These should be fixed by refusing a dbwrap_fetch_locked that does not follow a
defined lock hierarchy.
2012-01-18 14:48:04 +01:00
Richard Sharpe
422494a8e6 vfs: Make function pointer names consistent. They all end in _fn
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Mon Dec 12 04:58:40 CET 2011 on sn-devel-104
2011-12-12 04:58:40 +01:00
Michael Adam
ceb9f572ab s3:vfs: change the xattr_tdb module to use dbwrap wrapper functions
Avoid direct use of the db_record and db_context structs.
2011-10-11 14:17:57 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Michael Adam
1abdd9b2bb s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and
make the fallbacke implementation functoins non-static and create a
dbwrap_private.h header file that contains their prototypes.
2011-07-29 12:23:13 +02:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Günther Deschner
45364f5e69 s3-vfs: include smbd/smbd.h in vfs modules.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
50be0b2c1e s3: Remove superfluous ;
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Feb  2 15:44:21 CET 2011 on sn-devel-104
2011-02-02 15:44:21 +01:00
Jeremy Allison
f0dcc90f72 Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when adding new share via MMC
Change the find_service() interface to not depend on fstring, and
create a useable talloc-based interface.

Jeremy.
2010-11-10 01:14:17 +00:00
Günther Deschner
7a05ca2c9c s3-build: use dbwrap.h only where needed.
Guenther
2010-08-26 00:25:55 +02:00
Günther Deschner
0f8e032628 s3-netlogon: remove global include of netlogon.h.
This reduces precompiled headers by another 4 MB and also slightly speeds up the
build.

Guenther
2010-08-06 15:46:16 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Jeremy Allison
010dfbf1fd Fix one missing STAT -> LSTAT with POSIX pathnames in vfs_xattr_tdb.c. Caught by the torture tester. I love unit tests :-). Jeremy. 2009-10-16 16:38:59 -07:00
Jeremy Allison
d91edeaa94 When mapping EA's into a TDB, don't remove the EA
until the last link to the file is gone (fixes the
build farm RAW-RENAME test with xattr's in tdb's).
Jeremy.
2009-08-12 16:27:17 -07:00
Volker Lendecke
033185e2a1 Make the smbd VFS typesafe 2009-07-24 11:42:05 -04:00
Tim Prouty
258952aa85 s3: Plumb smb_filename through SMB_VFS_UNLINK 2009-07-06 15:38:36 -07:00
Tim Prouty
e129384d7c s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTAT
This patch introduces two new temporary helper functions
vfs_stat_smb_fname and vfs_lstat_smb_fname.  They basically allowed me
to call the new smb_filename version of stat, while avoiding plumbing
it through callers that are still too inconvenient.  As the conversion
moves along, I will be able to remove callers of this, with the goal
being to remove all callers.

There was also a bug in create_synthetic_smb_fname_split (also a
temporary utility function) that caused it to incorrectly handle
filenames with ':'s in them when in posix mode.  This is now fixed.
2009-06-24 21:15:25 -07:00
Tim Prouty
e4675ce8db s3: Add extid to the dev/inode pair
This extends the file_id struct to add an additional generic uint64_t
field: extid.  For backwards compatibility with dev/inodes stored in
xattr_tdbs and acl_tdbs, the ext id is ignored for these databases.
This patch should cause no functional change on systems that don't use
SMB_VFS_FILE_ID_CREATE to set the extid.

Existing code that uses the smb_share_mode library will need to be
updated to be compatibile with the new extid.
2009-02-19 20:58:26 -08:00
Tim Prouty
6fbebb5369 s3: Modify SMB_VFS_FILE_ID_CREATE to take a stat struct
Since file_id_create_dev is incompatible with the concept of file_ids,
it is now static and in the one file that needs it.
2009-02-19 20:58:01 -08:00
Michael Adam
2fb694df23 s3:vfs_xattr_tdb: don't leak state_path() to talloc_tos in xattr_tdb_init().
Michael
2009-01-16 01:02:21 +01:00
Steven Danneman
4a578ec50b Covert several persistant tdb files to use state_path() instead of lock_path() 2009-01-12 17:46:15 -08:00