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

321 Commits

Author SHA1 Message Date
Volker Lendecke
2a78eb9c0d Fix a ton of IBM checker uninitialized variable warnings
SET_STAT_INVALID only sets nlink, not the other fields

We might consider to change SET_STAT_INVALID to always do ZERO_STRUCT
(This used to be commit 8cf8c5b203)
2008-01-22 09:23:34 +01:00
Volker Lendecke
b1017bb551 Free case_state earlier
Found by a "set but never used" warning. Thanks to talloc_tos() this was not
really a bug, but this way the code becomes much clearer.
(This used to be commit b326f11dc3)
2008-01-20 17:44:40 +01:00
Volker Lendecke
896ec68181 NT_STATUS_OBJECT_NAME_NOT_FOUND also means "no streams around :-)"
(This used to be commit 96b9a7b3eb)
2008-01-20 14:44:39 +01:00
Jeremy Allison
0bb6fb7b6f Couple of minor fixes for POSIX pathname processing in the
new stream code. (1) In smbd/filename, don't split the name at
':' if we know it's a posix path (this should be parameterized....).
(2). When calling posix_mkdir, we get the flag FILE_FLAG_POSIX_SEMANTICS
passed to open_directory(). I know for a posix client lp_posix_pathnames
should be true (which is checked for in is_ntfs_stream_name() but we
have an explicit flag here, so let's use it.
Jeremy.
(This used to be commit 7bb7a0def6)
2008-01-19 21:53:49 -08:00
Volker Lendecke
1069cfe4ad Add streams support
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 6022873cc1)
2008-01-19 23:25:36 +01:00
Volker Lendecke
b36a78837f delete on close even prevents stat opens
(This used to be commit 85fe7f3f6e)
2008-01-12 20:11:10 +01:00
Volker Lendecke
4c0ca86051 There's no point in calling FLOCK on a non-existing fd
(This used to be commit 9ff79f231f)
2008-01-12 20:11:10 +01:00
Volker Lendecke
3cc3b9e187 use talloc_tos in a few more places
(This used to be commit 65dd869bea)
2008-01-10 13:19:58 +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
Volker Lendecke
c16a00b0af Replace an uninitialized variable
Reported by the IBM checker
(This used to be commit 48f61e4b9f)
2008-01-09 10:34:27 +01:00
Michael Adam
b2182c11ea Remove redundant parameter fd from SMB_VFS_FCHMOD_ACL().
Michael
(This used to be commit 7b201c177b)
2008-01-08 01:14:24 +01:00
Michael Adam
327cc04da5 Remove redundant parameter fd from SMB_VFS_KERNEL_FLOCK().
Michael
(This used to be commit 195c519377)
2008-01-07 17:14:20 +01: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
670909cb07 Remove redundant parameter fd from SMB_VFS_FCHOWN().
Michael
(This used to be commit fbb193db3e)
2008-01-07 15:59:02 +01:00
Michael Adam
e614dec27f Remove redundant parameter fd from SMB_VFS_FCHMOD().
Michael
(This used to be commit a54d5604da)
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
05352cf2cb Remove superfluous parameter fd from SMB_VFS_FSET_NT_ACL().
Michael
(This used to be commit 4f2d139a18)
2008-01-06 23:08:00 +01:00
Jeremy Allison
c6a2292724 Using a bool with a logical operation. IBM checker caught.
Jeremy.
(This used to be commit 7f9fe7da1e)
2008-01-04 23:17:38 -08:00
Jeremy Allison
9254bb4ef1 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
(This used to be commit c4e5a50504)
2008-01-04 12:56:23 -08:00
Volker Lendecke
31d3f5726a Use NULL instead of 0
"struct security_descriptor" has pointers, not integers inside
(This used to be commit 13158014e3)
2008-01-01 13:13:31 +01:00
Volker Lendecke
33f01360e0 Fix setting the initial permission bits
This fixes a make test failure on Solaris. When creating a new file,
file_set_dosmode() called from open_file_ntcreate calculates a new permission
mask, very likely different from what had been calculated in
open_file_ntcreate. Further down we overwrote the newly calculated value with
SMB_FCHMOD_ACL, ignoring what file_set_dosmode had calculated.

Why did Linux not see this? fchmod_acl on a newly created file without acls
would not retrieve an acl at all, whereas under Solaris acl(2) returns
something even for files with just posix permissions returns something.

Jeremy, given that we have very similar code in 3.0.28 this might also explain
some of the bug reports that people have concerning ACLs on new files.

Volker

P.S: This one took a while to find...
(This used to be commit 2135dfe91b)
2007-12-28 08:52:29 +01:00
Volker Lendecke
250c57ccfb We need to return the correct atime
On systems with nanosecond atime we need to re-stat after messing with the fd,
at least Solaris 10 updates atime after we stat(2)ed the file.
(This used to be commit 6e6ec0a563)
2007-12-26 14:55:57 +01:00
Michael Adam
e47520f222 Remove redundant connection_struct from fd_close() parameter list.
Michael
(This used to be commit 3611cc8561)
2007-12-22 02:01:32 +01:00
Michael Adam
4773973300 Remove redundant connection_struct from fd_close_posix() parameter list.
Michael
(This used to be commit f3365b74ac)
2007-12-22 02:01:32 +01:00
Volker Lendecke
39ea0edbbe separate out create_file_unixpath()
(This used to be commit deaacf971e)
2007-12-11 16:16:54 +01:00
Volker Lendecke
3063f85a72 Move more stuff out of the way
(This used to be commit ae422fce01)
2007-12-11 16:16:54 +01:00
Volker Lendecke
0ac113e5a2 Move INTERNAL_OPEN_ONLY calculation out of the way
(This used to be commit 0e96549b56)
2007-12-11 16:16:54 +01:00
Volker Lendecke
3a9576c724 Increase debug level
(This used to be commit 4e6df55471)
2007-12-10 12:22:01 +01:00
Volker Lendecke
ca4eee5bbe Pass only internal oplock request values to create_file
Other callers (e.g. reply_open_and_X) might have other ideas of the bit
shuffling
(This used to be commit 6a58d823e5)
2007-12-07 14:05:06 +01:00
Volker Lendecke
ce535b4dd8 More parameter shuffling
(This used to be commit 8f70f691ff)
2007-12-07 14:05:06 +01:00
Volker Lendecke
c55e44b6a7 Re-arrange create_file() parameters
This changes them to be a bit closer to open_file_ntcreate and thus provides
less surprises to developers
(This used to be commit d000258b96)
2007-12-07 14:05:05 +01:00
Volker Lendecke
30d31a3f85 Make fname arg to create_file a "const char *"
(This used to be commit da94b5f9e3)
2007-12-07 14:05:05 +01:00
Volker Lendecke
b2ca9253e9 There's no point in passing down a 0
(This used to be commit 525a6887af)
2007-12-05 15:47:32 +01:00
Volker Lendecke
188daba1a7 Move create_file to open.c
I'm checking in this long sequence of micro-checkins for review, the overall
patch from 3b057022a5 to this is not too large.
(This used to be commit 51db8d09a4)
2007-12-05 13:45:12 +01:00
Jeremy Allison
acb829ecc3 Add MAX_DNS_NAME_LENGTH, remove more pstrings.
Jeremy.
(This used to be commit a1725f4ff7)
2007-11-15 18:27:26 -08:00
Jeremy Allison
8f1f2f04c7 Fix some cases where file_set_dosmode was being passed
False instead of NULL. Fix more of the notifications to
be correct for Samba4 RAW-NOTIFY torture (we had missed
one when calling set_ea_dos_attribute().
Jeremy.
(This used to be commit 39d265375c)
2007-10-31 15:45:45 -07: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
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Volker Lendecke
0ebab65706 r25534: Apply some const
Why? It moves these structs from the data into the text segment, so they
will never been copy-on-write copied. Not much, but as in German you say
"Kleinvieh macht auch Mist...."
(This used to be commit 0141e64ad4)
2007-10-10 12:31:12 -05:00
Jeremy Allison
152a1f4a7d r25391: Fix bug #4978 : Store DOS Attributes fails when copying folders.
Jeremy.
(This used to be commit 713277391a)
2007-10-10 12:31:01 -05: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
Volker Lendecke
4ee8b2937d r25055: Add file_id_string_tos
This removes file_id_string_static and file_id_string_static2
(This used to be commit 638c848c9a)
2007-10-10 12:30:36 -05:00
Volker Lendecke
929e1d9920 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05:00
Volker Lendecke
b578db69e9 r24702: Remove the old API pointers
(This used to be commit 17df313db4)
2007-10-10 12:30:14 -05:00
Stefan Metzmacher
4b15f31f10 r24120: add a file_id_create() hook into the VFS layer
it's needed for some cluster filesystems to
overload this function.

metze
(This used to be commit cdaa24e804)
2007-10-10 12:29:08 -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
5391750ce6 r23725: Remove get_current_mid()
Jeremy, next one to review :-)
(This used to be commit a50555dda7)
2007-10-10 12:23:49 -05:00
Volker Lendecke
0bc56a2e5f r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_request
that contains some of the fields from the SMB header, removing the need
to access inbuf directly. This right now is used only in the open file
code & friends, and creating that header is only done when needed. This
needs more work, but it is a start.

Jeremy, I'm only checking this into 3_0, please review before I merge it
to _26.

Volker
(This used to be commit ca988f4e79)
2007-10-10 12:23:48 -05:00
Volker Lendecke
075a5dfdc4 r23375: Fix a 64-bit warning
(This used to be commit c592b562fa)
2007-10-10 12:23:11 -05:00