1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-19 10:03:58 +03:00

132 Commits

Author SHA1 Message Date
Jeremy Allison
b792454963 Correctly return access denied on share mode deny when we can't open the
file. This is a regression that was damaged by other code.
Jeremy.
(This used to be commit 5cdc957ea6335d8bb4248065a3b60a0a26e766a8)
2003-02-12 01:12:33 +00:00
Jeremy Allison
349c83f243 Ensure we only ever set fsp->conn in one place.
Jeremy.
(This used to be commit 2110901b381f2a749605c8e8b262fa5ceba11169)
2003-02-04 01:43:11 +00:00
Jeremy Allison
3e822dd2c6 Ensure Samba passes the open attribute truncate tests in smbtorture.
Jeremy.
(This used to be commit 651db9f242bb649f5efa4f4e59fe1ac0afe82981)
2003-02-04 01:11:33 +00:00
Jeremy Allison
f26591b3de Fix for interesting resource constraint condition. When all opens are
level 2 and a request for open with no oplock is received then the
smbd should send *synchronous* break messages, not asynchronous,
otherwise it spins very rapidly, releasing the lock, sending the
'break to none' messages and then re-acquiring the lock before
any other process has a chance to get the lock and remove it's own
oplock (at least on linux).
Jeremy.
(This used to be commit d1e8991a76a57b7d96dd7db3c1d9bbf5b28da88e)
2003-01-30 01:42:08 +00:00
Jeremy Allison
f420f75508 Fix open problem with changing attributes on an existing file - based
on work by  <steve@griffin.sio2.nl>.
Jeremy.
(This used to be commit 465d86d95fbdeda423d1f4b06cee46c119a31447)
2003-01-08 02:09:14 +00:00
Tim Potter
33e019a0c5 Remove unused variable.
(This used to be commit 4bc82624f6f2d3745a1528c56b9dcf04613a6a1d)
2003-01-07 03:31:52 +00:00
Jeremy Allison
a26f2fbe2b Fix problem with "hide unreadable". stat file opens are baaack :-).
Jeremy.
(This used to be commit 6e0cfec16594ade6e6c499f521781348fee25040)
2003-01-03 19:07:26 +00:00
Jeremy Allison
cbecefb1b2 Very curious. It turns out attribute matching on truncate only matters
when opening truncate with current SYSTEM|HIDDEN -> NONE. It's fine to
truncate on open with current NONE -> SYSTEM | HIDDEN.
Jeremy.
(This used to be commit 801b87e0f7c92553dc52b44d669a1795e2b9429f)
2002-11-19 01:45:55 +00:00
Jeremy Allison
6c5e0cce56 Fix to correctly return NT_STATUS_DELETE_PENDING.
Jeremy.
(This used to be commit 075987f1db4de5e21ebf205a16a847ce0b2a926e)
2002-11-05 21:46:33 +00:00
Jeremy Allison
7689a9c969 First cut of new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
This is not 100% the same as what SuSE shipped in their Samba, there is
a crash bug fix, a race condition fix, and a few logic changes I'd like to
discuss with Andreas. Added Andreas to (C) notices for posix_acls.c
Jeremy.
(This used to be commit a81d700ae9c82d4b7ea631ab7862162a2ed3d512)
2002-10-23 01:22:45 +00:00
Jeremy Allison
fedc33df42 Ensure we open UNIX fifo's non-blocking like we used to do.
Jeremy.
(This used to be commit 53f411df10f1e152d8d596cd24a2f66af9eb6e51)
2002-09-03 20:10:25 +00:00
Jeremy Allison
35b7dfaa20 Fix bug with stat mode open being done on read-only open with
truncate.
Jeremy.
(This used to be commit 18b9cbd857177a911ef95c9322bdf0709161cd84)
2002-08-30 19:29:59 +00:00
Jeremy Allison
fcdecb7c29 Correctly fail opens with mismatching SYSTEM or HIDDEN attributes if we
are mapping system or hidden.
Jeremy.
(This used to be commit bd1e3df9ffa0717f26696a222e5ec6a0198b3352)
2002-08-30 18:57:23 +00:00
Andrew Bartlett
363de3ca12 Fix const warning
(This used to be commit 3d2f0635ed060fca0fa97c97ef850e57641aef19)
2002-07-08 01:40:35 +00:00
Andrew Bartlett
6b4dde0c24 Raise some debug levels.
Andrew Bartlett
(This used to be commit 5c0e4ecfaf9bf7e6e799dceeb275b5db2d4142dd)
2002-06-22 12:15:42 +00:00
Jeremy Allison
4547fde9f5 When doing a non-io open the stat failing is no cause for a debug zero
to be printed, it just means file not found.
Jeremy.
(This used to be commit 25dea499b82da5e84412bf10781adbd240aa46f0)
2002-04-23 18:50:10 +00:00
Andrew Tridgell
86cf3b9f11 try to cope better with the take ownership operation for foreign SIDs
what we do is map to the authenticated user when the sid is unmappable
and dos filemodes are enabled
(This used to be commit b6c2ef4f54e7b42125f8c89ee5a62b0ba6b52f59)
2002-04-20 07:28:46 +00:00
Jeremy Allison
81a0d5b5e9 Matched W2K *insane* open semantics....
Jeremy.
(This used to be commit 6819e81da490914d2db91c4d2419d408b8d4c818)
2002-03-26 00:38:12 +00:00
Jeremy Allison
c90cd26e94 Fix the mp3 rename bug - also tidy up our open code and remove the special
cases for rename and unlink. Had to add desired_access into the share mode record.
Jeremy.
(This used to be commit 3b1b8ac43535fb0839c5474fa55bf7150f6cde31)
2002-03-23 02:57:44 +00:00
Jeremy Allison
bffc69a877 Fix stupid typo !
Jeremy.
(This used to be commit d0b58f66edeac516bde2dff79ab5cf529c37954b)
2002-03-21 21:23:22 +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 504e5ef0494c54efbd0357e334cb2aa5a9eb9c14)
2002-03-20 00:46:53 +00:00
Jeremy Allison
3bb219161a Added POSIX ACL layer into the vfs.
Jeremy.
(This used to be commit 7d59445b6962547a8938928a9371651a09e26516)
2002-03-12 00:08:08 +00:00
Jeremy Allison
db4c62d7ed Implemented default ACL patch (set inherit acls = true on a per share basis).
Based on code donated by Olaf Frczyk <olaf@cbk.poznan.pl>. Further commit
will change to sending via vfs interface.
Jeremy.
(This used to be commit d85133e2697eb22f1573c78447b57791ae63dd6b)
2002-03-11 21:57:12 +00:00
Jeremy Allison
11c0e88d9e Fixed delete on close semantics - preparing for share mode rewrite.
Jeremy.
(This used to be commit 25dd73be29bbf0a080fe0bcbe5c478545d1e8db7)
2002-03-07 04:21:12 +00:00
Andrew Tridgell
97d96862ca This is a nasty hack to fix "xcopy /o" from win2000 on a Samba share
The hack passes the true ntcreate desired_access down to open_file_shared1()
from the ntcreatex function. This is used to determine if share modes
should be used in denying this open.

This hack will become unnecessary when we redo open.c to use the proper
NTCreateX semantics rather than trying to jam the ntcreate semantics into
openX semantics.
(This used to be commit d09ae0c667a94fcf870c0fc7f97119266a650d45)
2002-02-26 05:45:33 +00:00
Tim Potter
cd38c3a71c Merge of smbclient print crash bug fix from app head.
(This used to be commit a56298d56ae67a764e9b9a43c1c568b7125e1c18)
2002-02-15 02:46:13 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-30 06:08:46 +00:00
Jeremy Allison
9d8ed7220f Fixed display of "remote downlevel document" in old print job submission
case.
Jeremy.
(This used to be commit 248770d73072e36fd9812ec5986dce5380dfab33)
2002-01-25 20:16:14 +00:00
Andrew Tridgell
630e0ae8ef don't use O_NONBLOCK in open(). This was added erroneously for kernel
oplocks and really shouldn't be used
(This used to be commit c3a83002cfc2e0b5158cae1898eda8bafcb41e48)
2002-01-17 00:25:13 +00:00
Jeremy Allison
68245b54cd Added the O_NOFOLLOW flag if follow symlinks is set off.
Jeremy.
(This used to be commit 4f1f5f28b514dda86f6f49465bd5887357e37bc6)
2002-01-12 00:50:01 +00:00
Jeremy Allison
28df80cf68 Moved fchown_acl change to the point where we *really* know if we
created the file or not.
Jeremy.
(This used to be commit 32dffa0ba792a81d89d06b527d82820b89507efd)
2001-12-16 23:44:38 +00:00
Jeremy Allison
59a8827f5d Spelling pedents strike again :-).
Jeremy.
(This used to be commit 0187d4ba16c794faa372bf1a50261b8f47482064)
2001-11-28 18:10:13 +00:00
Jeremy Allison
a17867af97 Ensure the CAN_WRITE is checked and prevents O_CREAT and O_TRUNC from
being set. Also prevent an open on a file on a readonly share from
setting delete on close.
Jeremy.
(This used to be commit 1f3dcd99bdd36cd3ff492394e80c3e2037a9aa48)
2001-11-28 05:03:37 +00:00
Jeremy Allison
1a50b36d97 Re-added "Share modes" meaning don't allow deny mode conflict. Due to
user demand (don't talk to me about removing parameters.... :-).
Jeremy.
(This used to be commit b69127391b322d81cc648f73a601ed61e79c8a44)
2001-11-28 04:47:46 +00:00
Jeremy Allison
01d91a8249 Fix for the logic bug wrt. existant oplocks. See long message
in samba-technical for explaination.
Jeremy.
(This used to be commit 8150f0f3f72957e77a1e6ca06760c87c516792eb)
2001-11-27 23:12:25 +00:00
Jeremy Allison
064b3e7da7 nsswitch/winbindd_group.c nsswitch/winbindd_user.c: formatting fixups.
smbd/open.c: Fix "delete on close" for directories.
Jeremy.
(This used to be commit 014b0973a3b3b9eb22cce3053171fa55f5c16a63)
2001-11-27 06:28:06 +00:00
Jeremy Allison
d05bbf0422 Fixed delete on close bug. Added core dump code to winbindd.
Jeremy.
(This used to be commit a58d0f91f9ee7354c01a9c20cfe178d5dc02142d)
2001-11-23 11:18:20 +00:00
Jeremy Allison
88b55f47b4 Move from timestamp to gen count file id's for finding oplocked files
in a tdb.
Jeremy.
(This used to be commit 058ae6b58f61ef46013dd076af3a84de5fbaaab1)
2001-10-20 21:59:34 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-10-02 04:29:50 +00:00
Jeremy Allison
abaa4ab96a Change log message to 2 from zero when failing to create directory.
Stops spurious profile creation messages.
Jeremy.
(This used to be commit fa74d07207fa9024b6ebdb10686b032ef6673d18)
2001-09-24 23:50:28 +00:00
Simo Sorce
61b2794968 move to SAFE_FREE()
(This used to be commit a95943fde0ad89ae3f2deca2f7ba9cb5ab612b74)
2001-09-17 11:25:41 +00:00
Simo Sorce
72c35310b2 use variables _before_ freeing them!
thanks to Andreas Moroder for spotting these two.
(This used to be commit 01f30ca0ad472eaab8f80ec4278b1d391be3a1ae)
2001-09-15 13:21:54 +00:00
Andrew Tridgell
387f1fd09c fixed formatting to make the code vaguely readable. It's still a dogs
breakfast, but at least you can follow the indents
(This used to be commit 9955ea0aaa299c6c946b4e7b7e98017c39b60bc8)
2001-09-05 21:11:52 +00:00
Andrew Tridgell
e8e98c9ea0 converted smbd to use NTSTATUS by default
major changes include:

- added NSTATUS type
- added automatic mapping between dos and nt error codes
- changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT()
  these calls auto-translate to the client error code system
- got rid of the cached error code and the writebmpx code

We eventually will need to also:
- get rid of BOOL, so we don't lose error info
- replace all ERROR_DOS() calls with ERROR_NT() calls

but that is too much for one night
(This used to be commit 83d9896c1ea8be796192b51a4678c2a3b87f7518)
2001-08-27 08:19:43 +00:00
Jeremy Allison
ecea36501e Missed '\' at eol...
Jeremy.
(This used to be commit 0dbd1be704209c1a66280148b40f7b7437d47242)
2001-08-22 01:06:27 +00:00
Jeremy Allison
85e063f5b8 Tidyup fixes for fcntl spin problem.
Jeremy.
(This used to be commit 27d3dd0e7cb777ef6b21d6966c07045c2940fd37)
2001-08-22 01:01:37 +00:00
Jeremy Allison
e4275a35a6 Fixed the (incorrect) paranioa fix I put in for the fcntl lock spin.
Don't delete a share mode that failed to remove the oplock (doh!),
just set the oplock entry to zero....
Jeremy.
(This used to be commit fe4aa720181a43f7a636ca029680fab0c836b968)
2001-08-22 00:29:40 +00:00
Volker Lendecke
e6a6dee027 This is Jeremy pretending to be Volker, 'cos the
link from Seattle is having problems.
I've added 3 things here to work on the fcntl spin
problem.
1). Check *all* tdb return codes... :-).
2). If we're asking ourselves to break an oplock, and we can't
find a fsp pointer that matches the entry, this is a *logic bug*
and we should abort and panic so someone with gdb can pick up
the pieces.
3). After we've broken an oplock, ensure that the entry itself
has been removed, and if not remove it ourselves. This should
not be neccessary in a correctly working environmen,t, but will
provide an added layer of robustness in error situations.
4). I hate german keyboards :-) :-).
Jeremy.
(This used to be commit 1c94fa80646f9e31377fbb41332fe4780f550cab)
2001-08-21 01:25:45 +00:00
Jeremy Allison
76f36b8c36 We were making an assumption in the oplock
break code path that was invalid (ie. we were assuming
we could infer a non-levelII oplock when such an oplock
was detected - this may no longer be valid once we've
processed the break process dealing with the break will
change the state of it anyway.
This prevents the state where we get the following packet
trace :

client                      server
NTcreate ->
                         <- NTcreate resp
NTcreate ->
                         <- break to level II
ok - broken ->
                         <- break to none

Thanks to Alan Romeril for providing the trace that allowed
me to track this down.

Jeremy.
(This used to be commit c343e4f49070011986fc2ed4acd4ce690d5f1d71)
2001-07-24 01:18:43 +00:00
Jeremy Allison
aa91def29f Fix race where wrong action (created or opened) could be returned.
Jeremy.
(This used to be commit af5b649b017f703a14a69f77a9067efb9c6a8269)
2001-07-05 23:37:09 +00:00