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

1517 Commits

Author SHA1 Message Date
Stefan Metzmacher
9fbbaa560a s3:passdb: avoid sid_to_gid() if the sid is "domain users"
If the call fails we would use the "domain users" sid anyway.

metze
2010-03-25 21:25:27 +01:00
Volker Lendecke
ea8e0d5d54 Fix some nonempty blank lines 2010-03-25 10:24:45 +01:00
Karolin Seeger
fad0629e78 s3-builtin: Add missing builtin groups.
Karolin
2010-03-23 15:24:52 +01:00
Karolin Seeger
ef83c970ca s3-builtin: Add some builtin groups.
Karolin
2010-03-23 11:39:05 +01:00
Volker Lendecke
2b4ce9a73f s3: Make login_cache_write take a pointer 2010-03-16 22:35:41 +01:00
Volker Lendecke
276b1aa189 s3: Make login_cache_read take a pointer, avoid a malloc 2010-03-16 22:35:41 +01:00
Volker Lendecke
13a278c1b9 s3: Remove a typedef 2010-03-16 22:35:41 +01:00
Volker Lendecke
02d7cdc671 s3: Fix some nonempty blank lines 2010-03-16 22:35:41 +01:00
Karolin Seeger
7fdbbddf42 s3-passdb: Fix typo in debug message.
Karolin
2010-03-10 12:08:27 +01:00
Simo Sorce
3b12c38ac0 s3:schannel streamline interface
Make calling schannel much easier by removing the need to explicitly open the
database. Let the abstraction do it instead.
2010-02-23 12:46:50 -05:00
Andreas Schneider
b9cf55cfea s3-passdb: Remove obsolete signal type cast. 2010-02-23 12:23:42 +01:00
Volker Lendecke
2ea2d2a81e s3: Fix bug 5198 -- parse chfn(1)-change gecos field 2010-02-13 17:23:43 +01:00
Björn Jacke
9b75650f1a s3: change ldap filter to what really was intended 2010-02-10 13:48:11 +01:00
Stefan Metzmacher
4dc2be2264 s3:passdb: only use gid_to_sid() result if the result is a group of our local sam
Otherwise retry with pdb_gid_to_sid().

metze
2010-02-09 12:57:01 +01:00
Stefan Metzmacher
6753fb1cf6 s3:pdb_ldap: don't search for the users primary group, if we already know it
metze
2010-02-08 11:23:25 +01:00
Stefan Metzmacher
49ace81e19 s3:pdb_ldap: optimize ldapsam_alias_memberships() and cache ldap searches.
ldapsam_alias_memberships() does the same LDAP search twice, triggered
via add_aliases() from create_local_nt_token().

This happens when no domain aliases are used.

metze
2010-02-08 11:23:24 +01:00
Stefan Metzmacher
25038fa85f s3:pdb_ldap: try to build the full unix_pw structure with ldapsam:trusted support
And also store the gid_to_sid mappings in the idmap_cache.

metze
2010-02-08 11:23:24 +01:00
Stefan Metzmacher
e10d086956 s3:passdb: speed up pdb_get_group_sid()
Use the cached version gid_to_sid() instead
of pdb_gid_to_sid().

And also avoid the expensive lookup_sid() call
for wellkown domain groups.

metze
2010-02-08 11:23:23 +01:00
Volker Lendecke
b99046fed1 s3: Make pdb_copy_sam_account also copy the group sid
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-08 11:23:23 +01:00
Stefan Metzmacher
779821df8e s3: shortcut gid_to_sid when "ldapsam:trusted = yes"
The normal gid_to_sid behaviour is to call sys_getgrgid()
to get the name for the given gid and then call the
getsamgrnam passdb method for the resulting name.

In the ldapsam:trusted case we can reduce the gid_to_sid
operation to one simple search for the gidNumber attribute
and only get the sambaSID attribute from the correspoinding
LDAP object. This reduces the number of ldap roundtrips
for this operation.

metze
2010-02-08 11:23:17 +01:00
Volker Lendecke
abbd0f9195 s3: Make use of ZERO_STRUCTP 2010-02-05 21:11:17 +01:00
Volker Lendecke
3ea602a7c3 s3: Remove a pointless if-statement 2010-02-05 21:11:17 +01:00
Volker Lendecke
dcc850e3b3 s3: Make guest_user_info() static 2010-02-05 21:11:17 +01:00
Volker Lendecke
004e3e400d s3: Hide some uses of pdb_get_init_flags (which I would love to remove...) 2010-02-05 21:11:17 +01:00
Volker Lendecke
1cd7223b8e s3: Fix some nonempty blank lines 2010-02-05 21:11:17 +01:00
Stefan Metzmacher
0c93aa3cd5 s3:passdb: fix a type Domain Users has RID -513
metze
2010-02-04 15:19:50 +01:00
Jeremy Allison
69fd8461b8 Second part of fix for bug #7072 - Accounts can't be unlocked from ldap.
Missed read of entry_timestamp (was entry->entry_timestamp).

Jeremy.
2010-01-27 16:52:40 -08:00
Jeremy Allison
627fb85092 Fix bug #7072 - Accounts can't be unlocked from ldap.
Fix suggested by Andy Hanton <andyhanton@gmail.com>. The LOGIN_CACHE
struct contains two time_t entries, but was being written to and
read from via tdb_pack/tdb_unpack functions using explicit 32-bit int specifiers.
This would break on machines with a 64-bit time_t. Use correct int
sizes for tdb_pack/tdb_unpack.

We have to fix this properly before 2037 :-).

Jeremy.
2010-01-27 16:42:06 -08:00
Volker Lendecke
9fcbe3a65c s3: Remove some pointless uses of string_sid_talloc 2010-01-23 14:35:37 +01:00
Volker Lendecke
253465456a s3:pdb_ldap: Fix large paged search.
Fix bug #6981 (Paged Search with DirX LDAP server broken).
(cherry picked from commit 0a3b576c0a)
2010-01-21 15:33:42 +01:00
Stefan Metzmacher
ac224452b9 s3:pdb_ldap: restore Samba 3.0.x behavior and use the first "uid" value.
See bug #6157 for more details.

metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 25806f43dd)
2010-01-14 02:27:34 +01:00
Volker Lendecke
373dcf45cf s3: Remove a pointless if-statement 2010-01-12 13:55:07 +01:00
Volker Lendecke
48251c3370 s3: Use sid_check_is_in_our_domain instead of a direct sid_peek_check_rid 2010-01-10 20:56:16 +01:00
Volker Lendecke
3ea64e0ad8 s3: Replace most calls to sid_append_rid() by sid_compose() 2010-01-10 20:56:16 +01:00
Michael Adam
017ccd0bda s3:passdb: store the plain nt passwords hashes in history, not salted md5
This is in order to be able to do challenge response with the history,
so that this can be checked when an invalid password was entered:
If the given password is wrong but in the history, then the bad password
count should not be updated...

The "lucky" bit here is that the md5 has and the nt hash (md4) both are
16 bytes long.

This is part of the fix for bug #4347 .

Michael
2010-01-07 16:51:17 +01:00
Volker Lendecke
5e2fc28b63 s3: Simplify pdb_set_plaintext_passwd: pwhistory==NULL can not happen anymore 2010-01-07 11:07:54 +01:00
Volker Lendecke
2a11f3b3d7 s3: Simplify pdb_set_plaintext_passwd: pwHistLen==0 was checked above 2010-01-07 11:07:54 +01:00
Volker Lendecke
ec0998ada5 s3: Add a paranoia check to pdb_set_plaintext_passwd() 2010-01-07 11:07:54 +01:00
Volker Lendecke
a3f522202d s3: Simplify pdb_set_plaintext_passwd() by removing a redundant condition
if (current_history_len != pwHistLen) {
     if (current_history_len < pwHistLen) {
     }
}

The second "if" is a bit pointless here
2010-01-07 11:07:54 +01:00
Volker Lendecke
7633837026 s3: Simplify pdb_set_plaintext_passwd: memcpy deals fine with 0 bytes 2010-01-07 11:07:53 +01:00
Volker Lendecke
864ed92954 s3: Simplify pdb_set_plaintext_passwd by using talloc_zero_array 2010-01-07 11:07:53 +01:00
Volker Lendecke
e7290255f5 s3: Make use of talloc_array in pdb_set_plaintext_passwd() 2010-01-07 11:07:53 +01:00
Volker Lendecke
7ba006430f s3: Simplify pdb_set_plaintext_passwd() a bit
Remove an indentation by the early return in

+       if (pwHistLen == 0) {
+               /* Set the history length to zero. */
+               pdb_set_pw_history(sampass, NULL, 0, PDB_CHANGED);
+               return true;
+       }
2010-01-07 11:07:52 +01:00
Volker Lendecke
ca6c1cdd5f s3: Simplify pdb_set_plaintext_passwd() slightly
No functional change, this just removes an indentation level by the early
"return True;" in

+       if ((pdb_get_acct_ctrl(sampass) & ACB_NORMAL) == 0) {
+               /*
+                * No password history for non-user accounts
+                */
+               return true;
+       }

Volker
2010-01-07 11:07:52 +01:00
Michael Adam
2fad148b27 s3:pdb_set_pw_history: free the old history before setting the new.
This is not strictly necessary, since this only leaks into the
struct samu, and this is not so long-lived in the code path that
changes the password, but it definitely correct and does not harm.

Michael
2010-01-07 11:07:51 +01:00
Michael Adam
71e3de6c9f s3:pdb_ldap:init_sam_from_ldap: untangle an assignment from the check
to enhance readability and denbuggability.

Michael
2010-01-07 11:07:51 +01:00
Volker Lendecke
129e976c47 s3: "startsmbfilepwent" only looks at the inode -- is that enough? 2009-11-29 11:22:04 +01:00
Volker Lendecke
44ce5603dd s3: Pass the "fake dir create times" parameter to sys_*stat
Step 0 to restore it as a per-share paramter
2009-11-29 11:22:01 +01:00
Michael Adam
557535302c s3:pdb_ldap: fix a comment typo
Michael
2009-11-19 17:55:47 +01:00
Michael Adam
457055871a s3: shortcut uid_to_sid when "ldapsam:trusted = yes"
The normal uid_to_sid behaviour is to call sys_getpwuid()
to get the name for the given uid and then call the
getsampwnam passdb method for the resulting name.

In the ldapsam:trusted case we can reduce the uid_to_sid
operation to one simple search for the uidNumber attribute
and only get the sambaSID attribute from the correspoinding
LDAP object. This reduces the number of ldap roundtrips
for this operation.

Michael
2009-11-19 17:55:47 +01:00