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

89 Commits

Author SHA1 Message Date
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Stefan Metzmacher
c34d5f445a s3:events: change event_add_timed() prototype to match samba4
metze
2009-01-05 15:07:35 +01:00
Jeremy Allison
d0eeb9aa8d Fix more asprintf warnings and some error path errors.
Jeremy.
2008-12-23 12:11:12 -08:00
Jeremy Allison
c7b75de962 Modify a comment to make things clearer.
Jeremy.
(This used to be commit 9d55ca85ff)
2008-09-12 15:03:05 -07:00
Stefan Metzmacher
c9fb96146c smbd: some write time fixes
- only the first non truncating write causes
  the write time update with 2 seconds delay.
  It's not enough to check for an existing update event
  as it will be NULL after the event was triggered.

- SMBwrite truncates always update the write time
  unless the sticky write time is set.

- SMBwrite truncates don't trigger a write time update on close.

metze
(This used to be commit 3d17089b6d)
2008-09-08 16:25:41 +02:00
Jeremy Allison
405b072431 Write times code update.
Ok, here's the fix for the write times breakage
with the new tests in S4 smbtorture.

The key is keeping in the share mode struct
the "old_file_time" as the real write time,
set by all the write and allocation calls,
and the "changed_write_time" as the "sticky"
write time - set by the SET_FILE_TIME calls.

We can set them independently (although I
kept the optimization of not setting the
"old_file_time" is a "changed_write_time"
was already set, as we'll never see it.

This allows us to update the write time
immediately on the SMBwrite truncate case,
SET_END_OF_FILE and SET_ALLOCATION_SIZE calls,
whilst still have the 2 second delay on the
"normal" SMBwrite, SMBwriteX calls.

I think in a subsequent patch I'd like to
change the name of these from "old_file_time"
to "write_time" and "changed_write_time" to
"sticky_write_time" to make this clearer.

I think I also fixed a bug in Metze's original
code in that once a write timestamp had been
set from a "normal" SMBwriteX call the fsp->update_write_time_triggered
variable was set and then never reset - thus
meaning the write timestamp would never get
updated again on subsequent SMBwriteX's.

The new code checks the update_write_time_event
event instead, and doesn't update is there's
an event already scheduled.

Metze especially, please check this over for
your understanding.

Jeremy.
(This used to be commit 6f20585419)
2008-09-05 19:00:48 -07:00
Stefan Metzmacher
206e7eeb6f smbd: make it possible to change the write time delay for testing
metze
(This used to be commit df8c100c2b)
2008-04-07 12:29:31 +02:00
Stefan Metzmacher
d03453864a smbd: implement the strange write time update logic
We now never call file_ntimes() directly, every update
is done via smb_set_file_time().

This let samba3 pass the BASE-DELAYWRITE test.

The write time is only updated 2 seconds after the
first write() on any open handle to the current time
(not the time of the first write).

Each handle which had write requests updates the write
time to the current time on close().

If the write time is set explicit via setfileinfo or setpathinfo
the write time is visible directly and a following close
on the same handle doesn't update the write time.

metze
(This used to be commit 2eab212ea2)
2008-04-07 12:29:26 +02: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
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
8dcce0d236 Remove redundant parameter fd from SMB_VFS_FSYNC().
Michael
(This used to be commit 8f83c9a7b2)
2008-01-07 15:59:01 +01:00
Michael Adam
ca275e2549 Remove unneeded parameter fd from SMB_VFS_PREAD().
Michael
(This used to be commit 73e28806ce)
2008-01-07 00:14:19 +01:00
Jeremy Allison
0bb1a6ec2d Note when we're setting change time, not write time, and send
message accordingly. Apart from not supporting create time we
now pass the S4 RAW-NOTIFY torture.
Jeremy.
(This used to be commit 8a77f520fa)
2007-10-31 16:32:48 -07: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
c3250149e1 Add new parameter, "min receivefile size" (by default set
to zero). If non-zero, writeX calls greater than this
value will be left in the socket buffer for later handling
with recvfile (or userspace equivalent). Definition of
recvfile for your system is left as an exercise for
the reader (I'm working on getting splice working :-).
Jeremy.
(This used to be commit 11c03b75dd)
2007-10-30 16:22:24 -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
Jeremy Allison
01ee1c7909 r24164: Fix for write cache corruption bug reported by Jean-Francois Panisset <panisset@A52.com>.
Awaiting confirmation from reporter.
Jeremy.
(This used to be commit 7bd65060bd)
2007-10-10 12:29:17 -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
f850ba5787 r23773: One pstring a day...
(This used to be commit 0c3016d32b)
2007-10-10 12:23:55 -05:00
Jeremy Allison
cc35d1300d r23508: Fix sync_file() to return NTSTATUS and return this
on failure in the write path.
Jeremy.
(This used to be commit cd3f7dbee8)
2007-10-10 12:23:23 -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
Jeremy Allison
120422f723 r17220: If we're going to fail a write with an errno, make
sure we return -1.
Jeremy.
(This used to be commit 89b83237b0)
2007-10-10 11:38:19 -05:00
James Peach
93954d6390 r9985: Move the all the strict sync logic into file_sync().
(This used to be commit cc680bbe22)
2007-10-10 11:03:30 -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
19ca97a70f r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Jeremy Allison
0ef417d958 r6949: Back-port Volker's cache fix, plus my change.
Jeremy.
(This used to be commit 27d43f6d36)
2007-10-10 10:56:58 -05:00
Jeremy Allison
fe0ce8dd8e r6890: Refactor printing interface to take offset into job. Fixes bug
where large print jobs can have out-of-order offsets. Bug found
by Arcady Chernyak <Arcady.Chernyak@efi.com>
Jeremy.
(This used to be commit 482f7e0e37)
2007-10-10 10:56:56 -05:00
Jeremy Allison
8a1756006a r6841: Attempt to fix buf #2681. With "strict allocate = yes" we now zero
fill when a file is extended. Should catch disk full errors on write
from MS-Office.
Jeremy.
(This used to be commit 858824f37b)
2007-10-10 10:56:56 -05:00
Jeremy Allison
0835575415 r6673: Fix the write cache based on some VERY good detective work
from Ingo Kilian <ikilian@web.de>.
You must do a make clean after updating this.
Jeremy.
(This used to be commit 3b2cd19fcb)
2007-10-10 10:56:50 -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
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
46f546571b r4007: Fix bug #2088 - ensure inherit permissions is only applied on a new file,
not an existing one.
Jeremy.
(This used to be commit fbbdb72cf1)
2007-10-10 10:53:27 -05:00
Jeremy Allison
9038a56f82 r3895: Fix for bug #2045. May also fix other timestamp bugs with Excel
(Volker please test). Setting a last write timestamp from Windows
overrides any subsequent write timestamp changes and must be immediately
seen by and findfirst/findnexts. This is a racy solution, but should
work most of the time. This may also fix #1061, not sure.
Jeremy.
(This used to be commit 47bab92c0b)
2007-10-10 10:53:24 -05:00
Gerald Carter
293136c04b r3067: patch based on volker's initial work in trunk that fixes the queu update problem when using the background daemon
(This used to be commit de7af09e72)
2007-10-10 10:53:00 -05:00
Jeremy Allison
722aa118c6 Added per-share parameter "store dos attributes". When set, will store
dos attributes in an EA. Based on an original patch from tridge, but
modified somewhat to cover all cases.
Jeremy.
(This used to be commit ed653cd468)
2004-04-02 18:46:19 +00:00
Gerald Carter
d86628d062 remove unused seek_file(); don't hardcode '\' when printing the auth-user
(This used to be commit fac5e05ca1)
2004-01-06 19:57:14 +00:00
Jeremy Allison
0d44747df9 Patch based on work from James Peach <jpeach@sgi.com> to convert over to
using pread/pwrite. Modified a little to ensure fsp->pos is correct.
Fix for #889.
Jeremy.
(This used to be commit 019aaaf0df)
2004-01-06 01:22:14 +00:00
Tim Potter
c8e84154af Printf fixes for 64-bit size_t.
(This used to be commit 8e2c543ebf)
2003-11-02 17:10:12 +00:00
Jeremy Allison
4e8b36a574 Fix SMBseek and get/set position information SMBs. Works against
Samba4 tester. You will need a make clean; make all after this !
Jeremy.
(This used to be commit 10d90171ed)
2003-08-14 21:16:06 +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
00a20ce45f The element in fsp->print_job should be a RAP jobid, not a uint32 RPC
jobid. This was causing Win9x client "set name" calls to fail.
Still need one cleanup fix to finish.
Jeremy.
(This used to be commit 6c23d2030a)
2002-12-05 04:00:16 +00:00
Jeremy Allison
ce4628c199 Fix for 64 bit issues with oplocks and allocation size.
Jeremy.
(This used to be commit 379e719e98)
2002-12-04 03:12:09 +00:00
Gerald Carter
6ce3e3b10c removed the following parameters
* postscript
  * printer driver
  * printer driver location
  * printer driver file

also removed the get_a_printer_driver_9x_compatible() function
(This used to be commit 743f2b8025)
2002-10-21 20:11:12 +00:00
Jeremy Allison
474340e440 Added ASCII art to make this clearer.
Jeremy.
(This used to be commit 31c0dd7e21)
2002-10-03 19:05:36 +00:00
Jeremy Allison
a4f7b7bec1 Write cache bugfix from Rasmus Borup Hansen, system adm. Email: rbh@math.ku.dk
Jeremy.
(This used to be commit d40a14dbb0)
2002-10-03 18:10:59 +00:00
Jelmer Vernooij
127e77e6e3 Sync 3.0 branch with head
(This used to be commit 42615b945e)
2002-08-17 15:27:10 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +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