Age | Commit message (Collapse) | Author | Files | Lines |
|
Rename functions to be internally consistent. Next step is
to cope queueing single (non-compounded) SMB2 requests to
put some code inside the stubs.
Jeremy.
|
|
Jeremy.
|
|
struct current_user current_user;"."
As requested by Volker, split this into smaller commits.
Jeremy.
|
|
Use accessor functions to get to this value. Tidies up much of
the user context code. Volker, please look at the changes in smbd/uid.c
to familiarize yourself with these changes as I think they make the
logic in there cleaner.
Cause smbd/posix_acls.c code to look at current user context, not
stored context on the conn struct - allows correct use of these
function calls under a become_root()/unbecome_root() pair.
Jeremy.
|
|
a directory.
Argh. Missed the second (and essential) part of the fix for the above :-(.
Jeremy
|
|
rights fails even if the delete right is set on the object.
Final fix for the vfs_acl_xattr and vfs_acl_tdb code.
Ensure we can delete a file even if the underlying POSIX
permissions don't allow it, if the Windows permissions do.
Jeremy.
|
|
calls are now handle based. Put rmdir into close.c
and make it private.
Jeremy.
|
|
|
|
Step 0 to restore it as a per-share paramter
|
|
BASE-DELAYWRITE and also RAW-CLOSE.
Jeremy.
|
|
the logic. This was incorrect (I'll revisit this tomorrow).
Jeremy.
|
|
set_close_write_time().
We were treating a file time set on close as a sticky write time set, and I don't
think it is. I will add a torture test later to RAW-CLOSE to confirm this.
Jeremy.
|
|
Jeremy.
|
|
"Normal" non truncate writes always cause the timestamp to
be set on close. Once a close is done on a handle this can
reset the sticky write time to current time also.
Updated smbtorture4 confirms this.
Jeremy.
|
|
function vfs_stat_fsp(). Stops code looking at fsp->posix_open
except for exceptional circumstances.
Jeremy.
|
|
metze
|
|
This often times means explicitly denying certain operations on a stream
as they are not supported or don't make sense at a particular level. At
some point in the future these can be enabled, but for now it's better to
remove ambiguity
|
|
|
|
|
|
|
|
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.
|
|
Jeremy.
|
|
Don't ignore the close error of the output file in check_magic()
|
|
|
|
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.
|
|
failure if we have a pending modtime and the containing directory
of the file has been renamed (there is no POSIX "update time by
fd" call). This can't happen on Windows as the rename will fail
if there are open files beneath it. Will add a torture test
for this.
Jeremy.
|
|
Unlinking a file while still holding an oplock can cause problems with
kernel oplocks. This simply releases the oplock before actually
unlinking the file.
|
|
Here is a short description for each of the new capability flags:
KOPLOCKS_LEVEL2_SUPPORTED: Level 2 oplocks are supported natively in
the kernel.
KOPLOCKS_DEFERRED_OPEN_NOTIFICATION: The kernel notifies deferred
openers when they can retry the open.
KOPLOCKS_TIMEOUT_NOTIFICATION: The kernel notifies smbds when an
oplock break times out.
KOPLOCKS_OPLOCK_BROKEN_NOTIFICATION: The kernel notifies smbds when an
oplock is broken.
|
|
1) Add in smb_file_time struct to clarify code and make room for createtime.
2) Get and set create time from SMB messages.
3) Fixup existing VFS modules + examples Some OS'es allow for the
setting of the birthtime through kernel interfaces. This value is
generically used for Windows createtime, but is not settable in the
code today.
|
|
|
|
monyo@samba.gr.jp.
Jeremy.
|
|
Some implementations of SMB_VFS_CREATE_FILE implementations actually
keep an fd open for directories just as files. In this case it is
necessary to call fd_close when closing directories. This is safe
because fd_close is a no-op when fd == -1, which is true for directory
opens originating from open.c (the default SMB_VFS_CREATE_FILE
implementation).
|
|
Restructures parts of open code so that fsp must be allocated before calling
open_file_ntcreate(_internal). Also fix up file ref-counting inside files.c.
Jeremy.
|
|
on the way to get rid of chain_fsp
|
|
Jeremy.
(This used to be commit 7eeed8bb41059ec2bddedb6a71deddeec7f33af2)
|
|
(This used to be commit 368454a27cb53a408ec416cbf37235b304592fb5)
|
|
being (correctly) used in the can_read/can_write checks for hide unreadable/unwritable
and this is more properly done using the functions in smbd/file_access.c.
Preparing to do NT access checks on all file access.
Jeremy.
(This used to be commit 6bfb06ad95963ae2acb67c4694a98282d3b29faa)
|
|
We now never call file_ntimes() directly, every update
is done via smb_set_file_time().
This let samba3 pass the BASE-DELAYWRITE test.
The write time is only updated 2 seconds after the
first write() on any open handle to the current time
(not the time of the first write).
Each handle which had write requests updates the write
time to the current time on close().
If the write time is set explicit via setfileinfo or setpathinfo
the write time is visible directly and a following close
on the same handle doesn't update the write time.
metze
(This used to be commit 2eab212ea2e1bfd8fa716c2c89b2c042f7ba12ea)
|
|
This is needed to implement the strange write time update
logic later. We need to store 2 time timestamps to
distinguish between the time the file system had before
the first client opened the file and a forced timestamp update.
metze
(This used to be commit 6aaa2ce0eeb46f6735ec984a2e7aadde7a7f456d)
|
|
Otherwise we may end up with share mode entry without an open file.
Volker, Jeremy: please check...
metze
(This used to be commit 547eacf6058d2bc5b41b266b70f8f4747aca4eae)
|
|
This is the core of the streams support. The main change is that in
files_struct there is now a base_fsp pointer that holds the main file open
while a stream is open. This is necessary to get the rather strange delete
semantics right: You can't delete the main file while a stream is open without
FILE_SHARE_DELETE, and while a stream is open a successful unlink of the main
file leads to DELETE_PENDING for all further access on the main file or any
stream.
(This used to be commit 6022873cc155bdbbd3fb620689715f07a24d6ed1)
|
|
Guenther
(This used to be commit 88874a501d0c086f796e4838af8c9399d3cccc1f)
|
|
a bunch of syscalls on close. Noticed by Volker.
Jeremy.
(This used to be commit 3caeeaea162e2083a087c242b850c107a3be1bf9)
|
|
(This used to be commit 65dd869bea351010c67f02046ae4134bdada1a4c)
|
|
Michael
(This used to be commit cebaa483e62910ac3f87cd135b2aff18dc880416)
|
|
Michael
(This used to be commit 3611cc8561cf837adea83fc7c16ca7535f188466)
|
|
metze
(This used to be commit e186b60afacfb609968b581a6d32757e1885a319)
|
|
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 f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
|
|
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
|
|
Jeremy.
(This used to be commit 7632f8fb4003657591778d2b55f546d1737859d1)
|