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

3027 Commits

Author SHA1 Message Date
Jeremy Allison
693ffb8466 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.
(This used to be commit 148628b616)
2000-05-02 02:23:41 +00:00
Jeremy Allison
830a9e571e 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.
(This used to be commit 3b25f7368b)
2000-05-01 19:43:50 +00:00
Andrew Tridgell
5fb473fc75 handle tabs in printcap files
this is needed for lprng
(This used to be commit c40e0a5d3b)
2000-05-01 05:42:39 +00:00
Andrew Tridgell
bfb9c3ea86 allow a DEFAULT_PRINTING to be specified in CFLAGS
(This used to be commit 80ebb0ad54)
2000-05-01 05:42:09 +00:00
Andrew Tridgell
3cc5f0dd15 fixed typo
(This used to be commit 5341597de6)
2000-05-01 00:48:41 +00:00
Andrew Tridgell
99fbf5c4bc added TDB_INTERNAL, TDB_NOLOCK and TDB_NOMMAP flags.
TDB_INTERNAL replaces the old method of passing a null filename
(This used to be commit 8ec815920d)
2000-05-01 00:41:47 +00:00
Andrew Tridgell
05cb3464f9 - added some error checking
- removed the VTP hook in smbd
(This used to be commit 09355fcd50)
2000-04-30 15:13:15 +00:00
Andrew Tridgell
29ba16f792 fixed dptr_wcard handling (need to use strdup)
(This used to be commit 0bab030074)
2000-04-30 14:59:00 +00:00
Andrew Tridgell
2fb2ae187d fixed parsing of broken NT short name
(This used to be commit 9e4b352945)
2000-04-30 14:58:13 +00:00
Andrew Tridgell
481ca7c67c handle the special rule of *.* for old style listings when old_list is
true
(This used to be commit cdf4c4c812)
2000-04-30 14:37:57 +00:00
Andrew Tridgell
cb6327cd2d removed more cruft from our old wildcard matching code
(This used to be commit 4a15924ffe)
2000-04-30 14:34:31 +00:00
Andrew Tridgell
0f35ded18e go back to ascii in SMB_FIND_FILE_BOTH_DIRECTORY_INFO
NT gives out unicode, but NT clients can't handle a unicode response!
(This used to be commit 85d634974f)
2000-04-30 14:30:47 +00:00
Andrew Tridgell
34cd425c1d 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!)
(This used to be commit 38f5e13367)
2000-04-30 14:29:45 +00:00
Andrew Tridgell
565cc66e6a fix handing of ascii_to_unistr
(This used to be commit 385b1844b6)
2000-04-30 14:27:39 +00:00
Andrew Tridgell
eaabef5098 - get the findclose code right
- handle broken NT response to trans2 findfirst
(This used to be commit 64f91a7a98)
2000-04-30 14:26:59 +00:00
Andrew Tridgell
23c0cb01ca added cli_list_old() to allow for old style directory listing from
masktest
(This used to be commit 8a5c8cfa0e)
2000-04-30 12:34:26 +00:00
Andrew Tridgell
aa6040c7ce some cleanups
(This used to be commit 95f6c0f84a)
2000-04-30 11:25:09 +00:00
Andrew Tridgell
814f37a5e3 we don't need fnmatch.c any more
(This used to be commit e23f43e7d3)
2000-04-30 11:15:27 +00:00
Andrew Tridgell
3727e4aaac changed masktest to test the internal algorithm against one server,
rather than 2 servers
(This used to be commit 0e63b4b363)
2000-04-30 11:11:19 +00:00
Andrew Tridgell
700f72453e - 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
(This used to be commit 03e9cea004)
2000-04-30 11:04:28 +00:00
Andrew Tridgell
71e7974f3f 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 :)
(This used to be commit cc9e007cdf)
2000-04-30 04:45:16 +00:00
Andrew Tridgell
c0e1c65053 put tdb utility functions in a separate file
(This used to be commit 77009422a0)
2000-04-29 04:05:38 +00:00
Jeremy Allison
74ac259e07 Removed tdb locking calls (picky Andrew...:-)
(This used to be commit 6bded3b74e)
2000-04-29 01:09:31 +00:00
Jeremy Allison
46d66938e7 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.
(This used to be commit 858eb53dc5)
2000-04-28 21:09:26 +00:00
Jeremy Allison
9a5eb068ab 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.
(This used to be commit 3f655de1c7)
2000-04-28 20:54:23 +00:00
Jeremy Allison
46e84a0090 Split off of POSIX locking into separate unit as Andrew requested.
Done so I don't lose my edits... :-).
Jeremy.
(This used to be commit 31a57be658)
2000-04-28 19:38:38 +00:00
Shirish Kalele
b39cee0bb9 Added info level 1005 to netsharegetinfo (is the share a DFS root)
Added dfs_server announcement in set_default_server_announce_type()
(This used to be commit 99d07e1352)
2000-04-28 18:36:47 +00:00
Jeremy Allison
ea9b2ed326 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.
(This used to be commit d69e4c6a48)
2000-04-28 02:06:19 +00:00
Jeremy Allison
1f7d96ee03 Forgot to close when "posix locking" is set to False.
Jeremy.
(This used to be commit b812f09ba8)
2000-04-28 01:08:32 +00:00
Jeremy Allison
f8e5696bd6 Added optimization where we are single opener (don't free POSIX locks).
Jeremy.
(This used to be commit a2deb91128)
2000-04-28 01:01:07 +00:00
Jeremy Allison
be828fcec8 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.
(This used to be commit 239abd48f0)
2000-04-28 00:39:23 +00:00
Jeremy Allison
4b60a33c6f 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.
(This used to be commit 6baa96bb46)
2000-04-27 23:28:56 +00:00
Jeremy Allison
36db78feda 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.
(This used to be commit 2746e5602e)
2000-04-27 22:23:04 +00:00
Jeremy Allison
3d3c50326b 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.
(This used to be commit 0487841120)
2000-04-27 21:12:33 +00:00
Jeremy Allison
e3987ff7a6 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.
(This used to be commit 5278ec016c)
2000-04-27 18:46:10 +00:00
Jeremy Allison
3d9141d415 Fixed range check on writeX.
Jeremy.
(This used to be commit 9cde198108)
2000-04-27 17:14:45 +00:00
Jeremy Allison
c4af7ad8dc Tidyup of smbecho.
Jeremy.
(This used to be commit 4a4b7a994b)
2000-04-27 16:53:31 +00:00
Andrew Tridgell
65ec80c51d quick hack to get smbtorture working again
(This used to be commit 2d37c1f98f)
2000-04-27 07:36:06 +00:00
Jeremy Allison
e4d382750c 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.
(This used to be commit 135855dbd3)
2000-04-25 20:30:58 +00:00
Andrew Tridgell
00e3fe1324 moved trans2.h and nterr.h into includes.h with all our other includes
(This used to be commit d7cd7c88fd)
2000-04-25 14:06:57 +00:00
Andrew Tridgell
858e63cab3 split clientgen.c into several parts
the next step is splitting out the auth code, to make adding lukes
NTLMSSP support easier
(This used to be commit 10c5470835)
2000-04-25 14:04:06 +00:00
Andrew Tridgell
dce954d275 added TDB_MODIFY flag - patch from from luke
(This used to be commit 90b574296e)
2000-04-25 01:17:45 +00:00
Andrew Tridgell
59c8a608c2 fixed a memory leak in nmblookup
(This used to be commit 49865ea06c)
2000-04-25 00:46:46 +00:00
Andrew Tridgell
4a57f9763a fixed a memory leak of devmode in spoolss
this stuff is screaming out for talloc() rather than malloc/free
(This used to be commit e9576124cb)
2000-04-25 00:46:24 +00:00
Andrew Tridgell
84f65e6be6 don't qsort a list less than 2 entries
(This used to be commit 6faa3c23ae)
2000-04-25 00:45:42 +00:00
Jeremy Allison
644f22ac61 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.
(This used to be commit 1df48ed55e)
2000-04-24 20:48:40 +00:00
Jeremy Allison
e82dbfcbe9 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.
(This used to be commit 389b700a26)
2000-04-24 19:23:51 +00:00
Andrew Tridgell
b76e942639 dump in a binary format
(This used to be commit 41af3232db)
2000-04-24 14:36:44 +00:00
Andrew Tridgell
e4f8301edf use an size_t not a ssize_t when checking for out of bounds errors
(This used to be commit 044af3cf97)
2000-04-24 14:36:25 +00:00
Andrew Tridgell
73417c07f7 moved INSURE hook into util.c
(This used to be commit 2fba24ef0e)
2000-04-24 11:31:20 +00:00