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

91 Commits

Author SHA1 Message Date
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
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
b92064fcfd 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.
(This used to be commit bbb5084146)
2007-10-10 12:22:02 -05:00
Andrew Tridgell
2383ffce69 r22784: fixed change notify for delete on close
(This used to be commit 6f52435a72)
2007-10-10 12:21:57 -05:00
Jeremy Allison
4952fe368a 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.
(This used to be commit 8f3d530c5a)
2007-10-10 12:18:24 -05:00
Volker Lendecke
bca83e3b08 r21409: saved_status1 is not used anymore after aio write behind was removed
(This used to be commit 29a1892c13)
2007-10-10 12:18:02 -05:00
Volker Lendecke
8a96fe6a59 r21280: Fix an uninitialized variable warning. Jeremy, please check.
Volker
(This used to be commit 4faa37a515)
2007-10-10 12:17:54 -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
985a26118a 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.
(This used to be commit 429dff3166)
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
d5206610cd 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
(This used to be commit 9cd6a8a827)
2007-10-10 12:17:21 -05:00
Jeremy Allison
aacd16e7c4 r20916: Add in the delete on close final fix - but only enabled
with -DDEVELOPER.
Jeremy.
(This used to be commit 7f817067a7)
2007-10-10 12:17:19 -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
Volker Lendecke
84da72860e r20542: Make close_remove_share_mode retun NTSTATUS. Not that anybody cares yet...
(This used to be commit c899577153)
2007-10-10 12:16:55 -05:00
Volker Lendecke
2276cd666f 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
(This used to be commit 8e1e896b02)
2007-10-10 12:16:54 -05:00
Volker Lendecke
3a9133dd06 r20524: Simplify logic of close_remove_share_mode().
Volker
(This used to be commit ade90dbf0c)
2007-10-10 12:16:54 -05:00
Volker Lendecke
200bd10b32 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.
(This used to be commit ce0ad24988)
2007-10-10 12:16:50 -05:00
Jeremy Allison
a093a76dc1 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.
(This used to be commit 4ace291278)
2007-10-10 11:38:24 -05:00
Jeremy Allison
e1da1fcf12 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.
(This used to be commit f1a9cf075b)
2007-10-10 11:38:11 -05:00
Jeremy Allison
cc9ea93456 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
(This used to be commit fd6fa1d4ea)
2007-10-10 11:17:06 -05:00
Volker Lendecke
c91a675ac1 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
(This used to be commit f66b9701b5)
2007-10-10 11:17:06 -05:00
Jeremy Allison
99b74908cd 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.
(This used to be commit 01ef957d48)
2007-10-10 11:10:52 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Jeremy Allison
d14af63e6a 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.
(This used to be commit 23f16cbc2e)
2007-10-10 11:06:21 -05:00
Jeremy Allison
86c9bac4c3 r13274: Fix for bug #3467. Not a show stopper.
jason qian <jason@infrant.com> was a *fantastic*
help in tracking this down.
Jeremy.
(This used to be commit 9f4a9c70fa)
2007-10-10 11:06:20 -05:00
Jeremy Allison
3317484799 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.
(This used to be commit d01824b785)
2007-10-10 11:06:05 -05:00
Volker Lendecke
67706697c5 r12460: Fixes for bug 3349
(This used to be commit 040eda6bf0)
2007-10-10 11:05:56 -05:00
Jeremy Allison
ab7a4f7e8e 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.
(This used to be commit 932e337db8)
2007-10-10 11:05:49 -05:00
Jeremy Allison
7d2771e758 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.
(This used to be commit 9d93af713f)
2007-10-10 11:05:49 -05:00
Jeremy Allison
78fa625d25 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.
(This used to be commit d1a9d0587c)
2007-10-10 11:05:46 -05:00
Jeremy Allison
c0dad16e0f 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.
(This used to be commit e959a5be39)
2007-10-10 11:05:13 -05:00
Jeremy Allison
533da83852 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.
(This used to be commit 1134abbbb3)
2007-10-10 11:05:13 -05:00
Gerald Carter
54abd2aa66 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)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Volker Lendecke
411be313dd r8531: Fix a memleak
(This used to be commit ebf0cda797)
2007-10-10 11:00:07 -05:00
Jeremy Allison
af8a691db1 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.
(This used to be commit c7fe18761e)
2007-10-10 10:58:18 -05:00
Jeremy Allison
f2f55d703d r7963: Add aio support to 3.0.
Jeremy.
(This used to be commit 1de27da470)
2007-10-10 10:58:05 -05:00
Jeremy Allison
95e68fa7f8 r5731: Get delayed write semantics closer to W2K3. We need to store 2 times.
This may fix bug #2382.
Jeremy.
(This used to be commit a27c351e6b)
2007-10-10 10:55:58 -05:00
Jeremy Allison
7eec693863 r3121: Bug #1956. Ensure errno is saved and restored consistently on a normal_close.
Jeremy.
(This used to be commit f08f437c73)
2007-10-10 10:53:01 -05:00
Jeremy Allison
3e0f586298 r1263: Make "defer sharing violations" a global parameter.
Jeremy.
(This used to be commit 42cdeccc36)
2007-10-10 10:52:04 -05:00
Jeremy Allison
2fc57c9a2c 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.
(This used to be commit 894cc6d162)
2007-10-10 10:51:54 -05:00
Volker Lendecke
f789481101 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
(This used to be commit 588351d1b3)
2007-10-10 10:51:20 -05:00
Tim Potter
7d833de662 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
(This used to be commit 59dae1da66)
2003-07-25 04:24:40 +00:00
Tim Potter
77373f1f8e More printf fixes - size_t is long on some architectures.
(This used to be commit ba4d334b82)
2003-07-24 23:46:27 +00:00
Alexander Bokovoy
bc2a3748e9 Prefix VFS API macros with SMB_ for consistency and to avoid problems with VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out
(This used to be commit c2689ed118)
2003-05-14 10:59:01 +00:00
Alexander Bokovoy
e7c8c15888 Fix VFS layer:
1. Finally work with cascaded modules with private data storage per module
2. Convert VFS API to macro calls to simplify cascading
3. Add quota support to VFS layer (prepare to NT quota support)

Patch by Stefan (metze) Metzemacher, with review of Jelmer and me
Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
(This used to be commit 91984ef5ca)
2003-05-11 23:34:18 +00:00
Jeremy Allison
505b3f5814 Tidyups of some dubious logic discovered whilst trying to track down a
strange oplock related issue on the PSA.
Jeremy.
(This used to be commit 1dd274bf61)
2003-04-22 01:12:52 +00:00
Jeremy Allison
d5f235912f Re-fix regression noticed by Tom Schaefer <tom@umsl.edu> due to
correct delete on close semantics change.
Jeremy.
(This used to be commit 7a45b45490)
2003-04-04 21:58:55 +00:00
Jeremy Allison
e6ac820d81 Fix delete on close semantics to match W2K. I (think:-) I understand it now :-).
Thanks to Nir Livni <nirl@cyber-ark.com> for giving me the test case to
track it down.
Jeremy.
(This used to be commit 41894489e8)
2003-02-11 02:24:51 +00:00
Jeremy Allison
20f1cf6cdc Fix problem with "hide unreadable". stat file opens are baaack :-).
Jeremy.
(This used to be commit 62038a0abf)
2003-01-03 18:50:13 +00:00
Jeremy Allison
b9e91d2a8e Remove the "stat open" code - make it inline. This should fix the
bugs with opening and renaming mp3 files, also the word rename
problems that people have had for a while.
Needs a make clean :-) make.
Also added JohnR's printing fix.
Jeremy.
(This used to be commit 504e5ef049)
2002-03-20 00:46:53 +00:00