1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

925 Commits

Author SHA1 Message Date
Gerald Carter
f9f9e6039b r5015: (based on abartlet's original patch to restrict password changes)
* added SE_PRIV checks to access_check_samr_object() in order
  to deal with the run-time security descriptor and their
  interaction with user rights

* Reordered original patch in _samr_set_userinfo[2] to still
  allow root/administrative password changes for users and machines.
2007-10-10 10:55:12 -05:00
Gerald Carter
8946efe102 r4996: sync up copytights with trunk 2007-10-10 10:55:11 -05:00
Günther Deschner
78c3c71274 r4994: Patch from abartlet:
When migrating account policies to ldapsam, handle the fact that an
admin might have changed the default location of the sambaDomain-object
after installation.

Guenther
2007-10-10 10:55:11 -05:00
Günther Deschner
4cbe37ecd5 r4988: After speaking with Jerry, remove old lp_admin_users to
administrator-sid mapping completely.

Guenther
2007-10-10 10:55:10 -05:00
Günther Deschner
d319c0e189 r4964: Fix our lsa lookupsid $OURDOMAINSID-500.
Give the admin-user (rid 500) a chance to be found in passdb, not
returning the (possibly obscure) first entry of "admin users" before
that.

Guenther
2007-10-10 10:55:09 -05:00
Günther Deschner
eee0bd806b r4926: Use LDAP_SCOPE_ONELEVEL instead of OpenLDAP's LDAP_SCOPE_ONE-scope.
Guenther
2007-10-10 10:55:08 -05:00
Günther Deschner
75af83dfcd r4925: Migrate Account Policies to passdb (esp. replicating ldapsam).
Does automated migration from account_policy.tdb v1 and v2 and offers a
pdbedit-Migration interface. Jerry, please feel free to revert that if
you have other plans.

Guenther
2007-10-10 10:55:08 -05:00
Gerald Carter
504ea4ac68 r4860: fix silly limitation in ldapsam and tdbsam. Expand variables in the profile path, logon home and logon script values 2007-10-10 10:54:00 -05:00
Günther Deschner
853a8b7f1c r4851: Preleminary fix for ldapsam_enum_group_memberships when
ldapsam:trusted=True. Don't bail out when ldap-search returns pure
posixgroups (w.o. samba group-mapping).

This way those unix-memberships do not appear in user and nt user token.
Volker, could you please look over that one?

Guenther
2007-10-10 10:53:59 -05:00
Günther Deschner
6394257cc7 r4847: Hand over a acb_mask to pdb_setsampwent in load_sampwd_entries().
This allows the ldap-backend to search much more effeciently. Machines
will be searched in the ldap_machine_suffix and users in the
ldap_users_suffix. (Note that we already use the ldap_group_suffix in
ldapsam_setsamgrent for quite some time).

Using the specific ldap-bases becomes notably important in large
domains: On my testmachine "net rpc trustdom list" has to search through
40k accounts just to list 3 interdomain-trust-accounts, similiar effects
show up the non-user query_dispinfo-calls, etc.

Also renamed all_machines to only_machines in load_sampwd_entries()
since that reflects better what is really meant.

Guenther
2007-10-10 10:53:59 -05:00
Günther Deschner
ced58bd884 r4840: * Add more generic root-dse inspection function to check for given
controls or extensions.
* Check and remember if ldapsam's LDAP Server support paged results
(in preparation of adding async paged-results to set|get|end-sampwent in
ldapsam).

Guenther
2007-10-10 10:53:57 -05:00
Jelmer Vernooij
ed38e60264 r4802: Don't try to update a column with the name "NULL" 2007-10-10 10:53:55 -05:00
Jelmer Vernooij
760455875f r4788: Don't log mysql password at debug level 1. 2007-10-10 10:53:54 -05:00
Gerald Carter
4b351f2fcc r4736: small set of merges from rtunk to minimize the diffs 2007-10-10 10:53:52 -05:00
Gerald Carter
77c10ff9aa r4724: Add support for Windows privileges in Samba 3.0
(based on Simo's code in trunk).  Rewritten with the
following changes:

* privilege set is based on a 32-bit mask instead of strings
  (plans are to extend this to a 64 or 128-bit mask before
   the next 3.0.11preX release).
* Remove the privilege code from the passdb API
  (replication to come later)
* Only support the minimum amount of privileges that make
  sense.
* Rewrite the domain join checks to use the SeMachineAccountPrivilege
  instead of the 'is a member of "Domain Admins"?' check that started
  all this.

Still todo:

* Utilize the SePrintOperatorPrivilege in addition to the 'printer admin'
  parameter
* Utilize the SeAddUserPrivilege for adding users and groups
* Fix some of the hard coded _lsa_*() calls
* Start work on enough of SAM replication to get privileges from one
  Samba DC to another.
* Come up with some management tool for manipultaing privileges
  instead of user manager since it is buggy when run on a 2k client
  (haven't tried xp).  Works ok on NT4.
2007-10-10 10:53:51 -05:00
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Jelmer Vernooij
99dc2f36d1 r3974: - Fix assignment of a couple of fields in pdb_{mysql,pgsql}
- Use new DTD URL in pdb_xml
2007-10-10 10:53:26 -05:00
Jeremy Allison
05b905a28f r3948: Fix incorrect declaration. Bug #2083.
Jeremy.
2007-10-10 10:53:26 -05:00
Jeremy Allison
8e979772a6 r3931: Fix all "may be used uninitialized" and "shadow" warnings.
Jeremy.
2007-10-10 10:53:25 -05:00
Volker Lendecke
2d952c86c7 r3883: Fix error return -- thanks to rsharpe 2007-10-10 10:53:23 -05:00
Günther Deschner
bb191c1098 r3875: Allow to look up at least or own sid in _lsa_lookup_sids.
This fixes Bugzilla #1076 and Exchange 5.5 SP4 can then be finally
installed on NT4 in a samba-controlled domain.

Guenther
2007-10-10 10:53:22 -05:00
Volker Lendecke
dbfdde5f63 r3871: Fix memleak 2007-10-10 10:53:22 -05:00
Volker Lendecke
3bd72b864f r3852: Fix the build... 2007-10-10 10:53:21 -05:00
Volker Lendecke
b94838aff1 r3705: Nobody has commented, so I'll take this as an ack...
abartlet, I'd like to ask you to take a severe look at this!

We have solved the problem to find the global groups a user is in twice: Once
in auth_util.c and another time for the corresponding samr call. The attached
patch unifies these and sends them through the passdb backend (new function
pdb_enum_group_memberships). Thus it gives pdb_ldap.c the chance to further
optimize the corresponding call if the samba and posix accounts are unified by
issuing a specialized ldap query.

The parameter to activate this ldapsam behaviour is

ldapsam:trusted = yes

Volker
2007-10-10 10:53:15 -05:00
Volker Lendecke
3d9758fa3c r3704: Implement a cache get saves the result of a pdb_getsampwnam for later
retrieval by pdb_getsampwsid. This solves our problem that we do lots of calls
to LDAP during a typical XP login. XP does a lookupnames, then an openuser and
some queryinfo stuff. Lookupnames triggers the initial getsampwnam, and all
the subsequent ones make us call getsampwsid. This patch gets this down to one
call to LDAP.

Yes, a more "correct" way would be to stick the information to the open user
handle, but this one is simpler and saves the LDAP roundtrip for the openuser
call.

Volker
2007-10-10 10:53:15 -05:00
Günther Deschner
906d5f88aa r3628: A typo and a compile-warning.
Guenther
2007-10-10 10:53:10 -05:00
Volker Lendecke
2508d4ed1e r3566: Completely replace the queryuseraliases call. The previous implementation does
not exactly match what you would expect.

XP workstations during login actually do this, so we should better become a
bit more correct. The LDAP query issued is not really fully optimal, but it is
a lot faster and more correct than what was there before. The change in
passdb.h makes it possible that queryuseraliases is done with a single ldap
query.

Volker
2007-10-10 10:53:09 -05:00
Volker Lendecke
3298f6105e r3563: During a typical logon a modern workstation makes a lot of anonymous session
setups on its way to open a pipe. This gets rid of many round-trips to the
LDAP server during logon by setting up the server_info_guest once and not
asking the LDAP server and nss every time. Make sure that the ldap connection
is reopened in the child. (I did not look at the sql backends.)

Volker
2007-10-10 10:53:09 -05:00
Günther Deschner
94f48d06c7 r2923: Fix some obvious copy/paste leftover debug-messages.
Guenther
2007-10-10 10:52:56 -05:00
Günther Deschner
a4b47e7147 r2819: Make 'password history'-behaviour in ldapsam more consistent.
Currently we cannot store more then 15 password history entries (windows
NT4 allows to store 24) in ldapsam. When choosing more then "15" with
pdbedit -P "password history", we fail to initialize the password
history upon password change and overwrite the history, effectively
using a password history of "1". We do already decrease any
history-policy larger then 15 to 15 while storing the password history
list attribute in ldap.

Guenther
2007-10-10 10:52:53 -05:00
Günther Deschner
c5b8bc6c2e r2752: Fix the paranoia-check to ensure the ldap-attribute and the
smb.conf-parameter for samba's "algorithmic rid base" in ldapsam are
identical.

It tried to get the value of LDAP_ATTR_ALGORITHMIC_RID_BASE via
get_userattr_key2string() for a very long time now. This just can not
work because LDAP_ATTR_ALGORITHMIC_RID_BASE is neither in attrib_map_v22
nor in attrib_map_v30. Instead, get it directly from dominfo_attr_list.

Ldapsam will now correctly refuse to initialize when admins tried
manually to have differing values for "algorithmic rid base" in ldap and
smb.conf. idmap_ldap is another story...

Guenther
2007-10-10 10:52:50 -05:00
Volker Lendecke
a32ea3bc88 r2619: Only issue the ldap extended password change operation if the ldap server
supports it. This might be a fix for bugs 1823 and 1545, notifying both.

Also ignore object class violation errors from the extended operation. We
don't have the userPassword field in sambaSamAccount, and if we have such
broken setup with user in /etc/passwd and only samba attribs in ldap, we fail
this :-)

Volker
2007-10-10 10:52:48 -05:00
Jeremy Allison
0351bf8b03 r2479: Stop attribute "modifyTimestamp" from being deleted.
Jeremy.
2007-10-10 10:52:45 -05:00
Jelmer Vernooij
8be3fa5bfa r2473: Convert internal data to UTF-8 before calling libxml2 2007-10-10 10:52:44 -05:00
Volker Lendecke
6957d6a892 r2444: Based on jmcd's patch, implement special lists for the ldap user attributes to
delete.

Richard, IMHO this is the better solution to the problem you currently
have. Please review.

Thanks,

Volker
2007-10-10 10:52:43 -05:00
Jeremy Allison
727fc341b5 r2374: Fix from Vince Brimhall vbrimhall@novell.com for
ldapsam_compat. Be robust against NULL attributes.
Jeremy.
2007-10-10 10:52:41 -05:00
Jeremy Allison
8ae10c74ec r2317: Fixup error messages and reformat.
Jeremy.
2007-10-10 10:52:39 -05:00
Jeremy Allison
e2b0b9fb72 r2312: Fix for bugid #1667, smbpasswd file could be left locked on
some error exits.
Jeremy.
2007-10-10 10:52:39 -05:00
Volker Lendecke
67d8bc4853 r1906: Revert lukeh's change for primary uid/gid change. This creates a recursion
loop between uid_to_sid -> getsampwnam -> uid_to_sid. It needs further
inspection.

Volker
2007-10-10 10:52:23 -05:00
Jeremy Allison
dae084d713 r1871: Patch from Luke Howard <lukeh@PADL.COM> to correctly use
uid_to_sid() and gid_to_sid() in pdb_set_sam_sids().
Jeremy.
2007-10-10 10:52:22 -05:00
Jeremy Allison
f44b4ba381 r1869: Rename "fallback_XXXX" mapping to "algorithmic_XXX" as
that's what it actually does, and "fallback_" is just
confusing.
Jeremy.
2007-10-10 10:52:22 -05:00
Jeremy Allison
dac72638fb r1810: Patch from Richard Renard <rrenard@idealx.com> to store
logon hours attributes in an LDAP database.
Jeremy.
2007-10-10 10:52:21 -05:00
Jeremy Allison
a1bb6fbbe4 r1733: Fix hashed password history for LDAP backends.
Jeremy.
2007-10-10 10:52:20 -05:00
Jeremy Allison
82e4036aaa r1661: Changed the password history format so that each history entry
consists of a 16 byte salt, followed by the 16 byte MD5 hash of
the concatination of the salt plus the NThash of the historical
password. Allows these to be exposed in LDAP without security issues.
Jeremy.
2007-10-10 10:52:17 -05:00
Jeremy Allison
4fd619d7e1 r1610: Patch from Richard Renard <rrenard@idealx.com>. Ensure we
save the password as it is being changed into the password
history list.
Jeremy.
2007-10-10 10:52:16 -05:00
Jeremy Allison
14bd2a9ffc r1539: If a account was locked out by an admin (and has a bad password count of zero)
leave it locked out until an admin unlocks it (but log a message).
Jeremy.
2007-10-10 10:52:14 -05:00
Andrew Bartlett
36741d3cf5 r1492: Rework our random number generation system.
On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork().

For other systems, we now only re-seed after a fork, and on startup.
No need to do it per-operation.  This removes the 'need_reseed'
parameter from generate_random_buffer().

Andrew Bartlett
2007-10-10 10:52:13 -05:00
Jeremy Allison
8ee6060977 r1412: Fix password history list in tdbsam. Fix some memory leaks. Add
my (C) to a header file that was at least 50% mine :-).
Jeremy.
2007-10-10 10:52:10 -05:00
Jeremy Allison
9ac4945012 r1394: Const fix.
Jeremy.
2007-10-10 10:52:10 -05:00
Jeremy Allison
ac846420d0 r1392: Added password history code to tdbsam backend. Not yet tested (ie. may
core dump) but compiles and links correctly. I will run the full set of
tests on the ldap sam and the tdb sam for password history tomorrow.
Jeremy.
2007-10-10 10:52:09 -05:00