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

183 Commits

Author SHA1 Message Date
Gerald Carter
04aff47c71 moving SAM_ACCOUNT to include a bit field for initialized
members (such as uid and gid).  This way we will be able to
keep ourselves from writing out default smb.conf settings when
the admin doesn't want to,  That part is not done yet.

Tested compiles with ldap/tdb/smbpasswd.  Tested connection with smbpasswd
backend.

oh...and smbpasswd doesn'y automatically expire accounts after 21 days
from the last password change either now.  Just ifdef'd out that code
in build_sam_account().

Will merge updates into 2.2 as they are necessary.




jerry
(This used to be commit f0d4379115)
2001-12-27 06:38:04 +00:00
Jean-François Micouleau
e0066d2dd4 again an intrusive patch:
- removed the ugly as hell sam_logon_in_ssb variable, I changed a bit the
definition of standard_sub_basic() to cope with that.

- removed the smb.conf: 'domain admin group' and 'domain guest group'
parameters ! We're not playing anymore with the user's group RIDs !

- in get_domain_user_groups(), if the user's gid is a group, put it first
in the group RID list.

I just have to write an HOWTO now ;-)

        J.F.
(This used to be commit fef52c4b96)
2001-12-06 13:09:15 +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 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
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
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 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
Simo Sorce
59a02ecae1 minor fixes
(This used to be commit 57e639bbdd)
2001-09-27 02:05:30 +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
Jeremy Allison
6ddcd8a3bc Fixup passdb stuff to add new nisplus and ldap backends.
Jeremy.
(This used to be commit 611bf806d5)
2001-09-25 20:21:21 +00:00
Andrew Bartlett
00842ae253 Don't segfault when deleting accounts not in /etc/passwd. The RID we want is
the one in the sampass anyway.

Andrew Bartlett
(This used to be commit 29b7434293)
2001-09-25 14:40:25 +00:00
Simo Sorce
76c8d7a579 memory leak fixes ..
(This used to be commit 7f07004571)
2001-09-25 09:58:36 +00:00
Simo Sorce
4561e8a8ea move to SAFE_FREE()
(This used to be commit 64d35e94fe)
2001-09-17 05:04:17 +00:00
Gerald Carter
a3203a7b16 merges from 2.2
(This used to be commit b619458dde)
2001-09-14 15:33:09 +00:00
Andrew Tridgell
9a9ac2739b got rid of USE_TDB_MMAP_FLAG as its not needed any more
(This used to be commit c26e0d3f27)
2001-09-06 22:08:19 +00:00
Simo Sorce
137fb61490 changed the data format in the tdb, as the time fields were not
managed correctly.
this mean you need to rebuild your passdb.tdb file.
(This used to be commit 57b8d3bb84)
2001-08-31 01:29:53 +00:00
Jeremy Allison
996719cce2 Added "use mmap" for HPUX.
Jeremy.
(This used to be commit 840802f106)
2001-07-30 22:21:31 +00:00
Tim Potter
afa7300006 Changed instances of TRUE, FALSE to True, False as some compilers don't
have the first set of symbols.
(This used to be commit ad0cbfbd79)
2001-07-12 22:27:00 +00:00
Andrew Tridgell
05fc3e578c use LDSHFLAGS not -shared in several places
(This used to be commit 8ec9c87b5d)
2001-06-04 05:13:59 +00:00
Gerald Carter
fcc23d40dc update from Simo
(This used to be commit 9e4a6c227f)
2001-05-10 20:52:20 +00:00
Gerald Carter
30c4c04c2f Patch from Simo:
o sed 's/pdb_clear_sam/pdb_free_sam/g'
  o add pdb_reset_sam()
  o password changing should be ok now as well.
(This used to be commit 96d0e7c330)
2001-05-07 14:04:46 +00:00
Jean-François Micouleau
f35157f392 Big cleanup of passdb and backends.
I did some basic tests but I have probably broken something. Notably the
password changing. So don't cry ;-)

	J.F.
(This used to be commit a4a4c02b12)
2001-05-04 15:44:27 +00:00
Gerald Carter
ba411ebf0c fixes from Simo
(This used to be commit 7703fbb30d)
2001-05-04 14:01:33 +00:00
Jeremy Allison
98560fa394 HEAD specific slprintf paranoia fixes.
Jeremy.
(This used to be commit 61723c18f9)
2001-04-08 20:31:39 +00:00
Jeremy Allison
a2e5dbb112 Remove "BYTE" - we already have uint8 - don't need more conflicts with
system header files...
Jeremy.
(This used to be commit 31e0ce310e)
2001-03-11 00:51:54 +00:00
Gerald Carter
d21325dbd9 more fixes from Simo. Also fixed the password expiration field
in the tdbsam to never expire (we don't support this yet).




jerry
(This used to be commit 3b7d0fe7eb)
2000-12-12 16:50:23 +00:00
Gerald Carter
f449a59136 group rid assignment cut and paste error
--jerry
(This used to be commit bb48b02d5f)
2000-12-09 20:45:04 +00:00
Gerald Carter
c09b1d19f8 updates to the tdbsam implementation.
--jerry
(This used to be commit 29b3ac8634)
2000-12-06 18:22:29 +00:00
Gerald Carter
0dcbafe2b9 Another large patch for the passdb rewrite.
o added BOOL own_memory flag in SAM_ACCOUNT so we could
    use static memory for string pointer assignment or
    allocate a new string

  o added a reference TDB passdb backend.  This is only a reference
    and should not be used in production because
	- RID's are generated using the same algorithm as with smbpasswd
 	- a TDB can only have one key (w/o getting into problems) and we
	  need three.  Therefore the pdb_sam-getpwuid() and
	  pdb_getsampwrid() functions are interative searches :-(

    we need transaction support, multiple indexes, and a nice open
    source DBM.  The Berkeley DB (from sleepycat.com seems to fit
    this criteria now)

  o added a new parameter "private dir" as many places in the code were
    using lp_smb_passwd_file() and chopping off the filename part.
    This makes more sense to me and I will docuement it in the man pages

  o Ran through Insure-lite and corrected memory leaks.  Need for
    a public flogging this time Jeremy (-:



-- jerry
(This used to be commit 4792029a29)
2000-11-21 05:55:16 +00:00
Gerald Carter
9fede0dc0d Large commit which restructures the local password storage API.
Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+)
are broken, but they were somewhat broken before. :)

The following functions implement the storage manipulation interface

/*The following definitions come from  passdb/pdb_smbpasswd.c  */

BOOL pdb_setsampwent (BOOL update);
void pdb_endsampwent (void);
SAM_ACCOUNT* pdb_getsampwent (void);
SAM_ACCOUNT* pdb_getsampwnam (char *username);
SAM_ACCOUNT* pdb_getsampwuid (uid_t uid);
SAM_ACCOUNT* pdb_getsampwrid (uint32 rid);
BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass);
BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override);
BOOL pdb_delete_sam_account (char* username);

There is also a host of pdb_set..() and pdb_get..() functions for
manipulating SAM_ACCOUNT struct members.  Note that the struct
passdb_ops {} has gone away.  Also notice that struct smb_passwd
(formally in smb.h) has been moved to passdb/pdb_smbpasswd.c
and is not accessed outisde of static internal functions in this
file.  All local password searches should make use of the the SAM_ACCOUNT
struct and the previously mentioned functions.

I'll write some documentation for this later.  The next step is to fix
the TDB passdb backend, then work on spliting the backends out into
share libraries, and finally get the LDAP backend going.

What works and may not:

	o domain logons from Win9x 	works
	o domain logons from WinNT 4	works
	o user and group enumeration
		as implemented by Tim	works
	o file and print access		works
	o changing password from
		Win9x & NT		ummm...i'll fix this tonight :)

If I broke anything else, just yell and I'll fix it.  I think it
should be fairly quite.





-- jerry
(This used to be commit 0b92d0838e)
2000-11-13 23:03:34 +00:00