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

211 Commits

Author SHA1 Message Date
Jeremy Allison
998fcd3f1e Patch from David_Tiller@ccnotes.ccity.com finally applied now I've thought
about it to stop account lockouts with "security=server" mode. Sorry for
the delay David.
Jeremy.
(This used to be commit e881971503)
2001-05-06 20:56:14 +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
1f7a451c1e merge from 2.2 in password_ok() to ensure that we check the
return code from smb_pam_accountcheck()
(This used to be commit d5d6f01aaf)
2001-05-04 14:28:28 +00:00
Jeremy Allison
c3a999409d Based on an original PAM patch by Andrew Bartlett, re-written by me to
remove global static PAM variables, and to tidy up the PAM internals code.
Now looks like the rest of Samba.
Still needs testing.
Jeremy.
(This used to be commit 1648ac64a7)
2001-04-30 21:05:58 +00:00
Jeremy Allison
ae8418d0c4 Added smb_ prefix to all Samba wrapper pam functions.
Fixed off by one bug using StrnCpy instead of strdup().
Jeremy.
(This used to be commit d4b1c0be2e)
2001-04-23 04:15:35 +00:00
Jeremy Allison
e277c08631 Commit of a modified version of Andrew Bartlett's patch that removes the
horrid utmp hostname parameter - now uses the client name instead.
Also tidies up some of the unencrypted password checking when PAM
is compiled in.
FIXME ! An pam_accountcheck() is being called even when smb encrypted
passwords are negotiated. Is this the correct thing to do when winbindd
is running ! This needs *SEVERE* testing....
Jeremy.
(This used to be commit 071c799f47)
2001-04-22 07:20:24 +00:00
Andrew Tridgell
9ce5a03ccb merge from 2.2
(This used to be commit f52a5014ee)
2001-04-18 16:41:04 +00:00
Jeremy Allison
bcdb9496e8 Bail out early if null passwords and lp_null_passwords not set.
Jeremy.
(This used to be commit 7c718fc85e)
2001-03-27 00:24:40 +00:00
Jeremy Allison
b840dce676 Moved cruft out of smb.h into ntdomain.h where it belongs. dc struct
now in pipe struct (where used) rather than user_struct.
Secured machine account password changing in srv_netlog_nt.c - ensure
that only the given machine can change its own password. May need to
free this up later for NT admin tools, but this is a fail-safe secure
position for now.
Jeremy.
(This used to be commit 46b12f2275)
2001-03-11 22:26:28 +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
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Gerald Carter
607ea0d6fa replaced inet_aton() with inet_addr() to keep Solaris from complaining.
jerry
(This used to be commit 2b18c44843)
2001-02-08 18:41:01 +00:00
Jeremy Allison
5aef8a21c6 Fixes from appliance-head for pdc searches.
Jeremy.
(This used to be commit d04ed97eca)
2001-01-25 02:59:13 +00:00
David O'Neill
23807f2b30 Changes from APPLIANCE_HEAD:
source/Makefile.in
        - changes to ctags and etags rules that somehow got lost along the way.

    source/include/proto.h
        - make proto

    source/smbd/sec_ctx.c
    source/smbd/password.c
        - merge debugs for debugging user groups and NT token stuff.

    source/lib/util_str.c
        - capitalise domain name returned from parse_domain_user()

    source/nsswitch/wb_client.c
        - fix broken conditional in debug statement.

    source/include/rpc_secdes.h
    source/include/rpc_spoolss.h
    source/printing/nt_printing.c
    source/lib/util_seaccess.c
        - fix printer permission bugs related to ACE masks for printers.
          This adds mapping of generic access rights to object specific
          rights for NT printers.  Still need to work out whether or not to
          ignore ACEs with certain flags set, though. See comments in
          util_seaccess.c:check_ace() for details.

    source/printing/nt_printing.c
    source/printing/printing.c
        - use PRINTER_ACCESS_ADMINISTER instead of JOB_ACCESS_ADMINISTER
          until we sort out printer/printjob permission stuff.
(This used to be commit 1dba9c5cd1)
2001-01-04 19:27:08 +00:00
Jeremy Allison
7bf9d8ce4b Fixed bug found by Gerald. If a Samba server joins a domain and is set
to search for a DC to authenticate to using the "*" syntax than ensure
that for the first hour after the password change is searches for the
PDC using the 1B name not the 1C name as domain replication may not
have occured.
Jeremy.
(This used to be commit c25533de99)
2000-12-19 23:57:48 +00:00
Jeremy Allison
cade42c05b Fixed bug noticed by JF. se_access_check needs user SID as first in token.
Jeremy.
(This used to be commit f0d7867801)
2000-12-12 20:41:02 +00:00
Jeremy Allison
276364e2a4 Removed the special casing of SIDs in se_access_check. This is now done (correctly)
when the NT_USER_TOKEN is *created*.
Jeremy.
(This used to be commit 27d72ed1cf)
2000-12-12 02:36:14 +00:00
Jeremy Allison
0f1ead1c93 Removed unused auto (IRIX compiler warning).
Jeremy.
(This used to be commit 63e2ebc427)
2000-12-08 19:21:09 +00:00
Jeremy Allison
cf5b71994d file_lines_load/file_lines_pload can now optionally convert unix_to_dos()
on read.
Jeremy.
(This used to be commit 76b8dd376d)
2000-12-07 19:26:04 +00:00
Tim Potter
a1f4e6e927 Print debug if domain_client_validate() cannot fetch the trust account
password (say for example if the tdb file format has changed).  (-:
(This used to be commit 447fbb38a8)
2000-12-06 03:22:44 +00:00
Jeremy Allison
366bf693d2 include/dlinklist.h: Added '{' '}' around DLIST_PROMOTE so it can be used as a single
statement after an 'if'. Tracking this down took 4 hours from my life and ANDREW I WANT
THEM BACK !!!!! :-).
include/smb.h smbd/password.c: Fixed the bug veritas reported with realloc of the validated_users
array growing without bounds. This is now a linked list as god (Andrew) intended :-).
Jeremy.
(This used to be commit 346f2f9206)
2000-11-28 22:17:44 +00:00
Gerald Carter
14067f9c9c combined 2 if statments which used the same condition
-- jerry
(This used to be commit 445fd1dbd8)
2000-11-21 06:05:08 +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
Tim Potter
7c4c781df2 Remove duplicate group initialisation function.
Don't initialise groups twice.
(This used to be commit 5375261152)
2000-10-11 04:54:01 +00:00
Jeremy Allison
56d514235e Fix for null passwords being allowed bug.
Jeremy.
(This used to be commit d4d5548839)
2000-10-05 22:51:57 +00:00
Jeremy Allison
7ec53a14b1 With John Reilly help tracking it down - fixed a *nasty* bug when
authorising logins. If a user connected to a share as guest, then
the snum was getting flagged as "force guest", meaning that all
subsequent connections to it, even under a different vuid, would
be bounced to guest.
This explains several very hard to reproduce access denied bugs,
and as the NT client also has bugs in that it will sometimes
erroneously use guest instead of the correct vuid on an IPC$
connection lead to a *very* hard problem to find.
This fix should be propagated into all branches (TNG/Applience
take note) and I'll also make a separate patch availalble on the
samba-technical list.
Jeremy.
(This used to be commit 0264fdafe9)
2000-09-12 19:51:38 +00:00
Tim Potter
45d30f72ff Hopefully this should fix the primary group permission problem.
(This used to be commit 2f33ec41ac)
2000-09-07 08:43:05 +00:00
Jeremy Allison
a1f66a820d Fix for the SID history problem when using a Win2k domain controller
with security=domain. Also fixed to dynamically allocate the SIDs and GIDs.
Jeremy.
(This used to be commit 2b1f66eb82)
2000-09-06 01:06:39 +00:00
Jeremy Allison
7d93eb3483 smbd/password.c: Fixed typo in Tim's new code that caused insure overrun error.
smbd/reply.c: Fixed lowercasing UNIX character set problem.
Jeremy.
(This used to be commit 2b6e3ed7a6)
2000-08-28 20:45:00 +00:00
Tim Potter
66cc9787ef Merge bug - still getting used to dirdiff.
(This used to be commit cb717b4a2b)
2000-08-28 07:25:18 +00:00
Tim Potter
d12f3fea75 Merge from appliance branch.
(This used to be commit 567b0095b1)
2000-08-28 06:46:53 +00:00
Jeremy Allison
04de6d0258 Found the sec_ctx_stack overflow - a become_root() should have been an
unbecome_root() - typo.
Jeremy.
(This used to be commit ebb160663e)
2000-08-08 23:49:26 +00:00
Jeremy Allison
06e4f11acd Fixed up the user/group contexts when using authenticated pipes.
Added a become_root()/unbecome_root() (push/pop security context)
around the initgroups() call to ensure it would succeed. Hmmm - I
wonder if this call being done as non-root might explain any "group access"
bugs we've had in the past....
Jeremy.
(This used to be commit 06a65972e8)
2000-08-04 00:59:09 +00:00
Jeremy Allison
f87399915b Added an NT_USER_TOKEN structure that is copied/passed around associated
with the current user. This will allow se_access_check() to quickly do
a SD check without having to translate uid/gid's to SIDs.
Still needs work on pipe calls.
Jeremy.
(This used to be commit e28d01b744)
2000-08-03 22:38:43 +00:00
Jeremy Allison
17dcd9a834 Started to canonicalize our handling of uid -> sid code in order to
get ready and fix se_access_check().
Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid()
functions that look via winbind first the fall back on local lookup.

All Samba should use these rather than trying to call winbindd code
directly.

Added NT_USER_TOKEN struct in user_struct, contains list of NT sids
associated with this user.

se_access_check() should use this (cached) value rather than attempting
to do the same thing itself when given a uid/gid pair.

More work needs to be done to preserve these things accross security
context changes (especially with the tricky pipe problem) but I'm
beginning to see how this will be done..... probably by registering
a new vuid for an authenticated RPC pipe and not treating the
pipe calls specially.

More thoughts needed - but we're almost there...

Jeremy.
(This used to be commit 5e5cc6efe2)
2000-08-02 02:11:55 +00:00
Jeremy Allison
7f36df301e Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
(This used to be commit c55bcec817)
2000-08-01 18:32:34 +00:00
Tim Potter
5af35320a9 Spelling fixes.
(This used to be commit c1d242f1dd)
2000-07-10 04:57:09 +00:00
Tim Potter
2a1dbb0acd Delete OriginalDir stuff.
(This used to be commit 3d0f1845c8)
2000-06-23 05:57:48 +00:00
Tim Potter
31e83abd3d ZERO_STRUCT() of info3 structure before using it.
(This used to be commit efe7f818c9)
2000-06-14 01:48:08 +00:00
Jeremy Allison
03e0164270 Luke, I am moving the code back into passdb/passdb.c, this the correct
place to do this, not in smbd/passwd.c

Please don't change this without asking first, I have run this past
Andrew so talk to him (I'm on vacation next week).

I also removed the g_newXXX macros. There are essentially a private C extension,
not used anywhere else in the code, and add no functionality over malloc(XX)
and make the code harder to understand (everyone knows what malloc does).

Jeremy.
(This used to be commit e1b1b6fb67)
2000-06-09 18:45:31 +00:00
Luke Leighton
979f509e74 free NET_USER_INFO_3 gids when vuser invalidated.
(This used to be commit 2f056c2aad)
2000-06-09 03:30:54 +00:00
Luke Leighton
ad98207f54 dynamic allocation of NET_USER_INFO_3 gids.
jeremy, the intent is to call se_access_check() with usr-sid, grp-sid,
array-of-group-rids (but array-of-group-sids would do).

please do look at smbd/lanman.c's api_NetWkstaGetInfo, it will show you
that we really do need to store the entire NET_USER_INFO_3 structure.

then again, api_NetWkstaGetInfo is only used by win9x so who cares :)
(This used to be commit bd34f65239)
2000-06-09 03:00:34 +00:00
Luke Leighton
c3487b00dd reverted jeremy's changes that removed NET_USER_INFO_3. will you please
not just undercut work in progress, thank you.
(This used to be commit 86d440a88c)
2000-06-09 01:26:42 +00:00
Jeremy Allison
28555ec92e include/smb.h: Removed NET_USER_3 struct from user struct. It doesn't belong there (yet)
as there is no infrastructure for it. Replaced it with a dynamic array
				of group SIDs plus a user.
passdb/passdb.c: Added setup_user_sids() function. This is where the lookup should be done,
				eventually calling winbind.
smbd/password.c: Changed to call setup_user_sids(). Removed spurious DEBUG(0) statements.
smbd/reply.c: Removed extra parameter to register_vuid().

Jeremy.
(This used to be commit 425f4ad9a5)
2000-06-08 17:50:19 +00:00
Luke Leighton
84d40095e1 added a NET_USER_INFO_3 struct to user_struct.
register_vuid fills it with constructed info.
(This used to be commit b1889e4334)
2000-06-08 13:56:07 +00:00
Andrew Tridgell
da44845a09 moved secrets fns into secrets.c
(This used to be commit f890bcf067)
2000-06-03 06:22:19 +00:00
Andrew Tridgell
7f2b42abec got rid of lp_revalidate()
(This used to be commit 8dea95e62c)
2000-05-24 06:36:10 +00:00
Andrew Tridgell
479c73559e use "winbind separator" option for domain/user separator character
(This used to be commit 6cbb826b15)
2000-05-12 06:30:45 +00:00
Andrew Tridgell
ebd73f37a2 use our primary domain trust account for trusted domain authentication
(This used to be commit db90a4b960)
2000-05-12 05:07:26 +00:00
Andrew Tridgell
43a3faab08 - changed smb_getpwnam() to use winbind style usernames
- finished ntdom -> winbind rename in head
(This used to be commit ada483cb56)
2000-05-10 14:48:33 +00:00