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

591 Commits

Author SHA1 Message Date
Andrew Tridgell
f4b4b3e6e3 casting cleanups
(This used to be commit ab849a97821c9e1f199eea8ea2ec477687bed947)
1997-10-20 02:50:12 +00:00
Andrew Tridgell
7d711a6d0d I am removing these from the source code in preparation for an
upcoming 1.9.18alpha release. We can't release with this code in there
as it currently stands as it might breach ITAR export restrictions in
the US.

I've discussed ways around this with Jeremy and we can put the code
back in with appropriate modifications once it is needed.

Note that this code isn't actually used in Samba yet, so removing it
has no effect.

If anyone wants the code then look in ~samba-bugs/arcfour/ or grab it
from the CVS attic.
(This used to be commit 426cd6b2ded4725186a9262f13a327d8cf94364b)
1997-10-20 01:10:45 +00:00
Andrew Tridgell
62b73f0913 move calls to smbhash() inside smbdes.c (for legal reasons)
(This used to be commit 9dfab27da3634539e99eb48c85dd5a64212e7005)
1997-10-20 01:00:08 +00:00
Andrew Tridgell
02674ea801 update the timestamp on config files in our linked list when we notice
they have changed, otherwise we keep reading them again and again
(This used to be commit 38c07fa932488542dbb687f8e0eca192d5f38a8e)
1997-10-19 23:22:03 +00:00
Luke Leighton
0c1d45dfa4 debugging the srvsvc Net Share Enum. some padding issues; some string length
issues.  it works!
(This used to be commit 80523a3e83191c9e0b930fc71bd502a94a6f1b19)
1997-10-19 17:54:13 +00:00
Luke Leighton
7aa5495c18 creating NetShareEnum parsing / reply creation. compiles, but untested.
(This used to be commit 0a191ee5047b2c81c7adb0554c39ec43d8690230)
1997-10-19 17:01:06 +00:00
Luke Leighton
54ffd7f5c9 Makefile :
added srvparse.o and pipesrvsvc.o

smb.h :

	mods to the Net Share Enum stuff

srvparse.c :

	Net Share Enum parsing support.  more srvsvc pipe parsing to go here...

pipenetlog.c util.c:

	modified standard_sub_basic() so that you can set a global boolean
	and use a different string for the %U username substitution.

proto.h:

	the usual.
(This used to be commit 22b86b6499b2680d16cb4180a736b4e750147409)
1997-10-19 15:33:25 +00:00
Luke Leighton
b0c148793b added the following structures:
SH_INFO_1
	SH_INFO_1_STR
	SHARE_INFO_1_CTR
	SRV_Q_NET_SHARE_ENUM
	SRV_R_NET_SHARE_ENUM

the share info1 container can handle a maximum of 32 shares.  the share info1
string structures contain two unicode strings, with 1024 uint16 characters
_each_.  we're going to _have_ to dynamically allocate the unicode strings,
else we'll run out of stack space.  rapidly.
(This used to be commit e8bedb18bf249d2f06834b0f151ea22df86e2602)
1997-10-19 14:36:27 +00:00
Luke Leighton
30ed3b5c77 pipes.c pipesrvsvc.c :
moved stub srvsvc pipe function into separate file, in preparation for
	further work.
(This used to be commit 2f2d18cc9474e1b40765a67242659be7c63a9936)
1997-10-19 12:24:23 +00:00
Luke Leighton
0225c88104 put the NT_STATUS_ALLOTTED_SPACE_EXCEEDED error in instead of 0x99.
whatever that means.
(This used to be commit ce54f3a7a965b0a9f888dc45d6f4633609d5ca08)
1997-10-18 15:01:01 +00:00
Jeremy Allison
07c507728b After talking with Andrew added "interfaces only" parameter that
turns off the filtering on the broadcast socket by default.
Jeremy (jallison@whistle.com)
(This used to be commit db9aad07481f48c0fe2108d4ab0b2bc9b632816c)
1997-10-18 00:22:04 +00:00
Jeremy Allison
c336a2f081 .cvsignore: Added make_smbcodepage
interface.c: Added is_local_net().
locking.c: Added Fix for zero length share files from Gerald Werner <wernerg@mfldclin.edu>
           plus a race condition fix for the fix.
nameannounce.c: Made function static.
namedbresp.c: extern int ClientDGRAM removed - not used.
namedbserver.c: extern int ClientDGRAM removed - not used.
namedbsubnet.c: Added code to make sockets per subnet.
namepacket.c: Added code to read from all sockets & filter.
nameresp.c: extern int ClientDGRAM removed - not used.
nameserv.c: Indentation tidyup :-).
nameserv.h: Added sockets to struct subnet.
nameservresp.c: Improved debug message.
nmbd.c: Changed to terminte on listen_for_packets exiting.
nmbsync.c: extern int ClientDGRAM & ClientNMB removed - not used.
proto.h: The usual.
util.c: Fixed debug message.
Jeremy (jallison@whistle.com)
(This used to be commit 6904c2de080b2a9702800e9e4126386ced20569d)
1997-10-17 23:08:07 +00:00
Christopher R. Hertel
10087a663b Simply moved the #include for ubi_dLinkList.h from within dir.c to
includes.h.  More consistent with current practice.
(This used to be commit cb51c860b352fb9d07fb3298d0317274ba6c9925)
1997-10-17 21:06:20 +00:00
Luke Leighton
545d6e5a30 make_unihdr() was setting the length to 1/2 the required value.
(This used to be commit 4c99a083b9555b1ccf16faf0d4c1fba8f52bbb6a)
1997-10-17 17:59:38 +00:00
Luke Leighton
9e4626593f pipenetlog.c lsaparse.c smb.h :
SAM logon sorting.  too many buffer pointers.  added in the missing
	switch value (value of 3).  dealing with the buffer pointers to the
	user info structure in a slightly different way.
(This used to be commit 7993e17c9a1edddae6407d3f12790c461def705a)
1997-10-17 16:46:56 +00:00
Luke Leighton
f3c37f925e smbparse.c smb.h :
uni_max_len and uni_str_len are the other way round, in UNIHDR.

util.c :

	increased the show_msg() data size from 256 bytes to 512 bytes:
	the LSA SAM Logon response can be about 500 bytes long.

pipenetlog.c :

	forgot to set the authoritative field to 1.
(This used to be commit 71c6678cd7ffe30a5da27766cf99147e1921feae)
1997-10-17 13:43:01 +00:00
Luke Leighton
f657f37b3a set the wrong info level (0x0C00 0000 instead of 0xC000 0000) so that
nt got confused and thought that the server password had been set instead
of refused.  this is for the SRV_PWSET response.
(This used to be commit f9fbcad42ec20da56466054e1984e391d03b3204)
1997-10-17 11:54:30 +00:00
Andrew Tridgell
34e2b0132e remove a spurious error message from nmbd. The message was:
WINS server did not respond to name registration!

this messages should only be produced when we are trying to register
our own names, not when we are the one with the name database and we
are doing a NAME_REGISTER_CHALLENGE on behalf of another host (for
secured wins registration)
(This used to be commit 42cb21d7259acfca124e5310894fb4fb8df4ad0c)
1997-10-17 03:09:03 +00:00
Andrew Tridgell
008b773834 fix the handling of negative name query responses and the handling of
packets with no answer section in general.

The fix has 2 parts:

1) set ans_name to the name we queried if nmb->answers == NULL

2) check for nmb->answers == NULL in several other places where we
currently check for nmb->answers->data

While doing this, I noticed there are lots of places in our nmbd code
where we make assumptions about the packets being well formed. Someone
could easily implement a denial of service attack on nmbd by sending a
packet that causes a null pointer dereference. Does anyone feel like
going through the code and adding checks? Probably the best solution
is to have a single function that "validates" a packet, making sure
that all the required fields are there. This will be a bit tricky as
what fields are required varies a lot between packets. A first pass
would be a function that prints "SUSPECT PACKET" when it hits a packet
that it suspects does not have a required field (or the field is badly
formatted), then we could use this on a live system to find any cases
we've missed.

Any takers?
(This used to be commit e02c21b0b8e3ed6f2d294458160c4f632af67ed3)
1997-10-17 02:56:23 +00:00
Andrew Tridgell
4fe23997bf added -a "append log" option
(This used to be commit 4b7d51ffb8cf23662e0e58a785620a0652da5a7c)
1997-10-17 01:46:16 +00:00
Luke Leighton
eb7f4cb0e2 smb.h :
id_info_1 has a pointer at the front of it.  so does return credentials,
	and so does the client credentials.  these are all from the sam logon.
	auth_level is 16 bytes not 32 and is actually called a switch_level.

smbparse.c :

	smb_io_unihdr() - uni_max_len and uni_str_len are 16 bytes not 32.
	this may have a knock-on effect on smb_in_unihdr2() but we'll see...
(This used to be commit ce36bfb3e4ad4b72a9f9759a3c49d2a73175d249)
1997-10-16 16:01:25 +00:00
Luke Leighton
820b7045fc dealing with some stack overflow bug somewhere around the use of
deal_with_credentials() by moving important code to the beginning
of the function :-) :-) :-).

the new seed (old_cred + time + 1) was getting corrupted.
(This used to be commit dab35ce5d61d53bce6ede44e56d9393645c0d67e)
1997-10-16 13:38:16 +00:00
Luke Leighton
0d7bdcb6a1 inside the auth 2 response bits, i wasn't storing the received client
credentials for the calculation of the next credentials: i was storing
the auth 2 calculated credentials.

oops.
(This used to be commit eb81fae874383f77ad72c0f7686b8c49e645b0b8)
1997-10-16 12:59:40 +00:00
Andrew Tridgell
ae9b654a6b add ERRDOS/67 ERRnosuchshare to the client.c list of error strings
(This used to be commit 1cccd7c519b8a706567477629bee70f7b7267b5c)
1997-10-16 08:01:00 +00:00
John Terpstra
b676826bec Added Michael Johnsons' PAM modifications <johnsonm@redhat.com>
This patch has been checked over. JHT
(This used to be commit c84a043f89ccba001597962cd03e2f2a634c4b08)
1997-10-16 05:33:24 +00:00
Andrew Tridgell
69eea4fcf8 fixed the problem that browsing breaks if you put quote marks around
the server string option.

I fixed it by adding: trim_string(ret, "\"", "\"") to lp_string()
which means that it removes leading and trailing quotes from _all_
strings in smb.conf. I think this is what we want as I can't actually
think of any case where quoted strings are needed.

I suspect that this fix will actually fix browsing at quite a few
sites. It's not uncommon to see people putting "" marks around the
workgroup name or other essential strings.

The real reason it was causing browsing to fail is that the browse.dat
file uses " to delimit fields, which means that it wasn't being parsed
correctly. It would be nice to use a proper database format in
browse.dat sometime. In fact, we really need a generic database type
subsystem in Samba to replace the mish-mash we currrently use
(browse.dat, wins.dat, smbpasswd etc)
(This used to be commit ac50a88e1181bd4954f03e5450dedce87ed781ad)
1997-10-16 03:53:07 +00:00
Christopher R. Hertel
c3ceabce3a Moved the LGPL from the ubiqx directory into the samba root directory
and renamed it COPYING.LGPL.  This is because the ubi_* files are under
LGPL, not regular GPL.
Removed the last few things from the ubiqx directory and deleted it.
(This used to be commit 31d50db98bbb3b64400d432e386056f7963b7d8d)
1997-10-16 01:13:09 +00:00
Christopher R. Hertel
98f6293297 Don't need it any more.
(This used to be commit 905b2b9562a8c82696d38024ec42aa38ca990277)
1997-10-16 01:06:12 +00:00
Christopher R. Hertel
50147ca41c Made changes to the dir cache functions:
- They now use the ubi_dLinkList linked list code.
  This is not a big gain, I suppose.  It would be significant if there
  were lots of doubly-linked lists in the code and I replaced them all.
  The only other advantage is that the code is more modular, which
  appeals to my own sense of order, if no one elses.  :-}
- I allocate space for the entry structure and the strings in one go,
  instead of using malloc() and separate strdup() calls.  This should
  be more efficient, and allows for a single call to free() to free the
  whole thing.
These are very minor changes, but they do serve to make me more familiar
with the code overall.
(This used to be commit 1dafef88871338f06dbcbbb67ce3bbbb460d7bb6)
1997-10-16 01:03:18 +00:00
Christopher R. Hertel
b525c17026 This code manages a simple doubly-linked list.
(This used to be commit a88ae60fc33e3598f46dfc38e930e261d5e06888)
1997-10-16 00:55:11 +00:00
Christopher R. Hertel
4aedb4ac5d I got fed up trying to put the tree and list stuff into a subdirectory,
so I've started to move them into the main directory.
(This used to be commit 4691a94d3c657321d29231f062aed714dfe4ac26)
1997-10-16 00:46:21 +00:00
Jeremy Allison
359d42c08d ipc.c: Adding Andrews become_root code to the main branch.
locking.c: Adding Andrews become_root code to the main branch.
pipes.c: Fixing the close_file issue.
proto.h: The usual.
reply.c: Move smb_pass into NTDOMAIN defined code. Fixing the close_file issue.
server.c: Fixing the close_file issue.
trans2.c: Fixing the close_file issue.
uid.c: Adding Andrews become_root code to the main branch.
Jeremy (jallison@whistle.com)
(This used to be commit 16fd4337f79ce33f91050c96c4a566221c5d9126)
1997-10-15 21:53:59 +00:00
Luke Leighton
d838452413 smb.h smbparse.c pipenetlog.c :
whoops, the SAM Logon structure was wrong.  updated this, and
	cifsntdomain.txt.  more debug info in pipenetlog.c.  the crash
	is somewhere around deal_with_credentials().

byteorder.h :

	put in uint8, uint16 and uint32 typecasts around debug info, because
	sign extending was resulting in ffffffe8 being displayed instead of e8.

credentials.c :

	some debugging info, because i'm tracking a coredump.  without gdb.
	nothing like making things difficult.

reply.c :

	whoops, missed this (important) bit from paul's code, which tells
	the NT workstation that the MACHINE$ entry doesn't already exist,
	and we're going to create a default entry with a password "machine"
	right now.

proto.h:

	the usual.
(This used to be commit ed606bc7d4e6fb1091e527ea70a3e950d50a1db4)
1997-10-15 19:16:38 +00:00
Christopher R. Hertel
5619b53921 Added ubi_sLinkList module which manages simple singly-linked lists.
(This used to be commit e55a3dc94a824b61a7123b080705be2271268ee4)
1997-10-15 17:59:58 +00:00
Luke Leighton
df4afea583 added srvsvc basic pipe, straight from paul's code. does NETSHAREENUM
and NETSERVERGETINFO.
(This used to be commit 96b17b829fc787c15cd366eca604c09d68b5b900)
1997-10-15 16:51:03 +00:00
Andrew Tridgell
1860d62d0d the usual proto.h update
(This used to be commit bdf3155418be02e2fe4daa1d2538f236be414e98)
1997-10-15 09:18:39 +00:00
Andrew Tridgell
54c3f7bbb0 add the port number to a debug statement
(This used to be commit 97d06dd05e952a134be26ec5998ec4b8d38991dd)
1997-10-15 09:17:21 +00:00
Andrew Tridgell
cc0f55bd5b added loopback_ip. This is used to detect packets from ourselves
(This used to be commit eb76fea411c5c3aa96b7158d02b49ed42ec7ba70)
1997-10-15 09:16:30 +00:00
Andrew Tridgell
9d3cce7c68 fixed the freeze on logout bug. The fix has several parts:
1) add a new parameter to queue_netbios_packet(), the "reply_id", this
is the id that should be used when sending a further response to the
packet (such as a response after we get back a reply to a name query
after senidnga  WACK). reply_id is 0 (meaning unused) in most cases.

2) fix the id used in the reply in add_name_respond() from
response_name_query_register()

3) remember to remove the response record at the end of
response_name_query_register()

4) get the right IP address (it was 0.0.0.0) in
response_name_query_register()

5) add a new field reply_id to struct response_record
(This used to be commit e1e86c1a160c8302004ea58e4f0f5874dd179dae)
1997-10-15 09:15:45 +00:00
Andrew Tridgell
be73ce8321 fixed a stack overflow bug in api_lsa_req_chal()
changed the order of arguments to smbhash() in credentials.c. Luke,
when you changed from E1() to smbhash() you didn't notice that the
arguments are in a different order. This is why your new code was
failing.

NT logon still fails, but now gets to SAMLOGON. It shouldn't take much
to get it working now.
(This used to be commit 708edc348f0fb81d9c918e4bf857f339a13a3781)
1997-10-15 04:51:23 +00:00
Andrew Tridgell
91e56c7b7b force the salt to be a maximum of 2 characters long in calls
to crypt()

This might solve some password problems, particulary on HPUX
(This used to be commit 45f4ae4327a8836cad22bbf64f1effba6a6eb7f5)
1997-10-15 04:04:38 +00:00
Christopher R. Hertel
4a9e9a40dc These are the ubiqx modules, as included with the Samba distribution.
Updated the linked list module, which has new and changed macros.
(This used to be commit 2181d929d1757aa523e7afaf0e8c232a51e68d30)
1997-10-15 03:11:46 +00:00
Christopher R. Hertel
e3d56eb181 First draft of a README file to explain the origins of the "ubiqx" code.
(This used to be commit df3bafd0c488760b1909329c899102d92a2fe16b)
1997-10-15 01:16:37 +00:00
Christopher R. Hertel
f9151159b8 Added a very small piece of documentation to describe the binary tree
modules.
(This used to be commit 781be1daac75092666c1753f21871f2923a6f775)
1997-10-14 19:32:30 +00:00
Luke Leighton
5ca38bab49 pipentlsa.c :
lsa close odd bug.

smbparse.c :

	smb_io_dom_sid() _does_ need 4-byte alignment before it.
(This used to be commit 93879ac8a533ad8cc175275cf1fc9a8f152f4b5a)
1997-10-14 19:31:07 +00:00
Christopher R. Hertel
d4605d5b95 Added a copy of the LGPL to the samba/ubiqx/ directory.
(This used to be commit 28de393878872081bac3a0b3ca82d915eae56701)
1997-10-14 19:30:07 +00:00
Luke Leighton
8fe499f775 byteorder.h:
created a RW_PIVAL macro which was missing.

smbparse.c:

	smb_io_dom_sid() was storing its sub-authorities as uint16s instead
	of uint32s.  used the DBG_RW_PIVAL macro instead of DBG_RW_PSVAL.

pipentlsa.c:

	not sure.  something to do with the Query Info reply.

pipeutil.c:

	make_rpc_reply() had the packed representation field set to 0x0100 0000
	instead of 0x1000 0000, which had the interesting result of turning all
	uint32 and uint16 field byte ordering the other way round!
(This used to be commit eafd6e9e797c5badb07059d7eddabd6a8947c830)
1997-10-14 18:37:55 +00:00
Luke Leighton
6084046eed credentials, query info reply.
(This used to be commit 9b095887df204393090d7da9a47508685ddd5163)
1997-10-14 17:01:43 +00:00
Luke Leighton
657fc8882e changed *(uint32*)(clnt_cred) to SIVAL(clnt_cred, ....)
(This used to be commit 0056b154435e9d2a3fd2be37f7c3afd9e3fbfd87)
1997-10-14 10:17:12 +00:00
Jeremy Allison
9f6a10d173 Broke my own rule about checking in uncompiled source :-(.
Jeremy.
(This used to be commit 9fd056c91196746e09f220a15171f3c97791dcce)
1997-10-14 00:36:57 +00:00