1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

99 Commits

Author SHA1 Message Date
Jeremy Allison
7632f8fb40 r25118: More pstring elimination.
Jeremy.
2007-10-10 12:30:41 -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
Jeremy Allison
9256ec0a20 r24464: Now Volker removed the readbmpx we don't need cached errors any more.
Jeremy.
2007-10-10 12:29:50 -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
Jeremy Allison
4aad77c27c r23906: Fix POSIX unlink bug found by Steve. If we
used lstat during the open (which we always
do for POSIX) then use lstat for the unlink.
Jeremy.
2007-10-10 12:28:40 -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
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
Volker Lendecke
74fa57ca5d r22868: Replace some message_send_pid calls with messaging_send_pid calls. More
tomorrow.
2007-10-10 12:22:04 -05:00
Volker Lendecke
bbb5084146 r22846: Chunk one to replace message_send_pid with messaging_send: Deep inside
locking/locking.c we have to send retry messages to timed lock holders.
The majority of this patch passes a "struct messaging_context" down
there. No functional change, survives make test.
2007-10-10 12:22:02 -05:00
Andrew Tridgell
6f52435a72 r22784: fixed change notify for delete on close 2007-10-10 12:21:57 -05:00
Jeremy Allison
8f3d530c5a r21714: Change the VFS interface to use struct timespec
for utimes - change the call to ntimes. This preserves
nsec timestamps we get from stat (if the system supports
it) and only maps back down to usec or sec resolution
on time set. Looks bigger than it is as I had to move
lots of internal code from using time_t and struct utimebuf
to struct timespec.
Jeremy.
2007-10-10 12:18:24 -05:00
Volker Lendecke
29a1892c13 r21409: saved_status1 is not used anymore after aio write behind was removed 2007-10-10 12:18:02 -05:00
Volker Lendecke
4faa37a515 r21280: Fix an uninitialized variable warning. Jeremy, please check.
Volker
2007-10-10 12:17:54 -05:00
Volker Lendecke
58bfd168b0 r21279: Get rid of 'aio write behind', this is broken.
It should probably better be integrated with our write cache.

Volker
2007-10-10 12:17:53 -05:00
Jeremy Allison
429dff3166 r21274: As we now have POSIX opens which can unlink
with other open files we may have taken
the delete code path with more than one share mode
entry - ensure we only delete once by resetting
the delete on close flag.
Jeremy.
2007-10-10 12:17:53 -05:00
Jeremy Allison
83dbbdff34 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.
2007-10-10 12:17:47 -05:00
Volker Lendecke
9cd6a8a827 r20931: This changes the notify infrastructure from a polling-based to an event-driven
based approach. The only remaining hook into the backend is now

	void *(*notify_add)(TALLOC_CTX *mem_ctx,
			    struct event_context *event_ctx,
			    files_struct *fsp, uint32 *filter);

(Should we put this through the VFS, so that others can more easily plug in?)

The trick here is that the backend can pick filter bits that the main smbd
should not handle anymore. Thanks to tridge for this idea.

The backend can notify the main smbd process via

void notify_fsp(files_struct *fsp, uint32 action, char *name);

The core patch is not big, what makes this more than 1800 lines are the
individual backends that are considerably changed but can be reviewed
one by one.

Based on this I'll continue with inotify now.

Volker
2007-10-10 12:17:21 -05:00
Jeremy Allison
7f817067a7 r20916: Add in the delete on close final fix - but only enabled
with -DDEVELOPER.
Jeremy.
2007-10-10 12:17:19 -05:00
Jeremy Allison
f2df77a149 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.
2007-10-10 12:17:18 -05:00
Volker Lendecke
c899577153 r20542: Make close_remove_share_mode retun NTSTATUS. Not that anybody cares yet... 2007-10-10 12:16:55 -05:00
Volker Lendecke
8e1e896b02 r20525: Closing a dir with del-on-close set requires the same as files: Don't actually
unlink/rmdir if another process still has it open.

Jeremy, this is a potential merger to 3.0.24.

Volker
2007-10-10 12:16:54 -05:00
Volker Lendecke
ade90dbf0c r20524: Simplify logic of close_remove_share_mode().
Volker
2007-10-10 12:16:54 -05:00
Volker Lendecke
ce0ad24988 r20442: Slight rewrite of the change notify infrastructure. This now survives the
first of the raw-notify subtests, the one-level test_notify_dir without any
flags around yet.

The tricky part was getting the data structures right, I hope the next tests
don't let that fall over.

fsp->notify is now by default NULL, meaning that nobody has issued a
changenotify call. This means nobody is interested in changes for this
directory.

If that has happened, notify_change_buf collects the changes if no current
request is outstanding, and it collects the requests if no change has happened
since the last request.

Happy New Year, somewhere on this planet it's already 2007 :-)

Volker

P.S: Jeremy, there's a question for you in smbd/files.c line 367.
2007-10-10 12:16:50 -05:00
Jeremy Allison
4ace291278 r17293: After the results from the cluster tests in Germany,
fix the messaging code to call the efficient calls :

save_re_uid()
set_effective_uid(0);

messaging_op

restore_re_uid();

instead of using heavyweight become_root()/unbecome_root()
pairs around all messaging code. Fixup the messaging
code to ensure sec_init() is called (only once) so that non-root
processes still work when sending messages.

This is a lighter weight solution to become_root()/unbecome_root()
(which swaps all the supplemental groups) and should be more
efficient. I will migrate all server code over to using this
(a similar technique should be used in the passdb backend
where needed).

Jeremy.
2007-10-10 11:38:24 -05:00
Jeremy Allison
f1a9cf075b r17098: Samba3 now cleanly passes Samba4 RAW-LOCK torture
test. Phew - that was painful :-). But what it means
is that we now implement lock cancels and I can add
lock cancels into POSIX lock handling which will fix
the fast/slow system call issue with cifsfs !
Jeremy.
2007-10-10 11:38:11 -05:00
Jeremy Allison
fd6fa1d4ea r15668: DOS or FCB opens share one share mode entry from different
fsp pointers. Ensure we cope with this to pass Samba4
DENY tests (we used to pass these, there must have been
a regression with newer code). We now pass them.
Jeremy
2007-10-10 11:17:06 -05:00
Volker Lendecke
f66b9701b5 r15660: Without this when using smbcquotas I get
close fd=-1 fnum=4321 (numopen=1)
close_file: Could not get share mode lock for file $Extend/$Quota:$Q:$INDEX_ALLOCATION
unix_error_packet: error string = Das Argument ist ungültig
error packet at smbd/reply.c(3325) cmd=4 (SMBclose) NT_STATUS_INVALID_HANDLE

so a fake file needs special close handling I think. Jeremy, can you check
this?

Thanks,

Volker
2007-10-10 11:17:06 -05:00
Jeremy Allison
01ef957d48 r13748: Don't reference memory after we just freed it (Doh!).
Thanks to tridge's changes to the directory delete on close tests
for catching this.
Jeremy.
2007-10-10 11:10:52 -05:00
Gerald Carter
b65be8874a r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
2007-10-10 11:10:14 -05:00
Jeremy Allison
23f16cbc2e r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
2007-10-10 11:06:21 -05:00
Jeremy Allison
9f4a9c70fa r13274: Fix for bug #3467. Not a show stopper.
jason qian <jason@infrant.com> was a *fantastic*
help in tracking this down.
Jeremy.
2007-10-10 11:06:20 -05:00
Jeremy Allison
d01824b785 r12877: Stop passing structs around in smb messages, instead
always linearize into little-endian. Should fix all
Solaris issues with this, plus provide a cleaner base
moving forward for cluster-aware Samba where smbd's
can communicate across different compilers/architectures
(eventually these message will have to go cross-machine).
Jeremy.
2007-10-10 11:06:05 -05:00
Volker Lendecke
040eda6bf0 r12460: Fixes for bug 3349 2007-10-10 11:05:56 -05:00
Jeremy Allison
932e337db8 r12213: Final fix for #3303 - send rename messages to smbd's
that have open file handles to allow them to correctly
implement delete on close. There is a further correctness
fix I'm intending to add to this to cope with different share
paths, but not right now...
Jeremy.
2007-10-10 11:05:49 -05:00
Jeremy Allison
9d93af713f r12203: Add the share path into the sharemode db. This involves
revving the minor version number for libsmbsharemodes (we
now have a new _ex interface that takes the share path
as well as the filename). Needed for #3303. Some code written
by SATOH Fumiyasu <fumiya@samba.gr.jp> included in the changes
to locking/locking.c. The smbstatus output is a bit of a mess
and needs overhauling...
Jeremy.
2007-10-10 11:05:49 -05:00
Jeremy Allison
d1a9d0587c r12160: The filename parameter to get_share_mode_lock is going
to become very important as we fix #3303, so make sure
we don't accidently set it here.
Jeremy.
2007-10-10 11:05:46 -05:00
Jeremy Allison
e959a5be39 r11344: I don't think share mode conflicts occur on deleting
a directory when you've got permissions. Need to write
a smbtorture test for this.
Jeremy.
2007-10-10 11:05:13 -05:00
Jeremy Allison
1134abbbb3 r11341: Put directory opens into the share mode db so we
can treat them similarly to file opens (delete on
close, share mode violations etc.). This fixes bug
#3216 I will up the default hash size on the locking
db in a later commit as this means more entries.
Jeremy.
2007-10-10 11:05:13 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Volker Lendecke
ebf0cda797 r8531: Fix a memleak 2007-10-10 11:00:07 -05:00
Jeremy Allison
c7fe18761e r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work
into the tree). I'll test this over the weekend....
Jerry - in looking at the difference between the two trees there
seem to be some printing/ntprinting.c and registry changes we might
want to examine to try keep in sync.
Jeremy.
2007-10-10 10:58:18 -05:00
Jeremy Allison
1de27da470 r7963: Add aio support to 3.0.
Jeremy.
2007-10-10 10:58:05 -05:00
Jeremy Allison
a27c351e6b r5731: Get delayed write semantics closer to W2K3. We need to store 2 times.
This may fix bug #2382.
Jeremy.
2007-10-10 10:55:58 -05:00
Jeremy Allison
f08f437c73 r3121: Bug #1956. Ensure errno is saved and restored consistently on a normal_close.
Jeremy.
2007-10-10 10:53:01 -05:00
Jeremy Allison
42cdeccc36 r1263: Make "defer sharing violations" a global parameter.
Jeremy.
2007-10-10 10:52:04 -05:00
Jeremy Allison
894cc6d162 r1085: Now it's had some proper user testing, merge in the deferred open fix. I'm
still doing more testing, but it fixes a behaviour that we've been wrong
on ever since the start of Samba.
Jeremy.
2007-10-10 10:51:54 -05:00
Volker Lendecke
588351d1b3 r370: The 'it does never happen -- error on close()' does happen when you exceed
your quota on an AFS file system. The specific errno was thrown away by
close_normal_file(). Thus we returned NT_STATUS_UNSUCCESSFUL and not
NT_STATUS_DISK_FULL as we should. Fix that. (Not that this gives more sane
Windows app behaviour.... :-( )

Jerry, jra, could you please look over this one, it's been quite a while since
I touch file server code.

Volker
2007-10-10 10:51:20 -05:00
Tim Potter
59dae1da66 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
-