1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-31 01:48:16 +03:00

1363 Commits

Author SHA1 Message Date
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 -
Andrew Tridgell
70ed0ec202 don't put two spaces at the start of lines if logging to stdout
or not timestamping.
-
Andrew Tridgell
c4a8cdc60a changed the format of the wins.dat file slightly.
It now has a line like this:

VERSION 1 251152

the first number is a version #define in nmbd_winsserver.c and will be
used if we ever have to change the format again.

The second number is a hash of the current interfaces setting. It is
used to detect the case where nmbd is restarted on a machine after the
IP of the machine has changed (or the interfaces list has changed in
any way). When that happens we need to discard the old wins.dat cache
or you end up with chaos. This has bitten quite a few people, they
find that when they move a machine it continues using the old IP for
some things for the next week until the wins entries time out!

I've checked, and the old nmbd can handle the new format, although it
does spit out a spurious error message about the VERSION line. So
users can safely run 2.0alpha then switch back to 1.9.18 without
problems.
-
Andrew Tridgell
275679db29 allow smbclient to connect to IPC$ as an IPC service -
Andrew Tridgell
9c1e4c2dae - zero shared memory before freeing it
- changed the hash size to 13 (much smaller than before). This should
  make for more efficient shared memory usage as it will lead to less
  fragmentation.
-
Andrew Tridgell
99782754f7 added a function zero_free(void *, int size) that zeros an area of
memory then frees it. Useful for catching bugs.
-
Andrew Tridgell
d3dda65d51 changed the size of a char array in the userdata_struct from 1 to 16
to account for padding/alignment issues. Eventually I'd like to find a
way to get rid of this construct altogether as it is a bit error
prone and hard to debug.

also added a new macro:

ZERO_STRUCTP() that takes a pointer to a structure and zeros the
structure. Used in nmbd to zero allocated structures before freeing
them to try to catch bugs a bit faster.
-
Andrew Tridgell
c5e5c25c85 added some defensive programming to nmbd. This mostly means zeroing
areas of memory before freeing them.

While doing this I also found a couple of real bugs. In two places we
were freeing some memory that came from the stack, which leads to
a certain core dump on many sytems.
-
Andrew Tridgell
a564e46627 got rid of calls to update_protected_database(). It was causing core
dumps. It is gone until someone can tell us why its needed and what it
does. (It was only used on OSF1 and core dumped there anyway!)
-
Andrew Tridgell
f18b4e95bf don't exit on a SIGPIPE -
Jeremy Allison
779b924ec1 This checking fixes the statcache bug that stopped NetBench from running
correctly. Added new parameter "stat cache size" - set to 50 by default.

I now declare the statcache code officially "open" for business :-).
It gets a hit rate of 97% with a NetBench run and seems to make
using a case insensitive run as efficient as a case sensitive run.

Also tidied up our sys_select usage - added a maxfd parameter and
also added an implementation of select in terms of poll(), for systems
where poll() is much faster. This is disabled by default.

Jeremy.
-
Andrew Tridgell
7db45f169c nmbd would core dump if a large number of netbios aliases is set. The
problem was a buffer overflow in process_node_status_request().

this really points out a general problem is allocating MAX_DGRAM_SIZE
packets on the stack in nmbd. There must be a better way.
-
Jeremy Allison
d6a9087e7e Fixed stat cache statistics calculation. Oops.
Jeremy.
-
Jeremy Allison
d0e48a2d80 This is the stat cache code - seems to work fine (needs heavy
NetBench testing though.... :-). Attempts to efficiently reduce
the number of stat() calls Samba does.
Jeremy.
-
Luke Leighton
cdc38c276d oops - added /usr/include/rpc includes. -
Andrew Tridgell
c2da46d1d0 use a separate ZERO_ARRAY() macro instead of ZERO_STRUCT() for
arrays. This prevents (harmless) warnings from some compilers
-