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

767 Commits

Author SHA1 Message Date
Tim Prouty
258952aa85 s3: Plumb smb_filename through SMB_VFS_UNLINK 2009-07-06 15:38:36 -07:00
Tim Prouty
5a09ba460c s3: Plumb smb_filename through SMB_VFS_RENAME 2009-07-06 15:38:29 -07:00
Stefan Metzmacher
8b94eb6cc8 s3:smbd: push nttrans and trans2 responses with no data to the client
For sync replies it's not a problem, as construct_reply() will send
the response, but for async replies we would not send the reply to the client.
Currently the notify code works arround this manually, so I assume
we didn't have a bug here. But the next commits will simplify
the notify code.

metze
2009-07-02 09:10:59 +02:00
Jeremy Allison
82b5fad8be Ensure we don't use delayed writes on POSIX opened files.
Don't remove pending writetime changes if no time changes
are sent in UNIX_BASIC infolevel.
Jeremy
2009-07-01 17:39:10 -07:00
Jeremy Allison
b971860e01 Fix bug #6520 time stamps - e.g. last mod time is not preserved when "unix extensions=yes" are set - and using latest cifs vfs client
Cancel out any pending "sticky" writes or "last write" changes when
doing a UNIX info level set.
Jeremy.
2009-07-01 16:58:14 -07:00
Tim Prouty
6395bc55db s3: pass a valid stat into file_ntimes()
file_ntimes() calls can_write_to_file() which expects a valid stat struct
2009-06-25 18:40:32 -07:00
Tim Prouty
358ccc3282 s3: Change set_ea() and its callers to use smb_filename 2009-06-25 18:25:47 -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
Jeremy Allison
34267482d5 Replace the boilerplate calls to :
resolve_dfspath() -> unix_convert() -> get_full_smb_filename() -> check_name()
with a new function filename_convert().
This restores the check_name() calls that had gone missing
since the default create_file was changed. All "standard"
pathname processing now goes through filename_convert().
I'll take a look at the non-standard pathname processing
next. As a benefit, fixed a missing resolve_dfspath()
in the trans2 mkdir call.
Jeremy.
2009-06-18 13:13:38 -07:00
Jeremy Allison
9b30c5c145 Fix msdfs after the change to smb_filename struct. We must *always*
pull the pathname, then call resolve_dfspath(), before unix_convert().
Jeremy.
2009-06-16 17:23:54 -07:00
Tim Prouty
04afa4b6b5 s3: Plumb smb_filename through SMB_VFS_CREATE_FILE 2009-06-12 16:14:50 -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
Tim Prouty
6088e554f5 s3: Make all callers of SMB_VFS_CREATEFILE call unix_convert first
This step is a requirement to change SMB_VFS_CREATEFILE to take an
smb_filename struct.
2009-06-10 13:13:26 -07:00
Stefan Metzmacher
356f0336e5 s3:smbd: move some session specific globals to struct smbd_server_connection
metze
2009-06-03 17:54:37 +02:00
Jeremy Allison
ff736dfcad Fix bug #6421 - POSIX read-only open fails on read-only shares.
The change to smbd/trans2.c opens up
SETFILEINFO calls to POSIX_OPEN only. The change to first smbd/open.c closes 2
holes that would have been exposed by allowing POSIX_OPENS on readonly shares,
and their ability to set arbitrary flags permutations. The O_CREAT ->
O_CREAT|O_EXCL change removes an illegal combination (O_EXCL without O_CREAT)
that previously was being passed down to the open syscall.
Jeremy.
2009-05-30 13:28:03 -07:00
Volker Lendecke
dd0506d15d Attempt to fix the build on NetBSD 2009-05-26 23:20:34 +02:00
Volker Lendecke
447515efaa Fix some nonempty blank lines 2009-05-26 21:07:44 +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
Volker Lendecke
5302db6326 TALLOC_FREE happily lives with a NULL ptr. Tim, please check!
Thanks,

Volker
2009-05-24 22:13:07 +02:00
Jeremy Allison
8c39931eb3 Ensure we return NT_STATUS_FILE_IS_A_DIRECTORY on a posix open on a
directory name.
Jeremy.
2009-05-22 15:55:27 -07:00
Tim Prouty
c1a21d085d s3: Change unix_convert (and its callers) to use struct smb_filename
This is the first of a series of patches that change path based
operations to operate on a struct smb_filename instead of a char *.
This same concept already exists in source4.

My goals for this series of patches are to eventually:

1) Solve the stream vs. posix filename that contains a colon ambiguity
   that currently exists.
2) Make unix_convert the only function that parses the stream name.
3) Clean up the unix_convert API.
4) Change all path based vfs operation to take a struct smb_filename.
5) Make is_ntfs_stream_name() a constant operation that can simply
   check the state of struct smb_filename rather than re-parse the
   filename.
6) Eliminate the need for split_ntfs_stream_name() to exist.

My strategy is to start from the inside at unix_convert() and work my
way out through the vfs layer, call by call.  This first patch does
just that, by changing unix_convert and all of its callers to operate
on struct smb_filename.  Since this is such a large change, I plan on
pushing the patches in phases, where each phase keeps full
compatibility and passes make test.

The API of unix_convert has been simplified from:

NTSTATUS unix_convert(TALLOC_CTX *ctx,
		      connection_struct *conn,
		      const char *orig_path,
		      bool allow_wcard_last_component,
		      char **pp_conv_path,
		      char **pp_saved_last_component,
		      SMB_STRUCT_STAT *pst)
to:

NTSTATUS unix_convert(TALLOC_CTX *ctx,
		      connection_struct *conn,
		      const char *orig_path,
		      struct smb_filename *smb_fname,
		      uint32_t ucf_flags)

Currently the smb_filename struct looks like:

struct smb_filename {
       char *base_name;
       char *stream_name;
       char *original_lcomp;
       SMB_STRUCT_STAT st;
};

One key point here is the decision to break up the base_name and
stream_name.  I have introduced a helper function called
get_full_smb_filename() that takes an smb_filename struct and
allocates the full_name.  I changed the callers of unix_convert() to
subsequently call get_full_smb_filename() for the time being, but I
plan to eventually eliminate get_full_smb_filename().
2009-05-20 17:40:15 -07:00
Aravind Srinivasan
1718e803dc s3: Always allocate memory in dptr_ReadDirName
This is a follow up to 69d61453df to
adjust the API to allow the lower layers allocate memory.  Now the
memory can explicitly be freed rather than relying on talloc_tos().

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-05-18 21:50:07 -07:00
Andrew Bartlett
f28f113d8e Rework Samba3 to use new libcli/auth code (partial)
This commit is mostly to cope with the removal of SamOemHash (replaced
by arcfour_crypt()) and other collisions (such as changed function
arguments compared to Samba3).

We still provide creds_hash3 until Samba3 uses the credentials code in
netlogon server

Andrew Bartlett
2009-04-14 16:23:35 +10:00
Jeremy Allison
202228d48b Ensure we never enter VFS_CREATE without having initialized
sbuf as invalid (if not already read via stat()). Still trying
to find the build farm RAW-STREAM errors and it's happening
in a openX call....
Jeremy.
2009-03-25 21:48:37 -07:00
Stefan Metzmacher
c16c90a1cb s3:smbd: use new simplified snb_signing code in the server
We keep the seqnum/mid mapping in the smb_request structure.

This also moves one global variable into the
smbd_server_connection struct.

metze
2009-03-23 12:21:13 +01:00
Jeremy Allison
bfc7ec9e4a Make test for open modes more robust against other bits.
Jeremy.
2009-02-25 13:00:44 -08:00
Jeremy Allison
3d7cde5dd3 Fix bug in processing of open modes in POSIX open.
Was missing case of "If file exists open. If file doesn't exist error."
Damn damn damn. CIFSFS client will have to have fallback cases
for this error for a long time.
Jeremy.
2009-02-25 12:53:45 -08:00
Jeremy Allison
ebe1aa9340 Allow set attributes on a stream fnum to be redirected to the base filename.
Fixes the new RAW-STREAMS torture test.
Jeremy.
2009-02-24 18:03:49 -08:00
Zack Kirsch
813273c87e Add VFS ops for Windows BRL: Lock, Unlock and Cancel:
This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS,
BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically:

* I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to
  *_default as the default implementations of the VFS ops.
* The blocking_lock_record (BLR) is now passed into the brl_lock_windows and
  brl_cancel_windows paths. The Onefs implementation uses it - future
  implementations may find it useful too.
* Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a
  lock_struct and call either the Posix or Windows lock function. These happen
  to be the same for the default implementation.
* Added helper functions: increment_current_lock_count() and
  decrement_current_lock_count().
* Minor spelling correction in brl_timeout_fn: brl -> blr.
* Changed blocking_lock_cancel() to return the BLR that it has cancelled. This
  allows us to assert its the lock that we wanted to cancel. If this assert ever
  fires, this path will need to take in the BLR to cancel, rather than choosing
  on its own.
* Adds a small helper function: find_blocking_lock_record_by_id(). Used by the
  OneFS implementation, but could be useful for others.
2009-02-13 10:08:40 -08:00
Steven Danneman
6272f4c2f4 s3: Added SMB_VFS_INIT_SEARCH_OP to initialize data at the beginning of SMB search requests.
By default this VFS call is a NOOP, but the onefs vfs module takes advantage
of it to initialize direntry search caches at the beginning of each
TRANS2_FIND_FIRST, TRANS2_FIND_NEXT, SMBffirst, SMBsearch, and SMBunique
2009-02-09 23:56:17 -08:00
todd stecher
54c51a66e3 S3: New module interface for SMB message statistics gathering
This changelist allows for the addition of custom performance
monitoring modules through smb.conf. Entrypoints in the main message
processing code have been added to capture the command, subop, ioctl,
identity and message size statistics.
2009-02-09 13:23:44 -08:00
Tim Prouty
b8f7cdbd79 s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is
returned to the client.
2009-01-29 15:29:33 -08:00
todd stecher
48b0016cff Extend NTIMES to allow setting create_time
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.
2009-01-23 21:05:38 -08:00
Michael Adam
39ec8791f8 s3: make better use of ccache by not including version.h in every C-file.
version.h changes rather frequently. Since it is included via includes.h,
this means each C file will be a cache miss. This applies to the following
situations:

* When building a new package with a new Samba version

* building in a git branch after calling mkversion.sh
  after a new commit (i.e. virtually always)

This patch improves the situation in the following way:

* remove inlude "version.h" from includes.h

* Use samba_version_string() instead of SAMBA_VERSION_STRING
  in files that use no other macro from version.h instead of
  SAMBA_VERSION_STRING.

* explicitly include "version.h" in those files that use more
  macros from "version.h" than just SAMBA_VERSION_STRING.

Michael
2009-01-15 22:56:01 +01: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
Stefan Metzmacher
9ae0c5e5a7 s3:smbd: make static const in mangle_hash2.c really static const
const char *foo, means a non-const pointer to
a const char.

const char * const foo, means a const pointer to
a const char.

char * const foo, would mean a const pointer to
a non-const char.

metze
2009-01-08 12:22:19 +01:00
Jelmer Vernooij
08259c1c52 Add iconv_convenience argument to size functions. 2009-01-01 04:45:33 +01:00
Volker Lendecke
972295f80a Rename parent_dirname_talloc() to parent_dirname() 2008-12-31 19:33:25 +01:00
Volker Lendecke
70002c1667 Use parent_dirname_talloc instead of parent_dirname in smb_unix_mknod 2008-12-31 19:33:25 +01:00
Tim Prouty
4d02bbbfb4 s3: Fix stream marshalling to return the correct streaminfo status
When there are enough streams on a file to fill up the max_data_count
when responding to a trans2 streaminfo, samba is returning
NT_STATUS_BUFFER_TOO_SMALL.  Windows handles this by returning
NT_STATUS_BUFFER_OVERFLOW while still sending as much of the data that
it can fit into the buffer.  When the windows client sees
BUFFER_OVERFLOW, it retries the streaminfo with a larger buffer (2x).
The windows client starts at 2K and will continue increasing the
buffer size by two until it reaches 64K.  If the streams don't fit in
64K the windows client seems to give up.

This patch fixes marshall_stream_info to overfill the buffer by 1
stream so that send_trans2_replies can properly detect the overflow
and return the correct status.
2008-12-23 00:28:00 -08:00
Jeremy Allison
6eda98dd13 Fix bug #5986 - Editing a stream is broken (rename problems).
Jeremy.
2008-12-19 13:59:12 -08:00
Jeremy Allison
0e723d8f7d Fix bug #5937 - filenames with "*" char hide other files
Jeremy.
2008-12-04 15:35:32 -08:00
Tim Prouty
5844012285 s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argument
This replaces the is_dos_path bool with a more future-proof argument.
The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead
of overridding the oplock_request.
2008-12-03 17:51:44 -08:00
Tim Prouty
08ce060475 s3: Modify direct callers of open_file_ntcreate and open_directory to call SMB_VFS_CREATE_FILE 2008-12-03 17:51:16 -08:00
Tim Prouty
f995a7af2a s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILE
Now unix paths can be differentiated from windows paths so the
underlying create_file implementations can convert paths correctly.
2008-12-03 17:50:37 -08:00
Tim Prouty
f38d7f20a8 s3: Add SMB_VFS_CREATE_FILE to the vfs layer
Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
2008-12-03 17:50:17 -08:00
Stefan Metzmacher
d1d9dc5574 s3:smbd: write times should be set on the base file instead of the stream name
metze
2008-12-01 13:45:55 -08:00
Stefan Metzmacher
4659215a00 s3:smbd: return DELETE_PENDING on path based operations on streams, when the main file was deleted.
metze
2008-12-01 13:35:28 -08:00
Stefan Metzmacher
8edd775244 s3:smbd: construct the correct newname for stream renames
The Windows Explorer creates temporary streams and renames
them later via SFILEINFO_RENAME_INFO. The newname comes
in as ":Stream:$DATA".

metze
2008-12-01 13:31:43 -08:00
Volker Lendecke
4f0661ace8 Fix a debug message, append the correct \n 2008-12-01 17:36:04 +01:00
Volker Lendecke
a790dcbc4e Remove inbuf references from the trans2ioctl code 2008-11-28 10:06:24 +01:00
Volker Lendecke
2719216d60 Consolidate the buffer checks for the reply_trans style functions
This is the one where I found the problem that led to 3.2.5. So if there is one
checkin in the last year that I would like others to review and *understand*,
it is this one :-)

Volker
2008-11-28 09:22:34 +01:00
Volker Lendecke
4a322398c5 Remove an unused variable 2008-11-28 08:23:20 +01:00
Volker Lendecke
114f519233 Fix the offset checks in the trans routines
This fixes a potential crash bug, a client can make us read memory we
should not read. Luckily I got the disp checks right...

Volker
(cherry picked from commit 64a1d80851)
(cherry picked from commit f04c5650a3)
2008-11-27 17:19:01 +01:00
Volker Lendecke
8315677ca3 Do not write into inbuf for the transs request
Instead, fix up the outbuf in send_xx_reply. In those routines, we know
what we are returning.
2008-11-08 10:42:29 +01:00
Volker Lendecke
95d1825a51 Fix a const warning 2008-11-04 21:53:14 +01:00
Volker Lendecke
7808a2594c Remove some inbuf references by adding "cmd" to smb_request 2008-11-02 23:17:01 +01:00
Volker Lendecke
77f52d903f Use "vwv" in trans parsing 2008-11-02 17:46:08 +01:00
Volker Lendecke
2bab73a18d Remove a bunch of direct inbuf references by adding "vwv" to smb_request 2008-11-02 16:58:19 +01:00
Jeremy Allison
54eaf2de74 Get closer to passing S4 RAW-ACLs.
Jeremy.
2008-10-31 18:04:53 -07:00
Jeremy Allison
c783d8a32e Cope with bad trans2mkdir requests from System i QNTC IBM SMB client.
If total_data == 4 Windows doesn't care what values
are placed in that field, it just ignores them.
The System i QNTC IBM SMB client puts bad values here,
so ignore them.
Jeremy.
2008-10-16 21:03:59 -07:00
Jelmer Vernooij
4746f79d50 Use {u,}int64_t instead of SMB_BIG_{U,}INT. 2008-10-14 01:59:36 +02:00
Volker Lendecke
ac126ea818 Use "struct files_struct" for pipes instead of smb_np_struct 2008-10-13 20:59:32 +02:00
Volker Lendecke
c530009401 Pass struct smb_request to file_free
on the way to get rid of chain_fsp
2008-10-13 19:32:38 +02:00
Volker Lendecke
3bbe5e88e5 Pass struct smb_request to file_fsp
The goal is to get rid of the chain_fsp global variable
2008-10-13 19:32:37 +02:00
Jeremy Allison
d275cc762d Fix bug #5783 FindFirst fails where search pattern == mangled filename.
That was an old and subtle bug.
Jeremy.
2008-09-23 15:05:45 -07:00
Jeremy Allison
cb40b1ae83 When requesting UNIX info levels on findfirst/findnext, don't play games with write time,
just return what the underlying filesystem says. Trying not to confuse UNIX apps any more than necessary.
Jeremy.
(This used to be commit b81a4dd003)
2008-09-10 14:54:25 -07:00
Volker Lendecke
d39e9e05ed Fix calculation of useable_space for trans2 and nttrans replies
When alignment was in place, we pretended to send more data/params according to
the param_offset/param_length and data_offset/data_length parameters than would
actually fit into the SMB according to the NBSS length field.
(This used to be commit ef3c132b84)
2008-09-08 23:32:22 +02:00
Jeremy Allison
405b072431 Write times code update.
Ok, here's the fix for the write times breakage
with the new tests in S4 smbtorture.

The key is keeping in the share mode struct
the "old_file_time" as the real write time,
set by all the write and allocation calls,
and the "changed_write_time" as the "sticky"
write time - set by the SET_FILE_TIME calls.

We can set them independently (although I
kept the optimization of not setting the
"old_file_time" is a "changed_write_time"
was already set, as we'll never see it.

This allows us to update the write time
immediately on the SMBwrite truncate case,
SET_END_OF_FILE and SET_ALLOCATION_SIZE calls,
whilst still have the 2 second delay on the
"normal" SMBwrite, SMBwriteX calls.

I think in a subsequent patch I'd like to
change the name of these from "old_file_time"
to "write_time" and "changed_write_time" to
"sticky_write_time" to make this clearer.

I think I also fixed a bug in Metze's original
code in that once a write timestamp had been
set from a "normal" SMBwriteX call the fsp->update_write_time_triggered
variable was set and then never reset - thus
meaning the write timestamp would never get
updated again on subsequent SMBwriteX's.

The new code checks the update_write_time_event
event instead, and doesn't update is there's
an event already scheduled.

Metze especially, please check this over for
your understanding.

Jeremy.
(This used to be commit 6f20585419)
2008-09-05 19:00:48 -07:00
Volker Lendecke
52664f62ba Remove current_user references from trans2.c
This involved replacing the CHECK_NTQUOTA_HANDLE_OK macro by a function.
(This used to be commit 5595cdf837)
2008-06-19 18:51:38 +02:00
Volker Lendecke
e901466061 Remove some current_user references from trans2.c
(This used to be commit 4c31cc0b62)
2008-06-19 18:51:38 +02:00
Volker Lendecke
49ca8efa91 Remove the "current_user" arg from check_fsp
check_fsp only used the vuid struct member anyway, and this is available in the
smb_request structure as well.
(This used to be commit 8d364c4c33)
2008-06-19 18:51:37 +02:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Volker Lendecke
5bda9a8af0 Remove "user" from connection_struct
(This used to be commit 368454a27c)
2008-05-10 11:17:01 +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
Jeremy Allison
85dc0ad7be Rename inherit_access_acl() -> inherit_access_posix_acl() to make use clear.
Jeremy.
(This used to be commit b739c7f1cd)
2008-05-02 12:54:53 -07:00
Jeremy Allison
0173eeb3b5 Fix bug found by Igor Mammedov <niallain@gmail.com> where we are
not returning a directory value for a QPATHINFO on a msdfs link
with a non-dfs path. Windows does this.
Jeremy.
(This used to be commit fbd99071f9)
2008-04-28 15:06:08 -07:00
Jeremy Allison
86e59c50f1 Rewrite the wrap checks to deal with gcc 4.x optimisations.
Karolin, please pull once Volker has reviewed. Thanks.
Jeremy.
(This used to be commit 09852899ca)
2008-04-07 21:11:16 -07:00
Stefan Metzmacher
19f49de92e smbd: make it possible to disable get_file_infos() on searches
metze
(This used to be commit 404a865a34)
2008-04-07 12:29:30 +02:00
Stefan Metzmacher
851cadba51 locking: combine get_delete_on_close_flag() and get_write_time() into get_file_infos()
This means we need to fetch the record only once.

metze
(This used to be commit 4130b87329)
2008-04-07 12:29:29 +02:00
Stefan Metzmacher
d03453864a smbd: implement the strange write time update logic
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 2eab212ea2)
2008-04-07 12:29:26 +02:00
Stefan Metzmacher
2ccf50256e locking: store the write time in the locking.tdb
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 6aaa2ce0ee)
2008-04-07 12:29:25 +02:00
Jeremy Allison
792c972538 Metze pointed out this we don't need FILE_ATTRIBUTE_READ here.
Jeremy.
(This used to be commit 923aa9f330)
2008-03-11 13:59:04 -07:00
Jeremy Allison
bac7b5b19e Try and fix bug #5315, as well as S4 torture tests RAW-OPLOCK BATCH19,
BATCH20 and RAW-RENAME.
Jeremy.
(This used to be commit 9065792d4b)
2008-03-11 13:27:33 -07:00
Jeremy Allison
380fcfa600 Fix S3 to pass the test_raw_oplock_exclusive3 test.
Jeremy.
(This used to be commit 028302fac5)
2008-03-11 12:37:01 -07:00
Volker Lendecke
6a2dbea794 Fix some typos
(This used to be commit cfa1b83814)
2008-03-08 12:31:21 +01:00
Volker Lendecke
14aa57a9e3 Don't use fname after create_file has been called
create_file calls unix_convert internally, so modifies fname. So we can't use
"fname" after create_file has returned. Use fsp->fsp_name instead.

Found during a lengthy debugging session with Karolin testing the xattr_tdb
module...
(This used to be commit 183fe57046)
2008-02-22 17:15:09 +01:00
Volker Lendecke
5398dd641c Fix uninitialized variables
Thanks to Corinna Vinschen
(This used to be commit aba8c17599)
2008-01-26 21:29:18 +01:00
Corinna Vinschen
9051199e40 Get Samba version or capability information from Windows
On Jan 22 13:31, Volker Lendecke wrote:
> On Tue, Jan 22, 2008 at 11:33:17AM +0100, Corinna Vinschen wrote:
> > Right.  I changed samba_gitcommitdate from time_t to NTTIME and shortened
> > samba_version_string to 28 bytes.  New patch below.
>
> Ok, pushed with some modifications. You might want to review
> that.

Reviewed and tested.  Looks good, thank you!

Below you'll find a tiny patch to add the git commit date.  It seems
I simply missed its existence in version.h :(  Tested on Windows XP.

Thanks,
Corinna

	* source/smbd/trans2.c (samba_extended_info_version): Fill out
	samba_gitcommitdate member with GIT commit timestamp.
(This used to be commit a33d079758)
2008-01-22 16:45:25 +01:00
Volker Lendecke
d4d962f691 Move samba_extended_info_version to smbd/trans2.c
This is right now only used there, and in version.c it gave linker errors
because some binaries (e.g. smbmnt) don't link in time.o
(This used to be commit 1f0eaaa591)
2008-01-22 13:00:22 +01:00
Corinna Vinschen
559603ad69 Get Samba version or capability information from Windows
On Jan 21 16:18, Danilo Almeida wrote:
> Corina wrote:
>
> > +	time_t samba_gitcommitdate;
>
> And:
>
> > +   SIVAL(pdata,28,extended_info.samba_gitcommitdate);
> > +   memcpy(pdata+32,extended_info.samba_version_string,32);
>
> Note that you are dropping bits on a system w/64-bit time_t, and that this has the 2038 problem.

Right.  I changed samba_gitcommitdate from time_t to NTTIME and shortened
samba_version_string to 28 bytes.  New patch below.

Thanks,
Corinna
(This used to be commit 28aa1c199d)
2008-01-22 12:39:47 +01:00
Volker Lendecke
a4c2b04a2b Hide streams from the EA API
(This used to be commit e9bb3d5067)
2008-01-22 12:29:02 +01:00
Volker Lendecke
6a69bc3ef9 Fix get_ea_names_from_file for many EAs
Found by the IBM checker
(This used to be commit 8741a9b374)
2008-01-22 09:23:27 +01:00
Volker Lendecke
043a7e1774 Activate SMB_QUERY_FILE_STREAM_INFO
gcolley was right, my nt4 does not blue screen with it
(This used to be commit 9f2b5dc186)
2008-01-20 15:59:31 +01:00
Volker Lendecke
1b976d5192 Add the STREAMINFO vfs call
Based on jpeach's work, modified the streaminfo prototype

Make use of it in trans2.c together with marshall_stream_info()
(This used to be commit c34d729c7c)
2008-01-19 22:58:17 +01:00
Volker Lendecke
84518f1fc7 Add get_ea_names_from_file to sanely list posix xattrs
Refactor get_ea_list_from_file to use that.
(This used to be commit aec357a456)
2008-01-19 16:07:56 +01:00
Volker Lendecke
6d7eb2e6ec Make get_ea_value public
(This used to be commit 0aa406bbba)
2008-01-19 15:50:05 +01:00
Jeremy Allison
ca6cf1fe94 Actually test vl's new code and make it work to fix the build farm :-).
Jeremy.
(This used to be commit 63defd3e9d)
2008-01-18 18:39:27 -08:00
Volker Lendecke
145ab107b2 Always return nlink=1 for directories
I did not test it, but it should not affect cifsfs, there are special posix
calls that also return the stat information unfiltered.
(This used to be commit e96cf1309e)
2008-01-18 17:37:04 -08:00
Alexander Bokovoy
03387a0f58 Remove is_remotestorage() call from VFS. We already have statvfs() there to handle FS capabilities.
As discussed with Volker, it is better to calculate FS capabilities at
connection time. We already do this with help of VFS statvfs() call
which allows to fill-in system-specific attributes including FS
capabilities. So just re-use it if you want to represent additional
capabilities in your modules. The only caution is that you need to
call underlying statvfs() call to actually get system-specific
capabilities (and other fields) added. Then add module-specific ones.
(This used to be commit e342ca0d93)
2008-01-17 16:59:29 +03:00