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

1419 Commits

Author SHA1 Message Date
Luke Leighton
648ceb2f2e received update from jean francois for ldap.c: he is doing add / mod
functions
(This used to be commit 381df1e52b)
1998-05-18 14:06:49 +00:00
Luke Leighton
39f3c0c25a - renamed some of the passdb.c functions: they have a prefix pdb_ on them
- split smbpass.c "password file lock" routines into smbpassfile.c: moved
  trust account routines into smbpassfile.c as well
(This used to be commit 3e48b4eb11)
1998-05-18 12:27:04 +00:00
Luke Leighton
a85b42ff37 oops. pressed ctrl-z while editing the previous cvs message: this was
taken to mean ":x".
(This used to be commit 660206e816)
1998-05-18 11:59:19 +00:00
Luke Leighton
32954eb9e9 Makefile:
- added nisppass.c and NISPLUS_FLAGS

includes.h:

	- renamed USE_LDAP to USE_LDAP_DB.  renamed NISPLUS to USE_NISPLUS_DB.
	added default define of USE_SMBPASS_DB.

	- removed ldap headers: they are local only to ldap.c

ldap.c :

	- made all ldap-specific functions static.

	- added dummy sam21 functions

loadparm.c :

	- renamed NISPLUS to NISPLUS_HOME


mkproto.awk

	- commented out ldap-specific #ifdef generation code: it's not
	  needed now that ldap-specific functions in ldap.c are static

nisppass.c :

	- first attempt at an add function from
(This used to be commit f215d375f0)
1998-05-18 11:54:00 +00:00
Jeremy Allison
94a39bd9a2 Change getpwnam to Get_Pwnam(xx , True) to allow lazy matching
in /etc/passwd. Fix from "Mike Black" <mblack@csihq.com>.
Jeremy.
(This used to be commit 0146883f85)
1998-05-15 23:10:46 +00:00
Jeremy Allison
5e1313d184 Fix from "Gerald W. Carter" <cartegw@eng.auburn.edu>, we were
copying from a parameter into an unitialized variable (doh !).
Jeremy.
(This used to be commit a3a0dc14c2)
1998-05-15 22:29:42 +00:00
Luke Leighton
c230ee1ef6 some databases have search capabilities. acknowledging this in design
of passdb.c api.
(This used to be commit 2dd01b7c70)
1998-05-15 14:50:35 +00:00
Luke Leighton
1f94f63653 first non-compiling, unused, mostly stub version of NIS+ password database.
based on Benny Holmgren's samba patch (copyright acknowledged).
(This used to be commit 2a87cf0957)
1998-05-15 14:49:48 +00:00
Luke Leighton
d36a24d2c8 adding copyright messages for Benny Holmgren
(This used to be commit d7ed2ee35c)
1998-05-15 14:48:25 +00:00
Luke Leighton
90e97bf9c5 two scripts from benny holmgren which a) create NIS+ table b) populate it
from private/smbpasswd.
(This used to be commit 1acdd9fd6c)
1998-05-15 14:47:01 +00:00
Jeremy Allison
bc69d08227 util.c: Re-seed the crypto random number generator after a fork, so all
smbds started from the same parent won't use the same sequence.
Jeremy.
(This used to be commit d3f507d05d)
1998-05-15 00:39:46 +00:00
Jeremy Allison
f8a4273407 passdb.c
server.c: Moved generate_machine_sid() into passdb.c for Jean-Francois
          (who might want an LDAP version). Changed locking to free exclusive
          lock as soon as possible to prevent contention.
lib/rpc/parse/parse_samr.c
lib/rpc/server/srv_samr.c: Changed last SID-as-string manipulation
                           function to use DOM_SID structure.
Jeremy.
(This used to be commit 3b8f5aef57)
1998-05-14 21:10:49 +00:00
Herb Lewis
109654575b sync with 1.9.18 branch (clean up comments)
(This used to be commit b924e378f8)
1998-05-14 19:04:29 +00:00
Luke Leighton
0923f9ec24 some pretty horrible formatting in standard_sub_basic(): makes the function
unreadable and unmaintainable
(This used to be commit eefeb61242)
1998-05-14 14:01:09 +00:00
Luke Leighton
ea92374814 robert frank - some Next3 compilation errors detected.
(This used to be commit da3d9602c7)
1998-05-14 11:16:18 +00:00
Jeremy Allison
05a8202b48 Fixed dce/rpc to use global_machine_sid (auto generated in server.c if
not present in smb.conf).
Jeremy.
(This used to be commit e7c1100390)
1998-05-14 03:32:21 +00:00
Jeremy Allison
bce6d41013 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.
(This used to be commit 5bf17840ac)
1998-05-14 03:20:42 +00:00
Jeremy Allison
a4276507e4 chgpasswd.c: Added comments to #ifdefs
ipc.c: Caused samba password changing not to be done if UNIX password
       changing requested and not successful.
util.c: Added string_to_sid() and sid_to_string() functions.
lib/rpc/client/cli_samr.c:
lib/rpc/include/rpc_misc.h:
lib/rpc/parse/parse_lsa.c:
lib/rpc/parse/parse_misc.c:
lib/rpc/parse/parse_net.c:
lib/rpc/parse/parse_samr.c:
lib/rpc/server/srv_lsa.c:
lib/rpc/server/srv_lsa_hnd.c:
lib/rpc/server/srv_netlog.c:
lib/rpc/server/srv_samr.c:
lib/rpc/server/srv_util.c: Changes so that instead of passing SIDs
around as char *, they are converted to DOM_SID at the earliest
opportunity, and passed around as that. Also added dynamic memory
allocation of group sids. Preparing to auto-generate machine sid.
Jeremy.
(This used to be commit 134d6fa79c)
1998-05-14 01:30:40 +00:00
Jeremy Allison
329fe21343 Fixed up HPUX entry.
Jeremy.
(This used to be commit a7afda2e4e)
1998-05-13 18:36:12 +00:00
Andrew Tridgell
5b619d9514 initialise some variables (stops warning)
(This used to be commit 6074d09dbf)
1998-05-13 05:07:55 +00:00
Andrew Tridgell
4b587cd3ed test for overflow in nmb name parsing code
(This used to be commit 204a939807)
1998-05-13 05:03:17 +00:00
Andrew Tridgell
d636d65bcc initialise a variable
(This used to be commit 1c052f8744)
1998-05-13 05:02:31 +00:00
Andrew Tridgell
ed4719b66c we don't need a typedef for string
(This used to be commit 9907296225)
1998-05-13 05:01:36 +00:00
Jeremy Allison
ee9a61841a includes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don't
have vsnprintf.
locking_slow.c: slight tidy.
make_smbcodepage.c: Use safe_strcpy instead of pstrcpy.
nmbd_winsserver.c: Use pstrcpy instead of fstrcpy.
smbmount.c: Fixed reported bug.
util.c: Removed old fstrcpy/fstrcat functions.
Jeremy.
(This used to be commit f257d2e4ba)
1998-05-12 22:11:24 +00:00
Luke Leighton
785d23c6cb - removed ldap_get_trust()
- #ifdef around putting 16 byte hashes instead of plaintext password.
(This used to be commit ca7bf597e4)
1998-05-12 16:49:26 +00:00
Luke Leighton
00d8e6626f function comments wrong
(This used to be commit da11063cbd)
1998-05-12 16:43:52 +00:00
Luke Leighton
d48e8376f1 removed lp_domain_workstation() parameter
(This used to be commit 80d6a3bb0c)
1998-05-12 14:04:46 +00:00
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
Andrew Tridgell
1dadc7af95 a new slprintf() function. This one is totally portable but a bit of a
kludge. It is a safe kludge with our current code but I would like to
revisit it at some point in the future.

The problem with the one I committed yesterday is it used non-portable
functions. (it also had a bug in it, but that's another matter)

This one works by just using vsprintf() into a 8k buffer and a memcpy
from there. No memory protection tricks or other non-portable
stuff. This is safe because all calls to slprintf() in samba use
strings which have been through a pstrcpy and thus are less than 1024
bytes. No call uses more than 2 of these strings. See what I mean by
kludge? Note that the 8k is way overkill but I like overkill :)

Someday (after autoconf) we will replace this with something better,
but meanwhile this is simple, secure and portable.
(This used to be commit 4cfcc398c3)
1998-05-12 12:48:54 +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
Jeremy Allison
05eb22f77c reply.c: Added code to not overwrite sesssetup_user when in share level security
and null session setup done.
smbpasswd.c: Fix from Gerald Carter <cartegw@Eng.Auburn.EDU> to fix incorrect
             use of pointer.
Jeremy.
(This used to be commit 69ace07609)
1998-05-11 17:53:37 +00:00
Luke Leighton
0518067c6e add lp_domain_workstations() parameter. this is a list of workstation names
from which an NT user can log in from.  empty (default) indicates no
restrictions.  exactly how this is enforced is unknown.  from past experience
it's likely that the enforcement is left to the client to carry out...
(This used to be commit 6b2f9ea68f)
1998-05-11 17:34:39 +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
b3cd94780d don't use system functions as arguments to qsort() as otherwise you
get stuck on systems with broken headers (like SunOS4). In this case
use StrCaseCmp instead of strcasecmp
(This used to be commit 1386c6e25a)
1998-05-11 08:41:09 +00:00
Andrew Tridgell
c78cf0b9d2 include includes.h in all the ubiqx files. I know Chris won't like
this but it really is necessary (sorry Chris!)

ubiqx code didn't compile on SunOS4 otherwise as stdlib didn't define
NULL.
(This used to be commit 4989db8b0b)
1998-05-11 08:32:37 +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
Andrew Tridgell
ffc88e2d26 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 6b0c1733d2)
1998-05-11 06:35:45 +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
721814dd3e added sam_passwd structure: don't want smb_passwd to be "polluted".
(This used to be commit d42dd371fa)
1998-05-08 17:53:17 +00:00
Herb Lewis
27e91f67f2 move things around to get rid of make clean warning messages
(This used to be commit d7975ef1e3)
1998-05-08 17:30:48 +00:00
Luke Leighton
64a0f84ab5 removed proto.h from cvsignore
(This used to be commit beb56f083d)
1998-05-08 17:01:25 +00:00
Jeremy Allison
9f57f01b14 clitar.c: #ifdef'ed out all the bits that were giving 'defined but not used'
messages.
nttrans.c: More updates.
smb.h: Removed stuff that didn't belong in the smb_passwd struct. Persuaded Luke
       to use a new structure.
web/swat.c: Fixed gcc complaints about shadowing global 'string'.
Jeremy.
(This used to be commit 61c1dbb978)
1998-05-08 16:59:30 +00:00
Jeremy Allison
5e9cd44fed Ho hum, someone deleted proto.h from cvs... re-adding.
Jeremy.
(This used to be commit 6dde50738f)
1998-05-08 16:49:10 +00:00
Luke Leighton
f5039406e1 proto.h was being a pain. use "make proto" instead. check release and
release-alpha scripts operate correctly when it comes to generating
a release or alpha release.
(This used to be commit 6f792502d7)
1998-05-08 14:41:35 +00:00
Luke Leighton
5d2d006fd2 added proto.h to .cvsignore
(This used to be commit 29eda8a00a)
1998-05-08 14:14:26 +00:00
Luke Leighton
45d32e5301 added smb_grpid to smb_passwd struct
(This used to be commit bcafdcda85)
1998-05-08 14:09:13 +00:00
Richard Sharpe
bb8706f407 Se-submitting clitar.c/
I now only have one warning in my code which is the result of some code I have started
working on but am not yet using in the code, along with a warning that is caused
by one of the include files (a nested comment).

I used -Wall -Wshadow -Wstrict-prototypes
(This used to be commit 7b98fd5b69)
1998-05-08 13:51:17 +00:00
Luke Leighton
965148c5f2 renamed last_change_time to pass_must_change_time. removed "if (bool==True)"
and "if (bool==False)" code from ldap.c - a boolean test may not necessarily
return exactly True or exactly False: True may be defined to be -1: you never
know...
(This used to be commit 9bf9752134)
1998-05-08 11:31:55 +00:00
Luke Leighton
6b70e2c7fd added extra fields to struct smb_passwd
the smbpw functions are expected to fill in the blanks by reading the
appropriate smb.conf parameters.

the ldappw functions are expected to fill in the fields from the ldap
database.  a separate utility can be written to fill in the ldap database
fields from the smb.conf parameters, at a later date.
(This used to be commit 0b6394c83e)
1998-05-08 11:30:17 +00:00