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

1378 Commits

Author SHA1 Message Date
Jeremy Allison
36544fe547 Added ssize_t to configure code.
Got 'religion' about using size_t and ssize_t for read/write stuff
as part of the code to expose 64 bits to the client.

This checkin does all the 'easy' stuff - such as all the read/write/lock
calls - but now comes the harder parts (open & friends) and all the
file enquiry functions.....

Jeremy.
-
Jeremy Allison
069efc0454 smb.h: Removed fdnum from file_fd_struct. Not needed.
files.c: Removed fd bitmap - not needed. Added code to do use arrays rather
         than linked list - disabled by default but can be enabled to check
         performance.
Jeremy.
-
Andrew Tridgell
1b07de7079 fixed a bug in the wins database writer that caused the database to be
written continuously rather than once every 5 seconds (at most).

also changed it to 20 seconds :)
-
Jeremy Allison
02b3fddce3 Improved stat cache code by uppercasing any search name that gets added to
it if we're in case insensitive mode, and then doing a memcmp rather
than a StrnCaseCmp (which is *horribly* slow) on every lookup.
Fixed bug with refusing NT SMB's (use *brackets* where needed :-).
Jeremy.
-
Christopher R. Hertel
ac13c29d46 Copyright notices written to debug logs are now through 1998.
Chris -)-----
-
Jeremy Allison
0de01f4598 Added back groupname map stuff removed by Andrew's "slash 'n' burn"
tactics :-). Protected by #ifdef until used.

Fixed bug in fd_attempt_close() where a pointer to potentially
free'd memory was returned. I hate that.

Added "blocking locks" as a per-share option for performance testing.

Changed is_mangled() so it will return true if called with a pathname
and any component of the pathname was mangled (it was already attempting
to do this, but not checking for a '/' as end-of-mangle).

This should be a better fix for the wierd stat cache bug Andrew identified.

Jeremy.
-
Luke Leighton
46301b1d21 added 0x10 to the frag length in the "bind ack". -
Andrew Tridgell
c83f3775cd add a "stat cache" boolean smb.conf option. (defaults to on)
I think we need this so we can rule out stat cache bugs when dealing
with bug reports. If we ask a user to disable the stat cache and the
problem persists then we know it isn't a stat cache bug. The stat
cache code is sufficiently complicated that it can be pretty hard to
tell if it is causing problems or not.
-
Andrew Tridgell
c96b5fde5a fixed a stat cache bug (the one found by Matthew Geier).
The fix I used is a very conservative fix. I'll leave it up to Jeremy
to put in a better fix. The problem was the detection of mangled
names.
-
Andrew Tridgell
5c7717f033 added a configuration summary at the end of ./configure. It also
aborts if essential functions are not available.
-
Andrew Tridgell
3f4959a065 expand the sysv shmem test to look for semaphores as well as shared
memory. Some FreeBSD systems have sysv shared memory but no
semaphores!
-
Andrew Tridgell
7b154dc431 some cleanups to use ZERO_STRUCT() and friends -
Andrew Tridgell
ead0338ad2 some people are foolishly running ./configure from other than the
source directory! This adds a new "trivial" test that makes sure that
the autoconf tests are working. It aborts the configure run if not.
-
Andrew Tridgell
41f0069afc ahh, the joy of deleting large chunks of code that someone else has
painstakingly put in :)

This gets rid of most of the #ifdef LARGE_SMB_INO_T ifdefs around
DEBUG() statements. We just use %.0f in all cases. Makes the code a
bit easier to read :)
-
Andrew Tridgell
2204475c87 tridge the destroyer returns!
prompted by the interpret_security() dead code that Jean-Francois
pointed out I added a make target "finddead" that finds potentially
dead (ie. unused) code. It spat out 304 function names ...

I went through these are deleted many of them, making others static
(finddead also reports functions that are used only in the local
file).

in doing this I have almost certainly deleted some useful code. I may
have even prevented compilation with some compile options. I
apologise. I decided it was better to get rid of this code now and add
back the one or two functions that are needed than to keep all this
baggage.

So, if I have done a bit too much "destroying" then let me know. Keep
the swearing to a minimum :)

One bit I didn't do is the ubibt code. Chris, can you look at that?
Heaps of unused functions there. Can they be made static?
-
Jeremy Allison
94d63cc382 Fixed one more Debug problem with inode in non-64 bit case.
Jeremy.
-
Jeremy Allison
63f65f5027 Bugfix for leak in reference counted file struct.
Added "nt smb support" parameter to allow NT SMB's to be turned off.
Jeremy.
-
Andrew Tridgell
88df8a8b25 got rid of interpret_security(). Thanks to Jean-Francois for pointing
out it is no longer used (replaced by enumerated types in loadparm.c)
-
Jeremy Allison
5910d07bbf Modified dev_t and ino_t code to be 64 bit clean (including changes
to oplock break message passing). I think that smbd/nmbd are now
inode and offset size independent (at least for 32 bit and 64 bit
systems).

Now to expose all this new functionality to NT clients.....

Jeremy.
-
Jeremy Allison
dcce6b98d8 Fixed uppercasing of share name (pointed out by Jean-Francois).
Jeremy.
-
Jeremy Allison
422f1dd450 More 64 bit stuff - now the fcntl locks are 64 bit clean.
Nearly at the stage where I can expose the 64-bit-ness to
the NT clients....
Jeremy.
-
Jeremy Allison
14500936c3 Ok - this is the 64 bit widening check in. It changes the configure
to check for stat64 and friends, and then changes much of Samba
to use the data type SMB_OFF_T for file size information.

stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide
the 64 bit calls if needed.

Note that this still does not expose 64 bit functionality to the
client, as the changes to the reply_xxx smb's are not yet done.

This code change should make these changes possible.

Still to do before full 64 bit-ness to the client:

fcntl lock code.
statfs code
widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T
types being in place).

Let me know if wierd things happen after this check-in and I'll
fix them :-).

Jeremy.
-
Andrew Tridgell
d252d33101 changed the SMBtrans reply code to align at the same alignment as
observed from NT. We were aligning the data before but not the
parameters. This aligns both.

This change may break some other parts of ipc.c if we have relied on
the alignment somewhere, so if you think this broke something then let
me know.
-
Andrew Tridgell
29e1e59db8 we were setting the strings 1 too long in make_srv_share_info1_str() -
Andrew Tridgell
c319d8ea3f fixed a bug in the name mangling code. It implicitly assumed that
mangling a name can't increase it's size which isn't true. (imagine a
file called "L B" which mangles to "LB~XX")

The symptoms were that users couldn't run batch files from short
directory names that contained non 8.3 characters (such as spaces).
-
Jeremy Allison
e817d836bb Fix for PR#9497 - not waiting for child.
Jeremy.
-
Andrew Tridgell
72c383f4b7 we are never interested in SIGPIPE so just ignore (block) it
always. Don't even install a handler.
-
Andrew Tridgell
ddb788c24d use /swat/ prefix in both inetd and cgi modes, to enable a static header.html -
Jeremy Allison
03ae657a36 Missed one struct stat.
Jeremy.
-
Jeremy Allison
28aa182dbf More abstraction of file system data types, to move to a 64
bit file interface for the NT SMB's.

Created a new define, SMB_STRUCT_STAT that currently is
defined to be struct stat - this wil change to a user
defined type containing 64 bit info when the correct
wrappers are written for 64 bit stat(), fstat() and lstat()
calls.

Also changed all sys_xxxx() calls that were previously just
wrappers to the same call prefixed by a dos_to_unix() call
into dos_xxxx() calls. This makes it explicit when a pathname
translation is being done, and when it is not.

Now, all sys_xxx() calls are meant to be wrappers to mask
OS differences, and not silently converting filenames on
the fly.

Jeremy.
-
Andrew Tridgell
c53ead308e need to istall new files -
Andrew Tridgell
d35c6e8098 spruced up SWAT a bit - it now uses the new Samba logo at the top and
a table to give it a little border
-
Andrew Tridgell
edcde70108 fixed a bug in the base64 hanlding that led to auth failures for some
passwords with SWAT
-
Andrew Tridgell
9fee8c2eb7 check that a valid pipe is passed before doing a pipe close.
I made this change after getting a segv in reply_pipe_close(). The
funny thing was that pipes_open was 1 and Pipes was NULL. That "can't
happen" and suggests that we have a wild pointer somewhere.

I suspect the rpc code, as I was playing with long share names (a
share called "averylongusername") at the time and the logs show lots
of srvsvc operations. I bet there is a buffer in the rpc code
somewhere that is overflowing and trashing bits of the data segment.
-
Jeremy Allison
3d9ec96de5 configure.in, configure: include/config.h.in: Added stropts and poll.
include/smb.h: Moved old typedefs of uint8 etc. into include/includes.h where
               all the other defines live (changed them from typedefs to
               defines).
Other changes : changed from using uint32 to SMB_DEV_T and SMB_INO_T
in preparation for moving to size independed (ie. 64 bit clean) device
and inode access. Stat call wrapper comes next :-).

Jeremy.
-
Andrew Tridgell
07f825fc94 I looked at the refresh issue a bit more and discovered that Samba
also doesn't switch to a registration if a refresh fails, instead the
name is removed! This makes it even more imortant that a Samba WINS
server accepts refresh requests as registration requests if the name
is not registered. I've gone ahead and implemented this.
-
Andrew Tridgell
222b6d90e0 minor fixes to the DMB<->DMB sync code. We now get the dmb name from
the local_master name on the unicast subnet if it is unknown.
-
Andrew Tridgell
0a5718b0ae if an address is ipzero in cli_connect() then do a name query -
Andrew Tridgell
685f4ef2e1 I realised that my DMB<->DMB sync code has the property that the
amount of network traffic grows as the square of the number of
workgroups. It probably wouldn't have caused problems but to be safe I
changed the code to use random() to decrease the probability of a
DMB<->DMB sync in proportion to the number of known workgroups. This
keeps the nice browse connectivity while making the traffic rise only
linearly with the number of workgroups.
-
Andrew Tridgell
560ed560f4 fixed a comment -
Andrew Tridgell
1d23dd0912 set a maximum name refresh time of 20 minutes.
The previous code was strictly correct, but not very practical. self
names were only refreshed every 3 days. I hit a situation where the
Samba WINS server was restarted after deleting wins.dat and didn't
notice some remote subnets (also running Samba). I realised that the
complete database wouldn't have been rebuilt for 3 days, which is way
too long. In order to recover from WINS restarts we need a much
shorter maximum refresh time.
-
Andrew Tridgell
55333edd2e cast the qsort to prevent warnings -
Andrew Tridgell
3eade55dc7 bounds check next_token() to prevent possible buffer overflows -
Andrew Tridgell
7d455ee637 added a dest_port parameter to send_mailslot() so we send replies to
the correct port in environments like ip masq.
-
Andrew Tridgell
03d343ddf5 a couple of debug lines -
Andrew Tridgell
a350a54680 finished the asynchronous browse synchronisation code. It even seems
to work (not a lot of testing yet though).

Now we just need to deal with people worried about having more than
two nmbd processes sometimes. (the async processes are created on
demand for browse sync, so you'll only see more than 2 occasionally)
-
Andrew Tridgell
425ccf9271 This should fix the zombie problem that luke noticed. -
Andrew Tridgell
601f995ffb we we have successfully done a query on *<1b> from a wins server and
then obtained a node status response we need to remember the server
name of the master browser so that other browse clients asking us for
a workgroup list will get a entry for the master of that workgroup.
-
Andrew Tridgell
4460a1bc6a changed the way that name query records are sorted in replies. They
are now sorted by the number of common leading bits in the IP address
with the address of the querying host.
-
Andrew Tridgell
f555a76df6 include our netbios names list and our workgroup in the wins.dat hash -