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

197 Commits

Author SHA1 Message Date
Richard Sharpe
dc9436bae4 Remove the copyright to Canon Information Systems Australia, as we don't
want them to have the copyright.

Added a new DOSERR response code that Win95 returns, unimp, unimplemented.

Added code to ignore errors on setting remote time, as Win 95 does not like
the time being changed on a directory.  Win NT and Samba are OK at this.

This is the next to last clean-ups here. Next is to properly handle restore
times on directories (except for Win95--see above).

Now have Jay's changes in and have fixed a bug reported by Tim Lee.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d23b443225 clientgen: Added USE_SSL for client shutdown.
clitar.c: Added 'Samba style' comments before string_create_s().
loadparm.c: Fixed missing comma in SSL code.
util.c: Removed string_create_s(). Currently it's only called from
        clitar.c and having it here as well as a static in clitar
        causes the compile to break (Richard, please decide where
        you want this function).
lib/rpc/parse/parse_net.c: Fix from <anders.blomdell@control.lth.se>
                           to stop coredump on missing parameter.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
31e768369f Added SSL support from Christian Starkjohann <cs@obdev.at>
This patch may not yet compile with -DUSE_SSL enabled, further
Makefile changes may be needed. But it was important to get
this code in place before I go off to USENIX.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5bf17840ac namequery.c: Fixed SGI IRIX 5.x compiler problem.
server.c: Added MACHINE.SID file generation - use lp_domain_sid() be default.
smbpass.c: Exposed do_file_lock() as I now use it in server.c
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
204a939807 test for overflow in nmb name parsing code 0001-01-01 00:00:00 +00:00
Jeremy Allison
2d77445400 This is a security audit change of the main source.
It removed all ocurrences of the following functions :

sprintf
strcpy
strcat

The replacements are slprintf, safe_strcpy and safe_strcat.

It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.

Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.

Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ee09e9dadb changed to use slprintf() instead of sprintf() just about
everywhere. I've implemented slprintf() as a bounds checked sprintf()
using mprotect() and a non-writeable page.

This should prevent any sprintf based security holes.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c6c22df201 clientgen.c: Fixed null session setup bug.
password.c: Stopped cli_nt_logout call (we don't have it correct yet).
            Added Luke object-orientation fix :-).
smb.h: Added clnt_name_slash to cli_state.
lib/rpc/client/cli_login.c: Changed global_myname to clnt_name_slash where needed.
lib/rpc/client/cli_netlogon.c: Fixed debug messages, don't check creds on error.
lib/rpc/client/cli_pipe.c: Fixed debug messages, Added Luke object-orientation fix.
lib/rpc/parse/parse_misc.c: Fixed STRING2 linearization bug that was adding 1.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
17b94a7084 This is the checkin that adds the security=domain functionality.
WARNING - so far this has only been tested against a Samba PDC
(still waiting for IS to add me the machine accounts :-).

Still missing is the code in smbpasswd that will add a machine
account password and change it on the domain controller, but
this is not hard, and I will check it in soon.

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5f258abf52 Fixed checked in code that didn't compile.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
37cbc35674 added NetShareEnum from Bartlomej Czardybon <czar@silesia.pik-net.pl> 0001-01-01 00:00:00 +00:00
Jeremy Allison
866406bfe3 This looks like a big change but really isn't.
It is changing the global variables "myname" and "myworkgroup"
to "global_myname" and "global_myworkgroup" respectively.

This is to make it very explicit when we are messing
with a global (don't ask - it makes the domain client
code much clearer :-).

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
899a9f0dce Makefile: Added nterr.c into the mix.
clientgen.c: Added nt_error as an entry in the struct client_state.
password.c: Open the netlogon pipe.
smb.h: Added nt_error as an entry in the struct client_state.
lib/rpc/parse/parse_net.c: Added comments on net logon.
lib/rpc/server/srv_netlog.c: Added comments on net logon.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
932b22cd49 We will need this new nterr.c for the DOMAIN_CLIENT code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0f00b8fce1 clientgen.c: Added rap error codes to cli_error, moved from smbpasswd.c
password.c: Changed global cli -> pw_cli, removed strtok (bad strtok, bad :-)
use in security=server, started to extend security=domain code.
smbpasswd.c: Removed rap error code functions.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
77882f002b clientgen.c: Added cli_ulogoff() call.
password.c: Added call to cli_ulogoff on successfull sessionsetup.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
608e985463 Makefile: Added genrand.o
clientgen.c: Changed to fill change password buffer with random stuff.
password.c: Changed to get challenge from genrand.c
server.c: Added #ifdef around O_SYNC.
version.h: Changed to 1.9.19prealpha.
genrand.c:

   New code to generate (hopefully) good random numbers for
use in crypto challenges/session keys etc.

PLEASE REVIEW THIS CODE AND SUGGEST IMPROVEMENTS !!!!!!

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
38350ea8b9 clientgen.c: Changes 'cli_xxx_' calls to use the following
regularized parameter syntax:

   setup, setup_count, max_setup_count,
   params, params_count, max_params_count,
   data, data_count, max_data_count,

(and if a reply is needed)

   *reply_params, *reply_data_len
   *reply_data, *reply_data_len

This allows the pointers and the lengths
that relate to these pointers to be next
to each other in the parameter list. This
makes seeing what you are passing to these
functions much easier to see.

Getting ready for adding the lib/rpc/client
functions needed to do security=domain.

torture.c: Fixed it so it uses / rather than \\
internally for the //machine/share syntax.

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
50aa513b96 Changing of machine passwords now works !!!!!!
smbdes.c: Added cred_hash3.
smbpasswd.c: Fixes for adding a machine account (needs more work).
lib/rpc/server/srv_netlog.c: Turn on the machine password changing
code by default (calls cred_hash3).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
cd2613c572 Changes to allow Samba to be compiled with -Wstrict-prototypes
with gcc. (Not a big change although it looks like it :-).

Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d361a06fa1 if the resolve order is blank then assume "host" 0001-01-01 00:00:00 +00:00
Andrew Tridgell
000b871839 support O_SYNC in opens for smbtorture 0001-01-01 00:00:00 +00:00
Jeremy Allison
4ac50c0f0a chgpasswd.c, ipc.c, loadparm.c: Added boolean "unix password sync"
parameter which allows the new change password code to change the
unix password also. Defaults to OFF.
includes.h: Added termios.h to FreeBSD to allow password changing.
namequery.c: Fixed missing name parameters to debug statements.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a31aa09173 RFC1002 says we must put compressed name pointers in the following
outgoing packets :

NMB_NAME_REG_OPCODE, NMB_NAME_RELEASE_OPCODE, NMB_NAME_REFRESH_OPCODE,
NMB_NAME_MULTIHOMED_REG_OPCODE.

A WINS server written by Shadow Software was rejecting our packets
as we weren't using name pointers in those requests (talk about
picky :-).

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7f74970838 clientgen.c ipc.c smbpasswd.c: Fixes for warnings (from Herb).
quotas.c: Linux quota fix.
util.c: Ensure smb_read_error is zero in all calls that can set it.
lib/rpc/include/rpc_misc.h lib/rpc/include/rpc_netlogon.h
lib/rpc/parse/parse_misc.c lib/rpc/parse/parse_net.c
lib/rpc/server/srv_netlog.c : Modify Luke's code to call
SamOEMhash().

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
20770b6f1c Adding the same changes to HEAD as were added to BRANCH_1_9_18.
Changed smbpasswd to be client-server for a normal user, rather
than accessing the private/smbpasswd file directly (it still accesses
this file directly when run as root, so root can add users/change a
users password without knowing the old password).

A shakeout of this change is that smbpasswd can now be used to
change a users password on a remote NT machine (yep - you heard
that one right - we can now change a NT password from UNIX !!!!!).

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e02e3bcbbd Added SamOEMChangePassword functionality.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
734dde8d68 Fixes for the static data bugs & incorrect use of strtok
that Andrew pointed out.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7f118970da Adding the same change as was added to 1.9.18 branch to add the
"name resolve order" parameter.

source/Makefile: Re-ordered link for name resolve order code.
source/clientgen.c:
source/clientutil.c: Added calls to resolve_name().
source/includes.h: Added HPUX zombie fix.
source/loadparm.c: Added new name resolve order parameter.
source/namequery.c: Re-wrote to include parsing of lmhosts file, new resolve_name()
                    function requested by John.
source/nmbd.c: Tell resolve_name not to do WINS lookups if we are the WINS server.
source/nmbd_lmhosts.c: Call lmhosts parsing functions in namequery.c
source/password.c: Call resolve_name() to lookup security=server name.

source/reply.c:
source/time.c:
source/trans2.c: "fake directory create times" fix from Jim Hague - hague@research.canon.com.au.
source/util.c: Removed isalnum() test in Get_Hostname() that seems to cause
               problems on many systems.

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b9c1697723 This is *not* a big change (although it looks like one).
This is merely updating the Copyright statements from 1997 to 1998.
It's a once a year thing :-).
NO OTHER CHANGES WERE MADE.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
cd9fad92d0 charcnv.c: Added codepage 866 support onto the file system. Patch
from Max Khon <max@iclub.nsu.ru>.
chgpasswd.c: Allow old RAP change password to work with encrypted
passwords. Samba can now allow Windows 95/NT clients to securely
change the Lanman password ! (But not the NT hash - that gets lost).
ipc.c:
smbdes.c:
smbpass.c: Support for the above.
server.c: #ifdef'ed out fix for NT redirector bug.
util.c: Fix NIS bug with server name.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0b0b1fb122 reply.c:
server.c: Test fix for NT worstation SMBmv oplock bug.
smbdes.c: Addition of 'forward' parameter in preparation of allowing
password change.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1084fb4682 client.c:
clientgen.c:
clientutil.c:
clitar.c: Changed usage of receive_smb to new function client_receive_smb
          except for one use of receive_smb in client.c. This is the
          receive_smb used to discard packets received whilst in a
          keyboard wait state.
util.c: Created new function client_receive_smb that ignores session
        keepalives just as the old receive_smb used to do. Created
        internal function read_smb_length_return_keepalive that is
        used internally by the changed receive_smb call.
        Changed read_smb_len to not use an internal buffer - it is
        never called with a null buffer so such code is redundant.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d80b0cb645 This is it ! The mega-merge of the JRA_NMBD_REWRITE branch
back into the main tree.
For the cvs logs of all the files starting nmbd_*.c, look
in the JRA_NMBD_REWRITE branch. That branch has now been
discontinued.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
fbb2be050d add the null string to SMBsetatr calls 0001-01-01 00:00:00 +00:00
Jeremy Allison
16e55ee2b8 clientgen.c: Added cli_mv() (used in a recent torture test).
reply.c: Changed reply_open_and_X to split out the oplock
request bits from core and extended and if an oplock was granted only set
the corresponding bit on reply.
server.c: Added code to dynamically allocate i/o buffers in oplock_break
(prevents recursion problems) , also made reset of sent_oplock_break
explicit.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
3a5e07f1e9 added cli_rmdir and cli_mkdir
added test in smbtorture for the server updating the directory modify
time when a file is added to a directory

cleanup in smbtorture so no garbage files are left on the server
0001-01-01 00:00:00 +00:00
Andrew Tridgell
162947c6e6 added a SMB_QUERY_FILE_ALL_INFO test into smbtorture
W95 doesn't seem to support this call.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
89141de14e added some QPATHINFO and QFILEINFO tests into smbtorture.
This tests for things like midnight access times, sticky create times
and word reversed INFO_STANDARD returns
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2f29c24ba7 test SMBsetatr as well 0001-01-01 00:00:00 +00:00
Andrew Tridgell
d64d40a6ec added a test for the NT SMBgetatr bug in smbtorture
added support for choosing the protocol level in smbtorture (-m option)

use -1 for null date in cli_close()

get the attributes right in cli_open()
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4561b8242e changed nmblookup to only set recursion_desired in queries if the -R
option is used.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
628d5895aa fixed a bug which caused nmbd to core dump. The problem was incorrect
parameters to cli_NetServerEnum()
0001-01-01 00:00:00 +00:00
Jeremy Allison
4a36ac236c Rolled back tree state to 11:59pm 8th November 1997 EST to
remove problems.
Jeremy
0001-01-01 00:00:00 +00:00
Luke Leighton
f27966957f attempting to mark up 32 bit error codes, needed for NT domains.
separated out smb server-mode password validation into a separate file.
added called and calling netbios names to client gen state: referenced
section in rfc1002.txt.
created workstation trust account checking code in ntclient.c

there might be a bug in reply_session_setup_andX.  i indented and added { }
around single-line if statements: the lm password checking code now doesn't
look right (around the GUEST_SESSSETUP bits).  *no code semantics have been
changed by the indentation process*.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
097781e299 added two more sets of tests to the smbtorture test. The tests I added
are ones that I know Samba fails. They are:

  1) correct support for retaining locks over a close (ie. the server
     must not use posix semantics)
  2) support for lock timeouts
  3) the server supports multiple locking contexts on the one SMB
  connection, distinguished by PID.
  4) the server correctly fails overlapping locks made by the same PID (this
     goes against POSIX behaviour, which is why it is tricky to implement)
  5) the server denies unlock requests by an incorrect client PID

I've been discussing with Jeremy ways that we can re-implement the
locking code to handle these correctly. This test code will be useful
to see that we have got it right.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c164681dfe fix some uchar/char conflicts 0001-01-01 00:00:00 +00:00
Andrew Tridgell
21878e7d86 convert the credentials code back to uchar[8] from uint32[2]
This should fix the byte order problems (maybe!)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
054e3b2ae3 a simple SMB torture tester. This will allow us to evaluate locking
techniques more accurately.
0001-01-01 00:00:00 +00:00
Luke Leighton
0a549e62fb hooray. hooray some more. hooray a lot. got the client-side working.
Q/R LSA_REQ_CHAL; Q/R LSA_AUTH2; Q/R LSA_SAMLOGON; Q/R LSA_SAMLOGOFF.
the last (non-essential right now) bit is the LSA_SRV_PWSET.

the next stage is to do LSA_OPENPOLICY; add the pipe binds (missing right
now); then we can test against an NT Server.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
944ecbcbd4 fix some casting errors in smbencrypt and some multiply-defined errors
in clientutil.c (Luke, you can't just copy a global variable
declaration from one file to another, you need to declare one of them
extern)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4bf5c03b18 The browse synchronisation code in nmbsync.c now uses the clientgen.c
code, which means we don't have to link with a fake getpass routine
and we don't have a whole pile of global variables that really have
nothing to do with nmbd and were there to keep the client code happy.

The code should function identically to what it did before (hopefully
it was correct)

The only thing that now uses the horrible clientutil.c code is
smbclient.
0001-01-01 00:00:00 +00:00
Luke Leighton
82436a3d99 Makefile :
adding bits for new nt domain code

byteorder.h :

	trying to get macros right, and not to crash on SUNOS5...

client.c :

	added #ifdef NTDOMAIN, and created do_nt_login() function.  don't
	want to have to recompile client.c unless absolutely necessary.

credentials.c :

	moved deal_with_creds() [possibly inappropriately] into credentials.c

ipc.c reply.c server.c uid.c :

	attempting to make (un)become_root() functions calleable from smbclient.
	this is a little tricky: smbclient might have to be another setuid
	root program, immediately setuid'ing to non-root, so that we can
	reset-uid to root to get at the smbpasswd file.  or, have a secure
	pipe mechanism to smbd to grab smbpasswd entries.  or the like.

smbdes.c smbencrypt.c :

	created a function to generate lm and nt owf hashes.

lsaparse.c ntclient.c smbparse.c :

	added nt client LSA_AUTH2 code.  it works, too!

pipenetlog.c pipentlsa.c pipesrvsvc.c :

	simplification.  code-shuffling.  getting that damn offset right
	for the opcode in RPC_HDR.

smb.h :

	changed dcinfo xxx_creds to DOM_CRED structures instead of DOM_CHAL.
	we might need to store the server times as well.

proto.h :

	the usual.
0001-01-01 00:00:00 +00:00
Luke Leighton
6d301d2cfd nmblib.c :
adding some debug info

pipenetlog.c pipentlsa.c pipesrvsvc.c :

	using unistrn2 instead of unistr2 in the SAM logon username.
	wrong offset for command in request (use "reserved" field
	not cancel_count.  AGH i'll get there)
0001-01-01 00:00:00 +00:00
Luke Leighton
39cec7f698 nterr.c :
added a structure that wraps nt errors as strings and enums, so we
	can do a smb_nt_error() function.

Makefile ntclient.c :

	added ntclient.c, broken out nt domain stuff into a separate file.
	getting fed up of compile-times and size of client.c.

	fixed the do_lsa_req_chal() function.  made it read the response,
	and return the challenge credentials received from the server.

	next stop: do_lsa_auth_2().

client.c :

	removed nt domain logon functions into a separate file.

pipenetlog.c pipentlsa.c pipesrvsvc.c smbparse.c :

	i'd broken the offsets of the RPC_HDR while trying to sort out the
	nt client code.  fixed it again.  added some robustness stuff.

util.c :

	the unistrn2() function was null-terminating the string at one
	character too many.
0001-01-01 00:00:00 +00:00
Luke Leighton
25560cf40b renamed static cli_setup_pkt() to static cli_setup_packet() because it
clashed with the currently-used cli_setup_pkt() in clientutil.c
0001-01-01 00:00:00 +00:00
Andrew Tridgell
178e27de07 Implemented asynchronous DNS lookups in nmbd.
I realised this afternoon just how easy it is to add this, so I
thought I'd implement it while the idea was fresh.

nmbd forks at startup and uses a pipe to talk to its child. The child
does the DNS lookups and the file descriptor of the child is added to
the main select loop.

While I was doing this I discovered a bug in nmbd that explains why
the dns proxy option has been so expensive. The DNS cache entries in
the WINS list were never being checked, which means we always did a
DNS lookup even if we have done it before and it is in cache. I'm sure
this used to work (I tested the DNS cache when I added it) so someone
broke it :-(

Anyway, the async DNS gets rid of the problem completely. I'll commit
just the fix to the DNS cache bug to the 1.9.17 tree.

You can disable async DNS by adding -DSYNC_DNS to the compile flags.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
3a0b5f06f4 This is a set of generic SMB client routines. I needed this in a hurry
to fix the password server code, so I didn't use SMBlib. This code is
fairly generic and uses a "struct cli_state" to hold the client
state.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ab849a9782 casting cleanups 0001-01-01 00:00:00 +00:00
Andrew Tridgell
9dfab27da3 move calls to smbhash() inside smbdes.c (for legal reasons) 0001-01-01 00:00:00 +00:00
Luke Leighton
7993e17c9a 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
ed606bc7d4 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
97d06dd05e add the port number to a debug statement 0001-01-01 00:00:00 +00:00
Andrew Tridgell
708edc348f 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.
0001-01-01 00:00:00 +00:00
Luke Leighton
9b095887df credentials, query info reply. 0001-01-01 00:00:00 +00:00
Luke Leighton
d7a9a02e0a debugging... no idea what i'm doing. 0001-01-01 00:00:00 +00:00
Luke Leighton
a3f96555b4 debug info added 0001-01-01 00:00:00 +00:00
Luke Leighton
9fdd697d17 byteorder.h :
debugging output wasn't (still isn't) perfect.

credentials.c lsaparse.c smbparse.c :

	added DEBUG strings.

pipes.c :

	lost some changes, to do with setup of RPC headers.  arg.
0001-01-01 00:00:00 +00:00
Luke Leighton
87a0a94485 Makefile:
added credentials.c to smbd

credentials.c:

	using credential structures instead of char*

password.c uid.c server.c:

	added sid and attr to user_struct.

smbdes.c:

	smbhash and str_to_key make public instead of private.

pipes.c smb.h:

	lsa structures, sub-functions.

proto.h:

	usual.
0001-01-01 00:00:00 +00:00
Luke Leighton
72a86f514f credentials.c:
use UTIME structure (defined and commented in smb.h to be time, secs,
                         since 01jan1970)

pipes.c:

	another sub-function.

util.c:

	added char *unistr2(uint16 *buff) function.  same as unistr except
    it takes uint16* instead of char*.

smbparse.c smb.h:

	more structure sorting.

proto.h:

	the usual.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
dd6ac9b1ee an implementation of the NT domain credentials protocol 0001-01-01 00:00:00 +00:00
Jeremy Allison
e7eb1f044d Adding Andrews buffer overflow fixes into the main branch.
Jeremy (jallison@whistle.com)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
35b92e725f - change generate_challenge() to use md4 instead of des
- move routines about a bit between smbencrypt.c and smbdes.c. Ensure
that there is no entry point for normal DES operation

- add the following comment:

   This code is NOT a complete DES implementation. It implements only
   the minimum necessary for SMB authentication, as used by all SMB
   products (including every copy of Microsoft Windows95 ever sold)

   In particular, it can only do a unchained forward DES pass. This
   means it is not possible to use this code for encryption/decryption
   of data, instead it is only useful as a "hash" algorithm.

   There is no entry point into this code that allows normal DES operation.

   I believe this means that this code does not come under ITAR
   regulations but this is NOT a legal opinion. If you are concerned
   about the applicability of ITAR regulations to this code then you
   should confirm it for yourself (and maybe let me know if you come
   up with a different answer to the one above)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9a42f88a09 bug fix in the new des code.
I had one of the sbox[] constants wrong, which interestingly gave a
20% chance of the whole algorithm failing.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
a156997166 rewrote md4.c from scratch. This implementation should be portable and
doesn't have any worries about RSA copyright.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
db917c62c1 This commit does 3 main things:
1) put the encryption code in by default, with no #ifdef. It is still
disabled by default so you need to add "encrypt passwords = yes" in
smb.conf but at least all binaries will have it.

2) cleanup the kanji code so it compiles with no warnings

3) get rid of lots of uses of ugly non-portable C code. The main
offender being things like "register" but also remove uses of the
"const" keyword as there are compilers out there that don't support it
and even those that do often complain about its usage. Users don't
like warnings :-(

There is still some work to do. We need to replace the md4 code with
our own implementation. The current code (from rfc1186) is PD but is
not very portable. The new RFC (rfc1320) is more portable but adds
copyright restrictions. I'll do a from-scratch MD4 soon.

We also need to test that what I've implemented is portable. It should
be, but I'm too tired right now to test it on anything other than
intel linux.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c2bc073a87 This is a written from scratch DES implementation. I couldn't find a
GPLd implementation so I decided to write one.

This version only does DES ecb encryption and isn't very general, so
it may in fact be exempt from ITAR regulations. ITAR regulations do
not prohibit the distribution of code that can be used for
authentication purposes only. This code has no decrypt function so it
would be useless for a normal encryption application and thus may be
ITAR exempt.

It is also very slow, but we don't need it to be fast. It is a literal
implementation from the standard and treats each bit as one byte to
make the code easy to write.
0001-01-01 00:00:00 +00:00
Samba Release Account
f08222bd8b charcnv.c: Fixed silly bugs detected on IRIX.
client.c:	Fixed silly bugs detected on IRIX.
namedbname.c:	Stopped 1d names from being registered in WINS db.
namedbsubnet.c:	Only register 1e names on broadcast subnet.
nameelect.c:	Changed add_my_name entries. Forced host announces if we
                have less than 10 servers listed. Fixed registering 1b
                domain name issues.
namepacket.c:	Added error message when dgram discarded.
nameserv.c:	Added notion of 'direct' names that are not registered on
                the network. Needed to get around bugs in earlier nmbd
                handling of DOMAIN(1b) names.
nameservreply.c:Tidied up debug message.
nameservresp.c:	Added response_name_query_domain() code. Deals with
                re-registering DOMAIN(1b) name.
nmbd.c:		Fixed silly bugs detected on IRIX.
nmblib.c:	Added paranoia debugs.
proto.h:	Updated remove_name_entry(), add_my_name_entry().
server.c:	Fixed silly bugs detected on IRIX.
trans2.c:	Fixed silly bugs detected on IRIX.
uid.c:		Fixed silly bugs detected on IRIX.
version.h:	Updated to alpha3.
Jeremy (jallison@whistle.com).
0001-01-01 00:00:00 +00:00
Samba Release Account
cf23a155a1 'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com)
Wed May  7 1997: Update for 1.9.17alpha1 release - 'browsefix release'
designed to make browsing across subnets work.

byteorder.h:	Updated copyright to 1997.
charcnv.c:      Updated copyright to 1997.
charset.c 	Updated copyright to 1997.
charset.h	Updated copyright to 1997.
client.c	Updated copyright to 1997.
clientutil.c	Updated copyright to 1997.
dir.c		Updated copyright to 1997.
fault.c		Updated copyright to 1997.
includes.h	Updated copyright to 1997.
interface.c	Updated copyright to 1997.
ipc.c		Updated copyright to 1997.
kanji.c		Updated copyright to 1997.
kanji.h		Updated copyright to 1997.
loadparm.c	Updated copyright to 1997.
locking.c	Updated copyright to 1997.
mangle.c	Updated copyright to 1997.
message.c	Updated copyright to 1997.
nameannounce.c

	Made use of WINS subnet explicit.
Added reset_announce_timer() so announcement
can be made immediately when we become a master.
Expanded code to do sync with dmb.

namebrowse.c

	Removed redundent checks for AM_MASTER in
sync code. Made use of WINS subnet explicit.

namedbname.c	Made use of WINS subnet explicit.
namedbresp.c	Made use of WINS subnet explicit.
namedbserver.c	Made use of WINS subnet explicit.

namedbsubnet.c

	Explicitly add workgroup to WINS subnet
when we become a dmb. Made use of WINS subnet explicit.

namedbwork.c

	Made use of WINS subnet explicit. Removed
redundent check_work_servertype() function.

nameelect.c

	Explicitly add workgroup to WINS subnet
when we become a master browser. Made use of WINS subnet explicit.

namelogon.c	Updated copyright to 1997.
namepacket.c	Updated copyright to 1997.
namequery.c	Updated copyright to 1997.

nameresp.c

	Made use of WINS subnet explicit. Made nmbd fail if
configured as master browser and one exists already.

nameserv.c

	Made use of WINS subnet explicit. Remove redundent
logon server and domain master code.

nameserv.h	Add emumerate subnet macros.
nameservreply.c	Made use of WINS subnet explicit.
nameservresp.c	Updated copyright to 1997.

namework.c

	Made use of WINS subnet explicit. Updated code to
add sync browser entries to add subnet parameter.

nmbd.c

	Added sanity check for misconfigured nmbd.

nmblib.c	Updated copyright to 1997.
nmblookup.c	Updated copyright to 1997.
nmbsync.c

	Removed redundent AM_ANY_MASTER check.

params.c	Updated copyright to 1997.
password.c	Updated copyright to 1997.
pipes.c		Updated copyright to 1997.
predict.c	Updated copyright to 1997.
printing.c	Updated copyright to 1997.

proto.h

	Changed protos for new nmbd code.

quotas.c	Updated copyright to 1997.
replace.c	Updated copyright to 1997.
reply.c		Updated copyright to 1997.
server.c	Updated copyright to 1997.
shmem.c		Updated copyright to 1997.
smb.h		Updated copyright to 1997.
smbencrypt.c	Updated copyright to 1997.
smbpasswd.c	Updated copyright to 1997.
smbrun.c	Updated copyright to 1997.
status.c	Updated copyright to 1997.
system.c	Updated copyright to 1997.
testparm.c	Updated copyright to 1997.
testprns.c	Updated copyright to 1997.
time.c		Updated copyright to 1997.
trans2.c	Updated copyright to 1997.
trans2.h	Updated copyright to 1997.
uid.c		Updated copyright to 1997.
username.c	Updated copyright to 1997.
util.c		Updated copyright to 1997.
version.h

	Changed to 1.9.17alpha1.
0001-01-01 00:00:00 +00:00
Samba Release Account
4563d978fe Added better debug for what kind of netbios packet we got.
jra@cygnus.com
0001-01-01 00:00:00 +00:00
Samba Release Account
979acbc109 Fixed for FreeBsd.
jra@cygnus.com
0001-01-01 00:00:00 +00:00
Andrew Tridgell
3af04f1580 - added support for TMPDIR env variable
- fixed fault.c for linux 2.1
- put back in the FIND_SELF failing code
- cleaned up casts in encryption
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f2c5f1eab1 - set default printer driver string to "NULL"
- fixed debug levels for name status parsing
0001-01-01 00:00:00 +00:00
Andrew Tridgell
61e3116e57 - use workgroup from smb.conf in smbclient
- change debug level on clitar stuff

- define MAP_FILE if not defined

- ensure we never set authoritative on queries in nmbd

- fake a positive response to SMBioctl, apparently this is needed for
some WfWg printer drivers

- deny file access for non-fcbopen queries when (access_allowed == AREAD && flags == O_RDWR)

- add sys_waitpid()
0001-01-01 00:00:00 +00:00
Andrew Tridgell
45e66a69d3 backout all the changes to nmbd.
The 1.9.16 tree is now back to 1.9.16p2 as far as nmbd is concerned
apart from a small change that fixes the announce type in two places.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
20b6203dac - a huge pile of changes from Luke which implement the browse.conf
stuff and also fix a pile of nmbd bugs. Unfortunately I found it very
hard to disentangle the new features from the bug fixes so I am
putting in the new code. I hope this is the last big pile of changes
to the 1.9.16 series!
0001-01-01 00:00:00 +00:00
Andrew Tridgell
aa6f8b04d1 - sequent-ptx support from bressler@iftccu.ca.boeing.com (Rick
Bressler)
- machten support from Trevor Strohman (trev@figment.tenon.com)

- added qinfo command to client as part of drag-and-drop printer
support for win95 from David Chappell <chappell@mouse.cc.trincoll.edu>
He also added the "printer driver" option

- use sigblock() on more systems and use sigsetmask(0) instead of
sigunblock() as its more portable. This beats a problem with zombies
on heavilily loaded systems.

- added internals.doc written by David Chappell into the source tree

- get rid of PRINT_COMMAND options from local.h as they are no longer
relevent

- new kanji code from Fujita

- don't set the recursion_available flag on queries in nmbd

- fix a potential bug with pointer subtraction in printing.c

- got rid of error_count code as the real fix (the EOF problem) is now
in
0001-01-01 00:00:00 +00:00
Samba Release Account
6e932e4bae local_only NetServerEnum syncs can now be issued.
bug spotted in nameservresp.c - arguments to test subnet the response
is received on (same_net()) were the wrong way round (ccm@shentel.net)

samba was adding WORKGROUP(1e) as a unique not a group name: fixed this

bug in reply_name_status() and reply_name_query(): WINS entries weren't
being looked up.

name status reply adds local SELF entries to WINS SELF entries: some
SELF entries are only added locally, while others are only added via
WINS. name status needs to have both, combined.

a sync will only occur when an ANN_LocalMasterAnnouncement is received, NOT
an ANN_HostAnnouncement or an ANN_DomainAnnouncement.

when samba is a member of a workgroup, it looks for (using a wins server)
and announces to its domain master. NAME_QUERY_ANNOUNCE_HOST - yet another
'state' - has been created to do this: do the name query on the wins server
and send the announce host to the answer to this query.

jeremy @ vantive wrote the original code to do this, which used the
name_query() function.  i'm trying to avoid name_query: it times out and
generally messes things up, but using queue_netbios_packet() and
queue_netbios_pkt_wins() is... not intuitive?

lkcl with help from jra
0001-01-01 00:00:00 +00:00
Samba Release Account
45d3b26447 lots of changes to nmbd
lkcl
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b551dc98f7 got rid of a lot of redundent header files as we now globally generate
prototypes automatically using "make proto". This is much less prone
to error than the old method of manually adding prototypes
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7ed71b73ae - added interface.c and removed all the references to myip, bcast_ip
and Netmask, instead replacing them with calls to routines in
interface.c

- got rid of old MAXINT define

- added code to ensure we only return one entry for each name in the ipc
enum routines

- added new_only option to add_netbios_entry() to prevent overwriting
of important names

- minor time handling fixup
0001-01-01 00:00:00 +00:00
Andrew Tridgell
cfbad9b082 - changed some debug levels in clientutil.c
- added dir_check_ftype() to clean up the file type checking a bit

- added check for libc version >= 5 for setfsuid() for Linux

- moved the AM_MASTER() and related macros to nameserv.h

- added proper defines for the various netbios announce types

- don't call the announce_backup() code, as I'm pretty sure its wrong
it sent ANN_GetBackupListReq packets as broadcasts, they are supposed
to be used only by clients to the master browser to find a list of
available backup servers to remote a netserverenum to, I don't think
nmbd should ever send one.

- fixed a bug in the browse list writing

- minor debug cleanups

- put in the code to discard our own broadcasts (it won't work for
multi-homed hosts though)

- changed ELECTION_VERSION to 1 so we can be beaten by a NT 3.51 server by
lowering the os level.

- only do sync_browse_lists() if we are the master browser, otherwise
we'll cause network overload

- don't call tell_become_backup() as it appears to be badly broken, it
should only be used when the machine being told has its MAINTAIN_LIST
to to auto. Not calling it does no great harm anyway

- fix a nasty bug where becomebackup was confused with reset browser!

- make setbuffer() not get caught by the auto protototypes
0001-01-01 00:00:00 +00:00
Andrew Tridgell
045014aa57 Did more integration of Lukes code ready for the first release.
I've now got WINS registration working, and refresh working. Its
looking pretty good so far, but needs lots of testing.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
0d8dcfa13c a huge pile of changes :-)
The biggest thing is the integration of Lukes new nmbd. Its still
largely untested, so we will really need some feedback

I've also added auto prototype generation and cleaned up a lot of
minor things as a result
0001-01-01 00:00:00 +00:00
Andrew Tridgell
635b56f19c Lots of changes!
- add faq info on NT printer handling
- add "delete readonly" option to help rcs users
- add stuff to man pages on new printer options
- add "proxy name resolution" option
- add "command string" -c option to smbclient (thanks Ken)
- split time functions into time.c
- rearrange the quotas stuff a bit and fix some bugs
- complete rehash of the time handling code thanks to Paul Eggert
- fix nmblookup output a bit
- add plp print queue parsing from Bertrand Wallrich
0001-01-01 00:00:00 +00:00
Andrew Tridgell
39fbeb04ae cleanups to make thinsg compile cleanly 0001-01-01 00:00:00 +00:00
Samba Release Account
291551d807 Initial version imported to CVS 0001-01-01 00:00:00 +00:00