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

363 Commits

Author SHA1 Message Date
Andrew Bartlett
0d09562eed Add a couple of extra debugs for the secrets.tdb stuff
(This used to be commit c76c1f6904)
2001-12-05 10:52:13 +00:00
Andrew Tridgell
cc3aff7436 auto-init secrets.tdb
(This used to be commit aff916e543)
2001-12-05 09:45:00 +00:00
Jean-François Micouleau
922eb763d7 added a boolean to the group mapping functions to specify if we need or
not the privileges. Usually we don't need them, so the memory is free
early.

lib/util_sid.c: added some helper functions to check an SID.

passdb/passdb.c: renamed local_lookup_rid() to local_lookup_sid() and pass
an RID all the way. If the group doesn't exist on the domain SID,
don't return a faked one as it can collide with a builtin one. Some rpc
structures have been badly designed, they return only rids and force the
client to do subsequent lsa_lookup_sid() on the domain sid and the builtin
sid !

rpc_server/srv_util.c: wrote a new version of get_domain_user_groups().
Only the samr code uses it atm. It uses the group mapping code instead of
a bloody hard coded crap. The netlogon code will use it too, but I have to
do some test first.

	J.F.
(This used to be commit 6c87e96149)
2001-12-04 21:53:47 +00:00
Andrew Bartlett
85450cb1c9 This comment no longer applies.
(This used to be commit 153c4a56b0)
2001-12-04 04:33:22 +00:00
Jean-François Micouleau
cdf9b42754 added a tdb to store the account policy informations.
You can change them with either usermanager->policies->account
or from a command prompt on NT/W2K: net accounts /domain

we can add a rpc accounts to the net command. As the net_rpc.c is still
empty, I did not start. How should I add command to it ? Should I take the
rpcclient/cmd_xxx functions and call them from there ?

alse changed the SAM_UNK_INFO_3 parser, it's an NTTIME. This one is more
for jeremy ;-)

        J.F.
(This used to be commit bc28a8eebd)
2001-12-03 17:14:23 +00:00
Jean-François Micouleau
83304678a0 added mapping of primary gid to rid thru the group mapping code.
and cleanup and comments in passdb/passdb.c


	J.F.
(This used to be commit 6533339887)
2001-12-02 00:03:35 +00:00
Jean-François Micouleau
fac01bda8b Changed again how the privilege list is handled in the group mapping code.
This time it's a PRIVILEGE_SET struct instead of a simple uint32 array. It
makes much more sense. Also added a uint32 systemaccount to the GROUP_MAP
struct as some privilege showing in USRMGR.EXE are not real privs but a
bitmask flag. I guess it's an heritage from NT 3.0 ! I could setup an NT
3.1 box to verify, but I'm too lazy (yes I still have my CDs).

Added 3 more LSA calls: SetSystemAccount, AddPrivileges and
RemovePrivileges, we can manage all this privilege from UserManager.

Time to change the NT_USER_TOKEN struct and add checks in all the rpc
functions. Fun, fun, fun.

        J.F.
(This used to be commit 3f0a9ef2b8)
2001-11-29 16:05:05 +00:00
Herb Lewis
3a193f1597 add .po32 files to ignore list
(This used to be commit 5f625f2877)
2001-11-28 19:49:43 +00:00
Andrew Tridgell
28c118c474 unable to open smbpasswd on initial create should only be a warning
(This used to be commit 8712ac8499)
2001-11-27 03:34:25 +00:00
Tim Potter
4348dfe7af Ignore *.po files.
(This used to be commit 091f01f34a)
2001-11-26 01:17:03 +00:00
Volker Lendecke
64bfd85d95 Don't close tdb twice.
(This used to be commit 6dda341bc8)
2001-11-25 18:49:20 +00:00
Andrew Tridgell
ad2974cd05 added "net join" command
this completes the first stage of the smbd ADS support
(This used to be commit 058a5aee90)
2001-11-24 14:16:41 +00:00
Andrew Bartlett
d0a2faf78d This is another rather major change to the samba authenticaion
subystem.

The particular aim is to modularized the interface - so that we
can have arbitrary password back-ends.

This code adds one such back-end, a 'winbind' module to authenticate
against the winbind_auth_crap functionality.  While fully-functional
this code is mainly useful as a demonstration, because we don't get
back the info3 as we would for direct ntdomain authentication.

This commit introduced the new 'auth methods' parameter, in the
spirit of the 'auth order' discussed on the lists.  It is renamed
because not all the methods may be consulted, even if previous
methods fail - they may not have a suitable challenge for example.

Also, we have a 'local' authentication method, for old-style
'unix if plaintext, sam if encrypted' authentication and a
'guest' module to handle guest logins in a single place.

While this current design is not ideal, I feel that it does
provide a better infrastructure than the current design, and can
be built upon.

The following parameters have changed:
 - use rhosts =

  This has been replaced by the 'rhosts' authentication method,
 and can be specified like 'auth methods = guest rhosts'

 - hosts equiv =

  This needs both this parameter and an 'auth methods' entry
  to be effective.  (auth methods = guest hostsequiv ....)

 - plaintext to smbpasswd =

  This is replaced by specifying 'sam' rather than 'local'
  in the auth methods.

The security = parameter is unchanged, and now provides defaults
for the 'auth methods' parameter.

The available auth methods are:

guest
rhosts
hostsequiv
sam (passdb direct hash access)
unix (PAM, crypt() etc)
local (the combination of the above, based on encryption)
smbserver (old security=server)
ntdomain (old security=domain)
winbind (use winbind to cache DC connections)


Assistance in testing, or the production of new and interesting
authentication modules is always appreciated.

Andrew Bartlett
(This used to be commit 8d31eae52a)
2001-11-24 12:12:38 +00:00
Andrew Bartlett
af1a0238aa Kill off that crazy copy_sam_passwd(). You simply can't do that if the
structre contains pointers (well not if you intend of free those pointers
at some stage)

There is no reason (given the new passdb interface) that you can't modify a
SAM_ACCOUNT in any case.

Andrew Bartlett
(This used to be commit e8e73f7f0f)
2001-11-24 00:36:37 +00:00
Jean-François Micouleau
2527f5ef52 Changed how the privileges are stored in the group mapping code. It's now
an array of uint32. That's not perfect but that's better.

Added more privileges too.

Changed the local_lookup_rid/name functions in passdb.c to check if the
group is mapped. Makes the LSA rpc calls return correct groups

Corrected the return code in the LSA server code enum_sids.

Only enumerate well known aliases if they are mapped to real unix groups.
Won't confuse user seeing groups not available.

Added a short/long view to smbgroupedit.

now decoding rpc calls to add/remove privileges to sid.

        J.F.
(This used to be commit f29774e589)
2001-11-23 15:11:22 +00:00
Jeremy Allison
02eda2e251 Tidyups when I was doing the big merge...
Jeremy.
(This used to be commit 9148bb9eaa)
2001-11-17 03:19:17 +00:00
Andrew Bartlett
e903a34b2e Minor updates. A small dose of const.
(This used to be commit 80667cb0dd)
2001-11-11 11:00:38 +00:00
Andrew Bartlett
7de42a4faf Remove built-in support for clear-text kerberos authentication.
This should remove some confusion from the ./configure, but does not affect the
'real' kerberos support currently residing in smbd/sesssetup.c.

This code is vunerable to a spoofed KDC, and is best replaced by --with-pam and
the pam_krb5 module.  This module includes measures to prevent such spoofing.

Andrew Bartlett
(This used to be commit 3235880b41)
2001-11-11 10:42:07 +00:00
Volker Lendecke
89c6eed93b As pdb_ldap.c does not compile in HEAD anyway, a not-compiled merge
from 2_2.

Volker
(This used to be commit 7d70b30dbd)
2001-11-09 22:15:33 +00:00
Jeremy Allison
3343d0281d Added debug in truncate, fixed warning with gcc3.
Jeremy.
(This used to be commit 970ec14b4b)
2001-11-07 23:47:20 +00:00
Andrew Bartlett
aa0ceb1255 UGLY HACK to get machines to join tdbsam domains again.
The problem is that we don't use the bitmap field, and so have to guess what
feilds to change.  NT4 sets the RID to NULL in its reply, (as a no-change
value) and we were attempting to set that as a RID.

jfm:  Can you get me the info on that bitmap, so I can construct a proper fix
to all this?

Thanks!
(This used to be commit 39f9c78d07)
2001-11-07 08:15:45 +00:00
Andrew Bartlett
971181179b Fixup for accounts without a local /etc/passwd entry.
- Now perfectly valid.
(This used to be commit be04aad90d)
2001-11-04 01:10:21 +00:00
Andrew Bartlett
acb81fe408 Various post AuthRewrite cleanups, fixups and tidyups.
Zero out some of the plaintext passwords for paranoia

Fix up some of the other passdb backends with the change to *uid_t rather than
uid_t.

Make some of the code in srv_netlog_nt.c clearer, is passing an array around,
so pass its lenght in is definition, not as a seperate paramater.

Use sizeof() rather than magic numbers, it makes things easier to read.

Cope with a PAM authenticated user who is not in /etc/passwd - currently by
saying NO_SUCH_USER, but this can change in future.

Andrew Bartlett
(This used to be commit 514c91b16b)
2001-11-01 05:02:41 +00:00
Andrew Bartlett
60f0627afb This is a farily large patch (3300 lines) and reworks most of the AuthRewrite
code.

In particular this assists tpot in some of his work, becouse it provides the
connection between the authenticaion and the vuid generation.

Major Changes:
	- Fully malloc'ed structures.
	  - Massive rework of the code so that all structures are made and destroyed
	    using malloc and free, rather than hanging around on the stack.
	- SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them
	   to be declared 'invalid' without the chance that people might get ROOT by
	   default.

	- kill off some of the "DOMAIN\user" lookups.  These can be readded at a more
	  appropriate place (probably domain_client_validate.c) in the future. They
	  don't belong in session setups.

	- Massive introduction of DATA_BLOB structures, particularly for passwords.

	- Use NTLMSSP flags to tell the backend what its getting, rather than magic
	  lenghths.

	- Fix winbind back up again, but tpot is redoing this soon anyway.

	- Abstract much of the work in srv_netlog_nt back into auth helper functions.

This is a LARGE change, and any assistance is testing it is appriciated.

Domain logons are still broken (as far as I can tell) but other functionality
seems
intact.

Needs testing with a wide variety of MS clients.

Andrew Bartlett
(This used to be commit f70fb819b2)
2001-10-31 10:46:25 +00:00
Andrew Bartlett
6ab678d42b Small 'const' updates ahead of some AuthRewrite merging.
(This used to be commit 3b5e72bda3)
2001-10-31 06:22:19 +00:00
Andrew Bartlett
15741d2fe4 Fix up smbpasswd -e/-d so that it doesn't change the password under you any
more.

(Previously it set them to 'XXXX' or similar when only the flags were being
changed - a bug I must have introduced when I reworked the passdb end of things
a few weeks back.)

Adds a new local flag:  LOCAL_SET_PASSWORD to specify that the password is
actually to be changed.

Andrew Bartlett
(This used to be commit cea6b6cb22)
2001-10-30 05:21:16 +00:00
Andrew Bartlett
d9d7f023d8 This commit is number 4 of 4.
In particular this commit focuses on:

Actually adding the 'const' to the passdb interface, and the flow-on changes.

Also kill off the 'disp_info' stuff, as its no longer used.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes introduces a large dose of 'const' to the Samba tree.
There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

---

This finishes this line of commits off, your tree should now compile again :-)

Andrew Bartlett
(This used to be commit c95f5aeb93)
2001-10-29 07:35:11 +00:00
Andrew Bartlett
2038649e51 This commit is number 3 of 4.
In particular this commit focuses on:

Changing the Get_Pwnam code so that it can work in a const-enforced
environment.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for 'const' in the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username
(This used to be commit e7634f81c5)
2001-10-29 07:28:32 +00:00
Andrew Bartlett
0db1899256 This commit is number 2 of 4.
In particular this commit focuses on:

The guts of the moving about inside passdb.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for the introduction of  a large dose of 'const' to
the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

passdb/

	- Kill off disp_info stuff, it isn't used any more - Kill off
	support for writing to the old smbpasswd format, it isn't relevent
	to Samba 3.0

	- Move around and modify the pdb_...() helper functions, adding
	one that sets the last changed  time to 'now' and that sets the
	must change time appropriately.

	- Remove the ugly forced update of the LCT- value in
	pdb_smbpasswd.  - Remove the implicit modification of the ACB
	flags when both NT and LM passwords are set.

	- Removed substation in pdb_getsampwnam output, as a single
	password change will render them  inoperable in any case (they
	will be substituted and stored)

	- Added a default RID to the init_sam_from_pw() function, based on
	our rid algorithm.

	- Added checks that an smbpasswd stored user has a uid-based RID.

	- Fail to store tdb based users without a RID

lib/
    - Change the substituion code to use global_myname if there is
      no connection (and therefore no called name) at the present time.
(This used to be commit 8f607810eb)
2001-10-29 07:24:49 +00:00
Andrew Bartlett
ab5d5cfbe0 This commit is number 1 of 4.
In particular this commit focusses on:

Adding the new 'pass changed now' helper function.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.
(This used to be commit a8971a5448)
2001-10-29 07:15:51 +00:00
Jeremy Allison
c416ff851b Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.
Ensure make_conection() can only be called as root.
Jeremy.
(This used to be commit 8d23a7441b)
2001-10-18 20:15:12 +00:00
Gerald Carter
1347bd6057 merge from 2.2
(This used to be commit 96c9df577b)
2001-10-10 17:04:23 +00:00
Jeremy Allison
ed94aa9d61 Fixes from John Trostel (modified somewhat by me) to ensure that all lookup_XX
functions correctly deal with the SID_NAME_TYPE. One fix for connection user
lookup in LSA.
Jeremy.
(This used to be commit 29730027d8)
2001-10-09 20:54:56 +00:00
Tim Potter
fbdc7ce391 Added a comment about not changing the magic timestamp values without
knowing what you are doing!
(This used to be commit 5805cfef78)
2001-10-03 23:08:10 +00:00
Jeremy Allison
3a17bab00f Ensure accessing NT member servers works with a Samba PDC. Don't
change these timestamp settings without good reason.
Remove CLEAR_IF_FIRST flag is tdb is read-only.
Jeremy.
(This used to be commit a71d9d98b0)
2001-10-03 22:58:37 +00:00
Andrew Tridgell
c388e744c4 set ACB_PWNOEXP by default on new accounts.
(This used to be commit ead3d41f1a)
2001-10-03 13:07:02 +00:00
Jeremy Allison
facbdd692d Fixed up the change password bug when not using PAM.
The problem is we were trying to use mask_match as a generic
wildcard matcher for UNIX strings (like the password prompts).
We can't do that - we need a unix_wild_match (re-added into lib/util.c)
as the ms_fnmatch semantics for empty strings are completely wrong.
This caused partial reads to be accepted as correct passwd change
responses when they were not....
Also added paranioa test to stop passwd change being done as root
with no %u in the passwd program string.
Jeremy.
(This used to be commit 9333bbeb76)
2001-10-02 21:58:09 +00:00
Jeremy Allison
cb4b13a82b Fixed the bug with member servers in a Samba PDC hosted domain not allowing
other access. Problem was max time was being set to 0xffffffff, instead of
0x7fffffff.
Jeremy.
(This used to be commit 94403d8417)
2001-10-02 06:57:18 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Andrew Tridgell
c6d1e75664 - fix handling of 0 last_change_time and must_change_time
- move the arbitrary 21 day timeout to local.h
(This used to be commit 11075f5434)
2001-10-01 10:54:11 +00:00
Andrew Bartlett
a28dd18fe7 This is the passdb section of the previously mentioned commit.
Of particular note is the change to pdb_free_sam() to take its sam argument by
reference, allowing it to be NULLified by the SAFE_FREE() macro, and the
changed to local_password_change() both to make it work and to remove the
duplicate code that caused so much breakage over the last few days.

 - Small change in behaviour:  when LOCAL_ADD_USER is set, the user doesn't
actually exist locally but does exist in the passdb we don't attempt to do a
GetPwnam().  (How the entry got there is another matter, and most passdbs won't
allow this anyway).

Andrew Bartlett
(This used to be commit 6b45e342fd)
2001-09-29 13:14:19 +00:00
Andrew Bartlett
b2e39ddcf7 How the heck I missed this I don't know, but somehow I got a copy-and-paste
error in here...

Now you can change local passwords again.  There is stil somthing broken about
remote (via windows/sampasswd) password changing.

I shall have to revise my testing, I honestly don't know how this slipped
through the net.

MERGE for 2.2.2.

Sorry,
Andrew Bartlett
(This used to be commit 1f83184f88)
2001-09-28 04:48:36 +00:00
Jeremy Allison
3bd48ad718 Merge HEAD and 2.2 - try frantically to keep in sync.
Jeremy.
(This used to be commit 65bf4a36ef)
2001-09-27 20:40:47 +00:00
Andrew Bartlett
2a9cd3b79a Fix memory leak in get_sampwd_entries(), reindent for clarity.
- call pdb_reset_sam() after each getent call.

Fix bug in get_group_alias_entries(), were if num_entries was zero this caused
talloc() to return NULL, failing a test below with NT_STATUS_NO_MEMORY.

Fix pdb_reset_sam() to correctly initalise the sam structure.

Move default value code into a single place, likewise for sam freeing code.
 - should make things easier if we decide to malloc other strings, or get more
 non-zero default values.

Finally, add a function in init a sam struct from a getpwnam() return.

Andrew Bartlett
(This used to be commit a41fb44f5e)
2001-09-27 09:13:26 +00:00
Simo Sorce
59a02ecae1 minor fixes
(This used to be commit 57e639bbdd)
2001-09-27 02:05:30 +00:00
Gerald Carter
c10dc7a4cc merge from 2.2
(This used to be commit 247b9c3eba)
2001-09-26 14:40:21 +00:00
Andrew Bartlett
1ef468f805 Fix the uninitialised variable, but more importantly fix the SEGFAULT.
Merge for 2.2.2

Should TDB cope with TDB pointers itself?

Andrew Bartlett
(This used to be commit 27f0510a0b)
2001-09-26 11:44:25 +00:00
Andrew Bartlett
f12ebc00a8 Fix up TDB_SAM with repect to case sensitvity. (need to use unix_strlower)
Also attempt to make some of the syntax clearer, its confusing enought for the
compiler... (it thinks that there is use of an unitilaised variable)

In fact there is, see next patch...
(This used to be commit 540abc8125)
2001-09-26 11:36:37 +00:00
Andrew Bartlett
dc62feccb6 Add a new interface pdb_set_plaintext_passwd() to the passdb. This simply
interfaces to the existing set NT and LM functions, but ensures we always do it
in the same way.

This also allows for the possibility for the unix password sync code to be
hidden behind the passdb interface as some stage.
(This used to be commit 33e3591b2d)
2001-09-26 11:23:08 +00:00
Andrew Bartlett
345a670324 We don't use a modified 'user' in any case, so don't modifiy it.
(This used to be commit e0e05cb5a5)
2001-09-26 05:22:10 +00:00