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

3576 Commits

Author SHA1 Message Date
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 0487841120a7584da9a2b83b9574562c415d7024)
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 5278ec016cb24d8263fe6e7c1d389f466270ef24)
2000-04-27 18:46:10 +00:00
Jeremy Allison
3d9141d415 Fixed range check on writeX.
Jeremy.
(This used to be commit 9cde198108439358e99128fa9a1b3000e33f5414)
2000-04-27 17:14:45 +00:00
Jeremy Allison
c4af7ad8dc Tidyup of smbecho.
Jeremy.
(This used to be commit 4a4b7a994bbe327216f736133edc51cf9a351716)
2000-04-27 16:53:31 +00:00
Tim Potter
03699e711e file winbindd_ntdom.h was initially added on branch SAMBA_TNG.
(This used to be commit b040be5ef967a9149cd6a4955b8e0404152e9f15)
2000-04-27 07:46:11 +00:00
Tim Potter
2be93929e0 file ntdom_config.h was initially added on branch SAMBA_TNG.
(This used to be commit 2a097e7b62441b5ccb90fa1d4a8b57ed6ee83fd0)
2000-04-27 07:45:30 +00:00
Andrew Tridgell
65ec80c51d quick hack to get smbtorture working again
(This used to be commit 2d37c1f98f45646546ee76743f9df90b1c0b01ae)
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 135855dbd3b8934a49229b81646cd4469acba926)
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 d7cd7c88fdabb01d9e40ae8a657737907a21ac37)
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 10c5470835b43116ed48b3137c3b9cc867a20989)
2000-04-25 14:04:06 +00:00
Andrew Tridgell
dce954d275 added TDB_MODIFY flag - patch from from luke
(This used to be commit 90b574296e06cd6ed4fedc1e5a8ae412a5e78b45)
2000-04-25 01:17:45 +00:00
Andrew Tridgell
59c8a608c2 fixed a memory leak in nmblookup
(This used to be commit 49865ea06c96b01a5e5dec84d64b78bf26129be3)
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 e9576124cbe8322ed7bee9f4e72b5d1753ee0bac)
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 6faa3c23ae6d8aab52f8d6689e04bde9b3029804)
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 1df48ed55ee303b6d84d7277fd79761cfe5f7052)
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 389b700a26e8a308a0dff6fc038c38068aa0119a)
2000-04-24 19:23:51 +00:00
Andrew Tridgell
b76e942639 dump in a binary format
(This used to be commit 41af3232dba90832684ad8260ce0bb05e077cb02)
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 044af3cf977e3172b3b1ce3f71457d5b0a4fc1b2)
2000-04-24 14:36:25 +00:00
Andrew Tridgell
73417c07f7 moved INSURE hook into util.c
(This used to be commit 2fba24ef0e4cae64c5a179370c83d8bbf4e70bb8)
2000-04-24 11:31:20 +00:00
Andrew Tridgell
befb7a100e fixed another memory leak
(This used to be commit 780713f67a848ade49c523cda96015ab46337cde)
2000-04-24 11:31:01 +00:00
Andrew Tridgell
f0442220fa fixed a parameter bug found by insure
(This used to be commit a559a8066fb162c4da0a5046c49a105eabf131d9)
2000-04-24 11:30:45 +00:00
Andrew Tridgell
e5b79f3d5b moved the INSURE hook into util.c
(This used to be commit 8c726b9764bac0bc95cf9877e172c9e1262e576d)
2000-04-24 11:30:24 +00:00
Andrew Tridgell
d315f69e54 more pstring/fstring errors found by insure
(This used to be commit ba1931bb6596b538549e712cb8898b1ed19f5adc)
2000-04-23 14:25:36 +00:00
Andrew Tridgell
a069d4d72f 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
(This used to be commit 990b16fcf7af74f376db157a3e5de7bb68c1a4a1)
2000-04-23 14:25:04 +00:00
Andrew Tridgell
2d96983c7c don't close high fd's in smbrun when using insure (prevents closing
error fd)
(This used to be commit defbedd198f02f7bb9af70436f5a25ab754b5fb6)
2000-04-23 08:45:21 +00:00
Andrew Tridgell
d0e9a0c4f2 another fstring/pstring fix
(This used to be commit 91ed7d8ffe8208d06191c64f5332954ec6bf75da)
2000-04-23 08:44:55 +00:00
Andrew Tridgell
6d667ad4d3 fixed another spoolss memory leak
I am falling in love with insure - it is finding _lots_ of memory
problems
(This used to be commit d9b4076293a4d37e1558ad63a3f522385ee3e521)
2000-04-23 08:40:54 +00:00
Andrew Tridgell
cc229d7042 fixed a memory leak I caused last week with my lines[] changes
(This used to be commit 4c889d08aed3cebba54abbc96f28a2d1c545a4b5)
2000-04-23 08:31:10 +00:00
Andrew Tridgell
b2461e93dd 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
(This used to be commit b7c7a4d564d36885aa7c3efb2a87caec470df7fe)
2000-04-23 08:30:37 +00:00
Andrew Tridgell
b1686a6109 we can't pass a fstring to a routine expecting a pstring
(This used to be commit 8af70f288723e4597bc8639fc0cbec44af2e50c7)
2000-04-23 08:13:48 +00:00
Andrew Tridgell
31446a98a3 check for a valid snum when running a printing command
(This used to be commit 381ddb464fd0da671d567177f1ded10f67952692)
2000-04-23 08:13:12 +00:00
Andrew Tridgell
a32420e5b7 Makefile.in change for split of printfsp.c
(This used to be commit 980a81651a043f2281f6a8b863d31438212b584a)
2000-04-23 07:56:11 +00:00
Andrew Tridgell
943471f2c8 split fsp specific routines out of printing.c to fix linking problem
in TNG
(This used to be commit 82df25b28b94b0041676fb433e0e677acb544579)
2000-04-23 07:51:15 +00:00
Andrew Tridgell
7fcdb8fb7e fixed two uninitialised memory references
(This used to be commit e4ddd1a4a96b7f723d3d92e4334f4033e1dbc8a8)
2000-04-23 07:44:01 +00:00
Andrew Tridgell
c389bd2d6b trick to get full stack trace when using the free version of insure
(This used to be commit bb9b3e03deebe23cf3fe10c2cb9b67a730e086a2)
2000-04-23 07:43:32 +00:00
Andrew Tridgell
d44ae9e229 insure caught an uninitialised memory reference - ensure it starts as
zero
(This used to be commit 53077295b76487a6eafc6b14b69a91074a02aa35)
2000-04-23 07:42:13 +00:00
Andrew Tridgell
71499fbe98 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
(This used to be commit 062d79bf8ba5308803393c7b9140d1f77db3690f)
2000-04-23 07:40:13 +00:00
Andrew Tridgell
9e3f457db0 fixed a prs memory leak (weren't freeing input buffer)
(This used to be commit be7186b0dd2779fc9f98b4c9f77874ef3ded37d6)
2000-04-23 07:38:18 +00:00
Andrew Tridgell
f930ec638b if using insure then don't close fd 2
(This used to be commit 1c6322473afcf9065fa25777d1b0627f133af3f6)
2000-04-23 07:37:43 +00:00
Andrew Tridgell
f1867dcad6 return NULL for a zero size memdup
(This used to be commit 9416b58b9c2ff898cdae2cb81ab1e150ef9f0e89)
2000-04-22 08:29:41 +00:00
Andrew Tridgell
67239541cd don't copy a null groups list
(This used to be commit d0fc1675df35e65488a19d7f5929792fba347b07)
2000-04-22 08:28:49 +00:00
Andrew Tridgell
f7608e8535 fixed overlapping strcpy() found by insure
(This used to be commit 1106fa7f24d229c3877263b7a7dde359556435e6)
2000-04-22 08:28:22 +00:00
Andrew Tridgell
d384e1801d fixed uninitialised snum
(This used to be commit 14251aab2ec00aa7f3e6a6e791e78732cb5a9eda)
2000-04-22 08:27:48 +00:00
Jeremy Allison
6259f51dd9 This is a *big* checkin that may break some things, but implements the
new open mechanism Andrew & I discussed.

config.sub:
configure: Included the QNX patch.

include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added ftruncate vfs call (needed).

Note that we will also need locking calls in the vfs (to be added).

lib/util_unistr.c:
nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump.
                          Also fix for sidsize DOS bug.

locking/locking.c: Check value of ret before using it for memdup.

printing/printing.c: Convert print_fsp_open to return an allocated fsp.

rpc_server/srv_lsa.c: Fix for NT domain logons.

I have removed all use of lp_share_modes() from the code (although I
left the parameter in the table for backwards compatibility). It no longer makes
sense for this to exist.

smbd/close.c: Removed lp_share_modes().
smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code.
smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail.

smbd/nttrans.c:
smbd/reply.c:
smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/
               open_file_stat to return an fsp from the call.

smbd/open.c: Changed all occurrences of open_file_shared/open_directory/
             open_file_stat to return an fsp from the call.

In addition I have fixed a long standing race condition in the deny mode
processing w.r.t. two smbd's creating a file. Andrew, please note that
your original idea of using open with O_EXCL in this case would not work
(I went over the races very carefully) and so we must re-check deny modes
*after* the open() call returns. This is because there is a race between
the open with O_EXCL and the lock of the share mode entry. Imagine the
case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL,
but is pre-empted before it locks the share modes and creates the deny
mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY
and a deny mode of DENY_NONE and the two opens would be allowed.

The *only* way to fix this race is to lock the share modes after the
open and then do the deny mode checks *after* this lock in the case
where the file did not originally exist.

This code will need extensive testing but seems to initially work.

Jeremy.
(This used to be commit ab0ecc39d688f16b9692fe90b991f0b89287070a)
2000-04-22 00:33:16 +00:00
Andrew Tridgell
b7a1d19d11 use sys_fsusage() not disk_free() in printing.c
(This used to be commit 763704f78fc44976b2d977e8a08ffdeb727903c4)
2000-04-19 08:44:56 +00:00
Andrew Tridgell
f074d6ef57 split fsusage() into a separate module (to fix linking problems with
spoolssd in tng)
(This used to be commit e2eacdd74c369fbbcd118148149321e36f3d0010)
2000-04-19 08:23:13 +00:00
Andrew Tridgell
59f992f12d patch from luke to split out lanman code from ipc.c into lanman.c
(This used to be commit 95246a8432e04bcdeed962d1a6112dfd90518941)
2000-04-19 07:00:22 +00:00
Andrew Tridgell
612682354f - got rid of the "passive" option
- cleaned up the standard_sub_*() calls a lot
(This used to be commit 2c2d95d77d3667eaa9252506a82b9054b0d0e01c)
2000-04-19 04:01:16 +00:00
Jeremy Allison
d2db520692 Sync up with 2.0.7 w.r.t. guest users.
Jeremy.
(This used to be commit 8a99d824c0e9a43c8a8c81140f8c9005c7e2621a)
2000-04-18 21:23:26 +00:00
Jeremy Allison
4217c939ec locking/locking.c: Fixed placeholder code for POSIX locking.
printing/printing.c: Cast tdb_delete to (tdb_traverse_func) to stop warning.
                     tmpfile gives mirror warning.
smbd/groupname.c: Remember to file_lines_free() on exit.
tdb/tdb.h: Add tdb_traverse_func typedef.
Jeremy
(This used to be commit 204ca1195c86499bd9beb273ce573db7a56ccead)
2000-04-18 20:41:04 +00:00