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

283 Commits

Author SHA1 Message Date
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
Volker Lendecke
e8156439f2 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
(This used to be commit 9b10dbbd5d)
2007-10-10 12:22:52 -05:00
Jeremy Allison
f3de07503a 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.
(This used to be commit 0a7d8362be)
2007-10-10 12:22:49 -05:00
Jeremy Allison
4c795b293d 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.
(This used to be commit 9b9513856e)
2007-10-10 12:22:49 -05:00
Jeremy Allison
dbfd6bf8c8 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.
(This used to be commit a301467d5f)
2007-10-10 12:22:46 -05:00
Jeremy Allison
828cb24004 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.
(This used to be commit f546750176)
2007-10-10 12:22:44 -05:00
Volker Lendecke
81acb2d805 r22942: Some message_register -> messaging_register conversions
(This used to be commit 65335a4206)
2007-10-10 12:22:10 -05:00
Volker Lendecke
fad7dd8a60 r22868: Replace some message_send_pid calls with messaging_send_pid calls. More
tomorrow.
(This used to be commit 74fa57ca5d)
2007-10-10 12:22:04 -05:00
Volker Lendecke
e6383f4762 r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch.
This changes "struct process_id" to "struct server_id", keeping both is
just too much hassle. No functional change (I hope ;-))

Volker
(This used to be commit 0ad4b1226c)
2007-10-10 12:21:52 -05:00
Jeremy Allison
1f56aabf90 r21665: Fix bug #4428 reported by Jason Mader <jason@ncac.gwu.edu>.
Jeremy.
(This used to be commit fe00771df5)
2007-10-10 12:18:23 -05:00
Jeremy Allison
a9dbdf937c r21480: Make fd_open match fd_close be translating
errno into an NTSTATUS immediately.
Jeremy.
(This used to be commit 71dd02cc16)
2007-10-10 12:18:07 -05:00
Volker Lendecke
d9a29aade0 r21279: Get rid of 'aio write behind', this is broken.
It should probably better be integrated with our write cache.

Volker
(This used to be commit 58bfd168b0)
2007-10-10 12:17:53 -05:00
Jeremy Allison
7a5fa7f12e r21191: Add in the POSIX open/mkdir/unlink calls.
Move more error code returns to NTSTATUS.
Client test code to follow... See if this
passes the build-farm before I add it into
3.0.25.
Jeremy.
(This used to be commit 83dbbdff34)
2007-10-10 12:17:47 -05:00
Volker Lendecke
69d8c5ae5f r21115: notify_internal.c needs to remove the table entry if a process has crashed. So
it needs the specific error message.

Make messages.c return NTSTATUS and specificially NT_STATUS_INVALID_HANDLE if
sending to a non-existent process.

Volker
(This used to be commit 3f620d181d)
2007-10-10 12:17:39 -05:00
Volker Lendecke
9974656d3b r21093: Remove the hash and dnotify backends. Disabling FAM for this checkin, I'm
working on that right now.

Volker
(This used to be commit 01c9fb1728)
2007-10-10 12:17:36 -05:00
Volker Lendecke
547f77778a r21087: Make the param list of notify_fname match notify_trigger
(This used to be commit defa28f9c3)
2007-10-10 12:17:34 -05:00
Volker Lendecke
caf8c6a76b r21064: The core of this patch is
void message_register(int msg_type,
                      void (*fn)(int msg_type, struct process_id pid,
-                                void *buf, size_t len))
+                                void *buf, size_t len,
+                                void *private_data),
+                     void *private_data)
 {
        struct dispatch_fns *dfn;

So this adds a (so far unused) private pointer that is passed from
message_register to the message handler. A prerequisite to implement a tiny
samba4-API compatible wrapper around our messaging system. That itself is
necessary for the Samba4 notify system.

Yes, I know, I could import the whole Samba4 messaging system, but I want to
do it step by step and I think getting notify in is more important in this
step.

Volker
(This used to be commit c8ae60ed65)
2007-10-10 12:17:32 -05:00
Jeremy Allison
c9a14ea19f r20883: W00t! I now understand how "delete on close" really
works - even with the strange "initial delete on close"
semantics. The "initial delete on close" flag isn't
committed to the share mode db until the handle is
closed, and is discarded if any real "delete on close"
was set. This allows me to remove the "initial_delete_on_close"
flag from the share db, and move it into a BOOL in files_struct.
Warning ! You must do a make clean after this. Cope with
the wrinkle in directory delete on close which is done
differently from files. We now pass all Samba4 smbtortute
BASE-DELETE tests except for the one checking that files
can't be created in a directory which has the delete on
close set (possibly expensive to fix).
Jeremy.
(This used to be commit f2df77a149)
2007-10-10 12:17:18 -05:00
Jeremy Allison
fd37f98158 r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.
Allow us to correctly refuse to set delete on close on a
non-empty directory. There are still some delete-on-close
wrinkles to be fixed, but I understand how to do that better
now. I'll fix this tomorrow.
Jeremy.
(This used to be commit 0296358858)
2007-10-10 12:17:16 -05:00
Volker Lendecke
940192ddcc r20854: Ok, now I think we're at a point where looking at notify starts to make sense
again :-)

Volker
(This used to be commit 5533cdeec1)
2007-10-10 12:17:13 -05:00
Jeremy Allison
60c1a8e5a8 r20845: Somehow I missed this one - should have been part of the
previous commit :-(.
Jeremy.
(This used to be commit 8fe3829e8a)
2007-10-10 12:17:13 -05:00
Volker Lendecke
46fdae1b6b r20634: A *LOT* more work is necessary before touching notify remotely starts to make
sense. Until then, remove it from the tree to keep the diff between 3_0_24 and
3_0 small.

Volker
(This used to be commit f146a85e74)
2007-10-10 12:17:00 -05:00
Volker Lendecke
92d02f7afe r20451: Survive the first of the filter-tests (mkdir).
Add lots of TODOs :-)

Volker
(This used to be commit 0e953884a1)
2007-10-10 12:16:50 -05:00
Volker Lendecke
165f5f3f40 r20433: Work in progress: Survive more of RAW-NOTIFY.
call_nt_transact_notify_change() is now sync if there are changes around.

A notify_message does a direct reply from within the message, so
process_pending_change_notify_queue is not needed anymore for samba-generated
events. Next step is to restructure the kernel-mechanisms to generate
messages.

Volker
(This used to be commit c813f71d00)
2007-10-10 12:16:49 -05:00
Volker Lendecke
98c082489b r20394: This is a *VERY* early start of my work on notify.
Checking in because Jeremy was bugging me. Potentially this becomes quite
intrusive, I'm not sure if I should open a temporary branch for this.

Jeremy, Jerry, do you think 3_0 is the right place for this?

Volker
(This used to be commit bcf5c751cb)
2007-10-10 12:16:46 -05:00
Volker Lendecke
8cd9636458 r20356: Consolidate the calls to parent_dirname() per open to one.
This involved passing the dirname as argument to a few routines instead of
calling parent_dirname() deep down.

Volker
(This used to be commit 7977fd7865)
2007-10-10 12:16:43 -05:00
Volker Lendecke
e8e5c17f2e r20344: Move the calls to inherit_access_acls and change_owner_to_parent together.
Jeremy, I'm 100% sure you watch me closely here, I count on you :-)

Volker
(This used to be commit 02f85265f2)
2007-10-10 12:16:43 -05:00
Volker Lendecke
a67757ef9c r20343: Split change_owner_to_parent fd-based (for file opens) and a name-based (for
directory opens) routines.

Volker
(This used to be commit 4ca921d9aa)
2007-10-10 12:16:43 -05:00
Volker Lendecke
4e5a335c07 r20342: Move the lstat into mkdir_internal, for the FILE_OPEN case in open_directory
we want to follow symlinks.

Volker
(This used to be commit c20bdd219d)
2007-10-10 12:16:43 -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
d0c6f9b728 r20339: Make mkdir_internal static to open.c
(This used to be commit 6dd0886b49)
2007-10-10 12:16:42 -05:00
Volker Lendecke
469b42c61f r20338: Restructure open_directory a bit. This gets rid of a race condition regarding
error messages: We relied upon a stat that a directory did not exist to later
on then do the mkdir or not. This does the mkdir directly and copes with a
potential error.

The second one is more important: It's possible with Samba 3 to do a
ntcreate&x with NTCREATEX_OPTIONS_DIRECTORY and we happily do a NT_STATUS_OK.

Also move up the use_nt_status() logic a bit. I think this does not belong
into the core routines, the smb server as such should take care of it.

Jeremy, do you think this should go to 3.0.24?

I'll update samba4torture when the build farm has picked up this checkin.

Volker
(This used to be commit 472fb11f49)
2007-10-10 12:16:42 -05:00
Volker Lendecke
920e1a3685 r20257: Hey, change_owner_to_parent is now static :-)
(This used to be commit 4090bc4bca)
2007-10-10 12:16:37 -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
Jeremy Allison
61ea96ec79 r19993: Fix the problem with Linux clients requesting O_WRONLY
on write-only files. Jim please check. Should not affect
Windows clients - I ensured all the relevent Samba4
torture tests still pass.
Jeremy.
(This used to be commit 6df3cac44f)
2007-10-10 12:16:18 -05:00
Jim McDonough
4fe70bcee2 r19647: Add some GPFS support in a vfs mod. Also adds the kernel flock op to
the vfs layer, since gpfs supports it.  Thanks to Volker, Christian,
Mathias, Chetan, and Peter.
(This used to be commit 0620658890)
2007-10-10 12:15:43 -05:00
Volker Lendecke
f27d5c7838 r19077: Fix an uninitialized variable
(This used to be commit 6bc2cce645)
2007-10-10 12:15:09 -05:00
Jelmer Vernooij
7ba2554d88 r18802: Use the pidl-generated code for the srvsvc interface, both client and server code.
This has had some basic testing. I'll do more during the next couple of days and hopefully also
make RPC-SRVSVC from Samba4 pass against it.
(This used to be commit ef10672399)
2007-10-10 12:00:59 -05:00
Jeremy Allison
23535f7d49 r17676: Fix printing bug found by kukks. Don't copy a return
value into an auto on the stack that gets removed when
we return from the frame :-).
Jeremy.
(This used to be commit 85bf8a1611)
2007-10-10 11:38:46 -05:00