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

354 Commits

Author SHA1 Message Date
Jeremy Allison
e919e767fb Cosmetic. Fix bad indentation.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Apr 22 03:16:43 CEST 2011 on sn-devel-104
2011-04-22 03:16:43 +02:00
Jeremy Allison
20baa11f33 Remove duplicate code - move to parent_dirname() as a common function. 2011-04-21 17:09:50 -07:00
Günther Deschner
c7073f8b54 s3-vfs: rename open function to open_fn.
This should finally fix the AIX build and allow to remove AIX specific ifdefs.

Guenther

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

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr 21 02:01:20 CEST 2011 on sn-devel-104
2011-04-21 02:01:20 +02:00
Günther Deschner
ae61a5c3d0 s3-smbd: fix the AIX 5.3 build.
(AIX defines open to be open64)

Guenther
2011-04-20 18:16:28 +02:00
Jeremy Allison
525ccd589e Ensure vfs_chown_fsp() is safe against races. 2011-04-15 12:21:39 -07:00
Günther Deschner
b1e3b9d7c1 s3: only include ntioctl.h where needed.
Guenther
2011-03-30 01:13:10 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
9bd06f6bc7 s3-build: only include transfer_file.h where needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Volker Lendecke
cf7dac6fbc s3: Pass smb_filename through the set_offline vfs op 2011-03-02 18:39:21 +01:00
Volker Lendecke
c9d1e16c2c s3: Pass smb_filename through the is_offline vfs op 2011-03-02 18:39:21 +01:00
Jeremy Allison
a674a56a97 Add fdopendir to the VFS. We will use this to reuse a directory fd already open by NtCreateX.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb  9 00:55:22 CET 2011 on sn-devel-104
2011-02-09 00:55:22 +01:00
Jeremy Allison
e68f6adca9 If possible (O_DIRECTORY exists) open an fd for a directory open.
Start of the move towards handle-based code for directory access.
Currently makes fstat/fchown code work for directories rather than
falling back to pathnames.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Feb  8 06:34:41 CET 2011 on sn-devel-104
2011-02-08 06:34:41 +01:00
Jeremy Allison
df34e804fc Fix try_chown code. Use new vfs_chown_fsp() which always trys fd first.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb  5 03:33:59 CET 2011 on sn-devel-104
2011-02-05 03:33:58 +01:00
Jeremy Allison
8998f4b013 Added call out to a Linux-compatible fallocate() when we need to extend a file
allocation extent without changing end-of-file size.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 21 02:41:24 CET 2010 on sn-devel-104
2010-12-21 02:41:23 +01:00
Volker Lendecke
98a2fff2e5 s3: re-add some debugs to check_reduced_name 2010-12-19 23:25:06 +01:00
Volker Lendecke
43e42b4e77 s3: Fix some typos 2010-12-19 23:25:06 +01:00
Jeremy Allison
716ea734e4 Rename vfs operation posix_fallocate to just fallocate and add the vfs_fallocate_mode parameter.
It turns out we need the fallocate operations to be able to both
allocate and extend filesize, and to allocate and not extend
filesize, and posix_fallocate can only do the former. So by defining
the vfs op as posix_fallocate we lose the opportunity to use any
underlying syscalls (like Linux fallocate) that can do the latter
as well.

We don't currently use the non-extending filesize call, but now
I've changed the vfs op definition we can in the future. For the
moment simply map the fallocate op onto posix_fallocate for the
VFS_FALLOCATE_EXTEND_SIZE case and return ENOSYS for the
VFS_FALLOCATE_KEEP_SIZE case.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec 18 08:59:27 CET 2010 on sn-devel-104
2010-12-18 08:59:27 +01:00
Jeremy Allison
0fe744078d Ensure we use vfs_fsp_stat(), not VFS_STAT directly, and store into fsp->fsp_name->st
instead of a SMB_STRUCT_STAT on the stack.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 14 05:05:50 CET 2010 on sn-devel-104
2010-12-14 05:05:50 +01:00
Jeremy Allison
b8d7de3199 Merge the two conflicting allocation codes into one function, vfs_slow_fallocate()
and use that from both the truncate and fill_sparse functions.

Jeremy.
2010-12-03 02:55:05 +01:00
Jeremy Allison
5819a36aef Move posix_fallocate into the VFS where it belongs.
Jeremy.
2010-12-02 16:25:59 -08:00
Jeremy Allison
de8ceb5364 Fix bug #7835 - vfs_fill_sparse() doesn't use posix_fallocate when strict allocate is on
Tries posix_fallocate() and then falls back to old code.

Jeremy.
2010-12-02 15:38:36 -08:00
Jeremy Allison
2b788aa6ce Move the uglyness of #ifdef REALPATH_TAKES_NULL into the vfs_default
module, change the signature of VFS_REALPATH to always return a
malloc'ed string.

Needed to make some privileges work I plan on doing shortly
easier to code.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Nov 20 02:15:50 CET 2010 on sn-devel-104
2010-11-20 02:15:50 +01:00
Jeremy Allison
b3fccd10a6 Fix bug 7409 - Thousands of reduce_name: couldn't get realpath.
Don't log this at level 1 - every EACCES will generate one.
Thanks to muehlfeld@medizinische-genetik.de for pointing this out.

Jeremy.
2010-09-13 16:54:21 -07:00
Günther Deschner
aba1bf4b5e s3-build: only include memcache.h where needed.
Guenther
2010-08-26 00:20:28 +02:00
Volker Lendecke
2d571fdddb s3: Remove smbd_server_fd from vfs_pwrite_data 2010-08-16 22:39:22 +02:00
Volker Lendecke
30ce02299b s3: Remove smbd_server_fd from vfs_write_data 2010-08-16 22:39:22 +02:00
Jeremy Allison
5bdb8b472c Revert "Remove the global char *LastDir."
Volker pointed out I'd missed the "last directory" cache
part of this code. Return us to caching the directory we're
in (reduces sys call load).

Mea maxima culpa.

Jeremy.

This reverts commit 2f30aea332.
2010-07-13 09:30:35 -07:00
Volker Lendecke
3caaca9021 s3: Fix typos in a debug message in vfs_init_custom 2010-03-28 15:25:14 +02:00
Jeremy Allison
c61c9c3a4c Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.
Ensure we don't use any of the create_options for Samba private
use. Add a new parameter to the VFS_CREATE call (private_flags)
which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS
and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code).
Rev. the VFS interface to version 28.

Jeremy.
2010-03-05 15:13:37 -08:00
Jeremy Allison
a6f402ad87 Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from Volker.
Create widelinks_warning(int snum) to cover the message needed in make_connection.

Jeremy.
2010-02-11 15:16:23 -08:00
Simo Sorce
5d92d969dd Introduce lp_safe_widelinks()
This way we avoid any chance that a configuration reload may turn
back on wide links when unix extensions are enabled.
2010-02-11 16:27:17 -05:00
Jeremy Allison
bd269443e3 Fix bug 7104 - "wide links" and "unix extensions" are incompatible.
Change parameter "wide links" to default to "no".
Ensure "wide links = no" if "unix extensions = yes" on a share.
Fix man pages to refect this.

Remove "within share" checks for a UNIX symlink set - even if
widelinks = no. The server will not follow that link anyway.

Correct DEBUG message in check_reduced_name() to add missing "\n"
so it's really clear when a path is being denied as it's outside
the enclosing share path.

Jeremy.
2010-02-05 15:20:18 -08:00
Jeremy Allison
2f30aea332 Remove the global char *LastDir.
This is no longer used for anything.
2010-01-12 14:48:23 -08:00
Jeremy Allison
b2dd546f01 Allow us to pass RAW-CHKPATH with FILE_FLAG_POSIX_SEMANTICS set or with
wide links = no.
Jeremy.
2009-11-24 14:05:56 -08:00
Volker Lendecke
f6650f5d19 s3: Do not talloc in readdir
This is a hot codepath (called from the stat cache)
2009-11-18 23:16:13 +01:00
Volker Lendecke
8006e0e634 s3: Fix debug messages in check_reduced_name 2009-11-12 11:20:22 +01:00
Abhidnya P Chirmule
ac774c4969 s3: Add access_mask to the flock VFS call 2009-10-06 18:52:06 +02:00
Jeremy Allison
6f22cd10ad Remove lots of duplicate code and move it into one
function vfs_stat_fsp(). Stops code looking at fsp->posix_open
except for exceptional circumstances.
Jeremy.
2009-10-02 13:45:38 -07:00
Jeremy Allison
1e322cf6a9 Fix more use of VFS_STAT when posix pathnames selected.
Jeremy.
2009-10-02 11:05:03 -07:00
Aravind Srinivasan
637901c242 vfs catia: Fix the double translation that was happening with createfile and open.
Since the catia translation is implemented for open, it should not
also be done in createfile.  By removing createfile from catia,
translation is now done correctly for the primary open path.

In order to support systems that have custom createfile
implementations that don't eventually call SMB_VFS_OPEN,
SMB_VFS_TRANSLATE_NAME has been expanded to take an additional
argument that specifies direction.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-09-24 10:59:33 -07:00
Aravind Srinivasan
e046b382f2 s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAME
This vop is designed to work in tandem with SMB_VFS_READDIR to allow
vfs modules to make modifications to arbitrary filenames before
they're consumed by callers.  Subsequently the core directory
enumeration code in smbd is now changed to free the memory that may be
allocated in a module.  This vop enables the new version of catia in
the following patch.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-08-28 16:38:57 -07:00
Jeremy Allison
c69f92d16d Second attempt at fix for bug 6529 - Offline files conflict with Vista and Office 2003.
Confirmation from reporter that this fixes the issue in master on ext3/ext4.
Back-ports to follow.
Jeremy.
2009-08-24 20:57:37 -07:00
Volker Lendecke
261ae2eb11 First patch for "new VFS" portability 2009-07-25 12:37:17 -04:00
Volker Lendecke
6b801d6c4c add my copyright after the VFS rewrite 2009-07-24 13:21:45 -04:00
Volker Lendecke
033185e2a1 Make the smbd VFS typesafe 2009-07-24 11:42:05 -04:00
Volker Lendecke
4b76f279d1 Fix some nonempty blank lines 2009-07-24 02:16:00 +02:00
Tim Prouty
83284e13f9 s3: Convert some callers of vfs_lstat_smb_fname to SMB_VFS_LSTAT() 2009-07-22 11:48:22 -07:00
Tim Prouty
841efce8b5 s3: Separate out a new file: filename_utils.c
This is to ease the linking pain of everything that links LOCKING_OBJ
2009-07-20 17:26:57 -07:00
Tim Prouty
5a8d70d465 s3: Change fsp->fsp_name to be an smb_filename struct! 2009-07-20 17:26:56 -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
a9ec21cf21 s3: Prepare the first set of SMB_VFS_CREATE_FILE callers to take an smb_filename struct
Some of the callers required minimal changes, while others
(copy_internals) required significant changes.  The task is simplified
a little bit because we are able to do operations and checks on the
base_name when a stream isn't used.

This patch should cause no functional changes.

Volker, Jeremy: Please check
2009-06-10 13:13:27 -07:00
Volker Lendecke
56efcb7b72 Add SMB_VFS_CONNECTPATH operation
This is required for the shadow_copy2 module and "wide links = no". The file
system snapshots by nature are typically outside of share directory. So the
REALPATH result fails the wide links = no test.
2009-06-02 11:58:22 +02:00
Volker Lendecke
83ffbb4ec4 Remove a variable used just once 2009-06-02 11:58:22 +02:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
This patch introduces

struct stat_ex {
        dev_t           st_ex_dev;
        ino_t           st_ex_ino;
        mode_t          st_ex_mode;
        nlink_t         st_ex_nlink;
        uid_t           st_ex_uid;
        gid_t           st_ex_gid;
        dev_t           st_ex_rdev;
        off_t           st_ex_size;
        struct timespec st_ex_atime;
        struct timespec st_ex_mtime;
        struct timespec st_ex_ctime;
        struct timespec st_ex_btime; /* birthtime */
        blksize_t       st_ex_blksize;
        blkcnt_t        st_ex_blocks;
};
typedef struct stat_ex SMB_STRUCT_STAT;

It is really large because due to the friendly libc headers playing macro
tricks with fields like st_ino, so I renamed them to st_ex_xxx.

Why this change? To support birthtime, we already have quite a few #ifdef's at
places where it does not really belong. With a stat struct that we control, we
can consolidate the nanosecond timestamps and the birthtime deep in the VFS
stat calls.

At this moment it is triggered by a request to support the birthtime field for
GPFS. GPFS does not extend the system level struct stat, but instead has a
separate call that gets us the additional information beyond posix. Without
being able to do that within the VFS stat calls, that support would have to be
scattered around the main smbd code.

It will very likely break all the onefs modules, but I think the changes will
be reasonably easy to do.
2009-05-26 17:48:23 +02:00
Michael Adam
8aa41bdeb2 s3:vfs: untangle logic for loading and probing modules in vfs_init_custom()
This is to be able to provide more specific error messages.

Michael
2009-04-29 16:48:22 +02:00
Tim Prouty
04a7213eb6 s3: Change the vfs_GetWd cache to use the file_id struct 2009-02-19 21:09:30 -08:00
Steven Danneman
af0e199b31 Add an optional SMB_STRUCT_SMB parameter to VFS_OP_READDIR
* this allows VFS implementations that prefetch stat information on
  readdir to return it through one VFS call
* backwards compatibility is maintained by passing in NULL
* if the system readdir doesn't return stat info, the stat struct is
  set to invalid
2009-02-09 23:56:16 -08:00
Tim Prouty
c6f1f055fd s3 oplocks: Make the level2 oplock contention API more granular
This replaces release_level2_oplocks_on_change with
contend_level2_oplock_begin/end in order to contend level2 oplocks
throughout an operation rather than just at the begining.  This is
necessary for some kernel oplock implementations, and also lays the
groundwork for better correctness in Samba's standard level2 oplock
handling.  The next step for non-kernel oplocks is to add additional
state to the share mode lock struct that prevents any new opens from
granting oplocks while a contending operation is in progress.

All operations that contend level 2 oplocks are now correctly spanned
except for aio and synchronous writes.  The two write paths both have
non-trivial error paths that need extra care to get right.

RAW-OPLOCK and the rest of 'make test' are still passing with this
change.
2009-02-09 23:47:45 -08:00
Tim Prouty
122dbbf00a s3 vfs: Add a destructor to the fsp extension data API
I'm not certain if the dummy pointer is needed in struct vfs_fsp_data,
but I added it to be consistent with the comment below.
2009-02-09 23:46:12 -08:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Jelmer Vernooij
4746f79d50 Use {u,}int64_t instead of SMB_BIG_{U,}INT. 2008-10-14 01:59:36 +02:00
Volker Lendecke
d62563342e Remove connection_struct->mem_ctx, connection_struct is its own parent
(This used to be commit 559180f7d3)
2008-05-05 11:23:13 +02:00
Michael Adam
fef9cf00e1 Combine fsp and tofd to tofsp in SMB_VFS_RECVFILE().
Michael
(This used to be commit 3958abffaf)
2008-01-11 01:27:05 +01:00
Michael Adam
e9a3a62e74 Remove redundant parameter fd from SMB_VFS_WRITE().
Michael
(This used to be commit c8ae7d095a)
2008-01-10 15:49:35 +01:00
Michael Adam
1d66f4d58b Remove redundant parameter fd from SMB_VFS_READ().
Michael
(This used to be commit a8fc2ddad8)
2008-01-10 15:33:51 +01:00
Michael Adam
10da70325b Make casts to (void *) explicit to remove compiler warnings.
Michael
(This used to be commit cbbfbd7a63)
2008-01-10 14:28:12 +01:00
Michael Adam
5661ac6a38 Correctly abstract the transfer_file mechanism with callbacks and void ptrs.
This removes the in_fsp and out_fsp global variables hack from smbd/vfs.c.

Michael
(This used to be commit b2e7cdc6e8)
2008-01-10 13:30:46 +01:00
Jeremy Allison
253fbf1a6e Make use of talloc_pool in the main codepaths. Remove the sub-contexts.
Jeremy.
(This used to be commit bc932b8ad4)
2008-01-09 17:11:04 -08:00
Michael Adam
b457b94bb8 Remove redundant parameter fd from SMB_VFS_FTRUNCATE().
Michael
(This used to be commit 2ad66050a0)
2008-01-07 15:59:02 +01:00
Michael Adam
87a684f7fc Remove redundant parameter fd from SMB_VFS_FSTAT().
Michael
(This used to be commit 0b86c420be)
2008-01-07 15:59:01 +01:00
Michael Adam
a56b417809 Remove redundant parameter fd from SMB_VFS_PWRITE().
Michael
(This used to be commit 8c4901a19a)
2008-01-07 15:59:01 +01:00
Michael Adam
ca275e2549 Remove unneeded parameter fd from SMB_VFS_PREAD().
Michael
(This used to be commit 73e28806ce)
2008-01-07 00:14:19 +01:00
Volker Lendecke
a60867b67e Apply some const
(This used to be commit 241b72141e)
2007-12-29 17:14:25 +01:00
Volker Lendecke
dea7d2223d Fix a C++ warning
(This used to be commit 7e1d9b561f)
2007-12-21 09:58:20 +01:00
James Peach
26b75f2d83 Expose per-fsp extension talloc context.
This patch supplements the fsp extension API with an operation to
retrieve the malloc zone pointer for that fsp.
(This used to be commit d5d9e4084c)
2007-12-19 22:20:09 -08:00
Volker Lendecke
f427d4ce65 Add a in-memory cache
This is a more general API that caches data with a LRU scheme. See
include/cache.h. No comments yet, I'm still working on it. But Jeremy has given
me a hint in one of his checkins that he would like to make use of this now.

The idea is that we get rid of all our silly little caches and merge them all
into one cache that we can then very easily trim, for example even with a
smbcontrol message if someone decides memory is tight. The main user is the
stat cache, this patch also converts the getwd cache. More caches to come.
(This used to be commit 7a911b3571)
2007-12-18 09:56:04 +01:00
Jeremy Allison
2b3c44e4fb Always define PATH_MAX. Makes code simpler (removes
a bunch of #defines). Remove pstring from msdfs.c.
Jeremy.
(This used to be commit e203ba2227)
2007-11-10 22:31:34 -08:00
Jeremy Allison
133fad90b5 Make explicit draining the socket on RECVFILE. Add
capability for large UNIX write if not signing and
recvfile set. Cope with large UNIX write length on
incoming processing. Stevef - we can now test 1-16Mb
writes from CIFFS.
Jeremy.
(This used to be commit 8cf78776b0)
2007-10-31 14:01:35 -07:00
Jeremy Allison
360c02328f Ensure we don't prematurely clean out the bytes read.
Jeremy.
(This used to be commit 247675695d)
2007-10-30 17:42:02 -07:00
Jeremy Allison
c3250149e1 Add new parameter, "min receivefile size" (by default set
to zero). If non-zero, writeX calls greater than this
value will be left in the socket buffer for later handling
with recvfile (or userspace equivalent). Definition of
recvfile for your system is left as an exercise for
the reader (I'm working on getting splice working :-).
Jeremy.
(This used to be commit 11c03b75dd)
2007-10-30 16:22:24 -07:00
Volker Lendecke
6ca0d8124c Enable vfs objects = /full/path/to/object.so
Right now I'm testing a vfs object. I can't right now in make test, because
"vfs objects" assumes the .so files to be in $libdir/vfs. This patch parses the
module name out of the object name in case it starts with "/". The module name
is assumed to be the last path component's basename.
(This used to be commit 95cc019af7)
2007-10-28 12:30:44 -04:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
ead70dc92e r23761: Rename reduce_name to check_reduced_name
The function name reduce_name is misleading, making the user believe it
changes an argument.
(This used to be commit 68234f0bc6)
2007-10-10 12:23:53 -05:00
Jeremy Allison
12ba88574b r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
(This used to be commit f6fa3080fe)
2007-10-10 12:19:44 -05:00
Jeremy Allison
4838055e5f r22132: I hate inefficiency. Don't call conv_str_size()
on every pread/sendfile call, initialize these
variables in an allocated struct at connection
time and just refer to them directly.
Jeremy.
(This used to be commit 85df3fca68)
2007-10-10 12:19:15 -05:00
Volker Lendecke
43101d6dd5 r21131: Some notify fixes
(This used to be commit b9300e1d5a)
2007-10-10 12:17:41 -05:00
Volker Lendecke
37a3339a18 r21082: Make canonicalize_path static to service.c -- we do have conn->connectpath
(This used to be commit 06f58096e3)
2007-10-10 12:17:34 -05:00
Jeremy Allison
cb916d33f5 r21063: All case statements are now NTSTATUS returning
functions. Now to factor out the post processing
and make all cases behave the same (no mixture
of "early returns" and "break"s.
Jeremy
(This used to be commit 7e17e54cb7)
2007-10-10 12:17:32 -05:00
Jeremy Allison
83eb0d1d6d r20844: Somewhat radical change - this may break the build (I will
watch carefully - so I'm doing it in one transaction so I can
roll back).

Change check_name(), reduce_name() and dptr_create() to
return NTSTATUS. This helps a lot in error path processing
and especially in reduce_name() allows us to ditch the flaky
and error-prone saving of errno and return errors directly.

Jeremy.
(This used to be commit 6133a694aa)
2007-10-10 12:17:12 -05:00
Volker Lendecke
af1750934d r20340: Join vfs_MkDir to its only caller
(This used to be commit cce911780f)
2007-10-10 12:16:42 -05:00
Volker Lendecke
9933b596d1 r20228: Bring the calling conventions of inherit_access_acl and change_owner_to_parent
a bit closer together: Move the lp_inherit_perms() check into the callers.

Volker
(This used to be commit 0874093e5f)
2007-10-10 12:16:34 -05:00
Volker Lendecke
771f595693 r20227: Simplify logic in vfs_MkDir() a bit
(This used to be commit b24cf79e9e)
2007-10-10 12:16:33 -05:00
Volker Lendecke
1362fd0b68 r19147: This is WRONG, but the way the VFS works this is the only fix to get rid of
this type-punned warning.

Volker
(This used to be commit d815b1a7e9)
2007-10-10 12:15:16 -05:00
Volker Lendecke
430fa0eba0 r17348: Some C++ warnings
(This used to be commit ae6b9b34e5)
2007-10-10 11:38:27 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Paul Green
31693197be r15283: Oh yeah. The build farm doesn't do much with head. OK, here is the patch to SAMBA_3_0 to declare prototypes for the initialization functions. These are the same changes I just made to head. --paulg
(This used to be commit 17774387ad)
2007-10-10 11:16:31 -05:00
Jeremy Allison
22dbd67708 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
(This used to be commit 08e52ead03)
2007-10-10 11:15:57 -05:00
Jeremy Allison
1d3fd5201c r14746: Add the Samba4 replacements for opendir/readdir etc. to
Samba3 - with some 64-bit macro madness. Attempt to fix
the broken directory handling in the *BSD-of-the-month
club.
Jeremy.
(This used to be commit fd98427f64)
2007-10-10 11:15:45 -05:00
Jeremy Allison
86909281c8 r11428: Fix bug #3192 by actually hooking up the dfree caching
function. Oops.
Jeremy.
(This used to be commit 7edb26e765)
2007-10-10 11:05:15 -05:00
Jeremy Allison
a5b339c799 r11232: Added ab's POSIX statvfs vfs call. Sorry for the delay ab.
Jeremy.
(This used to be commit af85458067)
2007-10-10 11:05:08 -05:00
Jeremy Allison
af8a691db1 r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work
into the tree). I'll test this over the weekend....
Jerry - in looking at the difference between the two trees there
seem to be some printing/ntprinting.c and registry changes we might
want to examine to try keep in sync.
Jeremy.
(This used to be commit c7fe18761e)
2007-10-10 10:58:18 -05:00
Jeremy Allison
f2f55d703d r7963: Add aio support to 3.0.
Jeremy.
(This used to be commit 1de27da470)
2007-10-10 10:58:05 -05:00
Jeremy Allison
8a1756006a r6841: Attempt to fix buf #2681. With "strict allocate = yes" we now zero
fill when a file is extended. Should catch disk full errors on write
from MS-Office.
Jeremy.
(This used to be commit 858824f37b)
2007-10-10 10:56:56 -05:00
Jeremy Allison
bd688a9138 r6633: Added "check_path_syntax_posix()" in preparation for handling
POSIX pathnames. Not yet used.
Jeremy.
(This used to be commit 381da9b55d)
2007-10-10 10:56:48 -05:00
Tim Potter
e09150948b r6408: Fix compile error lurking where PATH_MAX is not defined. Bugzilla #2560.
(This used to be commit 5921fcadd5)
2007-10-10 10:56:40 -05:00
Jeremy Allison
d761233aba r6234: Fix for possible root squash nfs bugs from psz@maths.usyd.edu.au
Jeremy.
(This used to be commit dbf021a2e0)
2007-10-10 10:56:31 -05:00
Jeremy Allison
4ba71014d6 r5825: Fix one more DISK_FREE call - spotted by Ying Li <ying.li2@hp.com>.
Jeremy.
(This used to be commit 19e017a78a)
2007-10-10 10:56:04 -05:00
Jeremy Allison
f783144516 r5757: Fix erroneous debug message - noticed by William Jojo <jojowil@hvcc.edu>.
Jeremy.
(This used to be commit fd1999f1d7)
2007-10-10 10:55:59 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
00f6baa15a r3823: Fix bug reported by Tom Dickson <tdickson@inostor.com> with
follow symlinks = no reporting an incorrect error when it should
be access denied.
Jeremy.
(This used to be commit 5a103f4abf)
2007-10-10 10:53:19 -05:00
Jeremy Allison
c0406ae1b0 r3642: Extend vfs to add seekdir/telldir/rewinddir. Yes I know I have to
fix the modules too... First step in fixing out large directories
problem.
Jeremy.
(This used to be commit 344e9dd33a)
2007-10-10 10:53:11 -05:00
Jeremy Allison
3f9bc7fe07 r2152: Fix for bug #1674, move the symlinks checks into reduce_name().
Jeremy.
(This used to be commit 341771857f)
2007-10-10 10:52:33 -05:00
Jeremy Allison
27dedb3b9d r1866: Fix for bug #1602 reported by <m.proehl@science-computing.de>.
Access to a share with
wide links = No
follow symlinks = No
Was failing with access denied.
Jeremy.
(This used to be commit c137accb25)
2007-10-10 10:52:22 -05:00
Jeremy Allison
fddef6fc20 r1115: Fix for #1427. Catch bad path errors at the right point. Ensure all
our pathname parsing is consistent.
Jeremy.
(This used to be commit 5e8237e306)
2007-10-10 10:51:56 -05:00
Jeremy Allison
cb03592c06 r933: When using widelinks = no, use realpath to canonicalize the
connection path on connection create for the user. We'll be
checking all symlinked paths are below this directory.
Jeremy.
(This used to be commit b562fe9fbc)
2007-10-10 10:51:50 -05:00
Jeremy Allison
cddd47d2cd r658: Oops - make smbclient work again with widelinks = no :-).
Jeremy.
(This used to be commit a697941706)
2007-10-10 10:51:33 -05:00
Jeremy Allison
89db7e1001 r656: Make widelinks use realpath(). Tidy up cases where we need to become a service.
Jeremy.
(This used to be commit a03b6a05e0)
2007-10-10 10:51:33 -05:00
Tim Potter
848b86290d r421: Fix debug message. Closes bugzilla #1305.
(This used to be commit 6654b03cbd)
2007-10-10 10:51:23 -05:00
Jeremy Allison
48eb635f31 Several mb tidyups - getting ready to address the XXX_sub function.
Jeremy.
(This used to be commit 92c3ae3458)
2004-03-05 22:32:45 +00:00
Jeremy Allison
893d5eba5d all_string_sub() is broken as it doesn't handle mb chars correctly (and
so breaks when substitution '/' and '\'). It's used by unix_clean_name(),
which is used by reduce_name, which is used by check_name() (phew!).
Now that we know all filenames passed to check_name() are in a "good"
format (no double slashes, all '\\' chars translated to '/' etc.) due
to the new check_path_syntax() we can avoid calling reduce_name unless
widelinks are denied. After this check-in I can fix all_string_sub() to
handle mb chars correctly as it won't be in the direct path in the
main path handling code.
Jeremy.
(This used to be commit 6080186fc4)
2004-03-05 01:37:12 +00:00
Jeremy Allison
0d44747df9 Patch based on work from James Peach <jpeach@sgi.com> to convert over to
using pread/pwrite. Modified a little to ensure fsp->pos is correct.
Fix for #889.
Jeremy.
(This used to be commit 019aaaf0df)
2004-01-06 01:22:14 +00:00
Jeremy Allison
94f59f5492 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
(This used to be commit f35e9a8b90)
2003-09-05 19:59:55 +00:00
Jeremy Allison
a83bac7571 Shadow copy API - Original work by "Ken Cross" <kcross@nssolutions.com>, adapted
into a patch by "Stefan (metze) Metzmacher" <metze@metzemix.de>.
Jeremy.
(This used to be commit ce5c91d35d)
2003-08-07 21:47:46 +00:00
Jeremy Allison
6fe5940109 Added EA operations to VFS layer.
Jeremy.
(This used to be commit 024de9213e)
2003-06-06 00:04:27 +00:00
Simo Sorce
9e9849c0ee add metze's patch for smb_register functions
(This used to be commit 1480c7e8c7)
2003-05-16 06:20:57 +00:00
Alexander Bokovoy
bc2a3748e9 Prefix VFS API macros with SMB_ for consistency and to avoid problems with VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out
(This used to be commit c2689ed118)
2003-05-14 10:59:01 +00:00
Alexander Bokovoy
c9bfb7660b Eliminate NULL pointers from VFS interface. All hooks now really callable, producing either correct result or returning error if the feature isn't supported in the configuration
(This used to be commit af0a17349e)
2003-05-12 16:03:16 +00:00
Alexander Bokovoy
ed1c7282e4 GCC accepts unnamed initalization of sub-structure. Let's see how AIX behave with this. Previous fix was incorrect.
(This used to be commit 13e1bbd803)
2003-05-12 09:01:50 +00:00
Richard Sharpe
6e4c1e4e4d A small patch from metze to fix builds on some platforms ...
http://lists.samba.org/pipermail/samba-technical/attachments/20030512/0332258a/vfs-fix-01.obj
(This used to be commit 5d643b9d03)
2003-05-12 06:57:32 +00:00
Alexander Bokovoy
e7c8c15888 Fix VFS layer:
1. Finally work with cascaded modules with private data storage per module
2. Convert VFS API to macro calls to simplify cascading
3. Add quota support to VFS layer (prepare to NT quota support)

Patch by Stefan (metze) Metzemacher, with review of Jelmer and me
Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
(This used to be commit 91984ef5ca)
2003-05-11 23:34:18 +00:00
Jelmer Vernooij
d2373e7dce Make the version numbers ints (patch from metze)
(This used to be commit dbe36b4c43)
2003-04-30 23:06:44 +00:00
Jelmer Vernooij
17a3acafa8 Use NTSTATUS as return value for smb_register_*() functions and init_module()
function. Patch by metze with some minor modifications.
(This used to be commit bc4b51bcb2)
2003-04-28 17:48:48 +00:00
Gerald Carter
79d3731d98 * fix segfault when no vfs objects defined
* add "sid=..." to 'net groupmap add'
(This used to be commit e5f6676639)
2003-04-21 19:43:25 +00:00
Jelmer Vernooij
ddf662d118 More merges from HEAD:
- Stephan Kulow's changes (fixing warnings in libsmbclient)
 - VFS modules
 - Seperating libs
(This used to be commit 6e9b780233)
2003-04-16 14:45:11 +00:00
Jeremy Allison
28074d957a Const warning fixes.
Jeremy.
(This used to be commit 30e8ae8e03)
2003-03-03 20:12:37 +00:00
Simo Sorce
df6d278785 untest fix from HEAD/2.2 for wide links parameter bug.
it work properly on 2.2 and the patch apply so I think it should be ok.
(This used to be commit 8498503f1d)
2003-02-02 18:08:37 +00:00
Andrew Bartlett
0ba7c143b3 Merge from HEAD - handle VFS module load failures, change some error returns to
avoid sending NT_STATUS_UNSUCCESSFUL.

Andrew Bartlett
(This used to be commit 7b95151ddc)
2003-01-06 07:40:39 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jeremy Allison
ce4628c199 Fix for 64 bit issues with oplocks and allocation size.
Jeremy.
(This used to be commit 379e719e98)
2002-12-04 03:12:09 +00:00
Jeremy Allison
f735551b9e First cut of new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
This is not 100% the same as what SuSE shipped in their Samba, there is
a crash bug fix, a race condition fix, and a few logic changes I'd like to
discuss with Andreas. Added Andreas to (C) notices for posix_acls.c
Jeremy.
(This used to be commit 40eafb9dde)
2002-10-23 01:22:32 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
127e77e6e3 Sync 3.0 branch with head
(This used to be commit 42615b945e)
2002-08-17 15:27:10 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Jeremy Allison
7d7c594644 Removed HAVE_LIBDL from most places (except system.c). Added checks for
dlopen & friends into configure.in. This should help building on *BSD
where dl*** calls are in libc.
Jeremy
(This used to be commit ac1baba35d)
2002-03-27 03:00:39 +00:00
Jeremy Allison
ffadd471b9 Sync up vfs changes from 2.2.x.
Jeremy.
(This used to be commit ad1e858d8e)
2002-03-19 02:32:39 +00:00
Jim McDonough
b9377e811e Missing comma from systems that have ACLs.
(This used to be commit 96e4282dca)
2002-03-12 16:32:25 +00:00
Jeremy Allison
3bb219161a Added POSIX ACL layer into the vfs.
Jeremy.
(This used to be commit 7d59445b69)
2002-03-12 00:08:08 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Jeremy Allison
427896866a Attempt to fix bugs in write cache code (yes I know it's going away :-).
Jeremy.
(This used to be commit ccda82b457)
2002-01-20 00:04:15 +00:00
Jeremy Allison
3454945146 Getting ready to add UNIX extensions in HEAD also.
Jeremy
(This used to be commit 6210d4aa19)
2002-01-10 00:28:09 +00:00
Jeremy Allison
eb61d92ca7 Re-wrote the guts of the rename_internals code to cope with a reported
bug (renaming name -> name was failing, on W2K it succeeds). Simplified
the common case, did a lot of work to ensure NT error codes are correctly
reported back to client.
Jeremy.
(This used to be commit e6b27f3d80)
2002-01-04 21:11:35 +00:00
Jeremy Allison
a32754589a Don't check space on every extend if strict allocate not set.
Jeremy
(This used to be commit 9391efb38e)
2001-11-12 02:03:44 +00:00
Jeremy Allison
22afba62c9 Fixed allocation bug in database prog. Some format fixes.
Jeremy.
(This used to be commit 9ff6b0c20c)
2001-11-12 01:00:54 +00:00
Jeremy Allison
3343d0281d Added debug in truncate, fixed warning with gcc3.
Jeremy.
(This used to be commit 970ec14b4b)
2001-11-07 23:47:20 +00:00
Tim Potter
fb328c9cc4 Made default vfs ops static so we can use this symbol in actual modules.
(This used to be commit 398ced6eef)
2001-10-24 00:35:55 +00:00
Tim Potter
f0e0dd6507 Renamed vfs_init() to smbd_vfs_init() to allow vfs modules to compile.
(This used to be commit 7c3542ba87)
2001-10-18 00:27:20 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Simo Sorce
61b2794968 move to SAFE_FREE()
(This used to be commit a95943fde0)
2001-09-17 11:25:41 +00:00
Jeremy Allison
7e75921e24 Merge of transfer file code from 2.2, fix for readbraw.
Jeremy.
(This used to be commit c05e794536)
2001-09-04 19:10:30 +00:00
Herb Lewis
717533483b get rid of compiler warnings
(This used to be commit 0768991d04)
2001-08-24 20:32:01 +00:00
Jeremy Allison
d851036d82 Correctly report amount written in debug when allocation space.
Jeremy.
(This used to be commit d1e7cf6073)
2001-08-07 00:36:10 +00:00
Jeremy Allison
f8d9da9983 Fix for getting allocate_file_space to return the correct errno.
Jeremy.
(This used to be commit 298595e8cb)
2001-08-06 19:21:23 +00:00
Jeremy Allison
27bdf594fb Extra debug to see what errno is on write fail.
Jeremy.
(This used to be commit 352a02bf5c)
2001-08-04 00:24:54 +00:00
Jeremy Allison
819a911735 Added "strict allocate" per share parameter. This causes actual on-disk allocation
to be done. Without it just does the ftruncate.
Jeremy.
(This used to be commit 0b052f103e)
2001-08-01 22:13:50 +00:00
Jeremy Allison
9df203f876 Wrapped dlerror() in the same way as the other dlxxx() calls.
Jeremy.
(This used to be commit ed5a1f70c6)
2001-07-06 18:45:59 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
e2ced932db Ensured all the system calls in msdfs.c go through the vfs layer.
Added vfs calls to symlink() and readlink() with appropriate configure
checks.
Jeremy.
(This used to be commit c24e6b41ea)
2001-06-29 22:32:24 +00:00
Jeremy Allison
53850c51ca configure:
configure.in:
include/config.h.in:
include/profile.h:
smbd/vfs-wrap.c:
smbd/vfs.c:
Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway).
smbd/dosmode.c:
smbd/files.c:
printing/printfsp.c:
smbd/close.c:
smbd/open.c:
Fixed "dos filemode" correctly so there are no race conditions. Forces test
of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls
standard close function that preserves POSIX locks due to POSIX-me-harder
braindamage. :-). Andrew please review this code.
Also - in removing the tmpdir param in smbrun an extra NULL parameter
was missed in each print_run_command() call (which is a varargs fn.).
Now fixed.
Jeremy.
(This used to be commit 32397e5bc6)
2001-04-14 00:19:12 +00:00
Jeremy Allison
162218259f smbd/posix_acls.c: Sync up with 2.2 changes - don't return deny ACE's.
smbd/vfs.c: Don't call [f]chmod_acl if no acl support.
Jeremy.
(This used to be commit 83f52394e6)
2001-03-26 05:43:04 +00:00
Jeremy Allison
c7a953a318 Added sys_dlopen/sys_dlsym/sys_dlclose.
Jeremy.
(This used to be commit 49f0e7e714)
2001-03-19 07:08:02 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
2f7c1db093 include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added fchmod_acl and chmod_acl.
lib/substitute.c:
smbd/lanman.c:
smbd/open.c:
smbd/process.c:
smbd/reply.c:
smbd/service.c: Removed sessetup_user variable. Added current_user_info struct
which conatins domain info etc. Added '%D' for client domain parameter.
Jeremy.
(This used to be commit 2844ec3d51)
2001-01-23 01:52:30 +00:00
Jeremy Allison
316cfee01c Added OLD_NTDOMAIN to remove warnings about undefined functions.
Jeremy.
(This used to be commit f4c32a75e6)
2000-12-08 19:35:58 +00:00
Jeremy Allison
6f58dd5871 Ok - fixed a bug in our levelII oplock code. We need to break a level II on
a byte range lock (write lock only, but Win2k breaks on read lock also so I
do the same) - if you think about why, this is obvious. Also fixed our client
code to do level II oplocks, if requested, and fixed the code where we would
assume the client wanted level II if it advertised itself as being level II
capable - it may not want that.
Jeremy.
(This used to be commit 213cd0b519)
2000-11-16 00:59:18 +00:00
Jeremy Allison
4bce271e4f Merge from appliance head of JR's changes for driver versioning.
Jeremy.
(This used to be commit cdbd2e9977)
2000-11-14 21:56:32 +00:00
Jeremy Allison
6d36edaf43 Added a VFS version return to init call. Allows smbd to fail an init if
versions don't match.
Jeremy.
(This used to be commit d0fbb4f5d9)
2000-11-06 21:44:33 +00:00
Jeremy Allison
abf055046f Ok - this is a big patch - and it may break smbd a bit (although
I hope not). If you encounter strange file-serving behavior after this
patch then back it out. I analysed our stat() usage and realised we
were doing approx. 3 stat calls per open, and 2 per getattr/setattr.
This patch should fix all that. It causes the stat struct returned
from unix_convert() (which now *must* be passed a valid SMB_STRUCT_STAT
pointer) to be passed through into the open code. This should prevent
the multiple stats that were being done so as not to violate layer
encapsulation in the API's.

Herb - if you could run a NetBench test with this code and do a
padc/par syscall test and also run with the current 2.2.0 code
and test the padc/par syscalls I'd appreciate it - you should
find the number of stat calls reduced - not sure by how much.

The patch depends on unix_convert() actually finding the file
and returning a stat struct, or returning a zero'd out stat
struct if the file didn't exist. I believe we can guarentee this
to be the case - I just wasn't confident enough to make this
an assertion before.

Ok ok - I did write this whilst at the Miami conference.....
sometimes you get a little free time at these things :-).

Jeremy.
(This used to be commit 66a5c05ec4)
2000-10-19 02:58:24 +00:00
Jeremy Allison
ba00796e6d Herb's warning fixes. Also the POSIX locking fix.
We now use our own vfs layer to do get/set acl calls (hurrah!).
Jeremy.
(This used to be commit dfe77c7046)
2000-10-06 18:13:52 +00:00
Jeremy Allison
14a8906e8c Inlined many of the vfs_XXX calls as macros for speed.
Jeremy.
(This used to be commit 0811d080ab)
2000-10-06 03:41:48 +00:00
Jeremy Allison
636f146abf Restructuring of vfs layer to include a "this" pointer - can be an fsp or
a conn struct depending on the call.
We need this to have a clean NT ACL call interface.
This will break any existing VFS libraries (that's why this is pre-release
code).
Andrew gets credit for this one :-) :-).

In addition - added Herb's WITH_PROFILE changes - Herb - please examine
the changes I've made to the smbd/reply.c code you added. The original
code was very ugly and I have replaced it with a
START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor.
Please check this compiles ok with the --with-profile switch.
Jeremy.
(This used to be commit b07611f815)
2000-10-06 03:21:49 +00:00
Jeremy Allison
94c63f6ca4 Vector get_nt_acl/set_nt_acl via vfs. POSIX ACL support should be added
above this layer.
Jeremy.
(This used to be commit b90af886a9)
2000-10-05 19:04:41 +00:00
Jeremy Allison
3ad2ee22bb utf-8 and EUC3 patch from Hiroshi Miura Samba User Group Japan staff.
mkdir high bits patch from Robert Dahlem" <Robert.Dahlem@gmx.net>.
jeremy.
(This used to be commit b40191d271)
2000-10-03 02:12:14 +00:00
Jeremy Allison
b43b2e4f8a Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector them
through the VFS. All file access/directory access code in smbd should now
go via the vfs. Added vfs_chown/vfs_chmod calls. Still looking at vfs_get_nt_acl()
vfs_set_nt_acl() call API design.
Jeremy.
(This used to be commit f96625ec12)
2000-09-27 19:09:59 +00:00
Jeremy Allison
177b962dfe Added vfs_unlink call to ensure vfs is used on unlink from client.
Jeremy.
(This used to be commit 38fc56c843)
2000-08-30 18:33:56 +00:00
Tim Potter
b561c18597 Fixes for various compile warnings on Solaris 8.
(This used to be commit 898a483cda)
2000-07-10 06:41:04 +00:00
Jeremy Allison
652d98c0bc Fix for dual unix_to_dos conversion in readdir from A.V.Shutko <AVShutko@mail.khstu.ru>
Jeremy.
(This used to be commit 1152f2ed00)
2000-05-05 19:57:02 +00:00
Jeremy Allison
ba020b0612 Moved uglyness needed in fcntl locking (64->32 bit mapping, NFS
errors etc.) into locking/posix.c, where it is needed. fcntl_lock in lib/util.c
is now very small and clean.
Added (*lock) op to vfs layer.
Jeremy.
(This used to be commit 46092ee141)
2000-05-02 03:20:47 +00:00
Jeremy Allison
6259f51dd9 This is a *big* checkin that may break some things, but implements the
new open mechanism Andrew & I discussed.

config.sub:
configure: Included the QNX patch.

include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added ftruncate vfs call (needed).

Note that we will also need locking calls in the vfs (to be added).

lib/util_unistr.c:
nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump.
                          Also fix for sidsize DOS bug.

locking/locking.c: Check value of ret before using it for memdup.

printing/printing.c: Convert print_fsp_open to return an allocated fsp.

rpc_server/srv_lsa.c: Fix for NT domain logons.

I have removed all use of lp_share_modes() from the code (although I
left the parameter in the table for backwards compatibility). It no longer makes
sense for this to exist.

smbd/close.c: Removed lp_share_modes().
smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code.
smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail.

smbd/nttrans.c:
smbd/reply.c:
smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/
               open_file_stat to return an fsp from the call.

smbd/open.c: Changed all occurrences of open_file_shared/open_directory/
             open_file_stat to return an fsp from the call.

In addition I have fixed a long standing race condition in the deny mode
processing w.r.t. two smbd's creating a file. Andrew, please note that
your original idea of using open with O_EXCL in this case would not work
(I went over the races very carefully) and so we must re-check deny modes
*after* the open() call returns. This is because there is a race between
the open with O_EXCL and the lock of the share mode entry. Imagine the
case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL,
but is pre-empted before it locks the share modes and creates the deny
mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY
and a deny mode of DENY_NONE and the two opens would be allowed.

The *only* way to fix this race is to lock the share modes after the
open and then do the deny mode checks *after* this lock in the case
where the file did not originally exist.

This code will need extensive testing but seems to initially work.

Jeremy.
(This used to be commit ab0ecc39d6)
2000-04-22 00:33:16 +00:00
Andrew Tridgell
689ec46450 the bulk of the changes to get rid of fd_ptr and move print open
handling to printing/printing.c

most of this was just replacing things like fsp->fd_ptr->fd with fsp->fd

the changes in open.c are quite dramatic. Most of it is removing all
the functions that handled the fd multiplexing
(This used to be commit d1827a3648)
2000-04-10 13:05:23 +00:00
Tim Potter
3b6298b001 Fix some compile warnings.
(This used to be commit ccbd936211)
2000-02-04 05:18:06 +00:00
Tim Potter
ae7696117e Put back lots of missing calls to dos_to_unix(). Thanks to
aono@cc.osaka-kyoiku.ac.jp (Tomoki AONO)
(This used to be commit 176c405d27)
2000-02-03 23:08:24 +00:00
Tim Potter
3d9a9cbe96 Comments to use vfs_* functions instead of dos_* unless really
accessing files on local disk.
(This used to be commit b55f63da7e)
2000-02-03 05:10:09 +00:00
Andrew Tridgell
32a965e09c 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0
(This used to be commit d7b2087865)
1999-12-13 13:35:20 +00:00
Tim Potter
f809734105 Pass VFS options defined in smb.conf to vfs_init() function.
(This used to be commit 8cde172a77)
1999-07-22 04:43:59 +00:00
Tim Potter
025493a3c9 Rewrite of VFS initialisation routines.
(This used to be commit acc1c9e49c)
1999-04-20 03:42:48 +00:00