1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-23 20:23:50 +03:00
Commit Graph

316 Commits

Author SHA1 Message Date
Volker Lendecke
85fe7f3f6e delete on close even prevents stat opens 2008-01-12 20:11:10 +01:00
Volker Lendecke
9ff79f231f There's no point in calling FLOCK on a non-existing fd 2008-01-12 20:11:10 +01:00
Volker Lendecke
65dd869bea use talloc_tos in a few more places 2008-01-10 13:19:58 +01:00
Jeremy Allison
bc932b8ad4 Make use of talloc_pool in the main codepaths. Remove the sub-contexts.
Jeremy.
2008-01-09 17:11:04 -08:00
Volker Lendecke
48f61e4b9f Replace an uninitialized variable
Reported by the IBM checker
2008-01-09 10:34:27 +01:00
Michael Adam
7b201c177b Remove redundant parameter fd from SMB_VFS_FCHMOD_ACL().
Michael
2008-01-08 01:14:24 +01:00
Michael Adam
195c519377 Remove redundant parameter fd from SMB_VFS_KERNEL_FLOCK().
Michael
2008-01-07 17:14:20 +01:00
Michael Adam
2ad66050a0 Remove redundant parameter fd from SMB_VFS_FTRUNCATE().
Michael
2008-01-07 15:59:02 +01:00
Michael Adam
fbb193db3e Remove redundant parameter fd from SMB_VFS_FCHOWN().
Michael
2008-01-07 15:59:02 +01:00
Michael Adam
a54d5604da Remove redundant parameter fd from SMB_VFS_FCHMOD().
Michael
2008-01-07 15:59:02 +01:00
Michael Adam
0b86c420be Remove redundant parameter fd from SMB_VFS_FSTAT().
Michael
2008-01-07 15:59:01 +01:00
Michael Adam
4f2d139a18 Remove superfluous parameter fd from SMB_VFS_FSET_NT_ACL().
Michael
2008-01-06 23:08:00 +01:00
Jeremy Allison
7f9fe7da1e Using a bool with a logical operation. IBM checker caught.
Jeremy.
2008-01-04 23:17:38 -08:00
Jeremy Allison
c4e5a50504 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.
2008-01-04 12:56:23 -08:00
Volker Lendecke
13158014e3 Use NULL instead of 0
"struct security_descriptor" has pointers, not integers inside
2008-01-01 13:13:31 +01:00
Volker Lendecke
2135dfe91b 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...
2007-12-28 08:52:29 +01:00
Volker Lendecke
6e6ec0a563 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.
2007-12-26 14:55:57 +01:00
Michael Adam
3611cc8561 Remove redundant connection_struct from fd_close() parameter list.
Michael
2007-12-22 02:01:32 +01:00
Michael Adam
f3365b74ac Remove redundant connection_struct from fd_close_posix() parameter list.
Michael
2007-12-22 02:01:32 +01:00
Volker Lendecke
deaacf971e separate out create_file_unixpath() 2007-12-11 16:16:54 +01:00
Volker Lendecke
ae422fce01 Move more stuff out of the way 2007-12-11 16:16:54 +01:00
Volker Lendecke
0e96549b56 Move INTERNAL_OPEN_ONLY calculation out of the way 2007-12-11 16:16:54 +01:00
Volker Lendecke
4e6df55471 Increase debug level 2007-12-10 12:22:01 +01:00
Volker Lendecke
6a58d823e5 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
2007-12-07 14:05:06 +01:00
Volker Lendecke
8f70f691ff More parameter shuffling 2007-12-07 14:05:06 +01:00
Volker Lendecke
d000258b96 Re-arrange create_file() parameters
This changes them to be a bit closer to open_file_ntcreate and thus provides
less surprises to developers
2007-12-07 14:05:05 +01:00
Volker Lendecke
da94b5f9e3 Make fname arg to create_file a "const char *" 2007-12-07 14:05:05 +01:00
Volker Lendecke
525a6887af There's no point in passing down a 0 2007-12-05 15:47:32 +01:00
Volker Lendecke
51db8d09a4 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.
2007-12-05 13:45:12 +01:00
Jeremy Allison
a1725f4ff7 Add MAX_DNS_NAME_LENGTH, remove more pstrings.
Jeremy.
2007-11-15 18:27:26 -08:00
Jeremy Allison
39d265375c 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.
2007-10-31 15:45:45 -07:00
Jeremy Allison
f35a266b3c 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.
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
5c6c8e1fe9 [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. 2007-10-10 15:34:30 -05:00
Volker Lendecke
0141e64ad4 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...."
2007-10-10 12:31:12 -05:00
Jeremy Allison
713277391a r25391: Fix bug #4978 : Store DOS Attributes fails when copying folders.
Jeremy.
2007-10-10 12:31:01 -05:00
Jeremy Allison
7f0db75fb0 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.
2007-10-10 12:30:41 -05:00
Volker Lendecke
638c848c9a r25055: Add file_id_string_tos
This removes file_id_string_static and file_id_string_static2
2007-10-10 12:30:36 -05:00
Volker Lendecke
6585ea2cb7 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
2007-10-10 12:30:24 -05:00
Volker Lendecke
17df313db4 r24702: Remove the old API pointers 2007-10-10 12:30:14 -05:00
Stefan Metzmacher
cdaa24e804 r24120: add a file_id_create() hook into the VFS layer
it's needed for some cluster filesystems to
overload this function.

metze
2007-10-10 12:29:08 -05:00
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Volker Lendecke
a50555dda7 r23725: Remove get_current_mid()
Jeremy, next one to review :-)
2007-10-10 12:23:49 -05:00
Volker Lendecke
ca988f4e79 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
2007-10-10 12:23:48 -05:00
Volker Lendecke
c592b562fa r23375: Fix a 64-bit warning 2007-10-10 12:23:11 -05:00
Volker Lendecke
9b10dbbd5d r23183: Check in a change made by Tridge:
This replaces the internal explicit dev/ino file id representation by a
"struct file_id". This is necessary as cluster file systems and NFS
don't necessarily assign the same device number to the shared file
system. With this structure in place we can now easily add different
schemes to map a file to a unique 64-bit device node.

Jeremy, you might note that I did not change the external interface of
smb_share_modes.c.

Volker
2007-10-10 12:22:52 -05:00
Jeremy Allison
0a7d8362be r23151: Re-arrange the logic so it looks identical to the
"file existed" case above. This has no functional
change but is easier to see that it's doing the
same thing.
Jeremy.
2007-10-10 12:22:49 -05:00
Jeremy Allison
9b9513856e r23150: Fix Samba3 in the build farm again. In the case where the
file was being created and we go into the race condition check,
we were testing for compatible open modes, but were not breaking
oplocks in the same way as if the file existed. This meant that
we weren't going into the code path that sets fsp->oplock = FAKE_LEVEL_II_OPLOCK
if the client didn't ask for an oplock on file create. We need
to do this as internally it's what Windows does.
Jeremy.
2007-10-10 12:22:49 -05:00
Jeremy Allison
a301467d5f r23100: Implement the delete on close semantics I've just tested for
in Samba4 smbtorture. Fix rename on an open file handle.
Needed for 3.0.25a.
Jeremy.
2007-10-10 12:22:46 -05:00
Jeremy Allison
f546750176 r23087: Fix POSIX setfilepathinfo to use lstat, not stat.
Still missing lchown (will add this for 3.0.26).
Don't merge for 3.0.25a - possibly 3.0.25b (if it
exists).
Jeremy.
2007-10-10 12:22:44 -05:00