1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

1721 Commits

Author SHA1 Message Date
Andrew Tridgell
7d455ee637 added a dest_port parameter to send_mailslot() so we send replies to
the correct port in environments like ip masq.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
03d343ddf5 a couple of debug lines 0001-01-01 00:00:00 +00:00
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)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
425ccf9271 This should fix the zombie problem that luke noticed. 0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f555a76df6 include our netbios names list and our workgroup in the wins.dat hash 0001-01-01 00:00:00 +00:00
Andrew Tridgell
70ed0ec202 don't put two spaces at the start of lines if logging to stdout
or not timestamping.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
275679db29 allow smbclient to connect to IPC$ as an IPC service 0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
99782754f7 added a function zero_free(void *, int size) that zeros an area of
memory then frees it. Useful for catching bugs.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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!)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f18b4e95bf don't exit on a SIGPIPE 0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d6a9087e7e Fixed stat cache statistics calculation. Oops.
Jeremy.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Luke Leighton
cdc38c276d oops - added /usr/include/rpc includes. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
c2da46d1d0 use a separate ZERO_ARRAY() macro instead of ZERO_STRUCT() for
arrays. This prevents (harmless) warnings from some compilers
0001-01-01 00:00:00 +00:00
Andrew Tridgell
afe98165a2 get includes right for systems that use getpwanam() 0001-01-01 00:00:00 +00:00
Andrew Tridgell
c2bf18fb8d took all the rpc includes back out until we can work out _why_ freebsd
needs them and what should really be there.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c8b0041570 added a warning when loading a parameter that is deprecated 0001-01-01 00:00:00 +00:00
Christopher R. Hertel
e162819054 Finally got around to updating the man pages for nmbd and smbd to reflect
the changes made re: -a and -o options.

Chris -)-----
0001-01-01 00:00:00 +00:00
Luke Leighton
d1005b5692 added loads of pointless rpcsvc/ and rpc/ include files, all because
rpcsvc/ypclnt.h wants a struct dom_binding.  knock-on include effect under
freebsd 2.1.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2af9565017 note that "alternate permissions" is deprecated in man page 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e4f81f4a23 proto changes 0001-01-01 00:00:00 +00:00
Andrew Tridgell
b32a346a1c some smbtorture hacks (random IPC calls) 0001-01-01 00:00:00 +00:00
Andrew Tridgell
c4363a12fd changed the default permissions code to do this:
if ((sbuf->st_mode & S_IWUSR) == 0)
      result |= aRONLY;

rather than the very complex user/group permissions checks we do
currently. This is equivalent ot setting "alternate permissions = yes"
in the old code. The change is motivated by three main reasons:

1) it's basically impossible to second guess whether a file is
writeable without trying to open it for writing. ACLs, root squash etc
just make it too hard.

2) setting it not RONLY if the owner can write is closer to what NT
does (eg. look at a cdrom - files are not marked read only).

3) it prevents the silly problem of copying files from a read only
share to a writeable share and then finding you can't write to them as
windows preserves the RONLY flag. Lots of people get bitten by this
when they drag a folder from a Samba drive. It also hurts some install
programs.

I have also added a new flag type for loadparm.c called
FLAG_DEPRECATED which I've set for "alternate permissions". I'll soon
add code to testparm to give a warning about deprecated options.
0001-01-01 00:00:00 +00:00
Jeremy Allison
260e7e2740 Added code to (correctly) ignore TRANSACT2_SETFILEINFO with SMB_SET_FILE_ALLOCATION_INFO.
Office 97 expects this call to succeed when you tell it you do NT SMB calls.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
dbe6ad014a Changed ASSERT macros to SMB_ASSERT macros as some systems already
have an ASSERT macro defined.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
e94ab03a4f resource.h on FreeBSD 2.1 requires sys/time.h to come first. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e6ce1c5b5a added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally
in the rpc code.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
bd9290c36c expanded MAX_LOOKUP_SIDS to 30 (I saw 21 in a packet) 0001-01-01 00:00:00 +00:00
Christopher R. Hertel
8a11d04b77 Just tweaking.
If the output line is longer than the format buffer could manage, I was
simply ignoring the additional output (that is, *not* copying it to the
format buffer--thus avoiding a buffer overrun).  Instead, I now output
the current content followed by " +>\n", and then reset the format buffer.
I have never seen a debug line that exceeds the size of a pstring, but I
might as well handle the situation...just in case.

Chris -)-----
0001-01-01 00:00:00 +00:00
Christopher R. Hertel
b1d374fb14 nmbd and smbd had different behavior with respect to log files. nmbd would
default to overwrite and smbd would default to append.  Also, the -a option
(actually a toggle, such that "-a -a" would set the default) was documented
as append mode for nmbd, and *overwrite mode* for smbd.

nmbd now defaults to append mode, to match smbd.  The -a option now always
means append, and I've added the -o option to both, meaning overwrite.

Note that the change to nmbd's default behavior may confuse some people.
I've not seen anything about 2.0.0 changes in the WHATSNEW.txt file.
Where would I document a change like this?

Chris -)-----
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d2fb7ee8f5 don't attempt to answer QFILEINFO/SMB_QUERY_FILE_STREAM_INFO queries -
if we do then NTws gets a BSOD.

I checked and NT server refuses these queries too :)
0001-01-01 00:00:00 +00:00
John Terpstra
6e196841c6 Adding first cut of the new Red Hat Linux packaging tools.
Note: It is intended to extend this so that the release
process produces all the packaging scripts, templates, etc.
that may be needed.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c6899df44c added new smb.conf option "panic action". see my samba-technical
explanation.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
bdd8aaa544 use ZERO_STRUCT() to initialise lots of structures.
Luke, you need to do something similar in the rest of the rpc code.
Have fun!
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f323af8fce added a macro ZERO_STRUCT() which is useful for initialising
structures declared on the stack.
0001-01-01 00:00:00 +00:00
Richard Sharpe
749ec1e0a7 Submitting the smbtar changes to the main branch as well.
Regards
Richard Sharpe
0001-01-01 00:00:00 +00:00
John Terpstra
268cbede0f Fix "make clean" to also delete SPROGS. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0d641d0ceb and get the message right ... 0001-01-01 00:00:00 +00:00
Andrew Tridgell
930a4292e9 silly me.
perms on lock dir should be 755 not 644.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
6e00de7a1d fixed a bug in trans2_qfilepathinfo() where we used the length of the
basename of a file but the whole file name. silly error.
0001-01-01 00:00:00 +00:00
Jeremy Allison
193cb53824 Fixes for the problem in blocking locks with file_fsp returning the
chain_fsp on close (if you don't know what this means, consider yourself
lucky - this one took a day to track down :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e1dd03ecda Turning on blocking locking code. NB. Blocking lock requests that are not
the head of an SMB request (ie. are part of a chain) will not be queued -
this will be fixed when we move to the new chain code. In practice, this
doesn't seem to cause much of a problem (in my admittedly limited testing)
bug a debug level zero message will be placed in the log when this
happens to help determine how real the problem is.

smbd/locking.c: New debug messages.
smbd/blocking.c: New blocking code - handles SMBlock, SMBlockread and SMBlockingX
smbd/chgpasswd.c: Fix for master fd leak.
smbd/files.c: Tidyup comment.
smbd/nttrans.c: Added fnum to debug message.
smbd/process.c: Made chain_reply() use construct_reply_common(). Added blocking
                lock queue processing into idle loop.
smbd/reply.c: Added queue pushes for SMBlock, SMBlockread and SMBlockingX.
Jeremy.
0001-01-01 00:00:00 +00:00