1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

886 Commits

Author SHA1 Message Date
Herb Lewis
f7089e3cba Fix for check_kernel_oplocks looking for the var directory
before it may need to be created.
Jeremy.
(This used to be commit 6bf74da8b8)
2000-05-09 22:07:07 +00:00
Herb Lewis
4fb6ca6677 This is reall Jeremy commiting as Herb at SGI labs. Fix
for "socket operation on non-socket" error in log.smb
on HEAD branch startup (server_fd not initialized to -1).
Jeremy.
(This used to be commit ebb4f76550)
2000-05-09 22:05:39 +00:00
Andrew Tridgell
4c061ca15c - use smb_gwtpwnam() in another couple of places
- don't call add/del user if the scripts are empty
(This used to be commit 43860215d4)
2000-05-09 15:09:52 +00:00
Andrew Tridgell
2958dfcdf8 added secrets.tdb and changed storage of trust account password to use
it
(This used to be commit 88ad00b82a)
2000-05-08 10:42:21 +00:00
Andrew Tridgell
2684f50849 fixed a vfs crash bug
(This used to be commit 76da586396)
2000-05-06 15:00:49 +00:00
Jeremy Allison
652d98c0bc Fix for dual unix_to_dos conversion in readdir from A.V.Shutko <AVShutko@mail.khstu.ru>
Jeremy.
(This used to be commit 1152f2ed00)
2000-05-05 19:57:02 +00:00
Jeremy Allison
a12b2cd9e8 Fix for read_file() returning -1.
Jeremy.
(This used to be commit b899943658)
2000-05-05 02:39:02 +00:00
Jeremy Allison
045469493c rpc_server/srv_lsa.c: Bring into sync with 2.0.x.
rpc_server/srv_pipe_hnd.c: Bring into sync with 2.0.x.
smbd/blocking.c: Improve blocking debug reporting.
utils/torture.c: Added check for NT locking bug.
Jeremy.
(This used to be commit e8ff6d3fb5)
2000-05-04 21:57:28 +00:00
Andrew Tridgell
f6844e0b7e a minimal change to get appliance mode to work with winbindd
we needed to accept usernames of the form DOMAIN/user, which means we
needed to pass the domain to a getpwnam() like routine in certain
critical spots.

What I'd rather do is get rid of "char *user" everywhere and use the
new userdom_struct, but that will have to wait a few days.
(This used to be commit 8b7a10febe)
2000-05-04 16:01:47 +00:00
Andrew Tridgell
f3a861e04e - use full_name instead of real_name
- got rid of guest map code in lpq parser
(This used to be commit 8e53f781d3)
2000-05-04 07:59:34 +00:00
Andrew Tridgell
6ed606cab4 if the stat cache is off then don't initialise it
(This used to be commit cd5dcd9e65)
2000-05-04 06:28:38 +00:00
Jeremy Allison
99352a0986 Insure uninitialized memory read fixes.
Jeremy.
(This used to be commit 577ddbfbec)
2000-05-03 02:24:01 +00:00
Andrew Tridgell
32d5416b6a 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.
(This used to be commit ee8546342d)
2000-05-02 13:55:42 +00:00
Andrew Tridgell
c39e2e6f9a fixed a memory leak (calling hash_table_init twice)
(This used to be commit 610fcef4d3)
2000-05-02 07:10:54 +00:00
Jeremy Allison
ba020b0612 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.
(This used to be commit 46092ee141)
2000-05-02 03:20:47 +00:00
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
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
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
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
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
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
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
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
73417c07f7 moved INSURE hook into util.c
(This used to be commit 2fba24ef0e)
2000-04-24 11:31:20 +00:00
Andrew Tridgell
7fcdb8fb7e fixed two uninitialised memory references
(This used to be commit e4ddd1a4a9)
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 bb9b3e03de)
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 53077295b7)
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 062d79bf8b)
2000-04-23 07:40:13 +00:00
Andrew Tridgell
67239541cd don't copy a null groups list
(This used to be commit d0fc1675df)
2000-04-22 08:28:49 +00:00
Andrew Tridgell
f7608e8535 fixed overlapping strcpy() found by insure
(This used to be commit 1106fa7f24)
2000-04-22 08:28:22 +00:00
Andrew Tridgell
d384e1801d fixed uninitialised snum
(This used to be commit 14251aab2e)
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 ab0ecc39d6)
2000-04-22 00:33:16 +00:00
Andrew Tridgell
f074d6ef57 split fsusage() into a separate module (to fix linking problems with
spoolssd in tng)
(This used to be commit e2eacdd74c)
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 95246a8432)
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 2c2d95d77d)
2000-04-19 04:01:16 +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 204ca1195c)
2000-04-18 20:41:04 +00:00
Luke Leighton
9ff032320d ReadDirName calls vfs->readdirname calls dos_readdirname.
replaced with readdirname.  ditto for OpenDir and CloseDir.
(This used to be commit a0afe0d5f8)
2000-04-18 02:09:50 +00:00
Andrew Tridgell
8d7e498db1 converted a couple more functions to use a fd instead of a FILE*
added a new utility fn file_lines_slashcont() which is used to handle
files that treat a \ followed by a newline as a blank
(This used to be commit 384ecd9d66)
2000-04-16 11:17:19 +00:00
Andrew Tridgell
19f946ba6f converted a bunch more functions to use a fd instead of a FILE*
to support some of this I added the following functions in util_file.c

file_lines_pload : load lines from a pipe
file_pload : load a pipe into memory
(This used to be commit a09470817c)
2000-04-16 11:00:21 +00:00
Andrew Tridgell
d79a8c68d6 removed old comments
(This used to be commit 9f49d17d4c)
2000-04-16 08:04:06 +00:00