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

402 Commits

Author SHA1 Message Date
Volker Lendecke
c9efd454c5 Fix bug 6157
This patch picks the alphabetically smallest one of the multi-value attribute
"uid". This fixes a regression against 3.0 and also becomes deterministic.
2009-05-12 15:21:46 +02:00
Jeremy Allison
b4c9cfb2af Fix a bunch of compiler warnings about wrong format types.
Should make Solaris 10 builds look cleaner.
Jeremy.
2009-05-11 21:56:57 -07:00
Björn Jacke
f238809d23 s3/ldap: also handle DirX return codes 2009-05-08 00:33:30 +02:00
Günther Deschner
fee4c99be4 s3-ldap: fix more callers of smbldap_dn_talloc() that were passing a NULL context.
Guenther
2009-05-05 21:22:28 +02:00
Günther Deschner
5b37df21f6 s3-ldapsam: Fix Bug #6313: ldapsam_update_sam_account() crashes while doing talloc_free on malloced memory.
Guenther
2009-05-05 21:14:53 +02:00
Andrew Bartlett
f28f113d8e Rework Samba3 to use new libcli/auth code (partial)
This commit is mostly to cope with the removal of SamOemHash (replaced
by arcfour_crypt()) and other collisions (such as changed function
arguments compared to Samba3).

We still provide creds_hash3 until Samba3 uses the credentials code in
netlogon server

Andrew Bartlett
2009-04-14 16:23:35 +10:00
Andrew Bartlett
3b3e21bd9b Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API

To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c

(the actual implementation remains distinct, but the API is now shared)

Andrew Bartlett
2009-04-14 12:53:56 +10:00
Andrew Bartlett
9512640155 s3:smbldap Remove smbldap_get_dn
This removes one more caller to pull_utf8_allocate()

Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-06 14:52:51 +02:00
Volker Lendecke
46bcb10b5a Shape up pdb_search a bit by making it a talloc ctx with a destructor 2009-03-07 17:51:21 +01:00
Jeremy Allison
669f2a02e2 Fix printf warnings found on systems where time_t <> long int.
Jeremy.
2009-02-19 13:36:20 -08:00
todd stecher
989ad44d32 Memory leaks and other fixes found by Coverity 2009-01-21 17:13:03 -08:00
Jeremy Allison
aa4abac6b7 Fix more ‘asprintf’, declared with attribute warn_unused_result.
Jeremy.
2008-12-23 10:42:25 -08:00
Günther Deschner
9203954428 s3-ldapsam: Fix Bug 5957: do not abort rename process on valid rename script.
Guenther
(cherry picked from commit 26139344fd)
(cherry picked from commit 866efa63a2)
2008-12-09 17:41:26 +01:00
John H Terpstra
b39237d3b3 pdb_ldap: Raise level for debug message to avoid log file flooding.
(This used to be commit 9b863a10da)
2008-07-24 09:49:28 +02:00
Karolin Seeger
490b60b500 Use LDAP macros instead of attribute names.
Karolin
(This used to be commit 7dae8b04f1)
2008-07-18 15:36:20 +02:00
Karolin Seeger
df15541926 Fix typo.
retieve -> retrieve

Karolin
(This used to be commit 37c6413070)
2008-07-14 16:40:36 +02:00
Volker Lendecke
90f3da4720 Fix some memleaks regarding trustdom passwords
(This used to be commit 3d2913d599)
2008-07-10 18:25:00 +02:00
Volker Lendecke
ad91d960d0 Fix some uninitialized variable references via ndr_print
(This used to be commit 26fb3fea81)
2008-07-10 18:24:54 +02:00
Volker Lendecke
516e381e09 Give a nice error message if trying to join with a non-privileged user
(This used to be commit 347772fc39)
2008-07-10 10:48:15 +02:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Marc VanHeyningen
e06aa46b9f Coverity fixes
(This used to be commit 3fc85d2259)
2008-03-17 20:52:25 +01:00
Volker Lendecke
f3856d074f Fix bug 4901
(This used to be commit 1dd8fa9a52)
2008-03-14 18:01:23 +01:00
Volker Lendecke
9d7cad7e82 Fix a memleak -- Coverity ID 222
(cherry picked from commit a40781bafa3a8f0c7737164bca6cf74b0a452e72)
(This used to be commit 86cabcad74)
2008-03-05 18:44:26 +01:00
Günther Deschner
2c5e04b1f7 Fix crash bug in pdb_init_ldapsam().
Karolin, this needs to be in 3-2-stable.

Guenther
(This used to be commit 0d73bde6de)
2008-03-04 11:03:35 +01:00
Karolin Seeger
cdb88dcf6b Change ldap search filter. This function is also used to search machine accounts which may be located in a different ou. This is an extension to e71a48bb80.
Karolin
(This used to be commit e5cc8b683c)
2008-02-19 12:35:54 +01:00
Karolin Seeger
cd50bc575e Change ldap search filter. This function is also used to search machine accounts which may be organized in a different ou.
Karolin
(This used to be commit e71a48bb80)
2008-02-11 10:03:47 +01:00
Michael Adam
7c6d77dd88 Fix memleak in ldapsam_rename_sam_account() found by IBM checker.
The check for out of memory was the wrong way round.

Michael
(This used to be commit d7a7b79320)
2008-01-09 22:09:55 +01:00
Michael Adam
f3603d5a5a Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael
(This used to be commit 6b2b9a60ef)
2008-01-09 01:47:10 +01:00
Jeremy Allison
cfcdeb52bf Fix for bug #5163 from Laurent Pinchart <pinchart@skynet.be>
Failure to change password in ldap is mapped to NT_STATUS_UNSUCCESSFUL unconditionally.
Jeremy.
(This used to be commit 9369d6e907)
2008-01-02 18:20:23 -08:00
Volker Lendecke
e70c97ef85 Remove the sampwent interface
(This used to be commit 9e80b969fb)
2007-12-26 18:57:15 +01:00
Volker Lendecke
2e07c2ade8 s/sid_to_string/sid_to_fstring/
least surprise for callers
(This used to be commit eb523ba776)
2007-12-15 22:47:30 +01:00
Volker Lendecke
14ef4cdec1 Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is
still far better than a static one.
(This used to be commit c7c885078b)
2007-12-15 22:09:37 +01:00
Volker Lendecke
54ae9dfcbc Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit 0a911d38b8)
2007-12-15 22:09:36 +01:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Volker Lendecke
105635e23c Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit f00ab810d2)
2007-12-15 22:09:35 +01:00
Jeremy Allison
42cfffae80 Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings.
Jeremy.
(This used to be commit ec003f3936)
2007-12-07 17:32:32 -08:00
Jeremy Allison
1cd1c9db3f Remove unused prototype for smbldap_get_single_pstring().
Don't use pstr_sprintf() on an fstring - change to talloc.
Jeremy.
(This used to be commit 6cae4b5fa1)
2007-11-27 22:22:35 -08:00
Volker Lendecke
d4bfafa29c Fix bug 5055
(This used to be commit 8bcd2df841)
2007-11-26 15:28:13 +01:00
Volker Lendecke
2b32252b8a Improve debug message
Fix bug 5056, thanks to debian package maintainer
(This used to be commit 5b4ba4bfc5)
2007-11-26 14:36:30 +01:00
Jeremy Allison
51b46147f2 Remove smbldap_get_single_pstring() and all pstrings
from pdb_ldap.c. I don't have an LDAP passdb setup here,
so I'm going to need some help on testing this.
Jeremy.
(This used to be commit 00760451b6)
2007-11-14 16:05:42 -08:00
Volker Lendecke
33d8317571 static pstring removal
(This used to be commit 5490e2d772)
2007-11-05 03:16:58 +01:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Jeremy Allison
ab9d7bf4f9 r25165: Use talloc_asprintf_append_buffer with an unmodified
string.
Jeremy.
(This used to be commit fe30a523df)
2007-10-10 12:30:47 -05:00
Michael Adam
e16f8188ea r25092: Add support for storing trusted domain passwords in LDAP for
passdb backend = ldapsam.

Along with reproducing the functionality of the secrets.tdb
code, I have prepared the handling of the previous trust password
(in case we are contacting a dc which does not yet know of a recent
password change). This information has still to be propagated
to the outside, but this requires a change of the api and also
a change of the secrets.tdb code.

Michael
(This used to be commit 6c3c20e6c4)
2007-10-10 12:30:39 -05:00
Michael Adam
3853c7e144 r25091: Start adding support for storing trusted domain passwords in LDAP
(for passdb backen = ldapsam). At a first step, add the hooks,
calling the secrets_ functions.

Michael
(This used to be commit 9c03cdf3a4)
2007-10-10 12:30:39 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Jeremy Allison
6afbd15b67 r23688: Fix bug #4759 reported by Raul <ismell@ismell.org>.
"N" is not a valid format entry for ber_printf, should be "n"
Jeremy.
(This used to be commit f3bb102c24)
2007-10-10 12:23:45 -05:00
Gerald Carter
86f79c402d r23194: cherry pick two fixes from SAMBA_3_0_26
* strptime() failure check
* make legcacy sid/uid/gid calls static
(This used to be commit 3c9fb1c6f3)
2007-10-10 12:22:53 -05:00
Volker Lendecke
0d91334fe7 r21784: Replace smb_register_idle_event() with event_add_timed(). This fixes winbind
who did not run the idle events to drop ldap connections.

Volker
(This used to be commit af3308ce5a)
2007-10-10 12:18:33 -05:00
Jeremy Allison
8e00e9d7a6 r21609: Fix memory leaks in error code paths (and one in winbindd_group.c).
Patch from Zack Kirsch <zack.kirsch@isilon.com>.
Jeremy.
(This used to be commit df07a662e3)
2007-10-10 12:18:16 -05:00
Jeremy Allison
fae01b4899 r21608: Fix a couple of memleaks in error code paths before
Coverity finds them :-)
Jeremy.
(This used to be commit cbe725f1b0)
2007-10-10 12:18:16 -05:00
Simo Sorce
e9e6af5951 r21606: Implement escaping function for ldap RDN values
Fix escaping of DN components and filters around the code
Add some notes to commandline help messages about how to pass DNs

revert jra's "concistency" commit to nsswitch/winbindd_ads.c, as it was
incorrect.
The 2 functions use DNs in different ways.

- lookup_usergroups_member() uses the DN in a search filter,
and must use the filter escaping function to escape it
Escaping filters that include escaped DNs ("\," becomes "\5c,") is the
correct way to do it (tested against W2k3).

- lookup_usergroups_memberof() instead uses the DN ultimately as a base dn.
Both functions do NOT need any DN escaping function as DNs can't be reliably
escaped when in a string form, intead each single RDN value must be escaped
separately.

DNs coming from other ldap calls (like ads_get_dn()), do not need escaping as
they come already escaped on the wire and passed as is by the ldap libraries

DN filtering has been tested.
For example now it is possible to do something like:
'net ads add user joe#5' as now the '#' character is correctly escaped when
building the DN, previously such a call failed with Invalid DN Syntax.

Simo.
(This used to be commit 5b4838f62a)
2007-10-10 12:18:16 -05:00
Andrew Bartlett
adb3a63943 r20402: Fix spelling: samba bug #4292 debian #402392
(This used to be commit e43aa4e03d)
2007-10-10 12:16:46 -05:00
Jeremy Allison
63609fbb04 r20090: Fix a class of bugs found by James Peach. Ensure
we never mix malloc and talloc'ed contexts in the
add_XX_to_array() and add_XX_to_array_unique()
calls. Ensure that these calls always return
False on out of memory, True otherwise and always
check them. Ensure that the relevent parts of
the conn struct and the nt_user_tokens are
TALLOC_DESTROYED not SAFE_FREE'd.
James - this should fix your crash bug in both
branches.
Jeremy.
(This used to be commit 0ffca7559e)
2007-10-10 12:16:24 -05:00
Volker Lendecke
817151c87f r19943: Fix bug 4267 -- Thanks to David!
(This used to be commit 714971b34a)
2007-10-10 12:16:12 -05:00
Volker Lendecke
d193fa1a4d r19083: Fix objectclass
(This used to be commit 6c4d68d849)
2007-10-10 12:15:09 -05:00
Jim McDonough
dc1f0804dd r19058: Implement "user cannot change password", and complete "user must change
password at next logon" code.  The "password last set time" of zero now
means "user must change password", because that's how windows seems to
use it.  The "can change" and "must change" times are now calculated
based on the "last set" time and policies.

We use the "can change" field now to indicate that a user cannot change
a password by putting MAX_TIME_T in it (so long as "last set" time isn't
zero).  Based on this, we set the password-can-change bit in the
faked secdesc.
(This used to be commit 21abbeaee9)
2007-10-10 12:15:06 -05:00
Günther Deschner
a3e1f7e44d r18703: Fix the annoying effect that happens when nscd is running:
We usually do not get the results from user/group script modifications
immediately. A lot of users do add nscd restart/refresh commands into
their scripts to workaround that while we could flush the nscd caches
directly using libnscd.

Guenther
(This used to be commit 7db6ce295a)
2007-10-10 12:00:49 -05:00
Volker Lendecke
716f7245d9 r18313: Nobody said "no" (yet.... gd?), so commit it:
Remove the account_policy_migrated() thingy, and make cache_account_policy_set
use gencache. Account policies are now handled like groups and users are with
respect to "passdb backend".

Volker
(This used to be commit fa8b2e2a58)
2007-10-10 11:51:19 -05:00
Gerald Carter
2b27c93a9a r18271: Big change:
* autogenerate lsa ndr code
* rename 'enum SID_NAME_USE' to 'enum lsa_SidType'
* merge a log more security descriptor functions from
  gen_ndr/ndr_security.c in SAMBA_4_0

The most embarassing thing is the "#define strlen_m strlen"
We need a real implementation in SAMBA_3_0 which I'll work on
after this code is in.
(This used to be commit 3da9f80c28)
2007-10-10 11:51:18 -05:00
Volker Lendecke
03e3cd1d5a r17554: Cleanup
(This used to be commit 761cbd52f0)
2007-10-10 11:38:38 -05:00
Volker Lendecke
ff7c0a7c35 r17451: Change pdb_getgrsid not to take a DOM_SID but a const DOM_SID * as an
argument.

Volker
(This used to be commit 873a5a1211)
2007-10-10 11:38:34 -05:00
Gerald Carter
9bfa22a502 r17271: Fix a regression in the ldapsam uri syntax.
Allow multiple LDAP URIs to be grouped by  ""
(This used to be commit 21d69dcb3c)
2007-10-10 11:38:23 -05:00
Gerald Carter
9f6fb43eee r17150: MMC User & group plugins fixes:
* Make sure to lower case all usernames before
  calling the create, delete, or rename hooks.
* Preserve case for usernames in passdb
* Flush the getpwnam cache after renaming a user
* Add become/unbecome root block in _samr_delete_dom_user()
  when trying to verify the account's existence.
(This used to be commit bbe11b7a95)
2007-10-10 11:38:16 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
ae30a44bc0 r16683: Fix bug #3900 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 8c7e40f2a4)
2007-10-10 11:19:07 -05:00
Jeremy Allison
5e924c3962 r16681: Fix bug #3899 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 1cd9a0ef83)
2007-10-10 11:19:07 -05:00
Jeremy Allison
6c94466d7b r16628: Fix bug #3880, reported by jason@ncac.gwu.edu
by ensuring we return the correct enum for sid
type, not a uint32.
Jeremy.
(This used to be commit 98a5e20ff4)
2007-10-10 11:19:04 -05:00
Volker Lendecke
ca8b86c51a r16427: Fix bug # 3848. Thanks to Wilco Baan Hofman for testing the release candidate!
Volker
(This used to be commit adf2dcce09)
2007-10-10 11:18:53 -05:00
Günther Deschner
17cbb65317 r16350: Fix the build.
GUenther
(This used to be commit 3203ce3b49)
2007-10-10 11:17:37 -05:00
Volker Lendecke
e279878b28 r16334: Fix Klocwork ID's 1087, 1095, 1096, 1098, 1099, 1101, 1102, 1105, 1107, 1109,
1111

Volker
(This used to be commit d3f5acb16e)
2007-10-10 11:17:34 -05:00
Günther Deschner
d28456fe22 r16121: Fix a eDir related memory leak.
Guenther
(This used to be commit 322f1664df)
2007-10-10 11:17:21 -05:00
Jeremy Allison
865e13aea1 r15895: Ensure all new rid allocation goes through
the same function (deals with races).
Jeremy.
(This used to be commit 4962548dfe)
2007-10-10 11:17:12 -05:00
Günther Deschner
f81e4521bf r15649: Allow to store 24 password history entries in ldapsam (same limit as on
Windows). Fixes bug #1914.

Guenther
(This used to be commit b5a5d0b24e)
2007-10-10 11:17:05 -05:00
Günther Deschner
22bed618b6 r15633: Minor smbldap/pdb_ldap cleanup
Guenther
(This used to be commit 1b5a712467)
2007-10-10 11:17:04 -05:00
Volker Lendecke
91828b893d r15571: Fix Coverity bug #285
(This used to be commit 2cf503d7da)
2007-10-10 11:17:02 -05:00
Gerald Carter
745e2490ae r15547: say goodbye to --with-ldapsam (although the ldapsam_compat passdb backend still exists
(This used to be commit 7d99e05ee8)
2007-10-10 11:16:58 -05:00
Jeremy Allison
d819760f8e r15444: Fix from Jim to ensure we do a wildcard search for SID's
starting with the global SAM sid, not an exact search.
Jeremy.
(This used to be commit 755c272ebf)
2007-10-10 11:16:45 -05:00
Günther Deschner
57909a1540 r14758: Fix broken LDAP search filter.
Guenther
(This used to be commit 25970a5429)
2007-10-10 11:15:46 -05:00
Günther Deschner
2ab46a7a93 r14756: Make smbpasswd -a root work for eDirectory where there is no "account"
structural objectclass.

Guenther
(This used to be commit 7eefeaad35)
2007-10-10 11:15:46 -05:00
Gerald Carter
14b07dccc0 r14452: Sorry. Need more coffee....
* Fix sprintf() args when createing the group search filter.
(This used to be commit 0b7549997a)
2007-10-10 11:15:31 -05:00
Gerald Carter
5133ab016e r14451: In order to get pdb_ldap searching for SID_NAME_ALIAS
groups in the ${MACHINESID} and S_1-5-32 domains correctly,
I had to add a substr search on sambaSID.

* add substr matching rule to OpenLDAP schema
  (we need to update the other schema as will since this
  is a pretty important change).  Sites will need to
  - install the new schema
  - add 'indea sambaSID   sub' to slapd.conf
  - run slapindex

* remove uses of SID_NAME_WKN_GRP in pdb_ldap.c
(This used to be commit 2c0a46d731)
2007-10-10 11:15:30 -05:00
Gerald Carter
0ce53f8ba5 r14403: * modifies create_local_nt_token() to create a BUILTIN\Administrators
group IFF sid_to_gid(S-1-5-32-544) fails and 'winbind nested groups = yes'

* Add a SID domain to the group mapping enumeration passdb call
  to fix the checks for local and builtin groups.  The SID can be
  NULL if you want the old semantics for internal maintenance.
  I only updated the tdb group mapping code.

* remove any group mapping from the tdb that have a
  gid of -1 for better consistency with pdb_ldap.c.
  The fixes the problem with calling add_group_map() in
  the tdb code for unmapped groups which might have had
  a record present.

* Ensure that we distinguish between groups in the
  BUILTIN and local machine domains via getgrnam()
  Other wise BUILTIN\Administrators & SERVER\Administrators
  would resolve to the same gid.

* Doesn't strip the global_sam_name() from groups in the
  local machine's domain (this is required to work with
  'winbind default domain' code)

Still todo.

* Fix fallback Administrators membership for root and domain Admins
  if nested groups = no or winbindd is not running

* issues with "su - user -c 'groups'" command

* There are a few outstanding issues with BUILTIN\Users that
  Windows apparently tends to assume.  I worked around this
  presently with a manual group mapping but I do not think
  this is a good solution.  So I'll probably add some similar
  as I did for Administrators.
(This used to be commit 612979476a)
2007-10-10 11:15:28 -05:00
Volker Lendecke
4357ef3bd6 r13979: We've dereferenced my_methods already, so there's no point in checking for
!= NULL. Coverity #149.

Volker
(This used to be commit d38e05329a)
2007-10-10 11:11:02 -05:00
Jeremy Allison
894358a8f3 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Simo Sorce
d54010e219 r13843: Merge in net sam provision and some pdb_ldap fixes
(This used to be commit 705d811808)
2007-10-10 11:10:56 -05:00
Simo Sorce
1da8345777 r13776: Merge in the editposix ldapsam optimization
(This used to be commit a374546c7e)
2007-10-10 11:10:53 -05:00
Günther Deschner
e54786b535 r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.
* Fix a couple of related parsing issues.
* in the info3 reply in a samlogon, return the ACB-flags (instead of
  returning zero)

Guenther
(This used to be commit 5b89e8bc24)
2007-10-10 11:10:25 -05:00
Gerald Carter
d95e13e68f r13679: Commiting the rm_primary_group.patch posted on samba-technical
* ignore the primary group SID attribute from struct samu*
* generate the primary group SID strictlky from the Unix
  primary group when dealing with passdb users
* Fix memory leak in original patch caused by failing to free a
  talloc *
* add wrapper around samu_set_unix() to prevent exposing the create
  BOOL to callers.  Wrappers are samu_set_unix() and samu-allic_rid_unix()
(This used to be commit bcf269e2ec)
2007-10-10 11:10:23 -05:00
Günther Deschner
cab298856a r13622: Allow to rename machine accounts in a Samba Domain. This still uses the
"rename user script" to do the rename of the posix machine account (this
might be changed later). Fixes #2331.

Guenther
(This used to be commit b2eac2e6eb)
2007-10-10 11:10:19 -05:00
Gerald Carter
6622ba566e r13601: * Remove unused code from pdb_ldap.c
* Add a 'struct passwd *' to the struct samu for later reference
  (I know this may be controversial but its easily reverted which is
  is why I'm checking this is as a seaparate patch before I get
  too deep).
* Remove unix_homedir from struct samu {} and update the pdb wrapper
  functions associated with it.
(This used to be commit 92c251fdf0)
2007-10-10 11:10:18 -05:00
Gerald Carter
2203bed32c r13576: This is the beginnings of moving the SAM_ACCOUNT data structure
to make full use of the new talloc() interface.  Discussed with Volker
and Jeremy.

* remove the internal mem_ctx and simply use the talloc()
  structure as the context.
* replace the internal free_fn() with a talloc_destructor() function
* remove the unnecessary private nested structure
* rename SAM_ACCOUNT to 'struct samu' to indicate the current an
  upcoming changes.  Groups will most likely be replaced with a
  'struct samg' in the future.

Note that there are now passbd API changes.  And for the most
part, the wrapper functions remain the same.

While this code has been tested on tdb and ldap based Samba PDC's
as well as Samba member servers, there are probably still
some bugs.  The code also needs more testing under valgrind to
ensure it's not leaking memory.

But it's a start......
(This used to be commit 19b7593972)
2007-10-10 11:10:15 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Gerald Carter
75ef18fa75 r13460: by popular demand....
* remove pdb_context data structure
* set default group for DOMAIN_RID_GUEST user as RID 513 (just
  like Windows)
* Allow RID 513 to resolve to always resolve to a name
* Remove auto mapping of guest account primary group given the
  previous 2 changes
(This used to be commit 7a2da5f0cc)
2007-10-10 11:10:04 -05:00
Volker Lendecke
7fc2c0befb r13389: get_ldap_filter is only used once, make it static
(This used to be commit d3b66fb871)
2007-10-10 11:09:58 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Volker Lendecke
3c50ec20fb r12663: Fix a memleak
(This used to be commit 3ee6b732f4)
2007-10-10 11:06:01 -05:00
Volker Lendecke
e0c989c949 r12645: Fix some memleaks. This will also be in the trunk checkin that comes next.
Volker
(This used to be commit dc167037b0)
2007-10-10 11:06:00 -05:00
Gerald Carter
830149e6d9 r12400: one line patch for Sun LDAP libs pointed out by Nicholas Brealey <nick@brealey.org>
(This used to be commit 5121d38069)
2007-10-10 11:05:55 -05:00
Gerald Carter
5ac6b21f09 r12398: adding Guenther's account policy migration fix
(This used to be commit be32f10609)
2007-10-10 11:05:54 -05:00
Volker Lendecke
28fb5b6f97 r12313: Introduce yet another copy of the string_sub function:
talloc_string_sub. Someone with time on his hands could convert all the
callers of all_string_sub to this.

realloc_string_sub is *only* called from within substitute.c, it could be
moved there I think.

Volker
(This used to be commit be6c9012da)
2007-10-10 11:05:53 -05:00
Volker Lendecke
ab51c18cc9 r12129: Fix uninitialized variables.
Volker
(This used to be commit 8a7d6eb2c0)
2007-10-10 11:05:46 -05:00
Volker Lendecke
bd21ee68e5 r11999: Re-add "passdb expand explicit".
We came to the conclusion that changing the default is something that has to
wait one or two more releases, but it will happen one way or the other.

Volker
(This used to be commit 30fcdf84d8)
2007-10-10 11:05:41 -05:00
Volker Lendecke
6f04dc477e r11947: Back out passdb:expand_explicit until we find consensus. I'll file this as a
bugzilla entry.

Volker
(This used to be commit d228cb62a7)
2007-10-10 11:05:38 -05:00
Volker Lendecke
046a8873b9 r11922: Looks bigger than it is: There's no point in allocating arrays in
samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in
the pdb module. Remove the latter, this might happen more often.

Volker
(This used to be commit 57f0cf8cdd)
2007-10-10 11:05:36 -05:00
Volker Lendecke
ace1212dec r11914: After talking to Jeremy, implement passdb:expand_explicit with a default of
no. This changes our default behaviour.

Sorry, Ingo, this *is* a bug that needs fixing.

Jerry, you might want to put a marker into the WHATSNEW.txt when this is due.

Volker
(This used to be commit 6622db97bb)
2007-10-10 11:05:34 -05:00
Günther Deschner
0e8b90e45d r11847: Fix typo.
Guenther
(This used to be commit 6aefb3aebb)
2007-10-10 11:05:29 -05:00
Jim McDonough
1113cad9c0 r11236: Implement user rename for smbpasswd and ldap backends. Some cleanup on
tdb as well to make naming consistent.
(This used to be commit ee91eb9a39)
2007-10-10 11:05:08 -05:00
Jeremy Allison
8d7c886671 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
(This used to be commit d720867a78)
2007-10-10 11:05:02 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Gerald Carter
f44e11c100 r9661: fallback to cn attribubte if displayName is not available
(This used to be commit b1524999e0)
2007-10-10 11:03:24 -05:00
Gerald Carter
be0f3f159f r9660: real fix for group enumeration bug in 3.0.20; only affected the ldapsam code
(This used to be commit 62f9fb5e3a)
2007-10-10 11:03:24 -05:00
Günther Deschner
faa4b4a9f2 r8797: avoid unset rids for builtin-aliases.
Guenther
(This used to be commit c2810bcf66)
2007-10-10 11:00:17 -05:00
Günther Deschner
ecc0d00a6d r8787: Make enumeration of builtin-aliases work again.
Guenther
(This used to be commit 0c8859474d)
2007-10-10 11:00:17 -05:00
Günther Deschner
235bece8ff r8542: - (re-)add better search-semantics: look for Interdomain trust accounts
below the machine-suffix (this is where we create them)) to avoid
  digging through thousands of user-accounts just to find a handful of
  trust-accounts in the enumdomusers-samr-call.

- don't access freed data in DEBUG-statement

Guenther
(This used to be commit 793c82c017)
2007-10-10 11:00:08 -05:00
Jeremy Allison
19ca97a70f r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Gerald Carter
27ccf6ba6a r7142: removing 'ldap filter' smb.conf option
(This used to be commit e2f8eeb4e2)
2007-10-10 10:57:03 -05:00
Volker Lendecke
8bb2b294f3 r6770: Fix bug 2705. Thanks, John, for beating my stuff :-)
Volker
(This used to be commit f406dda687)
2007-10-10 10:56:54 -05:00
Volker Lendecke
848cec55a0 r6748: With reconnects, state->connection->ldap_struct can change in smbldap_search
and friends. This should be a fix for bug 2701. Thanks to jht for giving me
access to his box!

Volker
(This used to be commit 85320c1257)
2007-10-10 10:56:53 -05:00
Volker Lendecke
2e0cac8e3e r6445: Make us survive the PARANOID_MALLOC_CHECKER. Should we enable that for
--enable-developer=yes?

Volker
(This used to be commit 61d40ac60d)
2007-10-10 10:56:41 -05:00
Gerald Carter
57eb9f47d0 r6421: use add machine script when creating a user (ACB_NORMAL)
who has a name ending in '$' (usrmgr.exe does this for
domain trusts (that's was jfm's original comment I think).

avoid an assert() call in libldap.
(This used to be commit 0ac57ae942)
2007-10-10 10:56:41 -05:00
Volker Lendecke
f74f7c933d r6367: Slim down pdb_interface.c a bit. next_entry and search_end are function
pointers now.

Yes, Jeremy, this is about re-inventing C++... :-)

Volker
(This used to be commit a831e54738)
2007-10-10 10:56:39 -05:00
Volker Lendecke
d3d6126d94 r6351: This is quite a large and intrusive patch, but there are not many pieces that
can be taken out of it, so I decided to commit this in one lump. It changes
the passdb enumerating functions to use ldap paged results where possible. In
particular the samr calls querydispinfo, enumdomusers and friends have
undergone significant internal changes. I have tested this extensively with
rpcclient and a bit with usrmgr.exe. More tests and the merge to trunk will
follow later.

The code is based on a first implementation by Günther Deschner, but has
evolved quite a bit since then.

Volker
(This used to be commit f0bb44ac58)
2007-10-10 10:56:38 -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
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
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
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
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
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
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
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
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
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
Volker Lendecke
9b734922b5 r3883: Fix error return -- thanks to rsharpe
(This used to be commit 2d952c86c7)
2007-10-10 10:53:23 -05:00
Volker Lendecke
b917dd4bfa r3871: Fix memleak
(This used to be commit dbfdde5f63)
2007-10-10 10:53:22 -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