1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-04 05:18:06 +03:00
Commit Graph

3620 Commits

Author SHA1 Message Date
Jeremy Allison
65399ae1f0 Added read overlay write lock on same fnum test to locktest2.
Added locktest5 for locking stacks.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
577ddbfbec Insure uninitialized memory read fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Herb Lewis
7b3afe300b merge 2.0 changes 0001-01-01 00:00:00 +00:00
Jeremy Allison
158d9cada8 Fixed wild pointer diff found by insure.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
6eb4fb6eef Implemented the last (I hope:-) part of the locking puzzle, the reference
counting when Windows downgrades a write lock to a read lock, then reference
counts the unlocks to match the locks.
With this code the POSIX unlock isn't done until the final Windows unlock.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e72a571853 added support for deleting printers into the spoolss system 0001-01-01 00:00:00 +00:00
Andrew Tridgell
ee8546342d split the username in the vuser structure into a separate
userdom_struct. As the name implies this also contains a domain
(unused at the moment).

This will be important shortly, as operation in appliance mode needs
the domain to be always carried with the username.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
a85ae6e0ae and yet another memory leak - this one in the client 0001-01-01 00:00:00 +00:00
Andrew Tridgell
610fcef4d3 fixed a memory leak (calling hash_table_init twice) 0001-01-01 00:00:00 +00:00
Andrew Tridgell
d4743ec0be fixed a memory leak 0001-01-01 00:00:00 +00:00
Jeremy Allison
46092ee141 Moved uglyness needed in fcntl locking (64->32 bit mapping, NFS
errors etc.) into locking/posix.c, where it is needed. fcntl_lock in lib/util.c
is now very small and clean.
Added (*lock) op to vfs layer.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
148628b616 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3b25f7368b locking/posix.c: Fixed double-free nasty crash bug found by insure.
utils/make_smbcodepage.c:
utils/make_unicodemap.c: Insure 'make install' fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c40e0a5d3b handle tabs in printcap files
this is needed for lprng
0001-01-01 00:00:00 +00:00
Andrew Tridgell
80ebb0ad54 allow a DEFAULT_PRINTING to be specified in CFLAGS 0001-01-01 00:00:00 +00:00
Andrew Tridgell
5341597de6 fixed typo 0001-01-01 00:00:00 +00:00
Andrew Tridgell
8ec815920d added TDB_INTERNAL, TDB_NOLOCK and TDB_NOMMAP flags.
TDB_INTERNAL replaces the old method of passing a null filename
0001-01-01 00:00:00 +00:00
Andrew Tridgell
09355fcd50 - added some error checking
- removed the VTP hook in smbd
0001-01-01 00:00:00 +00:00
Andrew Tridgell
0bab030074 fixed dptr_wcard handling (need to use strdup) 0001-01-01 00:00:00 +00:00
Andrew Tridgell
9e4b352945 fixed parsing of broken NT short name 0001-01-01 00:00:00 +00:00
Andrew Tridgell
cdf4c4c812 handle the special rule of *.* for old style listings when old_list is
true
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4a15924ffe removed more cruft from our old wildcard matching code 0001-01-01 00:00:00 +00:00
Andrew Tridgell
85d634974f go back to ascii in SMB_FIND_FILE_BOTH_DIRECTORY_INFO
NT gives out unicode, but NT clients can't handle a unicode response!
0001-01-01 00:00:00 +00:00
Andrew Tridgell
38f5e13367 fixed our smbsearch code. We now store the mask with the dptr, this
turns out to be essential for a correct implementation (there ins't
enough room to store all possible masks in the status return
structure!)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
385b1844b6 fix handing of ascii_to_unistr 0001-01-01 00:00:00 +00:00
Andrew Tridgell
64f91a7a98 - get the findclose code right
- handle broken NT response to trans2 findfirst
0001-01-01 00:00:00 +00:00
Andrew Tridgell
8a5c8cfa0e added cli_list_old() to allow for old style directory listing from
masktest
0001-01-01 00:00:00 +00:00
Andrew Tridgell
95f6c0f84a some cleanups 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e23f43e7d3 we don't need fnmatch.c any more 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0e63b4b363 changed masktest to test the internal algorithm against one server,
rather than 2 servers
0001-01-01 00:00:00 +00:00
Andrew Tridgell
03e9cea004 - removed all our old wildcard matching code and replaced it with a
call to ms_fnmatch(). This also removes all the Win9X semantics stuff
and a bunch of other associated cruft.

- moved the stat cache code into statcache.c

- fixed the uint16 alignment requirements of ascii_to_unistr() and
  unistr_to_ascii()

- trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as
  unicode always (at least thats what NT4 does)

- fixed some errors in the in-memory tdb code. Still ugly, but doesn't
  crash as much
0001-01-01 00:00:00 +00:00
Andrew Tridgell
cc9e007cdf YIPEE!!!!!
We finally have a perfect emulation of Microsoft wildcard
matching. The routine ms_fnmatch() does wildcard matching with all MS
wildcards (including the unicode wildcards), and masktest against a
NT4 workstation with hundreds of thousands of random exmaples has not
found a single error.

amazingly it is only about 60 lines of code, but it has taken us years
to get it right. I didn't sleep much last night :)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
77009422a0 put tdb utility functions in a separate file 0001-01-01 00:00:00 +00:00
Jeremy Allison
6bded3b74e Removed tdb locking calls (picky Andrew...:-) 0001-01-01 00:00:00 +00:00
Jeremy Allison
858eb53dc5 Moved deletion of vfs handle into smbd/conn.c as it was being done too
soon in smbd/service.c (file operations were being done after the
handle was closed).

It looks cleaner in smbd/conn.c as it is part of the closing of a conn
struct anyway.

Jeremy.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
31a57be658 Split off of POSIX locking into separate unit as Andrew requested.
Done so I don't lose my edits... :-).
Jeremy.
0001-01-01 00:00:00 +00:00
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()
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b812f09ba8 Forgot to close when "posix locking" is set to False.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a2deb91128 Added optimization where we are single opener (don't free POSIX locks).
Jeremy.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9cde198108 Fixed range check on writeX.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
4a4b7a994b Tidyup of smbecho.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
b040be5ef9 file winbindd_ntdom.h was initially added on branch SAMBA_TNG. 0001-01-01 00:00:00 +00:00
Tim Potter
2a097e7b62 file ntdom_config.h was initially added on branch SAMBA_TNG. 0001-01-01 00:00:00 +00:00