1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-15 05:57:49 +03:00

3585 Commits

Author SHA1 Message Date
Jeremy Allison
3f655de1c7 Ok - this is the *third* implementation of this (third time's the charm :-).
This implementation keeps all POSIX lock records in a separate in memory
tdb database only known about in locking/posix.c. In addition, the pending
close fd's are also held in a tdb which has an array of fd's indexed by
device and inode.

The walk-split code uglyness has been moved to posix.c from brlock.c,
which is the only place that needs to know about it, and the extra
functions hacked into brlock to expose internal state have been removed.

This implementation passes smbtorture locktest4, the only thing I need
to check now for completeness is what to do about lock upgrade/downgrades
which Win32 allows under some *very* strange circumstances.

Jeremy.
-
Jeremy Allison
31a57be658 Split off of POSIX locking into separate unit as Andrew requested.
Done so I don't lose my edits... :-).
Jeremy.
-
Shirish Kalele
99d07e1352 Added info level 1005 to netsharegetinfo (is the share a DFS root)
Added dfs_server announcement in set_default_server_announce_type()
-
Jeremy Allison
d69e4c6a48 Added tdb_get/set_int_byblob, which takes a size_t len and then implemented
the tdb_get/set_int string functions in terms of them. Will be useful in storing
POSIX pending close records (which are ints but indexed by dev/inode pairs).
Jeremy.
-
Jeremy Allison
b812f09ba8 Forgot to close when "posix locking" is set to False.
Jeremy.
-
Jeremy Allison
a2deb91128 Added optimization where we are single opener (don't free POSIX locks).
Jeremy.
-
Jeremy Allison
239abd48f0 Made changes suggested by Andrew review.
fd_close now calls fd_close_posix() directly.
set_posix_lock/release_posix_lock() now handle the reference counting.
More changes due when this gets moved to the file locking/posix.c
Jeremy.
-
Jeremy Allison
6baa96bb46 Ok - this is more subtle than it looks :-).
When a file is being closed, once it passes the fnum and tid tests then
the locking context should be ignored when removing all locks. This is
what is done in the brl close case, but when you have outstanding
POSIX locks, then you cannot remove all the brl locks in one go, you
have to get the lock list and call do_unlock individually. As this
uses global_smbpid as the locking context, you need to make sure
that this is set correctly for the specific lock being removed. I
now do this by storing the smbpid in each entry in the unlock list returned from
the query call. I removed the smbpid from fsp (not needed) and
things seem ok (even with the stupid smbpid tricks that smbtorture plays :-).

Jeremy.
-
Jeremy Allison
2746e5602e Fixed subtle unlocking bug when a file is closed. We need to store the
smbpid used when a file was opened in the files_struct. Else we use
the wrong global_smbpid when we are closing the file and trying to
remove the brl locks - this causes the brl locks to be left when the
file is closed as the samba_context check fails.
Jeremy.
-
Jeremy Allison
0487841120 Did the rewrite Andrew wanted where all knowledge of POSIX locking is
removed from the smbd/open.c code.
We now use a dlink list of structures indexed by dev/inode to store
all pending fd's for close. This could be rewritten to use lib/hash.c
if this is discovered to be too slow in use.
Andrew, please take a look and let me know if this is what you
had in mind.
Jeremy.
-
Jeremy Allison
5278ec016c Fixed crash bugs Andrew pointed out with LOCK4 smbtorture
test. Was miscounting posix locks, plus was not taking into account
the case where other_fsp == fsp in the 'move locks' case. DOH ! This
code will be re-written anyway :-).
Jeremy.
-
Jeremy Allison
9cde198108 Fixed range check on writeX.
Jeremy.
-
Jeremy Allison
4a4b7a994b Tidyup of smbecho.
Jeremy.
-
Tim Potter
b040be5ef9 file winbindd_ntdom.h was initially added on branch SAMBA_TNG. -
Tim Potter
2a097e7b62 file ntdom_config.h was initially added on branch SAMBA_TNG. -
Andrew Tridgell
2d37c1f98f quick hack to get smbtorture working again -
Jeremy Allison
135855dbd3 Added the hard code :-).
HEAD should now map brl locks correctly into POSIX locks, including the
really nasty case of large range unlock.

There is a lot of pretty ASCII art in locking/brlock.c explaining
exactly how this code works. If it is unclear, please ask me.

Jeremy.
-
Andrew Tridgell
d7cd7c88fd moved trans2.h and nterr.h into includes.h with all our other includes -
Andrew Tridgell
10c5470835 split clientgen.c into several parts
the next step is splitting out the auth code, to make adding lukes
NTLMSSP support easier
-
Andrew Tridgell
90b574296e added TDB_MODIFY flag - patch from from luke -
Andrew Tridgell
49865ea06c fixed a memory leak in nmblookup -
Andrew Tridgell
e9576124cb fixed a memory leak of devmode in spoolss
this stuff is screaming out for talloc() rather than malloc/free
-
Andrew Tridgell
6faa3c23ae don't qsort a list less than 2 entries -
Jeremy Allison
1df48ed55e Added the code that keeps fd's open across a close if there are other fsp's
open on the same dev/inode pair with existing POSIX locks.

This is done at the smbd/open layer, so smbd just calls fd_close() and
the transfer of any open fd's is done under the covers of fd_close().
When an fsp is closed and no other fsp's open on the same dev/inode
pair have existing POSIX locks then all fd's associated with this fsp
are closed.

Now only the hard part of doing the POSIX range unlock code when read
locks overlap remains for full POSIX/SMB lock integration....

Jeremy.
-
Jeremy Allison
389b700a26 Now that fsp's are created on successful file open, the structure member
fsp->open is no longer needed (if an fsp pointer is valid, then it's open :-).

NB for Luke, this patch also did not apply to TNG. TNG is not yet
identical w.r.t file serving with HEAD. This makes it impossible for
me to help maintain TNG. Please fix asap.

lib/substitute.c: Removed unused variable (pidstr).

Jeremy.
-
Andrew Tridgell
41af3232db dump in a binary format -
Andrew Tridgell
044af3cf97 use an size_t not a ssize_t when checking for out of bounds errors -
Andrew Tridgell
2fba24ef0e moved INSURE hook into util.c -
Andrew Tridgell
780713f67a fixed another memory leak -
Andrew Tridgell
a559a8066f fixed a parameter bug found by insure -
Andrew Tridgell
8c726b9764 moved the INSURE hook into util.c -
Andrew Tridgell
ba1931bb65 more pstring/fstring errors found by insure -
Andrew Tridgell
990b16fcf7 fixed a locking database bug - it was actually harmless except that
smbstatus could display the wrong filename when files change dev/inum
after a rename
-
Andrew Tridgell
defbedd198 don't close high fd's in smbrun when using insure (prevents closing
error fd)
-
Andrew Tridgell
91ed7d8ffe another fstring/pstring fix -
Andrew Tridgell
d9b4076293 fixed another spoolss memory leak
I am falling in love with insure - it is finding _lots_ of memory
problems
-
Andrew Tridgell
4c889d08ae fixed a memory leak I caused last week with my lines[] changes -
Andrew Tridgell
b7c7a4d564 split out standard_sub_basic() again to fix a bug where %p was being
substituted in the loadparm code and thus leaving lpq with no printer
-
Andrew Tridgell
8af70f2887 we can't pass a fstring to a routine expecting a pstring -
Andrew Tridgell
381ddb464f check for a valid snum when running a printing command -
Andrew Tridgell
980a81651a Makefile.in change for split of printfsp.c -
Andrew Tridgell
82df25b28b split fsp specific routines out of printing.c to fix linking problem
in TNG
-
Andrew Tridgell
e4ddd1a4a9 fixed two uninitialised memory references -
Andrew Tridgell
bb9b3e03de trick to get full stack trace when using the free version of insure -
Andrew Tridgell
53077295b7 insure caught an uninitialised memory reference - ensure it starts as
zero
-
Andrew Tridgell
062d79bf8b avoided a memory leak in the ubi code by deleting a mangled cache
entry before adding to ensure that we don't ever add a duplicate entry

this code can be removed when ubi gets fixed
-
Andrew Tridgell
be7186b0dd fixed a prs memory leak (weren't freeing input buffer) -
Andrew Tridgell
1c6322473a if using insure then don't close fd 2 -
Andrew Tridgell
9416b58b9c return NULL for a zero size memdup -
Andrew Tridgell
d0fc1675df don't copy a null groups list -