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

3631 Commits

Author SHA1 Message Date
Luke Leighton
9118b8508b retired this file: it's not actually needed now that passdb.c provides
the interface point.
(This used to be commit 27ba6fafc9)
1998-05-12 14:01:56 +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
9141acecdc password back-end database support
ldap.c :

	- added getldap21pwent() function

passdb.c :

	- getsam21pwent() no longer a stub: calls ldap21 or smb21

smbpass.c :

	- added getsmb21pwent() function (he he :-)

lib/rpc/server/srv_samr.c :

	- removed "specific" calls to ldap functions; replaced with
	  call to get_sampwd_entries instead (which is unfinished).

	- rewrote get_user_info_21 function to call getsam21pwrid.
(This used to be commit c760ebbf12)
1998-05-11 18:03:01 +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
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
b54509045d loadparm.c: Added #ifdef USE_LDAP around ldap code.
server.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic()
          as only smbd knows about usernames. Also fixes problem with calling
          standard_sub_basic() from loadparm.c.
smbpass.c: Partial tidyup of machine_password_lock() code - not finished yet.
util.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic()
          as only smbd knows about usernames. Also fixes problem with calling
          standard_sub_basic() from loadparm.c.
lib/rpc/server/srv_ldap_helpers.c: Added #ifdef USE_LDAP around ldap code.
lib/rpc/server/srv_samr.c: Added #ifdef USE_LDAP around ldap code.
Jeremy.
(This used to be commit 446b98ca07)
1998-05-06 18:14:02 +00:00
Luke Leighton
5fa8775d97 jean-francois micouleau's well-alpha code for ldap password database stuff!
he's going to hate me for checking this in so early, but...
(This used to be commit ad9ba0a1cb)
1998-05-06 17:43:44 +00:00
Luke Leighton
4ff2a51c15 compiler warning for unimportant uninitialised variable
(This used to be commit 81bf263092)
1998-05-06 12:11:35 +00:00
Luke Leighton
f601e6e048 patches from jean francois: couple of minor bugs
(This used to be commit 532b3956c6)
1998-05-05 09:04:49 +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
90177708aa Makefile: Added files to smbpasswd.c.
loadparm.c: Patch from tim@quiknet.com for static string problems.
server.c: Setup global_myname.
smbpass.c: Fix up locking. Add machine_password_delete() call.
smbpasswd.c: Added provisional code to add to a domain.
lib/rpc/client/cli_login.c: Fixed incorrect cred_hash3 call when setting machine password.
lib/rpc/server/srv_netlog.c: Fixed incorrect cred_hash3 call when setting machine password.
Jeremy.
(This used to be commit 6a7164233e)
1998-04-29 22:27:26 +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
Luke Leighton
9189005f7f ABOUT time. dce/rpc long packet format now works, server-side.
turns out that [it can be deduced that] microsoft ignores the SMBreadX
offset, and goes by the SMBreadX length only.  this makes for a lot simpler
code, in both client and server.
(This used to be commit a8b641c027)
1998-04-24 21:01: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
da4e61efad Fixed bug found by Gerald Carter <cartegw@Eng.Auburn.EDU> where
global myname was being overwritten incorrectly.
Jeremy.
(This used to be commit a3e7cf1b8a)
1998-04-22 17:59:44 +00:00
Luke Leighton
76d3bc36a5 put server-side long dce/rpc code in main branch.
(This used to be commit 2e1a08b28c)
1998-04-21 02:36:37 +00:00
Jeremy Allison
2beb8f3cb5 genrand.c: Improved filename based random seed generation.
lib/rpc/server/srv_netlog.c: Changed to use generate_random_buffer().
Jeremy.
(This used to be commit 093d060a06)
1998-04-20 23:57:29 +00:00
Jeremy Allison
6733e2b36e includes.h: Added John's redhat fix for QSORT_CAST.
smbpass.c: Added lock depth code so calls to pw_file_lock() can be nested.
           Fixed codedump problems in add_smbpwd_entry().
smbpasswd.c: Removed all the code that manipulated the password file
             directly. Now *all* smbpasswd file changes are done through
             the interfaces defined in smbpass.c This should make
             the life of people adding alternate backend databases
             *much* easier.
lib/rpc/server/srv_netlog.c: Removed debug messages used to debug
                             machine password changing.
Jeremy.
(This used to be commit c9f61be08f)
1998-04-18 02:00:39 +00:00
Jeremy Allison
373d7c6257 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.
(This used to be commit 50aa513b96)
1998-04-17 19:29:51 +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
e300c0346f includes.h: Moved HPUX undefine of SEMMSL to where it actually does something.
ipc.c: Added Luke's debug statement.
locking_slow.c: Added FTRUNCATE_NEEDS_ROOT code for broken systems that
need it (not sure what these are yet).

membuffer.c ntdomain.h proto.h
lib/rpc/include/rpc_dce.h lib/rpc/include/rpc_srvsvc.h
lib/rpc/parse/parse_prs.c lib/rpc/parse/parse_rpc.c
lib/rpc/server/srv_pipe_hnd.c lib/rpc/server/srv_util.c:
   Re-merge of Luke's NTDOM changes 'cos he's a lazy git with
   carpel tunnel syndrome :-).

Jeremy.
(This used to be commit 52e3966fbc)
1998-04-10 18:21:16 +00:00
Jeremy Allison
77e4dd2478 Changed code to check NT password *first* - if it exists.
The NT password is a higher quality password, and should
always be looked at before the LM password, if available
(sorry, Luke, just a minor change, the other changes you
made were fine :-).
Jeremy.
(This used to be commit c1367bf533)
1998-04-02 01:07:53 +00:00
Luke Leighton
92e2ecc3b5 cli_login.c :
start to create the calls needed for client-side of "network" logins,
	which will be used for domain version of pass-through authentication.
	unfortunately, none of this code is called in the main branch, because
	smbclient BRANCH_NTDOM code isn't in use, yet!

srv_netlog.c :

	fixed a problem with static net_login_network() which was being
	stubborn: the if() statement looked horrendous, so i split it into
	two if() statements, one to deal with the lm password; the other to
	deal with the nt password.

	the smb_password_check() functions should _not_ be called here, in
	case we decide to disable lm hashes for security reasons, just like
	nt does.

	so, we now get a response to the SAM_LOGON "network" call, but the
	connection is still dropped.  a trace is needed from an nt server,
	which is why i started on the client-side code.  see above, which
	is why i'm calling it a day :-)
(This used to be commit 2c29a7d9cf)
1998-04-01 21:31:06 +00:00
Jeremy Allison
c6db9717f6 Rolling back machine password change code - this doesn't work (yet).
Jeremy.
(This used to be commit 66affb3dc3)
1998-04-01 19:12:35 +00:00
Jeremy Allison
10fe54befa includes.h: Added semaphore fix for HPUX10.x
server.c trans2.c: Added oplock deadlock bug fix.
lib/rpc/server/srv_netlog.c: Made code that changes machine account password the default.
Jeremy.
(This used to be commit 3b56fbc11e)
1998-03-31 20:55:14 +00:00
Jeremy Allison
5d7c8375e4 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.
(This used to be commit 7f74970838)
1998-03-24 00:37:53 +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
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