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

237 Commits

Author SHA1 Message Date
Luke Leighton
32b9508d06 implement server-side generation of NTLMv2 session key. YESSS :-)
(This used to be commit 1092b4f6fb)
1999-11-21 19:59:56 +00:00
Luke Leighton
680dcc9341 hmmm... have to add client-side support in domain_client_validate() to
_use_ user session key.
(This used to be commit be6a6b1393)
1999-11-21 17:27:20 +00:00
Luke Leighton
4081147c31 adding user session key into network netlogon response.
(This used to be commit c73f6b0d02)
1999-11-21 17:11:00 +00:00
Luke Leighton
387cc182e6 oops, #ifdef'd cli_shutdown out, as the fun has _already_ started:
NT refuses to play nice, and establish a trust relationship.
(This used to be commit 98c42764fb)
1999-11-20 22:05:31 +00:00
Luke Leighton
27b8df4d9b attempting to establish inter-domain trust relationships. modified
smbpasswd so it can be used to set up inter-domain trust account.
(This used to be commit 99ec0620c3)
1999-11-20 21:59:16 +00:00
Luke Leighton
24a069eac3 modified domain_client_validate to take trust account name / type. this
is to pass DOMAIN_NAME$ and SEC_CHAN_DOMAIN instead of WKSTA_NAME$ and
SEC_CHAN_WKSTA.

modified check_domain_security to determine if domain name is own domain,
and to use wksta trust account if so, otherwise check "trusting domains"
parameter and use inter-domain trust account if so, otherwise return
False.
(This used to be commit 97ec74e1fa)
1999-11-20 20:54:29 +00:00
Luke Leighton
902b53dcc0 cli_nt_setup_creds() returns uint32 NT status code not a BOOL.
removed all comparisons to if (fn() == False), replaced with if (!fn()).
(This used to be commit fdef97eb7c)
1999-10-29 15:53:18 +00:00
Luke Leighton
6f9105c853 various. debug levels changed. nmbd doesn't need libsmb/clienttrust.c.
samr_lookup_rids() moved to a dynamic memory structure not a
static one limited to 32 RIDs.  cli_pipe.c reading wasn't checking
ERRmoredata when DOS error codes negotiated (this terminates
MSRPC code with prejudice).
(This used to be commit 8976eca2db)
1999-10-21 16:53:50 +00:00
Luke Leighton
33ed8059a2 NTLMv2 check being actioned when NT password response was only 24 chars.
added check to ensure response is more than 24 chars before bothering
to do an NTLMv2 check.
(This used to be commit 7a58895ff2)
1999-07-16 22:23:45 +00:00
Luke Leighton
0262b2a6b4 copy of password struct needed to be made prior to calling copy_passwd_struct
found by Bertl <bs@vpnet.at>.
(This used to be commit 93298bca1c)
1999-07-16 22:03:15 +00:00
Luke Leighton
92b8937bae added %d %d to error message, try to track down the uid / smb_uid mismatch
(This used to be commit ec918ba144)
1999-07-15 17:50:27 +00:00
Luke Leighton
527820d306 oops, refused lm when ntlmv2 was true not false/auto. oops!
(This used to be commit 6b4b24d220)
1999-07-07 16:44:38 +00:00
Luke Leighton
ec711742c0 smb_password_ok() checking incorrectly whether lm password exists.
when lmcompatibilitylevel=0x2 on nt sp4+ clients, lm# is not sent.
(This used to be commit e655e68474)
1999-07-06 21:25:42 +00:00
Luke Leighton
73891ca8e4 improving authentication code (tidyup).
(This used to be commit ab1a6aa42d)
1999-06-29 18:47:06 +00:00
Tim Potter
731c7f2ecf Moved code that changes the pw_passwd entry (i.e shadow password and
weird unixware stuff) into _Get_Pwnam() to fix a memory allocation bug.

Note that the Get_Pwnam() function now returns a const struct passwd *
as a hint to other developers not to change entries in the struct
passwd.
(This used to be commit 36d7cb4ccc)
1999-06-13 04:14:24 +00:00
Luke Leighton
150645f955 Jani Jaakkola's "getpwuid() / getpwnam()" hash-cache-hack
(This used to be commit 899fc053c5)
1999-05-06 18:05:45 +00:00
Luke Leighton
43a460075a SAM database "set user info".
----------------------------

- removed DOM_RID4

- removed SAMR_UNKNOWN_32

- added SAMR_SET_USERINFO (opcode 0x32)

- added level 0x1 to SAMR_QUERY_DOM_INFO (needed for create user)

- fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

- added mod_sam21pwd_entry()

- preparing to call mod_sam21pwd_entry()

- added "user session key" to user_struct.dc.  this is md4(nt#) and is
  needed to decode user's clear-text passwords in SAMR_SET_USERINFO.

- split code out in chgpasswd.c to decode 516 byte password buffers.
(This used to be commit 2e58ed7424)
1999-03-25 13:54:31 +00:00
Luke Leighton
bd76e02ec4 going to start adding inter-domain trust logons soon.
(This used to be commit f9f594c03e)
1999-03-19 15:49:22 +00:00
Luke Leighton
c4241b5662 cli_setup_creds new arguments added.
(This used to be commit 5fa3a3f710)
1999-03-12 19:37:40 +00:00
Luke Leighton
e67a8d9d98 server_cryptkey() now calling cli_connectserverlist(). stupid microsoft
idiotic *SMBSERVER connectionism added to cli_connect_serverlist().
also added check for protocol < LANMAN2.
(This used to be commit c2bcb3a286)
1998-12-14 21:22:59 +00:00
Luke Leighton
9c848ec329 removed nt_pipe_fnum from struct cli_state. need to be able to call
LsaLookupSids etc from within SamrQueryAliasMembers, for example.
fnum is now a parameter to client functions.  thanks to mike black
for starting the ball rolling.
(This used to be commit bee8f7fa6b)
1998-12-07 20:23:41 +00:00
Luke Leighton
f3787515d6 moved get_unixgroups it will be needed by the unix instance of the group
DB API
(This used to be commit ef58e48bc9)
1998-12-03 17:41:14 +00:00
Luke Leighton
30038de462 weekend work. user / group database API.
- split sam_passwd and smb_passwd into separate higher-order function tables

- renamed struct smb_passwd's "smb_user" to "unix_user".  added "nt_user"
plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd
password databases to fill in the blank entries that are not obtained
from whatever password database API instance is being used.

NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST
be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c
for the only example outside of the password database APIs i could find.

- added query_useraliases code to rpcclient.

- dealt with some nasty interdependencies involving non-smbd programs
and the password database API.  this is still not satisfactorily
resolved completelely, but it's the best i can do for now.

- #ifdef'd out some password database options so that people don't
mistakenly set them unless they recompile to _use_ those options.

lots of debugging done, it's still not finished.  the unix/NT uid/gid
and user-rid/group-rid issues are better, but not perfect.  the "BUILTIN"
domain is still missing: users cannot be added to "BUILTIN" groups yet,
as we only have an "alias" db API and a "group" db API but not "builtin-alias"
db API...
(This used to be commit 5d5d7e4de7)
1998-11-29 20:03:33 +00:00
Andrew Tridgell
091a92e996 try to use *SMBSERVER to connect to password server if the first
session_request fails.
(This used to be commit ab2370e7ac)
1998-11-21 01:28:15 +00:00
Jeremy Allison
a97baa50fd smbd/password.c: Added *SMBSERVER fix is name is too long.
web/swat.c: Changed '?' to help.
Jeremy.
(This used to be commit 631913ea85)
1998-11-21 00:16:28 +00:00
Jeremy Allison
768761820e Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.
Tidied up some of the mess (no other word for it). Still doesn't
compile cleanly. There are calls with incorrect parameters that
don't seem to be doing the right thing.

This code still needs surgery :-(.

Jeremy.
(This used to be commit 18ff93a9ab)
1998-11-17 20:50:07 +00:00
Luke Leighton
74d539f557 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e609)
1998-11-17 16:19:04 +00:00
Andrew Tridgell
8c62b28e0e converted smbclient to use clientgen.c rather than clientutil.c
I did this when I saw yet another bug report complaining about
smbclient intermittently missing files. Rather than applying more
patches to smbclient it was better to move to the more robust
clientgen.c code.

The conversion wasn't perfect, I probably lost some features of
smbclient while doing it, but at least smbclient should be consistent
now. It if fails it should _always_ fail rather than giving people the
false impression of a reliable utility.

the tar stuff seems to work, but hasn't had much testing as I never
use it myself. I'm sure someone will find bugs in my conversion of
smbtar.c. It was quite tricky as it did a lot of its own SMB calls. It
now uses clientgen.c exclusively.

smbclient is still quite messy, but at least it doesn't build its own
SMB packets.

I haven't touched smbmount as I never use it. Mike, do you want to
convert smbmount to use clientgen.c?
(This used to be commit e14ca7765a)
1998-11-09 03:45:49 +00:00
Jeremy Allison
548b417d40 codepages/codepage_def.936: Updated comment.
param/loadparm.c: Removed "networkstation user login", "domain controller", and "domain sid" parameters.
passdb/passdb.c: Removed "networkstation user login" code and changed bug test code
                 to only check once for a bad password server. This will stop the
                 complaints of many "bad login" audit records in NT PDC logs.
utils/smbpasswd.c: Removed check for "domain controller".
Jeremy.
(This used to be commit d6e6e936b5)
1998-11-07 05:32:37 +00:00
Jeremy Allison
6e3af45afe Fixed mainly signed/unsigned issues found by SGI cc in -fullwarn mode.
smbd/chgpasswd.c: Fixed (my) stupid bug where I was returning stack based variables. Doh !
smbd/trans2.c: Allows SETFILEINFO as well as QFILEINFO on directory handles.
Jeremy.
(This used to be commit 0b44d27d0b)
1998-10-21 16:58:34 +00:00
Luke Leighton
01de603084 - dce/rpc code
- removed debug info in struni2 and unistr2 (security risk)

- rpc_pipe function was getting pointer to data then calling realloc *dur*

- password check function, the start of "credential checking",
  user, wks, domain, pass as the credentials (not just user,pass which
  is incorrect in a domain context)

- cli_write needs to return ssize_t not size_t, because total can be -1
  if the write fails.

- fixed signed / unsigned warnings (how come i don't get those any more
  when i compile with gcc???)

- nt password change added in smbd.  yes, jeremy, i verified that the
  SMBtrans2 version still works.
(This used to be commit fcfb40d2b0)
1998-10-19 17:32:10 +00:00
Luke Leighton
b6993a89af !pass -> pass != NULL is wrong: !pass -> pass == NULL is correct. oops.
(This used to be commit 866e101818)
1998-10-16 21:41:42 +00:00
Luke Leighton
97f0c9d550 made pass_check_smb() available for dce/rpc use.
(This used to be commit 95e8a910c5)
1998-10-16 21:36:19 +00:00
Luke Leighton
3637ad5f2b cli_nt_session_open() encrypt arg removed
(This used to be commit 63def71799)
1998-10-16 20:18:46 +00:00
Luke Leighton
5cb99177af setup_groups() - code clarification. no functional change.
(This used to be commit dae7c5ea9a)
1998-10-16 20:13:26 +00:00
Luke Leighton
c404bb7754 rpcclient interactive login (with trust account changing if you are root)
cli_session_setup handles null sessions correctly
(This used to be commit 60c0f22a4e)
1998-10-15 23:51:07 +00:00
Jeremy Allison
fc7d3e4caa config: Fix crypt prototype on RedHat Linux.
include/includes.h: Fix crypt prototype on RedHat Linux.
smbd/fileio.c: Fix mmap bug found by WinCE client.
smbd/ipc.c: Fix WinCE wierdness with pipes being opened as \server\pipe\lanman
smbd/password.c: Fix encrypted null passwords.
Jeremy.
(This used to be commit 475992730c)
1998-10-15 00:55:17 +00:00
Luke Leighton
935dc98f66 dce/rpc
(This used to be commit 69f5f9f889)
1998-10-14 06:29:20 +00:00
Andrew Tridgell
99208208fa use level 0 for DEBUG() of malformed password entry in smbpasswd
(This used to be commit bff457b4a4)
1998-10-13 14:14:09 +00:00
Luke Leighton
f8a3e2df11 using wrong cli_state in "security = domain" call.
(This used to be commit 1c08cc2466)
1998-10-06 16:25:24 +00:00
Andrew Tridgell
40984f6b55 - modified resolve_name() to take a name_type
- cleaned up resolve_name() (split into separate functions for each resolver)
- if can't find local master then use #1B name
- support listing of foreign workgroups in /smb/
(This used to be commit a4e607c17d)
1998-10-04 12:00:40 +00:00
Jeremy Allison
9066025a8a Got very strict about the differences and uses of
uid_t, gid_t and vuid. Added sys_getgroups() to get
around the int * return problem. Set correct datatypes
for all uid, gid and vuid variables.
Jeremy.
(This used to be commit e570db46fc)
1998-09-29 20:24:17 +00:00
Jeremy Allison
cf3a9741dc Changes to test in configure if capabilities are enabled on a system.
Changes to get Samba to compile cleanly with the IRIX compiler
with the options : -fullwarn -woff 1209,1174 (the -woff options
are to turn off warnings about unused function parameters and
controlling loop expressions being constants).
Split prototype generation as we hit a limit in IRIX nawk.
Removed "." code in smbd/filename.c (yet again :-).
Jeremy.
(This used to be commit e0567433bd)
1998-09-28 21:43:48 +00:00
Luke Leighton
66d5d73a5d added rpcclient program
(This used to be commit aa38f39d67)
1998-09-25 21:01:52 +00:00
Andrew Tridgell
f6044c87c0 some cleanups to use ZERO_STRUCT() and friends
(This used to be commit 7b154dc431)
1998-09-05 13:24:20 +00:00
Andrew Tridgell
e9ea36e4d2 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?
(This used to be commit 2204475c87)
1998-09-05 05:07:05 +00:00
Andrew Tridgell
61b5fd6f32 bounds check next_token() to prevent possible buffer overflows
(This used to be commit 3eade55dc7)
1998-08-31 03:11:42 +00:00
Jeremy Allison
5e5e320d36 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.
(This used to be commit d0e48a2d80)
1998-08-27 20:38:53 +00:00
Jeremy Allison
8afc9c80ac Changed ASSERT macros to SMB_ASSERT macros as some systems already
have an ASSERT macro defined.
Jeremy.
(This used to be commit dbe6ad014a)
1998-08-24 21:49:10 +00:00
Jeremy Allison
e13aeea928 configure: Changes for extra headers.
configure.in: Source for header changes.
client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile.
include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers.
include/includes.h: Headers for the above.
include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int).
lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/debug.c: Fixed signal functs.
lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile.
libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile.
locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile.
locking/shmem_sysv.c: Fixed error messages in sysV stuff.
nmbd/asyncdns.c: Fixed signal functs.
nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile.
passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile.
passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/nttrans.c: Fixed fsp code path.
smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem.
smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/trans2.c: Fixed core dump bug.
smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile.
Jeremy.
(This used to be commit 1b9cbcd02e)
1998-08-15 01:19:26 +00:00
Christopher R. Hertel
b067f0e2b9 Debug output formatting change. I'm trying to combine log lines that
really should be together.  Chris -)-----
(This used to be commit 8880fc58fa)
1998-08-13 00:01:02 +00:00
Andrew Tridgell
fa88efbbac split the system password checking routines out of smbd/password.c and
into passdb/pass_check.c. This means SWAT no longer needs to link to
smbd/password.c
(This used to be commit 90d93889d7)
1998-08-10 07:04:53 +00:00
Andrew Tridgell
fb08c34cf3 get rid of the runtime test for broken getgroups() and add a compile
time test instead. This also allows us to get rid of the igroups
element of a couple of structures.
(This used to be commit 8b25fe7341)
1998-07-29 05:05:36 +00:00
Andrew Tridgell
64578c0589 merge from the autoconf2 branch to the main branch
(This used to be commit 3bda7ac417)
1998-07-29 03:08:05 +00:00
Jeremy Allison
1aa138922e chgpasswd.c: Fixed up debug calls to stop crashes if ptsname failed.
local.h: Kept FSTYPE_STRING as Samba for now.
nmbd_browsesync.c: Added bugfix from Matt Chapman mattyc@cyberdude.com
                   - lmb_browserlist is now a struct ubi_dlList not a
                   struct browse_cache_record *.
server.c:
smb.h:
uid.c:
password.c: Removed attrs code - it is not used anywhere.
Jeremy
(This used to be commit ef1af7fe6d)
1998-07-27 18:50:45 +00:00
Jeremy Allison
86de50535f New version of the DFS_AUTH code from Karsten Muuss <muuss@or.uni-bonn.de>
Jeremy.
(This used to be commit cf7402c532)
1998-07-09 19:13:01 +00:00
Jeremy Allison
7a2b695bcb password.c: Fixes to allow Win95 clients to have lm encrypted passwords
recognised.
lib/rpc/client/cli_login.c: Fix debug comment.
lib/rpc/parse/parse_misc.c: Fix for passing null pointers.
lib/rpc/parse/parse_net.c: Send correct password lengths when called
                           from Win95.
Jeremy.
(This used to be commit ad1848b355)
1998-07-06 22:48:21 +00:00
Jeremy Allison
5b5eb35c91 Makefile: Added ubi_sLinkList.o as the groupname.o file needs it. Added groupname.o
includes.h: Added ubi_sLinkList.h include.
loadparm.c: Added groupname map parameter.
password.c: Fix HPUX big_crypt.
username.c: New user_in_list() code. Moved groupname map code to groupname.c
lib/rpc/server/srv_util.c: Added lookup_wellknown_sid_from_name().

New groupname map stuff. Note that nothing currently uses this but at
compiles ok.

Jeremy.
(This used to be commit beef636a4d)
1998-06-13 03:04:00 +00:00
Jeremy Allison
9bd7e1e887 loadparm.c: Added machine password timeout parameter - set to 7 days be default.
password.c: Added code to tell server.c when machine password needs changing.
server.c: Change machine password in idle cycles if it needs it.
smbpassfile.c: Fixed up length calculations for machine password file.
smbpasswd.c: Moved domain joining code/machine password changing code.
lib/rpc/client/cli_netlogon.c: And this is where it now lives.
Jeremy.
(This used to be commit b8fedca619)
1998-05-27 00:30:52 +00:00
Jeremy Allison
bfa013908f Fixed 'revalidate' parameter so it's only considered in security=share
mode.
Jeremy.
(This used to be commit 7727f09ea9)
1998-05-21 23:59:04 +00:00
Jeremy Allison
ffab54750f chgpasswd.c: Changed back to getsmb... from getsam...
ldap.c: Stoped dummy_function being prototyped.
loadparm.c: Fixed slprintf sizes.
nisppass.c: Fixed safe_strcpy sizes.
nmbd_processlogon.c: Changed back to getsmb... from getsam...
nttrans.c: Just a dump of new code.
passdb.c: Moved stuff around a lot - stopped any lookups by rid. This
          needs to be indirected through a function table (soon).
password.c: Changed back to getsmb... from getsam...
reply.c: Changed back to getsmb... from getsam...
slprintf.c: Fixed prototype problems.
smb.h: Fixed prototype problems.
smbpass.c: Changed to getsmbfile....
smbpasswd.c: Changed back to getsmb... from getsam...
lib/rpc/server/srv_netlog.c: Changed back to getsmb... from getsam...
lib/rpc/server/srv_samr.c: Fixed rid lookup - use uid or gid lookup.
lib/rpc/server/srv_util.c: Changed back to getsmb... from getsam...
Jeremy.
(This used to be commit 7d332b2493)
1998-05-18 21:30:57 +00:00
Jeremy Allison
f888868f46 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.
(This used to be commit 2d77445400)
1998-05-12 00:55:32 +00:00
Luke Leighton
f004d84f68 ldap back-end database development
Makefile:

	created PASSBD_OBJ group

includes.h:

	added #ifdef USE_LDAP to #include <ldap> headers

ldap.c:

	- renamed "_machine" to "_trust" everywhere.
	- added sam_passwd support routines
	- removed get_ldappwd_entry function: replaced with get_sampwd_entry
	- removed getldappwnam/uid: replaced with getsampwnam/uid
	- other messing about bits which are probably going to annoy the
	  hell out of jean-francois (sorry!)

mkproto.awk:

	- added stuff to wrap ldap.c protos with #ifdef USE_LDAP
	- added uid_t and gid_t return results to the prototype generation

passdb.c:

	- created getsam21pwent, add_sam21pwd_entry, mod_sam21pwd_entry.
	- modified getsampwnam/uid and created getsam21pwnam/rid functions
	  to replace the local get_smbpwd_entry() and get_ldappwd_entry()
	  functions, which jeremy didn't like anyway because they were
	  dual-purpose.
	- added utility routines which are or may be useful to all the
	  password database routines.

password.c:

	- renamed "machine_" to "trust_" everywhere.

smbpass.c:

	- removed get_smbpwd_entry function: replaced it with get_sampwd_entry
	  functions in passdb.c
	- moved code that decoded acct_ctrl into passdb.c
	- moved encode_acct_ctrl into passdb.c
	- removed getsmbpwnam/uid: replaced with getsampwnam/uid
	- renamed "machine_" to "trust_" everywhere.

smbpasswd.c:

	- renamed "machine_" to "trust_" everywhere.

util.c:

	- moved gethexpwd function into passdb.c

lib/rpc/server/srv_util.c:

	- moved user_rid_to_uid, group_rid_to_rid etc etc into passdb.c
(This used to be commit 673ab50c4c)
1998-05-11 15:56:01 +00:00
Andrew Tridgell
3dfc0c8472 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.
(This used to be commit ee09e9dadb)
1998-05-11 06:38:36 +00:00
John Terpstra
839e47c5a6 Updated OSF1_ENH_SEC mode password handling.
This now tries Enhanced passwords first and if this fails trys Basic
mode (ie: Unix /etc/passwd) authentication. This only happens when
OSF1_ENH_SEC is defined at compilation.
(This used to be commit 29462c8d7a)
1998-05-10 06:20:27 +00:00
Luke Leighton
d8d9f77233 created "passdb.c" which is an interface point to (at present) either
smbpasswd or ldap passwd, at compile-time (-DUSE_LDAP).

_none_ of the functions in ldap.c or smbpass.c should be called directly:
only those in passdb.c should be used.

-DUSE_LDAP is unlikely to compile at the moment.
(This used to be commit 57b01ad4ff)
1998-05-07 18:19:05 +00:00
Jeremy Allison
346abceb27 smbpass.c: Fixed machine_passwd_lock() problems.
password.c: Fixed machine_passwd_lock() problems.
lib/rpc/server/srv_ldap_helpers.c: Oops - broke proto.h with dummy function. Fixed now.
Jeremy.
(This used to be commit d28427f21f)
1998-05-06 18:45:57 +00:00
Jeremy Allison
a2bddb20ed Fixes for the %U and %G problems people have reported.
Essentially, multiple session_setup_and_X's may be done
to an smbd. As there is only one global variable containing
the requested connection name (sessionsetup_user), then any
subsequent sessionsetups overwrite this name (causing %U
and %G to get the wrong name). This is particularly common
when an NT client does a null session setup to get a
browse list after the user has connected, but before
a share has been mounted.

These changes store the requested_name in the vuid structure
(so this only really works for user level and above security)
and copies this name back into the global variable before
the standard_sub call.

Jeremy.
(This used to be commit b5187ad6a3)
1998-05-06 01:34:51 +00:00
Jeremy Allison
19f76f391b genrand.c: SGI compile warning fix.
ipc.c: Fix for duplicate printer names being long.
loadparm.c: Set bNetWkstaUserLogon to false by default - new code in password.c
protects us.
nmbd_logonnames.c:
nmbd_namequery.c:
nmbd_namerelease.c: Debug messages fix.
password.c: SGI compile warning fix, fix for tcon() with bNetWkstaUserLogon call.
reply.c: SGI compile warning fix.
server.c Debug messages fix.
smbpass.c: Fix for incorrect pointer.
Jeremy.
(This used to be commit 567d3f8389)
1998-05-05 19:24:32 +00:00
Jeremy Allison
3eae1e3f8e Added patch from Bruce Tenison <btenison@dibbs.net> to allow encrypted
passwords to be stored over time, allowing a smbpasswd file migration.
Adds new parameter "update encrypted".
Will also add to 1.9.18 branch.
Docs update to follow.
Jeremy.
(This used to be commit 5d3e874d78)
1998-04-30 01:39:22 +00:00
Jeremy Allison
e305c2c9e2 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.
(This used to be commit c6c22df201)
1998-04-29 19:22:01 +00:00
Luke Leighton
a8e7f804ca password.c:
added become_root / unbecome_root around the get machine account password.

smbpass.c:

	cleaning up code.

	- turning if (BOOL_expr == False) into if (BOOL_expr)
	  what if you test if (BOOL_expr == True) and someone defines
	  True to be -1 on one system and 1 on another?  or if you get
	  inconsistent return results between developers

	- removed if ((FILE*) == 0) and made this if ((FILE*) == NULL) -
	  cannot assume that NULL is zero integer.  plus there are typecast
	  issues to deal with

	- removed return (ret == 0) ? True : False and made this return ret == 0
	  rely on the compiler to return correct BOOL value: not all developers
	  will return True or False #defines: stick with BOOL test (non-zero).

	- removed if (ret == False) replaced with if (!ret)

	- bug where instead of if (sizeof(pstring)-len-len-6 < 0) it had a
	  boolean test if (pstring-len-len-6).

	- removed "." after debugging of filenames: the "." - a fullstop -
	  looked like it was part of the filename, making things difficult
	  to sort out.

still to be resolved: the global_myname isn't set up, such that the
machine account password file is named "TEST3..mac".
(This used to be commit 315e26c23a)
1998-04-29 11:00:12 +00:00
Jeremy Allison
d3832506b2 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.
(This used to be commit 17b94a7084)
1998-04-29 00:02:57 +00:00
Jeremy Allison
e7ac86607c 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.
(This used to be commit 866406bfe3)
1998-04-25 01:12:08 +00:00
Jeremy Allison
30675f81f6 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.
(This used to be commit 899a9f0dce)
1998-04-23 22:59:19 +00:00
Jeremy Allison
002a47de8e 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.
(This used to be commit 0f00b8fce1)
1998-04-23 20:12:17 +00:00
Jeremy Allison
a85f5bc268 genrand.c: Changed SMB_PASSWD_FILE to lp_smb_passwd_file().
password.c: Started the initial code for domain_client_validate(). All
            bracketed with #ifdef DOMAIN_CLIENT for now.
reply.c: Call to domain_client_validate(). All
            bracketed with #ifdef DOMAIN_CLIENT for now.
smbpass.c: New code to get/set machine passwords. Tidied up nesting
           of lock calls.
Jeremy.
(This used to be commit 89fe059a68)
1998-04-23 18:54:57 +00:00
Jeremy Allison
8584c6bd66 genrand.c: Improved generation of random values, more secure.
loadparm.c: Started add of 'security=domain' code.
password.c: Fix for security=server NT bugs.
reply.c: Started add of 'security=domain' code.
server.c: Started add of 'security=domain' code.
smb.h: Started add of 'security=domain' code.
Jeremy.
(This used to be commit e6bda112eb)
1998-04-22 00:56:38 +00:00
Jeremy Allison
c41f6c8fdf Added cli_ulogoff() calls to all the exit code paths in security=server.
Jeremy.
(This used to be commit 78d87a5bfd)
1998-04-21 02:27:12 +00:00
Jeremy Allison
2dee1ed388 clientgen.c: Added cli_ulogoff() call.
password.c: Added call to cli_ulogoff on successfull sessionsetup.
Jeremy.
(This used to be commit 77882f002b)
1998-04-21 02:23:24 +00:00
Jeremy Allison
efb71742ca 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.
(This used to be commit 608e985463)
1998-04-20 22:43:54 +00:00
Jeremy Allison
2a53d6f707 Modified interfaces to getting smb password entries from
get_smbpwd_entry (now an internal function to smbpass.c)
to a more UNIX-like :

getsmbpwnam() - get entry by name.
getsmbpwuid() - get entry by uid.

Changed the type returned by the smbpasswd enumeration
functions to be a void * so that people don't come to
depend on it being a FILE *.

These abstractions should make it much easier to
replace the smbpasswd file with a better backend
in future.

Other files changed are to match the above changes.

Jeremy.
(This used to be commit 1161cfb7f2)
1998-04-14 00:41:59 +00:00
Jeremy Allison
cac6a060af Changes to allow Samba to be compiled with -Wstrict-prototypes
with gcc. (Not a big change although it looks like it :-).

Jeremy.
(This used to be commit cd2613c572)
1998-04-13 19:24:06 +00:00
John Terpstra
d1cc06083d Added const cast to struct args to get rid of compile time warning.
(This used to be commit 5d956abb4f)
1998-04-09 14:13:20 +00:00
Andrew Tridgell
f996885676 this isn't a big commit, it just looks like it :-)
I needed the client_name() and client_addr() functions in swat so I
could tell who was connecting from where. The problem was that these
functions didn't take a file descriptor parameter they just used
the global "Client".

So I needed to change all calls to pass a parameter ... lots of files.
(This used to be commit a776058900)
1998-03-17 12:31:43 +00:00
Jeremy Allison
c54af0f8b2 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.
(This used to be commit 7f118970da)
1998-03-16 20:59:47 +00:00
Jeremy Allison
90cdd717f8 includes.h: Addition of NetBSD 1.3 fix, fix for HPUX 9.x, 10.x zombie
problem.
password.c: Fix for Thursby to stop Dave clients failing in share
mode security (this was their bug - they were interpreting the uid
field in share mode which is explicitly denied by the spec but
it's easier for us to fix it than them :-).

Jeremy.
(This used to be commit 39372d9e20)
1998-03-16 18:31:09 +00:00
Andrew Tridgell
2e68682069 move setup_groups() into password.c so that swat can link without
including server.o
(This used to be commit 67bb8835c7)
1998-03-12 02:43:46 +00:00
Jeremy Allison
fdeea341ed "For I have laboured mightily on Luke's code, and hath broken
all I saw" - the book of Jeremy, chapter 1 :-).

So here is the mega-merge of the NTDOM branch server code.
It doesn't include the new client side pieces, we'll look
at that later.

This should give the same functionality, server wise, as
the NTDOM branch does, only merged into the main branch.

Any fixes to domain controler functionality should be
added to the main branch, not the NTDOM branch.

This code compiles without warnings on gcc2.8, but will
need further testing before we are sure all the working
functionality of the NTDOM server branch has been
correctly carried over.

I hereby declare the server side of the NTDOM branch
dead (and all who sail in her :-).

Jeremy.
(This used to be commit 118ba4d77a)
1998-03-11 21:11:04 +00:00
Jeremy Allison
3fb9f9db56 Adding Korean and Traditional Chinese codepage support.
Jeremy.
(This used to be commit 2df47cf1bb)
1998-03-04 01:50:47 +00:00
Jeremy Allison
45dab9f065 Makefile, password.c, includes.h: Added KRB4 patches from Johan Hedin <johanh@fusion.kth.se>
nmbd_packets.c: Patch for aliased interfaces from Daniel Haun <dhaun@ecf2.puc.edu>.
Jeremy.
(This used to be commit 60f6302b19)
1998-02-26 22:58:21 +00:00
Jeremy Allison
5546e28e69 A small raft of changes, I will sync up with 1.9.18 also.
chgpasswd.c: Fixed typo in debug message.
includes.h: Fix include for aix.
kanji.c: Added cap_to_sj as inverse of sj_to_cap.
loadparm.c:
local.h:
password.c: Added code for "networkstation user login" parameter.
- patch from Rob Nielsen <ran@adc.com>.
printing.c: Added further aix printing fixes.
reply.c: Changed access time fetch to a function.
trans2.c: Changed access time fetch to a function.
time.c: Changed access time fetch to a function.
server.c: Made NT redirector workaround final.
util.c: Added debug for write_socket failing.
Jeremy.
(This used to be commit a031404623)
1998-02-07 12:15:20 +00:00
Jeremy Allison
a215c98602 Changed code that truncates salt after 2 characters so that it becomes
HPUX specific. This fixes a bug with FreeBSD md5 crypt implementation
that needs all of the password characters.
It seems better to make this an HPUX specific thing.
Jeremy.
(This used to be commit 91a2b746d3)
1998-01-23 13:52:17 +00:00
Jeremy Allison
55f400bd84 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.
(This used to be commit b9c1697723)
1998-01-22 13:27:43 +00:00
John Terpstra
0e7be48597 Following discussions with Cristian Gafton (Red Hat) we have decided to make
PAM silent about it's actions. This reduced error logging for EVERY password
validation request. Refer to password.c PAM section for further info.
Fiels Affected: password.c
(This used to be commit 7a1a8042dd)
1998-01-10 11:42:29 +00:00
Andrew Tridgell
69460b470f allow users to disable the NetWkstaUserLogon call in server level
security by changing a setting in local.h or adding it to their
Makefile. See comment in local.h
(This used to be commit cc10fdf758)
1997-12-03 03:43:05 +00:00
Andrew Tridgell
7097597fd6 HPUX trusted systems need to use bigcrypt() not crypt()
(This used to be commit 979eaf9e9c)
1997-12-02 23:27:40 +00:00
Jeremy Allison
77aec4ae63 Rolled back tree state to 11:59pm 8th November 1997 EST to
remove problems.
Jeremy
(This used to be commit 4a36ac236c)
1997-11-10 19:23:17 +00:00
Luke Leighton
e357d91068 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*.
(This used to be commit f27966957f)
1997-11-09 17:30:10 +00:00
Luke Leighton
bd529d7a83 following a cvs error, i am rewriting this monster-commit. with bad grace.
Modified Files:
---------------

Makefile:

	adding extra files

ipc.c :

	send_trans_reply() - alignment issue.  this makes the alignment
	the same as that in NT.  this should be looked at by people who
	understand the SMB stuff better than i.

	api_fd_commands[] - added samr and wkssvc pipes.

loadparm.c :

	lp_domain_controller() changed to mean "samba is a domain controller".
	it's a "yes/no" parameter, now.  no, it isn't used _anywhere_.

namedbwork.c nameelect.c :

	if "domain controller = yes" then add SV_TYPE_DOMAIN_CTRL to the
	host _and_ workgroup announcements.  yes, you must do both: nt does.

namelogon.c :

	important NETLOGON bug in SAMLOGON request parsing, which may be
	the source of some people's problems with logging on to the Samba PDC.

password.c :

	get_smbpwnam() renamed to get_smbpwd_entry().

pipes.c :

	added samr and wkssvc pipes.

proto.h :

	usual.  can we actually _remove_ proto.h from the cvs tree, and
	have it as one of the Makefile dependencies, or something?

reply.c :

	get_smbpwnam() renamed to get_smbpwd_entry() - also changed response
	error code when logging in from a WORKSTATION$ account.  yes, paul
	is right: we need to know when to return the right error code, and why.

server.c :

	added call to reset_chain_pnum().

	#ifdef NTDOMAIN added call to init_lsa_policy_hnd() #endif.  jeremy,
	you'd be proud: i did a compile without NTDOMAIN, and caught a link
	error for this function.

smb.h :

	defines and structures for samr and wkssvc pipes.

smbpass.c :

	modified get_smbpwnam() to get_smbpwd_entry() and it now takes
	two arguments.  one for the name; if this is null, it looks up
	by smb_userid instead.

	oh, by the way, smb_userids are actually domain relative ids
	(RIDs).  concatenate a RID with the domain SID, and you have
	an internet globally unique way of identifying a user.

	we're using RIDs in the wrong way....

	added mod_smbpwnam() function.  this was based on code in smbpasswd.c

rpc_pipes/lsaparse.c :

	added enum trusted domain parsing.  this is incomplete: i need
	a packet trace to write it properly.

rpc_pipes/pipe_hnd.c :

	added reset_chain_pnum() function.

rpc_pipes/pipenetlog.c :

	get_smbpwnam() function renamed to get_smbpwd_entry().

	arcfour() issues.

	removed capability of get_md4pw() function to automatically add
	workstation accounts.  this should either be done using
	smbpasswd -add MACHINE$, or by using \PIPE\samr.

rpc_pipes/pipe_util.c :

	create_pol_hnd() - creates a unique LSA Policy Handle.  overkill
	function: uses a 64 bit sequence number; current unix time and
	the smbd pid.

rpc_pipes/smbparse.c :

	arcfour() issues.

	smb_io_unistr2() should advance by uni_str_len not uni_max_len.

	smb_io_smb_hdr_rb() - request bind uses uint16 for the context
	id, and uint8 for the num_syntaxes.  oops, i put these both as
	uint32s.


Added Files:
------------

rpc_pipes/lsa_hnd.c :

	on the samr pipe, allocate and associate an LSA Policy Handle
	with a SID.  you receive queries with the LSA Policy Handle,
	and have to turn this back into a SID in order to answer the
	query...

rpc_pipes/pipesamr.c rpc_pipes/samrparse.c

	\PIPE\samr processing.  samr i presume is the SAM Replication pipe.

rpc_pipes/pipewkssvc.c rpc_pipes/wksparse.c

	\PIPE\wkssvc processing.  the Workstation Service pipe?


holy cow.
(This used to be commit 1bd084b3e6)
1997-11-06 23:03:58 +00:00
Andrew Tridgell
224c40a523 a simple SMB torture tester. This will allow us to evaluate locking
techniques more accurately.
(This used to be commit 054e3b2ae3)
1997-11-01 13:22:16 +00:00
Andrew Tridgell
0891bb6a91 rewrote the password server code using the new clientgen.c client
interface

The new code uses a source netbios name equal to the Samba servers
name, not the client name. It also uses NetWkstaUserLogon to do a full
network logon. This means it will honour the servers logon
restrictions (such as login times etc).
(This used to be commit 11de90f972)
1997-10-21 09:34:33 +00:00
Luke Leighton
423a7c4171 util.c password.c :
added automount_server() function which, if -DAUTOMOUNT is in use,
	returns the server name of the NIS auto.map entry.  otherwise,
	it returns local_server.

	added use of automount_server() for a new substitution %N for NIS
	home server.  this defaults, via automount_server(), to the same
	functionality as %L if -DAUTOMOUNT is not used.

	removed vuser->home_share.  moved code that grabbed the servername
	into the separate function automount_server().

loadparm.c :

	created "logon drive" (default of "")
	created "logon home"  (default of "\\%N\%U")
	changed default of "logon path" from NULL to "\\%N\%U\profile".

ipc.c pipenetlog.c :

	use lp_logon_drive(), lp_logon_home() and lp_logon_path() in their
	now easier-to-use form (don't have to check if *lp_logon_path() and
	manually substitute a default of \\%L\%U and do a standard_sub_basic()
	on the result, because the default automatically does this.
(This used to be commit c6c28a4c3c)
1997-10-20 12:10:58 +00:00
Andrew Tridgell
f4b4b3e6e3 casting cleanups
(This used to be commit ab849a9782)
1997-10-20 02:50:12 +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 c84a043f89)
1997-10-16 05:33:24 +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 45f4ae4327)
1997-10-15 04:04:38 +00:00
Luke Leighton
c5e739febe 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.
(This used to be commit 87a0a94485)
1997-10-10 14:48:05 +00:00
Jeremy Allison
a0cd12e221 dir.c: more pstrcpys.
local.h: Add OPLOCK_BREAK_TIMEOUT.
password.c: Fix for paranoia password server security bug.
proto.h: Updated.
reply.c: Oplock changes.
server.c: Massive oplock changes - nearly there....
smb.h: oplock definitions.
util.c: Add local message processing queues for oplocks.
Jeremy (jallison@whistle.com)
(This used to be commit 92f1553db2)
1997-09-30 02:38:19 +00:00
Andrew Tridgell
cda707f917 add a cast
(This used to be commit e712c6ed61)
1997-09-16 08:26:33 +00:00
Andrew Tridgell
57c2578cb2 - 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)
(This used to be commit 35b92e725f)
1997-09-16 04:41:16 +00:00
Andrew Tridgell
33a003de40 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.
(This used to be commit db917c62c1)
1997-09-14 16:37:18 +00:00
Jeremy Allison
ab68ac375e Fix from Frank Varnavas <varnavas@ny.ubs.com>.
We cannot use the same name as the client to
the NT password server, as NT will drop client
connections if the same client name connects
twice. Instead, synthesize a name from our pid.
and the remote machine name.
Jeremy (jallison@whistle.com)
(This used to be commit ebf9487a9a)
1997-09-04 21:23:27 +00:00
Samba Release Account
9170cfd4b6 spelling.
lkcl
(This used to be commit 7e326450cf)
1997-08-11 18:06:44 +00:00
Samba Release Account
b5114b41f5 Makefile: Added IRIX 6 target.
loadparm.c: Fixed stupid static warnings with set_default_server_announce_type.
password.c:	Fixed char -> uchar cast warnings.
nameservreply.c: Fixed group fade out code.
Jeremy (jallison@whistle.com)
(This used to be commit a2dd5c5a55)
1997-08-05 01:31:55 +00:00
Samba Release Account
7314126d9e client.c: Added amanda fixes.
clitar.c:	Added amanda fixes.
nameannounce.c:	Removed redundent code.
nameelect.c:	Removed redundent code.
nameserv.h:		Removed redundent code.
nameservresp.c:	Removed redundent code.
namework.c:		Removed redundent code.
password.c:		Prevented crash if getpwnam fails.
Jeremy (jallison@whistle.com)
(This used to be commit 760fe30353)
1997-07-28 18:59:57 +00:00
Samba Release Account
a3de6a813e charset.c: Fixed signed/unsigned issues.
password.c:	Fixed problem with MS-Exchange services.
Jeremy (jallison@whistle.com)
(This used to be commit e723dd3dee)
1997-07-22 19:04:40 +00:00
Samba Release Account
8b904f4ecc Makefile: Added krb5 option from Nathan Neulinger <nneul@umr.edu>
includes.h:	Added krb5 option from Nathan Neulinger  <nneul@umr.edu>, added SGI5 fix.
password.c: Added krb5 option from Nathan Neulinger  <nneul@umr.edu>
quotas.c: Added inode quote fix.
reply.c: removed redundent code.
server.c: Changed error debug to 0, removed redundent check.
util.c: Added close_low_fd() to become_daemon - fix for rsh from Johnathan Knight.
Jeremy (jallison@whistle.com)
(This used to be commit 256afb7648)
1997-07-17 20:11:58 +00:00
Samba Release Account
fc3901122d Fixes for UnixWare 2.x with shadow passwords from
Warren Young <tkennedy@cyberport.com>.
(This used to be commit 885b42b447)
1997-07-03 17:19:46 +00:00
Samba Release Account
16c87e9198 Fixed *really* stupid bug in register_vuid - only a problem
on multi-user NT systems.
Jeremy (jallison@whistle.com)
(This used to be commit 6ca5c8ca32)
1997-06-18 01:04:57 +00:00
Samba Release Account
0f1f0ceb95 '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.
(This used to be commit cf23a155a1)
1997-05-08 01:14:17 +00:00
Samba Release Account
121c81e3d6 added automount home directory support. contributed by simeon@bangor.co.uk
and a mini bug-fix by rob.nacarrato@sheridanc.on.ca

reads in an entry from the auto.home file for the user when they log in,
and mounts their home directory as the default path for the [homes] service.

i might add this as to the %substitution system, so that you can
specify subdirectories for the user profiles, mainly.

lkcl
(This used to be commit 0bb6acc358)
1997-05-07 17:56:46 +00:00
Samba Release Account
cc55a88ddc JHT ===> Fixed potential PAM Security hole and second chance syndrome
spurious warning message "Warning - no crypt available"
(This used to be commit dc559428b8)
1997-02-04 10:35:38 +00:00
Samba Release Account
d613892674 JHT ==> Added extensions for PAM (Pluggable Authentication Module) support
for Linux and other little beasties that use PAM.
	Source: ftp.redhat.com/pub/Incoming/samba-1.9.16p9.src.rpm
	Originally from RedHat modifications to samba-1.9.15p8
(This used to be commit 79145bad56)
1997-01-02 04:04:49 +00:00
Samba Release Account
7da995a1dd Set num_validated_users to zero if Realloc fails.
(This used to be commit 57121e609e)
1996-11-09 01:56:20 +00:00
Samba Release Account
8c5c55fea5 Core of the changes for returning smb_uid's. smb_uid's are now
returned as an index plus offset into the valudated_users table.
The offset (100) is added so that an smb_uid of zero becomes
an invalid value. All access into the validated_users table are
done by removing the offset and indexing into the table. Out of
ranges return NULL. Causes accesses into the validated_users table
to be more consistant and controlled.

This change made due to the fact that the uid field is only 16
bits in the smb header and we need for this not to be a unix
user id (which can ge 32 bits).

jra@cygnus.com
(This used to be commit ac265eff85)
1996-10-25 20:18:28 +00:00
Andrew Tridgell
e5893bdfbe I have fixed quite a few important bugs in this commit.
Luke, can you take special note of the bug fixes to nmbd so you can
propogate them to your new code.

- rewrote the code that used to use fromhost(). We now call
gethostbyaddr() only if necessary and a maximum of once per
connection. Calling gethostbyaddr() causes problems on some systems so
avoiding it if possible is a good thing :-)

- added the "fake oplocks" option. See the docs in smb.conf(5) and
Speed.txt

- fixed a serious bug in nmbd where it would try a DNS lookup on
FIND_SELF queries. This caused a lot of unnecessary (and incorrect)
DNS lookups to happen. FIND_SELF queries should only go to the
internal name tables.

- don't set FIND_SELF for name queries if we are a wins proxy, as we
are supposed to be answering queries for other hosts.

- fixed a bug in nmbd which had "if (search | FIND_LOCAL)" instead of
"if (search & FIND_LOCAL)". Luke, this was in nameservreply.c

- the above 3 bugs together meant that DNS queries were being cached,
but the cache wasn't being used, so every query was going to DNS, no
wonder nmbd has been chewing so much CPU time! Another side effect was
that queries on names in lmhosts weren't being answered for bcast
queries with "wins proxy" set.

- ignore the maxxmit for seconday session setups (see CIFS spec)

- close user opened files in a uLogoffX for user level security (see
CIFS spec)

- added uid into the files struct to support the above change
(This used to be commit ea472b7217)
1996-10-05 10:41:13 +00:00
Andrew Tridgell
11d9539d75 - accept either NT or lanman passwords in tconX
(This used to be commit b6c1c60d72)
1996-10-02 14:06:17 +00:00
Andrew Tridgell
9155889092 - add timeouts to connect() for password server connections. This
makes multiple password servers practical.
(This used to be commit 5c3e8326cc)
1996-08-22 06:32:03 +00:00
Andrew Tridgell
a521fe8a27 a cleanup of the receive_smb() usage, adding timeouts in some places
also added paranoid code in the main process() loop of smbd to detect
when smbd is looping uselessly. This should stop the "smbd is chewing
lots of cpu" reports
(This used to be commit 8e9dce34d5)
1996-06-10 05:16:19 +00:00
Andrew Tridgell
7e3b4a1c0d 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
(This used to be commit b551dc98f7)
1996-06-10 04:38:24 +00:00
Andrew Tridgell
b9ae225b28 - 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
(This used to be commit 7ed71b73ae)
1996-06-06 11:43:09 +00:00
Andrew Tridgell
a2c1623827 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
(This used to be commit 0d8dcfa13c)
1996-06-04 06:42:03 +00:00
Andrew Tridgell
58734631b4 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
(This used to be commit 635b56f19c)
1996-05-31 15:13:29 +00:00
Andrew Tridgell
1956d13494 cleanups to make thinsg compile cleanly
(This used to be commit 39fbeb04ae)
1996-05-29 07:47:47 +00:00
Andrew Tridgell
11f7553c74 turn on KEEP_PASSWORD_SERVER_OPEN by default
(This used to be commit d2676cdd0b)
1996-05-05 11:25:07 +00:00
Andrew Tridgell
03aeb8af5d fix a netgroup bug (innetgr() was being called with the args in the
wrong order!)
(This used to be commit 4419093d33)
1996-05-04 10:45:50 +00:00
Samba Release Account
0e8fd33987 Initial version imported to CVS
(This used to be commit 291551d807)
1996-05-04 07:50:46 +00:00