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

1000 Commits

Author SHA1 Message Date
Volker Lendecke
9f4c0afa0a r6277: This implements a new caching API for enumerating the pdb elements. It is
modeled after query_displayinfo and should hide the differences between users,
groups and aliases while allowing a cache analog load_sampw_entries:

struct pdb_search *pdb_search_users(uint16 acct_flags);
struct pdb_search *pdb_search_groups(void);
struct pdb_search *pdb_search_aliases(const DOM_SID *sid);
uint32 pdb_search_entries(struct pdb_search *search, uint32 start_idx,
                          uint32 max_entries,
                          struct samr_displayentry **result);
void pdb_search_destroy(struct pdb_search *search);

Why this API? Eventually we will need to apply the work gd has started on
enumerating users with paged ldap searches to groups and aliases. Before doing
that I want to clean up the search routines we have.

The sample application (more to follow) is 'net maxrid'.

Volker
(This used to be commit 8b4f67a1e9)
2007-10-10 10:56:34 -05:00
Volker Lendecke
83e11ba86c r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
(This used to be commit 3493d9f383)
2007-10-10 10:56:33 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Derrell Lipman
9840db418b r6149: Fixes bugs #2498 and 2484.
1. using smbc_getxattr() et al, one may now request all access control
   entities in the ACL without getting all other NT attributes.
2. added the ability to exclude specified attributes from the result set
   provided by smbc_getxattr() et al, when requesting all attributes,
   all NT attributes, or all DOS attributes.
3. eliminated all compiler warnings, including when --enable-developer
   compiler flags are in use.  removed -Wcast-qual flag from list, as that
   is specifically to force warnings in the case of casting away qualifiers.

Note: In the process of eliminating compiler warnings, a few nasties were
      discovered.  In the file libads/sasl.c, PRIVATE kerberos interfaces
      are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED
      kerberos interfaces are being used.  Someone who knows kerberos
      should look at these and determine if there is an alternate method
      of accomplishing the task.
(This used to be commit 994694f7f2)
2007-10-10 10:56:24 -05:00
Jeremy Allison
202c7b4571 r6092: This much const causes the compiler on Fedora Core 2
to throw up.
Jeremy.
(This used to be commit 051f0ed807)
2007-10-10 10:56:21 -05:00
Volker Lendecke
e84ead0cfd r6080: Port some of the non-critical changes from HEAD to 3_0. The main one is the
change in pdb_enum_alias_memberships to match samr.idl a bit closer.

Volker
(This used to be commit 3a67865169)
2007-10-10 10:56:20 -05:00
Jim McDonough
cf7d098b2c r5965: Apply Volker's patch for "ldapsam trusted = yes" for samr_lookup_rids. Gives us
again up to ~6x improvement on group membership lookups.
(This used to be commit e2117bcb09)
2007-10-10 10:56:13 -05:00
Gerald Carter
ec139622c5 r5957: BUGS 2478, 2093: compiler warning patches from Jason Mader
(This used to be commit b0f4346082)
2007-10-10 10:56:12 -05:00
Gerald Carter
dbd5c968d7 r5951: gotta love that SGI compiler :-) (thanks Jason)
(This used to be commit e84d070275)
2007-10-10 10:56:10 -05:00
Jim McDonough
b824fcb081 r5927: Fix ldapsam trusted enum_group_members. We were searching in the user
suffix instead of the group suffix.

Thanks to John Janosik (jpjanosi@us.ibm.com).
(This used to be commit bf3ce651ff)
2007-10-10 10:56:09 -05:00
Jeremy Allison
91d355772f r5817: Patch from Vince Brimhall <vbrimhall@novell.com> to change the way pdb_nds
handles users with no Universal or Simple Password. Bug #2453.
Jeremy.
(This used to be commit 0976793e30)
2007-10-10 10:56:03 -05:00
Volker Lendecke
5ba3fb825b r5767: Get rid of some compiler warnings
(This used to be commit 66471de977)
2007-10-10 10:56:00 -05:00
Gerald Carter
f651bb0bea r5746: remove unneeded header that caused problems on rh73
(This used to be commit 68fe1f194a)
2007-10-10 10:55:59 -05:00
Jelmer Vernooij
a9a218f5e6 r5733: Don't crash when the SID column contains NULL (Fixes #2316)
Patch by Justin Ossevoort
(This used to be commit a281148168)
2007-10-10 10:55:58 -05:00
Jelmer Vernooij
cbe4adaec7 r5718: Don't update fields that haven't changed (fixes #1957)
(This used to be commit 5c682c665d)
2007-10-10 10:55:57 -05:00
Gerald Carter
32416866dd r5708: BUG 2424: patch from Vince Brimhall <vbrimhall@novell.com> to ensure that uidNumber and gidNumber use match the rfc2307 schema
(This used to be commit c1727dc9e0)
2007-10-10 10:55:56 -05:00
Jeremy Allison
a5f84481e3 r5655: Added support for Novell NDS universal password. Code donated by
Vince Brimhall <vbrimhall@novell.com> - slight tidyup by me to
use Samba conventions.
Vince - thanks a *lot* for this code - please test to make sure
I haven't messed anything up.
Jeremy.
(This used to be commit 6f5ea963ab)
2007-10-10 10:55:54 -05:00
Volker Lendecke
f17c4ad8ae r5481: Fix a memleak
(This used to be commit 36bcfc5dae)
2007-10-10 10:55:42 -05:00
Volker Lendecke
a90a58ff22 r5467: Optimize _samr_query_groupmem with LDAP backend for large domains.
Could someone else please look at this patch, verifying that I did not break
the ldapsam:trusted = False fallback to the old behaviour? It works fine for
me, but you never know. You're certainly free to review the new code as well :-)

Thanks,

Volker
(This used to be commit e1c3ca182b)
2007-10-10 10:55:41 -05:00
Volker Lendecke
f51677051c r5428: Apply some const. LDAP attribs should now be declared const char *attr[]. This
gives some new warnings in smbldap.c, but a the callers are cleaned up.

Volker
(This used to be commit 543799fc0d)
2007-10-10 10:55:40 -05:00
Volker Lendecke
bc10e4067a r5421: Fix a memleak
(This used to be commit a7df3b5f06)
2007-10-10 10:55:40 -05:00
Günther Deschner
6c84ecb556 r5349: After talking with Jerry, reverted the addition of account policies to
passdb in 3_0 (they are still in trunk).

Guenther
(This used to be commit fdf9bdbbac)
2007-10-10 10:55:38 -05:00
Gerald Carter
25edc545fc r5337: BUG 1439: make sure to initialize pointer to prevent invalide free()'s on exit
(This used to be commit a882a349df)
2007-10-10 10:55:38 -05:00
Jeremy Allison
eed0e6875b r5166: From James Peach - remove minor C99-isms.
Jeremy.
(This used to be commit 54ac409d4f)
2007-10-10 10:55:31 -05:00
Günther Deschner
26dcc2aa74 r5058: Due to the fragileness how windows reacts on unmapped sids sometimes,
don't leave administator-sid unmapped. Simply return "Administrator"

Guenther
(This used to be commit 168ddf31d1)
2007-10-10 10:55:13 -05:00
Gerald Carter
46d8ff2320 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.
(This used to be commit f9f9e6039b)
2007-10-10 10:55:12 -05:00
Gerald Carter
e512799c00 r4996: sync up copytights with trunk
(This used to be commit 8946efe102)
2007-10-10 10:55:11 -05:00
Günther Deschner
a548e710d8 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
(This used to be commit 78c3c71274)
2007-10-10 10:55:11 -05:00
Günther Deschner
de87569cfb r4988: After speaking with Jerry, remove old lp_admin_users to
administrator-sid mapping completely.

Guenther
(This used to be commit 4cbe37ecd5)
2007-10-10 10:55:10 -05:00
Günther Deschner
0b3889e346 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
(This used to be commit d319c0e189)
2007-10-10 10:55:09 -05:00
Günther Deschner
e3971524d2 r4926: Use LDAP_SCOPE_ONELEVEL instead of OpenLDAP's LDAP_SCOPE_ONE-scope.
Guenther
(This used to be commit eee0bd806b)
2007-10-10 10:55:08 -05:00
Günther Deschner
b4afdc08d5 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
(This used to be commit 75af83dfcd)
2007-10-10 10:55:08 -05:00
Gerald Carter
811df6699c r4860: fix silly limitation in ldapsam and tdbsam. Expand variables in the profile path, logon home and logon script values
(This used to be commit 504ea4ac68)
2007-10-10 10:54:00 -05:00
Günther Deschner
320d765081 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
(This used to be commit 853a8b7f1c)
2007-10-10 10:53:59 -05:00
Günther Deschner
1ed62fde09 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
(This used to be commit 6394257cc7)
2007-10-10 10:53:59 -05:00
Günther Deschner
0c6010238d 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
(This used to be commit ced58bd884)
2007-10-10 10:53:57 -05:00
Jelmer Vernooij
5d47f8e5e5 r4802: Don't try to update a column with the name "NULL"
(This used to be commit ed38e60264)
2007-10-10 10:53:55 -05:00
Jelmer Vernooij
69e24e59a4 r4788: Don't log mysql password at debug level 1.
(This used to be commit 760455875f)
2007-10-10 10:53:54 -05:00
Gerald Carter
c3ba8b9a53 r4736: small set of merges from rtunk to minimize the diffs
(This used to be commit 4b351f2fcc)
2007-10-10 10:53:52 -05:00
Gerald Carter
d94d87472c 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.
(This used to be commit 77c10ff9aa)
2007-10-10 10:53:51 -05:00
Jeremy Allison
acf9d61421 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.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jelmer Vernooij
2956b574df r3974: - Fix assignment of a couple of fields in pdb_{mysql,pgsql}
- Use new DTD URL in pdb_xml
(This used to be commit 99dc2f36d1)
2007-10-10 10:53:26 -05:00
Jeremy Allison
c5c2dd6dba r3948: Fix incorrect declaration. Bug #2083.
Jeremy.
(This used to be commit 05b905a28f)
2007-10-10 10:53:26 -05:00
Jeremy Allison
90a18110e9 r3931: Fix all "may be used uninitialized" and "shadow" warnings.
Jeremy.
(This used to be commit 8e979772a6)
2007-10-10 10:53:25 -05:00
Volker Lendecke
9b734922b5 r3883: Fix error return -- thanks to rsharpe
(This used to be commit 2d952c86c7)
2007-10-10 10:53:23 -05:00
Günther Deschner
7c93bdcdf8 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
(This used to be commit bb191c1098)
2007-10-10 10:53:22 -05:00
Volker Lendecke
b917dd4bfa r3871: Fix memleak
(This used to be commit dbfdde5f63)
2007-10-10 10:53:22 -05:00
Volker Lendecke
36913aa038 r3852: Fix the build...
(This used to be commit 3bd72b864f)
2007-10-10 10:53:21 -05:00
Volker Lendecke
f9e87b9ba6 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
(This used to be commit b94838aff1)
2007-10-10 10:53:15 -05:00
Volker Lendecke
69ddbbf97b 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
(This used to be commit 3d9758fa3c)
2007-10-10 10:53:15 -05:00
Günther Deschner
8384b33e0d r3628: A typo and a compile-warning.
Guenther
(This used to be commit 906d5f88aa)
2007-10-10 10:53:10 -05:00
Volker Lendecke
154d5f913b 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
(This used to be commit 2508d4ed1e)
2007-10-10 10:53:09 -05:00
Volker Lendecke
55fe875a44 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
(This used to be commit 3298f6105e)
2007-10-10 10:53:09 -05:00
Günther Deschner
5976f2327b r2923: Fix some obvious copy/paste leftover debug-messages.
Guenther
(This used to be commit 94f48d06c7)
2007-10-10 10:52:56 -05:00
Günther Deschner
c5ccf8edaf 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
(This used to be commit a4b47e7147)
2007-10-10 10:52:53 -05:00
Günther Deschner
4edd6528f9 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
(This used to be commit c5b8bc6c2e)
2007-10-10 10:52:50 -05:00
Volker Lendecke
a9a4f22958 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
(This used to be commit a32ea3bc88)
2007-10-10 10:52:48 -05:00
Jeremy Allison
557f2cf461 r2479: Stop attribute "modifyTimestamp" from being deleted.
Jeremy.
(This used to be commit 0351bf8b03)
2007-10-10 10:52:45 -05:00
Jelmer Vernooij
2dce7d4409 r2473: Convert internal data to UTF-8 before calling libxml2
(This used to be commit 8be3fa5bfa)
2007-10-10 10:52:44 -05:00
Volker Lendecke
ec62d5a968 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
(This used to be commit 6957d6a892)
2007-10-10 10:52:43 -05:00
Jeremy Allison
b0d376ba07 r2374: Fix from Vince Brimhall vbrimhall@novell.com for
ldapsam_compat. Be robust against NULL attributes.
Jeremy.
(This used to be commit 727fc341b5)
2007-10-10 10:52:41 -05:00
Jeremy Allison
c0b43349b3 r2317: Fixup error messages and reformat.
Jeremy.
(This used to be commit 8ae10c74ec)
2007-10-10 10:52:39 -05:00
Jeremy Allison
92c1eba403 r2312: Fix for bugid #1667, smbpasswd file could be left locked on
some error exits.
Jeremy.
(This used to be commit e2b0b9fb72)
2007-10-10 10:52:39 -05:00
Volker Lendecke
9723edd84f 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
(This used to be commit 67d8bc4853)
2007-10-10 10:52:23 -05:00
Jeremy Allison
5cd11b7127 r1871: Patch from Luke Howard <lukeh@PADL.COM> to correctly use
uid_to_sid() and gid_to_sid() in pdb_set_sam_sids().
Jeremy.
(This used to be commit dae084d713)
2007-10-10 10:52:22 -05:00
Jeremy Allison
c9e0625f57 r1869: Rename "fallback_XXXX" mapping to "algorithmic_XXX" as
that's what it actually does, and "fallback_" is just
confusing.
Jeremy.
(This used to be commit f44b4ba381)
2007-10-10 10:52:22 -05:00
Jeremy Allison
bdab948fcf r1810: Patch from Richard Renard <rrenard@idealx.com> to store
logon hours attributes in an LDAP database.
Jeremy.
(This used to be commit dac72638fb)
2007-10-10 10:52:21 -05:00
Jeremy Allison
ead3776a74 r1733: Fix hashed password history for LDAP backends.
Jeremy.
(This used to be commit a1bb6fbbe4)
2007-10-10 10:52:20 -05:00
Jeremy Allison
2723be1239 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.
(This used to be commit 82e4036aaa)
2007-10-10 10:52:17 -05:00
Jeremy Allison
db4fde99d4 r1610: Patch from Richard Renard <rrenard@idealx.com>. Ensure we
save the password as it is being changed into the password
history list.
Jeremy.
(This used to be commit 4fd619d7e1)
2007-10-10 10:52:16 -05:00
Jeremy Allison
1fca1fd8d7 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.
(This used to be commit 14bd2a9ffc)
2007-10-10 10:52:14 -05:00
Andrew Bartlett
9d0783bf21 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
(This used to be commit 36741d3cf5)
2007-10-10 10:52:13 -05:00
Jeremy Allison
d4ac326d46 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.
(This used to be commit 8ee6060977)
2007-10-10 10:52:10 -05:00
Jeremy Allison
c54a86b969 r1394: Const fix.
Jeremy.
(This used to be commit 9ac4945012)
2007-10-10 10:52:10 -05:00
Jeremy Allison
10f0c34a2a 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.
(This used to be commit ac846420d0)
2007-10-10 10:52:09 -05:00
Jeremy Allison
1c5867502a r1388: Adding password history code for ldap backend, based on a patch from
"Jianliang Lu" <j.lu@tiesse.com>. Multi-string attribute changed to
linearised pstring due to ordering issues. A few other changes to
fix race conditions. I will add the tdb backend code next. This code
compiles but has not yet been tested with password history policy
set to greater than zero. Targeted for 3.0.6.
Jeremy.
(This used to be commit dd54b2a3c4)
2007-10-10 10:52:09 -05:00
Volker Lendecke
e107e9790d r1108: Index: pdb_ldap.c
===================================================================
--- pdb_ldap.c	(revision 1095)
+++ pdb_ldap.c	(working copy)
@@ -1134,6 +1134,19 @@
 	return NT_STATUS_OK;
 }

+static void append_attr(char ***attr_list, const char *new_attr)
+{
+	int i;
+
+	for (i=0; (*attr_list)[i] != NULL; i++)
+		;
+
+	(*attr_list) = Realloc((*attr_list), sizeof(**attr_list) * (i+2));
+	SMB_ASSERT((*attr_list) != NULL);
+	(*attr_list)[i] = strdup(new_attr);
+	(*attr_list)[i+1] = NULL;
+}
+
 /**********************************************************************
 Get SAM_ACCOUNT entry from LDAP by username.
 *********************************************************************/
@@ -1149,6 +1162,7 @@
 	int rc;

 	attr_list = get_userattr_list( ldap_state->schema_ver );
+	append_attr(&attr_list, MODIFY_TIMESTAMP_STRING);
 	rc = ldapsam_search_suffix_by_name(ldap_state, sname, &result, attr_list);
 	free_attr_list( attr_list );

@@ -1194,6 +1208,7 @@
 	switch ( ldap_state->schema_ver ) {
 		case SCHEMAVER_SAMBASAMACCOUNT:
 			attr_list = get_userattr_list(ldap_state->schema_ver);
+			append_attr(&attr_list, MODIFY_TIMESTAMP_STRING);
 			rc = ldapsam_search_suffix_by_sid(ldap_state, sid, result, attr_list);
 			free_attr_list( attr_list );

Index: login_cache.c
===================================================================
--- login_cache.c	(revision 1095)
+++ login_cache.c	(working copy)
@@ -95,10 +95,13 @@
 			&entry->bad_password_count,
 			&entry->bad_password_time) == -1) {
 		DEBUG(7, ("No cache entry found\n"));
+		SAFE_FREE(entry);
 		SAFE_FREE(databuf.dptr);
 		return NULL;
 	}

+	SAFE_FREE(databuf.dptr);
+
 	DEBUG(5, ("Found login cache entry: timestamp %12u, flags 0x%x, count %d, time %12u\n",
 		  (unsigned int)entry->entry_timestamp, entry->acct_ctrl,
 		  entry->bad_password_count, (unsigned int)entry->bad_password_time));
(This used to be commit c0bf8425f4)
2007-10-10 10:51:55 -05:00
Volker Lendecke
4e1b26db34 r989: Calling sid_to_gid from within winbind makes no sense, as this calls
winbind_sid_to_gid. For the consistency check, local_sid_to_gid must set the
name_type it found.

Volker
(This used to be commit 5070c1b68f)
2007-10-10 10:51:52 -05:00
Andrew Bartlett
fe8977e12c r936: Fix a rather weird error that crippled my site, when we upgraded to
Samba 3.0.4.

If we fail a query for the members of the 'administrators' group (and we may well just have the IDL wrong), this destroys later parts of the domain logon process.

For reasons I can't understand, the client-side 'heck, what happened'
bailout causes the connection to the DC to be dropped, and causes the
mandetory profile not to be loaded.  (This also only occours after a reboot)

Return the members of 'administrators', and it all works fine.

The reason we hit this is because we run winbindd (to support
pam_winbind) on our DC, and the winbindd lookup in sid_to_gid was
messing things up.  As we don't care what type of thing this is,
provided it exists in the group mapping db, we should not bother
winbindd here.

Andrew Bartlett
(This used to be commit d626b5c6d4)
2007-10-10 10:51:50 -05:00
Jeremy Allison
e8681c225f r910: Fix for bug #1385 found by Jason Mader <jason@ncac.gwu.edu>.
Don't use non-consts in a structure initialization.
Jeremy.
(This used to be commit 455ed258b3)
2007-10-10 10:51:48 -05:00
Jeremy Allison
52ddd54083 r801: Fix from "Jianliang Lu" <j.lu@tiesse.com> to return correct group
types.
Jeremy.
(This used to be commit d97b9146a1)
2007-10-10 10:51:46 -05:00
Jeremy Allison
0f5e40b14e r788: Inspired by patch from "Jianliang Lu" <j.lu@tiesse.com>. Correct
sid type is WKN_GROUP, not alias. Added some more known types.
Jeremy.
(This used to be commit 538b66f4e9)
2007-10-10 10:51:38 -05:00
Richard Sharpe
7cb9ca16f6 r505: Break out algorithmic_gid_to_sid so that those of us who need it can use it.
(This used to be commit 5d7ee320cc)
2007-10-10 10:51:26 -05:00
Richard Sharpe
fc62b9fcc1 r501: Fix a small cut-n-pasteo ...
(This used to be commit b1825184d3)
2007-10-10 10:51:26 -05:00
Stefan Metzmacher
f880fe51b3 r340: fix a segfault in the login_cache code...
metze
(This used to be commit 908d8a4125)
2007-10-10 10:51:20 -05:00
Volker Lendecke
0d6acfe19a r316: Fix split_domain_name. This defaulted to get_myname() instead of
get_global_sam_name().

Error case: Adding a domain user to a XP local group did a lsalookupname on
the user without domain prefix, and this then failed.

Jerry: This is a must-fix before 3.0.3.

Volker
(This used to be commit f35e353454)
2007-10-10 10:51:18 -05:00
Gerald Carter
8ad3d8c9b0 r196: merging struct uuid from trunk
(This used to be commit 911a28361b)
2007-10-10 10:51:13 -05:00
Volker Lendecke
69a91df4ed r145: pdb_create_alias now returns NTSTATUS. More of this to follow.
Volker
(This used to be commit 6e18bed170)
2007-10-10 10:51:11 -05:00
Gerald Carter
7af3777ab3 r116: volker's patch for local group and group nesting
(This used to be commit b393469d95)
2007-10-10 10:51:10 -05:00
Jim McDonough
a15393a3d9 r53: Remove modifyTimestamp from list of our attributes. We just check it for
cache entry time comparisons in password lockout.  Fixes problems where
pdb_ldap tries to delete the operational attribute modifyTimestamp when
deleting a user account.
(This used to be commit 5ebcb9081e)
2007-10-10 10:51:06 -05:00
Jeremy Allison
7226511ead r48: Fix types for debug message parameters.
Jeremy.
(This used to be commit 85d9c92fd5)
2007-10-10 10:51:05 -05:00
Gerald Carter
931df5850e r39: * importing .cvsignore files
* updateing WHATSNEW with vl's change
(This used to be commit a7e2730ec4)
2007-10-10 10:51:05 -05:00
Volker Lendecke
95bd9b5ab0 Apply some const
(This used to be commit aa220cffa7)
2004-03-31 15:21:48 +00:00
Volker Lendecke
9d1a4e8013 Remove some unused code
(This used to be commit 2b757b6adf)
2004-03-31 14:36:25 +00:00
Jim McDonough
2732b702fb Use timegm, or our already existing replacement instead of timezone, as
some platforms (FreeBSD in this case) don't define timezone according to
posix.  This is what I wanted to do anyway.

Spotted by Andrzej Tobola <san@iem.pw.edu.pl>
(This used to be commit bc13e35db0)
2004-03-25 18:25:41 +00:00
Jeremy Allison
a79b205d92 Fix gcc warnings. Fix mkproto with new type.
Jeremy.
(This used to be commit 00fa66df3e)
2004-03-19 01:29:14 +00:00
Jim McDonough
357998ddbd Password lockout for LDAP backend. Caches autolock flag, bad count, and
bad time locally, updating the directory only for hitting the policy limit
or resetting.

This needed to be done at the passdb level rather than auth, because some
of the functions need to be supported from tools such as pdbedit.  It was
done at the LDAP backend level instead of generically after discussion,
because of the complexity of inserting it at a higher level.

The login cache read/write/delete is outside of the ldap backend, so it could
easily be called by other backends.  tdbsam won't call it for obvious
reasons, and authors of other backends need to decide if they want to
implement it.
(This used to be commit 2a679cbc87)
2004-03-18 19:22:51 +00:00
Jim McDonough
3d18997afd Get MungedDial actually working with full TS strings in it for pdb_ldap.
I know this isn't pretty, but neither was our assumption that all strings
from the directory fit inside a pstring.  There was no way this worked
before will all versions of usrmgr (for example, the only version of
mine that has the TS Confic button).
(This used to be commit d275c0e384)
2004-03-11 16:32:19 +00:00
Volker Lendecke
b3b93aaa3f Get us a little closer to Windows LSA semantics.
A windows DC does not reply to DCNAME\\Administrator, only to
DOMAIN\\Administrator. Fix that.

Without winbind we are wrong as domain members, we should forward the request
DOMAIN\\Username to the DC on behalf of the asking client. Winbind fixes that
nicely.

Volker
(This used to be commit 7ed61edbbe)
2004-03-07 08:22:06 +00:00
Volker Lendecke
e692b991d1 And another little const
(This used to be commit f6bb3304fc)
2004-02-26 11:07:06 +00:00