1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

1723 Commits

Author SHA1 Message Date
Gerald Carter
da158ad6a2 r22447: Patch from Ying Li <ying.li2@hp.com> to default tdb idmap
plugin when neither idmap domains nor idmap backend have
been defined.
(This used to be commit 2fa12753da)
2007-10-10 12:19:34 -05:00
Gerald Carter
026852b47a r22444: * Validate a SID before trying to convert it to a uid/gid via the public
winbindd interface

* Add nss_info/*so files to the RHEL/Fedora packaging
(This used to be commit 1787fcb8c1)
2007-10-10 12:19:34 -05:00
Gerald Carter
d27d6e822e r22430: Add SID validate to sid2uid() and sid2gid() public entry points in winbindd
(This used to be commit 0890cb941e)
2007-10-10 12:19:34 -05:00
James Peach
44f5211c17 r22418: Support running under launchd. We abstract the method of obtaining
sockets to listen on a little, because in the launchd case these
are provided for us. We also add an idle timeout so that a daemon
can exit after a period of inactivity.
(This used to be commit fc8589a337)
2007-10-10 12:19:33 -05:00
James Peach
8a22b1f0ea r22417: Refactor the various daemon run-mode options to make the semantics
of the various flags explicit.
(This used to be commit 19c929c633)
2007-10-10 12:19:33 -05:00
Günther Deschner
04a70aaf1c r22402: Fix build warning.
Guenther
(This used to be commit bf9131fed3)
2007-10-10 12:19:32 -05:00
Simo Sorce
2d8fbef151 r22393: fix cut&paste error
(This used to be commit 70878d6985)
2007-10-10 12:19:31 -05:00
Simo Sorce
39888067e3 r22392: Remove leftover potentially segfaulty code.
Check we are online before actually trying to connect anywhere
(This used to be commit ff5e0b2986)
2007-10-10 12:19:30 -05:00
Gerald Carter
36da6cb584 r22390: Patchset sent to samba-technical to address the winbind
loop when allocating a new id for a SID:

auth_util.patch		Revert create_local_token() to
			the 3.0.24 codebase

idmap_type.patch	Have the caller fillin the
			id_map.xid.type field when
			resolving a SID so that if we allocate
			a new id, we know what type to use

winbindd_api.patch	Remove the WINBINDD_SIDS_TO_XIDS calls
			from the public winbindd interface
			for the 3.0.25 release

idmap_rid.patch		Cleanup the idmap_rid backend to not
			call back into winbindd to resolve
			the SID in order to verify it's type.
(This used to be commit 3b24dae9e7)
2007-10-10 12:19:30 -05:00
Simo Sorce
20086f66cc r22388: clearer message, thanks David
(This used to be commit 7961476784)
2007-10-10 12:19:29 -05:00
Simo Sorce
d7c8710a1d r22348: 3_0 as well
(This used to be commit ad57434faf)
2007-10-10 12:19:28 -05:00
Simo Sorce
01be4914b3 r22343: Commit to 3_0 as well after adapting the patch.
(tdb_delete_bystring instead of tdb_delete is used here)
(This used to be commit ee40cead09)
2007-10-10 12:19:27 -05:00
Gerald Carter
b066668b74 r22340: Fix another segfault in idmap_ldap.c caused by setting the iterator
LDAPMessage * to NULL on each loop rotation.
(This used to be commit 356dd0dd3a)
2007-10-10 12:19:27 -05:00
Stefan Metzmacher
f718428845 r22313: as discussed with simo:
remove the only usage of backup_tdb() in samba3.
As backup_tdb() will go completely soon.

metze
(This used to be commit 363d1d676c)
2007-10-10 12:19:25 -05:00
Stefan Metzmacher
a8c6250274 r22298: move ZERO_*, ARRAY_SIZE and PTR_DIFF macros into libreplace
metze
(This used to be commit 8a7d2e633b)
2007-10-10 12:19:24 -05:00
Gerald Carter
615f025654 r22283: Remove very old bug where we assigned the online mode of
the domain to queried to our own domain.
(This used to be commit 2abeec5768)
2007-10-10 12:19:24 -05:00
Simo Sorce
0dd0aab2bc r22230: Let's just cast here, the 2 calls have different allocation mechanisms.
We just let domname and name hang on the mem ctx until the call returns,
and the context will be destroyed.

Simo.
(This used to be commit c38d8396c5)
2007-10-10 12:19:21 -05:00
Volker Lendecke
3e819bd22c r22214: Fix incompatible pointer type warnings. Simo, please check and merge to 3_0_25
if appropriate.

Volker
(This used to be commit 6a4f6c5177)
2007-10-10 12:19:20 -05:00
Jeremy Allison
731df24607 r22211: Don't return a value from void functions !
Jeremy.
(This used to be commit 1dd8d3a723)
2007-10-10 12:19:20 -05:00
Jeremy Allison
91be3a9ed6 r22210: Fix typo in testing for non-centry entries.
Jeremy.
(This used to be commit b89ecbcac6)
2007-10-10 12:19:20 -05:00
Jeremy Allison
c7d136dcac r22209: Fix the storage of time_t -> make it 64 bits (use the
same load/store function as NTTIME). Add a version number
string to the winbindd cache so we can tell if it needs
upgrading. THIS WILL DELETE ANY EXISTING winbindd_cache.tdb
on first startup regardless of offline auth status. Once
this is done we're in good shape though.
Jeremy.
(This used to be commit c52c7f91af)
2007-10-10 12:19:19 -05:00
Jeremy Allison
a2bab163be r22207: Fill in the validation functions. Now to test...
Jeremy.
(This used to be commit fc2b9e860e)
2007-10-10 12:19:19 -05:00
Jeremy Allison
127cc73034 r22206: Added boilerplate to be filled in for other validation functions.
Jeremy.
(This used to be commit 9be463eb0c)
2007-10-10 12:19:19 -05:00
Jeremy Allison
23e575c4b7 r22205: Add some flesh to the bones of the cache validation code.
Jeremy
(This used to be commit b773ea2c8a)
2007-10-10 12:19:19 -05:00
Simo Sorce
59523f55a9 r22204: Workaround to quickly close bug #4508
This hack makes thing work, but we will need to try again to
make the getpw* calls fully async, that's the real fix.
(This used to be commit 2552859b3d)
2007-10-10 12:19:19 -05:00
Jeremy Allison
9f41ff47d0 r22202: Volker is clever :-). Use TDB_NOMMAP to prevent any wild pointer
problems when validating the winbindd cache. Wish I'd have
thought of that.
Jeremy.
(This used to be commit 6b0a8cbbb8)
2007-10-10 12:19:19 -05:00
Gerald Carter
d1491cc500 r22173: BUG 4491, 4501: Additional fixes for protecting against
crashes in allocate_id().

BUG 4501: Fix segv in idmap_ad caused by resetting the
entry iterator when parsing search results.
(This used to be commit bd6ebbfb9f)
2007-10-10 12:19:18 -05:00
Gerald Carter
330985ebb5 r22159: BUG 4501 (second half of fix): Just disable the
uid/gid allocation if no idmap alloca backend has been
defined and we are not using a 3.0.24 idmap backend
compatible configuration.
(This used to be commit 0b700456f4)
2007-10-10 12:19:18 -05:00
Gerald Carter
43401cf93b r22158: BUG 4501 (partial): Fix a crash caused by not using the
nss_info_{rfc2307,sfu} plugin with idmap_ad.
(This used to be commit f640f056bf)
2007-10-10 12:19:17 -05:00
Gerald Carter
ccb99cafa7 r22110: don't cache the S-1-22-{1,2} domain SID/uig/gid lookups in idmap_cache
(This used to be commit adfc2d3165)
2007-10-10 12:19:13 -05:00
Simo Sorce
ca70c3cde7 r22109: Readonly is automatically set in the generic init code, let's just log the fact there
and remove the specific, but redundant, code in idmap_ad.c
(This used to be commit f127803734)
2007-10-10 12:19:13 -05:00
Gerald Carter
06ec19e2fb r22069: BUG 4447: Fix compile failure on AIX 5.2 (patch from William Jojo <jojowil@hvcc.edu>)
(This used to be commit c1cb6d059b)
2007-10-10 12:19:09 -05:00
Gerald Carter
3bdd0e3650 r22066: Ensure that winbind can resolve SIDs in the S-1-22-{1,2}
domain to a uid.gid using the idmap_passdb backend.
(This used to be commit fc1aeee52d)
2007-10-10 12:19:09 -05:00
Gerald Carter
01c8809f76 r22061: Fix the krb5 user ticket refresh event timeout in winbindd
(This used to be commit 4a99b89618)
2007-10-10 12:19:07 -05:00
Jeremy Allison
ce3c830f15 r22015: Fix for memory leak from Steven Danneman <steven.danneman@isilon.com>
Jeremy.
(This used to be commit 61a1574f50)
2007-10-10 12:19:02 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
56ba447668 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
(This used to be commit fa322f0cc9)
2007-10-10 12:18:59 -05:00
Stefan Metzmacher
4b0c9a0084 r21986: make use of tdb_*_bystring() and string_term_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit 08d23a1c4f)
2007-10-10 12:18:56 -05:00
Stefan Metzmacher
5060393272 r21985: make use of string_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit a8bc20d67f)
2007-10-10 12:18:56 -05:00
Stefan Metzmacher
ef0a0f9b2b r21984: make use of tdb_*_bystring() and string_term_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
(This used to be commit 91301f7347)
2007-10-10 12:18:56 -05:00
Herb Lewis
dfc4a8b2b2 r21957: minor formatting fix
(This used to be commit 99b9570ebe)
2007-10-10 12:18:52 -05:00
Volker Lendecke
8a2b73a58a r21941: Attempt to fix bug 4460
(This used to be commit d1b8f00c12)
2007-10-10 12:18:51 -05:00
Gerald Carter
5b105eaf7c r21940: Sorry Volker, I have to revert your revert in r21935.
We can talk about this later if you still feel that strongly
but I need to fix the build for now.
(This used to be commit c7df0cad82)
2007-10-10 12:18:50 -05:00
Volker Lendecke
719f4657e8 r21935: Revert obviously not sufficiently tested code -- sorry for the pain. I am afraid I was basically off the net for the day
(This used to be commit 08c29abc03)
2007-10-10 12:18:50 -05:00
Gerald Carter
e68ea1283d r21933: Change the write_sock() call in pam_winbind_request()
to not request a privileged pipe operation for everything
as this cannot be done from a process running under the
context of a user (e.g. screensaver).

Thanks to Danilo Almeida <dalmeida@centeris.com> for the help
in pointing out the change to write_sock().
(This used to be commit 80790f935a)
2007-10-10 12:18:50 -05:00
Jeremy Allison
820184bdcc r21927: Removed unused variable.
Jeremy.
(This used to be commit 2d951c91a5)
2007-10-10 12:18:49 -05:00
Simo Sorce
a38b34aa3b r21919: now that the local passdb abd BUILTIN have been blacklisted and they always
point to the passdb module, remove this comment and move the explanation in
the dimap_ad man page.

Simo.
(This used to be commit 58d2ec00d2)
2007-10-10 12:18:49 -05:00
Gerald Carter
b44d53e307 r21918: Reverting this change as it is now causing aborts() in
find_builtin_domain().    This all needs more testing
before anyone starts changing these lookup routines again.
(This used to be commit add225e1c8)
2007-10-10 12:18:48 -05:00
Gerald Carter
3f85405be0 r21913: fix one bug in build 717: correctly check the return from sid_peek_check_rid() when trying to find a matching domain
(This used to be commit c63bc30037)
2007-10-10 12:18:48 -05:00
Gerald Carter
f8c2960d45 r21905: Rename
idmap expire time 	-> idmap cache time
  idmap negative time	-> idmap negative cache time
(This used to be commit aac2d0af5e)
2007-10-10 12:18:48 -05:00
Günther Deschner
ed360fe5e5 r21887: Fix annoying bug where in a pam_close_session (or a pam_setcred with the
PAM_DELETE_CREDS flag set) any user could delete krb5 credential caches.
Make sure that only root can do this.

Jerry, Jeremy, please check.

Guenther
(This used to be commit 947a59a849)
2007-10-10 12:18:44 -05:00
Gerald Carter
52d5e2a935 r21884: * Blacklist BUILTIN and MACHINE domains from the
idmap domains as these should only be handled by the
  winbindd_passdb.c backend

* Allow the alloc init to fail for backwards compatible
  configurations like

     idmap backend = ad
     idmap uid = 1000-100000
	....

* Remove the deprecated flags from idmap backend, et. al.
  These are mutually exclusive with the new configuration
  options (idmap domains).  Logging annoying messages
  about deprecated parameters is confusing.  So we'll try
  this apprpach for now.
(This used to be commit 5e30807b4e)
2007-10-10 12:18:44 -05:00
James Peach
b4f19aea18 r21881: Make sure we are very specific when testing whether a backand can handle a
particular SID. Make sure that the passdb backend will accept the same set
range of local SIDs that the idmap system sends it.

Simo, Jerry - this is a 3_0_25 candidate. Can you please review?
(This used to be commit 86a70adb6a)
2007-10-10 12:18:43 -05:00
Volker Lendecke
3fdef9433a r21878: Fix a bug with smbd serving a windows terminal server: If winbind decides smbd
to be idle it might happen that smbd needs to do a winbind operation (for
example sid2name) as non-root. This then fails to get the privileged
pipe. When later on on the same connection another authentication request
comes in, we try to do the CRAP auth via the non-privileged pipe.

This adds a winbindd_priv_request_response() request that kills the existing
winbind pipe connection if it's not privileged.

Volker
(This used to be commit e5741e27c4)
2007-10-10 12:18:42 -05:00
Volker Lendecke
00b73df552 r21873: This is winbindd_pam.c, not pam_winbind.c :-)
(This used to be commit e1fbfbe1c4)
2007-10-10 12:18:41 -05:00
Volker Lendecke
22cc1dce41 r21872: Fix a debug message
(This used to be commit fcec3d1c46)
2007-10-10 12:18:41 -05:00
Gerald Carter
815fdf23c7 r21860: Fixes for "winbind normalize names" functionality:
* Fix getgroups() call called using a normalized name
* Fix some more name mappings that could cause for example
  a user to be unable to unlock the screen as the username
  would not match in the PAM authenticate call.
(This used to be commit 505fc669a1)
2007-10-10 12:18:39 -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
Herb Lewis
b1fc114fdc r21775: make messages more understandable - don't leave part dangling after newline
(This used to be commit f57e4f8ada)
2007-10-10 12:18:31 -05:00
Herb Lewis
80a216970d r21704: open sockets immediately in process_loop
(This used to be commit 51b96ba79c)
2007-10-10 12:18:23 -05:00
Gerald Carter
cfecca614f r21636: Was almost right before. We have to specify the short domain name to get the
Krb5 config stuff to work in the server affinity settings.
(This used to be commit 518052be38)
2007-10-10 12:18:19 -05:00
Gerald Carter
a4db672e26 r21633: First real fix from me found during the bug hunt.
ads_cached_connection() does not call get_dc_name()
before ads_connect() and therefore does not setup
the environment to look at krb5.conf.DOMAIN file
before sending the TGT request.  The failure I'm seeing
occurs ni a multi-DC domain where we get back preuath
failed after we just joined the domain.
(This used to be commit 256f36dce3)
2007-10-10 12:18:18 -05:00
Gerald Carter
5f24668961 r21632: Remove ununsed variable
(This used to be commit 82dc19f844)
2007-10-10 12:18:18 -05:00
Gerald Carter
377bb74101 r21626: Fix memory leak on error path noticed by
SATOH Fumiyasu <fumiya@samba.gr.jp>
(This used to be commit d68b2910c8)
2007-10-10 12:18:18 -05:00
Simo Sorce
1983759266 r21623: Fix copy/paste error
(This used to be commit 0de7472428)
2007-10-10 12:18:18 -05:00
Gerald Carter
9b568ecdc4 r21622: Fix bad merge caught by James.
(This used to be commit 05886edb35)
2007-10-10 12:18:18 -05:00
Gerald Carter
b1f4259cd5 r21616: Delay initialization of idmap and nss_info backends until necessary
so they can honor the offline logon state.
(This used to be commit 15b13dfe81)
2007-10-10 12:18:18 -05:00
Gerald Carter
6fb6adba27 r21615: don't wait until the last second to try to renew a Krb5 ticket as it is took late
(This used to be commit 5575845952)
2007-10-10 12:18:17 -05:00
Gerald Carter
5e88cb83b1 r21614: The memset() called on aligned memory was causing crashes
on x86_64 Linux boxes.  Since it is not needed, just use malloc()
on Linux.
(This used to be commit 3644bd9996)
2007-10-10 12:18:17 -05:00
Gerald Carter
aaa3a9a329 r21613: perform variable subsitution on home directories and shells provided by the nss_info backend
(This used to be commit a9028612a3)
2007-10-10 12:18:17 -05:00
Gerald Carter
2c51e492f9 r21612: Make pam_winbind do the same username fixup on AIX as the WINBINDD
LAM module does to work around a system that does not support
>8 character usernames.  Without the change, pam_winbind tries
to authenticate _#uid in the domain.
(This used to be commit 7f0ba72e05)
2007-10-10 12:18:17 -05:00
Gerald Carter
85f769dbb4 r21611: I'm not entirely sure about this patch but it is working.
su - DOM\user was unable to set the process crendentials
without listing the "id" and other attributes in the attrlist[].
More fixes to come, but I didn't want this to get lost.
(This used to be commit 4c53d300fa)
2007-10-10 12:18:17 -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
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
Jeremy Allison
2546b63f73 r21566: If we're going to be broken, at least be *consistently*
broken :-). This will do until Simo fixes the escape
calls properly.
Jeremy.
(This used to be commit b7d91ec1b2)
2007-10-10 12:18:14 -05:00
Herb Lewis
bdc612a098 r21548: prevent segv (reference to -1 element of array)
(This used to be commit b5fd72282d)
2007-10-10 12:18:12 -05:00
Günther Deschner
6af7f33bbb r21537: Avoid to trigger the confusing "cached entry differs." warning when
there is just no cache around for a user.

Guenther
(This used to be commit a6c249b592)
2007-10-10 12:18:11 -05:00
Jeremy Allison
3f3a3a23ce r21530: Don't code with jet-lag and Volker looking over your
shoulder.... Correct fix for warning :-)
Jeremy.
(This used to be commit 773001870d)
2007-10-10 12:18:10 -05:00
Jeremy Allison
8e9ce06f35 r21529: Fix warning from bad cast.
Jeremy.
(This used to be commit 34675624e2)
2007-10-10 12:18:10 -05:00
Gerald Carter
56c1d7e507 r21525: Go ahead and checkin the mlock() & memalign() fixes so
others don't get stuck with the winbindd hang.
Still waiting on additional confirmation from Guenther
that this fixes thes issues he was observing as well.
But it's been running in my local tree for a day without
problems.
(This used to be commit 0d2b80c6c4)
2007-10-10 12:18:10 -05:00
Simo Sorce
fa5e0a238c r21508: Fix memleak in new idmap_tdb, thanks Herb.
Jerry please check.

Simo.
(This used to be commit a5354aa9a0)
2007-10-10 12:18:09 -05:00
Gerald Carter
43c290639b r21505: make sure mlock()'d memory is aligned on a page boundary
(This used to be commit 52e6a2ceab)
2007-10-10 12:18:08 -05:00
Günther Deschner
9684e353a1 r21500: Fix inappropriate creation of a krb5 ticket refreshing event when a user
changed a password via pam_chauthtok. Only do this if

a) a user logs on using an expired password (or a password that needs to
be changed immediately) or

b) the user itself changes his password.

Also make sure to delete the in-memory krb5 credential cache (when a
user did not request a FILE based cred cache).

Finally honor the krb5 settings in the first pam authentication in the
chauthtok block (PAM_PRELIM_CHECK). This circumvents confusion when
NTLM samlogon authentication is still possible with the old password after
the password has been already changed (on w2k3 sp1 dcs).

Guenther
(This used to be commit c3005c48cd)
2007-10-10 12:18:08 -05:00
Jeremy Allison
7f981b457f r21474: Ensure trustdom_cache_shutdown() gets called
on terminate. Pointed out by Herb.
Jeremy.
(This used to be commit 08998b74a5)
2007-10-10 12:18:07 -05:00
Günther Deschner
83dce23550 r21454: Fix debug typo.
Guenther
(This used to be commit 5c4a58ff3a)
2007-10-10 12:18:05 -05:00
Günther Deschner
aa12597000 r21450: No need to TALLOC_FREE twice here.
Guenther
(This used to be commit ad063d9a94)
2007-10-10 12:18:04 -05:00
Herb Lewis
9162cb7684 r21399: need to zero the request and response structures
(This used to be commit aa8f306fa5)
2007-10-10 12:18:02 -05:00
Herb Lewis
6432e901c7 r21397: revert accidential commit
(This used to be commit 9fe5f78857)
2007-10-10 12:18:02 -05:00
Herb Lewis
2b30279169 r21396: fix wbinfo --lookup-rids command
allow detection of libbiconv if all others fail - need for FreeBSD
(This used to be commit 7acc9421b0)
2007-10-10 12:18:02 -05:00
Günther Deschner
4a18f37f22 r21394: Prevent nscd crash due to potential NULL pointer dereference in
_nss_winbind_initgroups_dyn() on an empty group list.

Guenther
(This used to be commit 155b9e7c74)
2007-10-10 12:18:01 -05:00
Günther Deschner
637b01b63d r21387: Another important fix for non-AD domains:
Avoid assigning 0 as primary group id for users in NSS calls.
Jerry, please check.

Guenther
(This used to be commit 03f5f7d014)
2007-10-10 12:18:01 -05:00
Günther Deschner
ca072a9998 r21382: Important fix for winbind when using non-AD domains.
Jeremy, I'm afraid you removed the "domain->initialized" from the
set_dc_types_and_flags() call when the connect to PI_LSARPC_DS failed
(with rev. 19148).

This causes now that init_dc_connection_network is called again and
again which in turn rescans the DC each time (which of course fails each
time with NT_STATUS_BUFFER_TOO_SMALL). Just continue with the
non-PI_LSARPC_DS scan so that the domain is initialized properly.

Guenther
(This used to be commit c6f63a08f5)
2007-10-10 12:17:59 -05:00
Günther Deschner
1b16e8cbf9 r21358: Some more debugging for _nss_winbind_initgroups_dyn() on Linux.
Guenther
(This used to be commit 639b7989b3)
2007-10-10 12:17:58 -05:00
Günther Deschner
8bbe400c56 r21357: Fix typo.
Guenther
(This used to be commit e3c3258379)
2007-10-10 12:17:58 -05:00
Günther Deschner
c13e862d0e r21353: In the turn of tracking down nss_winbind related bugs on Linux:
print NSS_STATUS code with DEBUG_NSS when leaving a function.

Guenther
(This used to be commit 53ecd63d94)
2007-10-10 12:17:58 -05:00
Günther Deschner
5876136754 r21336: Fix indent (as pointed out by Volker).
Guenther
(This used to be commit dcbf7a1250)
2007-10-10 12:17:56 -05:00
Günther Deschner
3a46604800 r21318: Fix Bug #4225.
Cached logon with pam_winbind should work now also for NT4 and samba3
domains.

Guenther
(This used to be commit b2f9115482)
2007-10-10 12:17:56 -05:00
Günther Deschner
6dd654c381 r21310: Fix invalid printfs in pam_winbind.
Guenther
(This used to be commit 5a7b2fccb3)
2007-10-10 12:17:55 -05:00
Günther Deschner
826aa64c45 r21309: Add PRINTF_ATTRIBUTE checks for log statements.
Guenther
(This used to be commit 968dfcc821)
2007-10-10 12:17:55 -05:00
Günther Deschner
8e589ea7f2 r21308: Fix some typos and ensure to null terminate the correct strings.
Guenther
(This used to be commit 16c90f30b9)
2007-10-10 12:17:54 -05:00
Gerald Carter
b5114650cf r21284: Fix some unitilized variable warnings pointed out by Volker.
(This used to be commit 5c3edad860)
2007-10-10 12:17:54 -05:00
Günther Deschner
69cee2a3ec r21240: Fix longstanding Bug #4009.
For the winbind cached ADS LDAP connection handling
(ads_cached_connection()) we were (incorrectly) assuming that the
service ticket lifetime equaled the tgt lifetime. For setups where the
service ticket just lives 10 minutes, we were leaving hundreds of LDAP
connections in CLOSE_WAIT state, until we fail to service entirely with
"Too many open files".

Also sequence_number() in winbindd_ads.c needs to delete the cached LDAP
connection after the ads_do_search_retry() has failed to submit the
search request (although the bind succeeded (returning an expired
service ticket that we cannot delete from the memory cred cache - this
will get fixed later)).

Guenther
(This used to be commit 7e1a84b722)
2007-10-10 12:17:50 -05:00
Herb Lewis
d4e430d0c7 r21231: get rid of unused defines that cause a redefined warning
(This used to be commit 509ae5ffa1)
2007-10-10 12:17:49 -05:00
Jeremy Allison
50b3dbef68 r21228: Fix for fd leak on error path. Thanks to
dleonard@vintela.com for this fix !
Jeremy.
(This used to be commit 70b5db7d8c)
2007-10-10 12:17:49 -05:00
Gerald Carter
e7d2f46229 r21182: * Refactor the code to obtain the LDAP connection credentials
from both idmap_ldap_{alloc,db}_init()
* Fix the backwards compat support in idmap_ldap.c
* Fix a spelling error in the idmap_fetch_secret() function name
(This used to be commit 615a104356)
2007-10-10 12:17:46 -05:00
Gerald Carter
d3b3e02881 r21180: fix backwards compatible idmap backends parameter parsing
(This used to be commit 01af19cc9d)
2007-10-10 12:17:46 -05:00
Günther Deschner
317d005142 r21161: Another fix for pam_winbind: Move the entire pwd expiry handling into
the PAM_SUCCESS block.

Guenther
(This used to be commit f4a704745c)
2007-10-10 12:17:44 -05:00
Günther Deschner
7440e4255c r21160: Some more pam_winbind fixes:
* Consolidate all pam_winbind password expiry warnings in the one
_pam_send_password_expiry_message() call.
* Also convert some more NTSTATUS codes to error messages.
* Add paranoia check to only do all the post-processing after PAM_SUCCESS.

Guenther
(This used to be commit 02713f314b)
2007-10-10 12:17:44 -05:00
Günther Deschner
902a6e1da1 r21159: Cleanup pam_sm_chauthtok() in pam_winbind:
Set info3 strings, krb5ccname and returned username after we changed a
password and sucessfully re-authenticated afterwards. In that case we
ended up without this information.

Guenther
(This used to be commit 034d42ba72)
2007-10-10 12:17:44 -05:00
Günther Deschner
dbb9450312 r21158: Add _pam_setup_krb5_env() and _pam_warn_logon_type() functions for
pam_winbind.

Guenther
(This used to be commit 1feb961577)
2007-10-10 12:17:44 -05:00
Günther Deschner
462893a7be r21155: Forgot one _PAM_LOG_STATE_DATA_STRING call (only in 3_0).
Guenther
(This used to be commit 86b34cd5d6)
2007-10-10 12:17:44 -05:00
Günther Deschner
0cf5662363 r21154: Add PAM_WINBIND_LOGONSERVER, also merge the various pam_set_data calls.
Guenther
(This used to be commit 97a0b1b794)
2007-10-10 12:17:43 -05:00
Günther Deschner
44512030b1 r21152: Correctly omit pam conversations when PAM_SILENT has been set by the
calling application.

Guenther
(This used to be commit ebfae9a671)
2007-10-10 12:17:43 -05:00
Gerald Carter
a252038187 r21151: applying patches for CVE-2007-045[34]
(This used to be commit 1d46b2ae34)
2007-10-10 12:17:43 -05:00
Günther Deschner
3a0e9a5462 r21149: Only say we are a groupmember for the optimized (rid 513) membership
lookup when we actually are. Although the Linux nss winbind backend
protects against num_mem != 0 && buf == NULL.

Guenther
(This used to be commit a9ac4630b4)
2007-10-10 12:17:43 -05:00
Günther Deschner
a90034f5aa r21146: Fix debug typos.
Guenther
(This used to be commit cdef1d00b8)
2007-10-10 12:17:43 -05:00
Günther Deschner
c622130a7d r21145: Convert some int to BOOL in pam_winbind (only in 3_0).
Guenther
(This used to be commit 1b82c5fa0e)
2007-10-10 12:17:42 -05:00
Günther Deschner
0b2bbb2704 r21144: Create more accurate warning message when the pam_winbind chauthtok has
received NT_STATUS_PASSWORD_RESTRICTION.

Guenther
(This used to be commit 2ac9cb3bbd)
2007-10-10 12:17:42 -05:00
Günther Deschner
4aa7205c3d r21143: Fix wrong check for pam error codes for getpwnam and lookup winbind
requests in pam_winbind (Bug #4094).

Inspired by fix from Lars Heete.

Guenther
(This used to be commit 88e2185d29)
2007-10-10 12:17:42 -05:00
Gerald Carter
4c484662d6 r21130: Don't mix SAFE_FREE() and TALLOC_FREE().
(This used to be commit 5c36d67d27)
2007-10-10 12:17:41 -05:00
Günther Deschner
48191ddec6 r21122: Simplify code in pam_winbind a bit.
Guenther
(This used to be commit 08ca5ea6f1)
2007-10-10 12:17:40 -05:00
Gerald Carter
e005f8b014 r21112: fix const compile warning
(This used to be commit 6b754f7c96)
2007-10-10 12:17:39 -05:00
Günther Deschner
f2b8db93c4 r21106: We neither need a account lockout policy handler nor a check domain
online handler for internal (local SAM, BUILTIN) childs. Jeremy, please
check.

Guenther
(This used to be commit 7d0e2e7068)
2007-10-10 12:17:38 -05:00
Jeremy Allison
91cf91e028 r21101: Remove "unused" warning from Jerry's code. We still
have a build failure in 3.0.24 in event_add_timed ?
Jeremy
(This used to be commit ede30a8b4b)
2007-10-10 12:17:37 -05:00
Günther Deschner
8162d5ef3a r21098: When get_dc_name_via_netlogon() in get_dcs() fails to find a trusted DC
we may not just assume that we look for our own realm's dcs next.

Guenther
(This used to be commit bf0c4ce7b1)
2007-10-10 12:17:37 -05:00
Gerald Carter
a94b044a5c r21070: * Add the new boolean 'winbind normalize names' option as discussed
on the samba-technical ml.  The replacement character is hardcoded
  as a '_' for now.
(This used to be commit bd8238417b)
2007-10-10 12:17:32 -05:00
Volker Lendecke
caf8c6a76b r21064: The core of this patch is
void message_register(int msg_type,
                      void (*fn)(int msg_type, struct process_id pid,
-                                void *buf, size_t len))
+                                void *buf, size_t len,
+                                void *private_data),
+                     void *private_data)
 {
        struct dispatch_fns *dfn;

So this adds a (so far unused) private pointer that is passed from
message_register to the message handler. A prerequisite to implement a tiny
samba4-API compatible wrapper around our messaging system. That itself is
necessary for the Samba4 notify system.

Yes, I know, I could import the whole Samba4 messaging system, but I want to
do it step by step and I think getting notify in is more important in this
step.

Volker
(This used to be commit c8ae60ed65)
2007-10-10 12:17:32 -05:00
Günther Deschner
c51e4c3440 r21056: Moving the set_domain_online_request to fork_domain_child() (formerly
lived in trustdom_recv().

Jeremy, this is the better place I think but please check.

Guenther
(This used to be commit beed8b8b32)
2007-10-10 12:17:30 -05:00
Gerald Carter
400f419580 r21036: Fix the ad nss info backend to not abort the search when called outside the idmap daemon
(This used to be commit 57160e3dd9)
2007-10-10 12:17:29 -05:00
Günther Deschner
4a5868f3ca r21033: To make the logs a bit more readable let the winbind dc connect child
write to a separate logfile.

Guenther
(This used to be commit 0313edc0d6)
2007-10-10 12:17:28 -05:00
Günther Deschner
b979bf5686 r21020: Some pam_winbind fixes:
* make debug_state also configurable from the config file
* minor code cleanup

Guenther
(This used to be commit c562095953)
2007-10-10 12:17:28 -05:00
Günther Deschner
74f38589b3 r21019: Fix typo.
Guenther
(This used to be commit adb40884e0)
2007-10-10 12:17:28 -05:00
Günther Deschner
a6f30ced0a r21018: Removing the set_domain_online_request again in trustdom_recv().
Jeremy, we really can't do that. There are setups with hundred and more
trusted domains out there, I have one customer who tells me it takes
more then half an hour for him after winbind is up and running. That
request registers the check_domain_online_handler which in turn forks
off the child immediately. Also discussed with Volker.

Guenther
(This used to be commit ccd4812c0b)
2007-10-10 12:17:27 -05:00
Günther Deschner
3f9585018d r21016: Fix pam_sm_setcred again.
Jerry, the switch statement must ignore the PAM_SILENT flag.

Guenther
(This used to be commit 46d23c72bf)
2007-10-10 12:17:27 -05:00
Gerald Carter
05ec639127 r21015: fix typo that breaks the build
(This used to be commit f82a517530)
2007-10-10 12:17:27 -05:00
Gerald Carter
db99a55c10 r21014: move some functionss to winbindd_group.c and make static
(This used to be commit af5a2fa9ec)
2007-10-10 12:17:27 -05:00
Gerald Carter
45aa381a77 r21013: * Remove "inline" keyword
* Remove anpther check for PAM_SILENT that prevents logging to syslog
* Add missing check for TRY_FIRST_PASS when using authtok (missed
  from previous merge)
(This used to be commit ed794f0872)
2007-10-10 12:17:27 -05:00
Gerald Carter
7e8a068a5e r21012: Patch from Danilo Almeida @ Centeris (via me):
Details: Improve PAM logging
- The improved logging is far tracking down PAM-related bugs
- PAM_SILENT was being mis-used to suppress syslog output instead of
  suppressing user output.  This lets PAM_SILENT still log to syslog.
- Allow logging of item & data state via debug_state config file option.
- Logging tracks the pam handle used.
(This used to be commit cc1a13a9f0)
2007-10-10 12:17:27 -05:00
Gerald Carter
76fd8f8e1d r21011: Another patch from Danilo Almeida @ Centeris (via me):
Details: Reset the "new password prompt required" state whenever
we do a new auth.  In more detail, in pam_sm_authenticate, if not
settting PAM_WINBIND_NEW_AUTHTOK_REQD, then clean any potentially
present PAM_WINBIND_NEW_AUTHTOK_REQD.
(This used to be commit 402e859475)
2007-10-10 12:17:26 -05:00
Gerald Carter
df1e2693dc r21009: Patch from Danilo Almeida @ Centeris (via me).
Patch details:

Support most options in pam_winbind.conf; support comma-separated names in
require-membership-of.  Details below:

1) Provides support for almost all config options in pam_winbind.conf
   (all except for use_first_pass, use_authtok, and unknown_ok).

 - That allows us to work well when invoked via call_modules from
   pam_unix2.conf as well as allowing use of spaces in names used
   w/require_membership_of.

2) Support for comma-separated list of names or SID strings in
   require_membership_of/require-membership-of.

 - Increased require_membership_of field in winbind request from fstring
   (256) to pstring (1024).

 - In PAM side, parse out multiple names or SID strings and convert
   all of them to SID strings.

 - In Winbind side, support membership check against multiple SID strings.
(This used to be commit 4aca986489)
2007-10-10 12:17:26 -05:00
Gerald Carter
a31f10c99e r21001: * Use a simple '#define LDAPMessage void' to fix the build
problems in the nss_info interface when HAVE_LDAP is undefined.
* Revert previous ifdef HAVE_ADS brakets
* Remove an unused init function wrapper.
(This used to be commit 2ba353848b)
2007-10-10 12:17:25 -05:00
James Peach
a1f0af5205 r20994: Remove unused code.
(This used to be commit 8052a18f29)
2007-10-10 12:17:24 -05:00
Gerald Carter
e2757521bb r20993: temporary build fix to get things going again on non-ADS systems
(This used to be commit 8c23158f05)
2007-10-10 12:17:24 -05:00
Gerald Carter
a4faa575a4 r20992: another attempt at fixing the build breakage
(This used to be commit 7011a1b5ab)
2007-10-10 12:17:24 -05:00
Gerald Carter
b9b26be174 r20986: Commit the prototype of the nss_info plugin interface.
This allows a provider to supply the homedirectory, etc...
attributes for a user without requiring support in core
winbindd code.  The idmap_ad.c module has been modified
to provide the idmap 'ad' library as well as the rfc2307 and sfu
"winbind nss info" support.

The SID/id mapping is working in idmap_ad but the nss_info
still has a few quirks that I'm in the process of resolving.
(This used to be commit aaec0115e2)
2007-10-10 12:17:23 -05:00
Gerald Carter
37cc3e3d62 r20951: Remove the DOM_SID field in the struct idmap_domain and bounce
domain SID lookups through the struct winbindd_domain *domain_list
by searching by name.

Refactor the order lookup when searching for the correct idmap_domain
to a single function and remove the requirement that the default
domain be listed first in the config file.

I would still like to make the idmap_domain array a linked list and
remove the existing code which makes use of indexes into the list.

Basic testing with tdb pans out ok.
(This used to be commit e6c300829f)
2007-10-10 12:17:21 -05:00
Jeremy Allison
cce97a9b50 r20915: Fixed the bad merge from 3.0.24.
Jeremy.
(This used to be commit 018d7805b5)
2007-10-10 12:17:19 -05:00
Jeremy Allison
da35d24b68 r20914: Sync up incorrect differences between 3.0.24 and 3.0
Jeremy.
(This used to be commit a2222a565c)
2007-10-10 12:17:19 -05:00
Gerald Carter
600ef4f6f3 r20911: Fix copyright message in winbindd to use the macro from smb.h
(This used to be commit e635bad00e)
2007-10-10 12:17:18 -05:00
Gerald Carter
c47347ebe9 r20905: Windows 2000 returns NT_STATUS_ACCOUNT_RESTRICTION if the pw
chnage fails due to policy settings where as 2003 (the chgpasswd3()
request) fails with NT_STATUS_PASSWORD_RESTRICTION.  Thunk down
to the same return code so we correctly retreive the password policy
in both cases.
(This used to be commit 262bb80e9c)
2007-10-10 12:17:18 -05:00
Günther Deschner
e9c294b926 r20874: We need to distinguish client sitenames per realm. We were overwriting
the stored client sitename with the sitename from each sucessfull CLDAP
connection.

Guenther
(This used to be commit 6a13e878b5)
2007-10-10 12:17:16 -05:00
Günther Deschner
f3ad8bb00a r20860: Adding some small tweaks. When we have no sitename, there is no need to
ask for the list of DCs twice.

Guenther
(This used to be commit a9baf27e13)
2007-10-10 12:17:14 -05:00
Jeremy Allison
bfd099e148 r20857: Silence gives assent :-). Checking in the fix for
site support in a network where many DC's are down.
I heard via Volker there is still a bug w.r.t the
wrong site being chosen with trusted domains but
we'll have to layer that fix on top of this.
Gd - complain if this doesn't work for you.
Jeremy.
(This used to be commit 97e248f89a)
2007-10-10 12:17:14 -05:00
Günther Deschner
51dad2a560 r20848: Minor typo.
Guenther
(This used to be commit fb730e1e7b)
2007-10-10 12:17:13 -05:00
Volker Lendecke
bf219447a3 r20846: Before this gets out of control...
This add a struct event_context and infrastructure for fd events to smbd. This
is step zero to import lib/events.

Jeremy, I rely on you to watch the change in receive_message_or_smb()
closely. For the normal code path this should be the only relevant change. The
rest is either not yet used or is cosmetic.

Volker
(This used to be commit cd07f93a8a)
2007-10-10 12:17:13 -05:00
Volker Lendecke
b906886e9e r20824: Send access to the trusted domain passwords through the pdb backend, so that
in the next step we can store them in LDAP to be replicated across DCs.

Thanks to Michael Adam <ma@sernet.de>

Volker
(This used to be commit 3c879745cf)
2007-10-10 12:17:10 -05:00
Simo Sorce
c50c8d0dc3 r20774: I thought I committed this before Xmas holidays ...
This change is needed to make it possible to not expire
caches in disconnected mode.

Jerry, please can you look at this and confirm it is ok?

Simo.
(This used to be commit 9e8715e4e1)
2007-10-10 12:17:08 -05:00
Volker Lendecke
209509f7ca r20738: Remove unused variable
(This used to be commit c16ce9ebaa)
2007-10-10 12:17:07 -05:00
Volker Lendecke
afb5cda0de r20725: Get rid of a bool passed down -- gd, please check
(This used to be commit 1ef910f423)
2007-10-10 12:17:07 -05:00
Günther Deschner
0d538f7370 r20687: Implement grace logons for offline authentications in pam_winbind.
In case a user authenticated sucessfully and his password just expired
while beeing disconnected, we should allow a user to logon (given a
clear warning). We currently forced the user into a password change
dialogue in that scenario; this did not make much sense while offline.

Guenther
(This used to be commit 668b278653)
2007-10-10 12:17:02 -05:00
Günther Deschner
062a1a4904 r20651: Fix "password expires soon" warning message for pam_winbind.
We were incorrectly calculating the days until the password expires and
we also need to look at the info3 pass_must_change_time for expiry
calculation.

Guenther
(This used to be commit 22d7923712)
2007-10-10 12:17:01 -05:00
Günther Deschner
f3a85fb152 r20536: In the offline PAM session close case the attempt to delete a
non-existing krb5 credential cache should not generate an error.

Guenther
(This used to be commit 11c6f573af)
2007-10-10 12:16:55 -05:00
Jeremy Allison
e5e0f51b83 r20530: Don't want this call to get inadvertently re-added :-).
Jeremy.
(This used to be commit 68c4fbcf33)
2007-10-10 12:16:54 -05:00
Gerald Carter
3063738c24 r20489: Missed patch ofthe forest_name patch for lookupname
(This used to be commit 25c4ebb55f)
2007-10-10 12:16:52 -05:00
Gerald Carter
b2317c0979 r20488: When joined to a child domain in a multi-domain/single domain tree,
the child domain cannot always resolve SIDs in sibling domains.
Windows tries to contact a DC in its own domain and then the root
domain in the forest.  This async changes makes winbindd's name2sid()
call do the same.
(This used to be commit 7b2bf0e5a6)
2007-10-10 12:16:52 -05:00
Volker Lendecke
9f2807fc93 r20355: Fix some C++ warnings
(This used to be commit f103c301b1)
2007-10-10 12:16:43 -05:00
Jeremy Allison
c04b948750 r20330: And here's the fix for the parent winbindd crashing
after it's child died unexpectedly whilst the parent
was waiting for a reply. We need to clean up the request
we're not going to service, plus we still need to call
the continuation function with a "False" flag so it
can clean things up. Still testing this, but I think
I'm right.
Jeremy
(This used to be commit 9b04ac0c81)
2007-10-10 12:16:41 -05:00
Jeremy Allison
ad325a7905 r20329: Fix a winbindd crash bug. If someone pulls
the network cable out of the machine *exactly*
after the init_dc_connect() call in cm_connect_sam()
or cm_connect_lsa() call succeeded but before any
of the other calls fail, and they have debug level
10 set in the log, then we'd crash due to dereferencing
a now NULL pointer (conn->cli gets set to NULL when
the init_dc_connect() call called from cm_get_schannel_dcinfo()
fails). Yes, before you ask this *did* happen on a
customer site :-).
Jeremy.
(This used to be commit a0278a0cb0)
2007-10-10 12:16:41 -05:00
Günther Deschner
c1a05657b9 r20304: Smaller fixes for pam_winbind:
* fail on invalid credential flags in pam_sm_setcred
* parse config file for pam_sm_acct_mgmt and pam_sm_open_session

Guenther
(This used to be commit 2a428ac814)
2007-10-10 12:16:40 -05:00
Jeremy Allison
eeb14fcc94 r20296: If we're going to overwrite krb5.conf
only do it for our primary domain.
Jeremy.
(This used to be commit 61d31ce008)
2007-10-10 12:16:39 -05:00
Simo Sorce
c127486a84 r20290: Remove unused call
(This used to be commit 4920265c31)
2007-10-10 12:16:39 -05:00
Simo Sorce
ced5c1f9aa r20289: IDMAP is part of winbind but not the main process.
Make sure we route all request to remote DCs via the main process
so that IDMAP can correctly reuse DC connections and use the
async interface.

This fixes also idmap_nss so that it is able to resolve local
group names (requires patch on the samba dc earlier committed
to SAMBA_3_0 to make it resolve both the mapped and the unmapped
name).

Simo.
(This used to be commit 4297510f22)
2007-10-10 12:16:39 -05:00
Gerald Carter
8b0fce0b0c r20287: Allow a NULL sid when setting up the list of trusted domains.
(This used to be commit ccea7155bc)
2007-10-10 12:16:39 -05:00
Günther Deschner
bb9ca5025c r20279: Fix winbind segfault in winbindd_getsidaliases.
Jeremy: sidstr formerly could be NULL (when num_aliases was 0), since we
strdup here it needs to exist.

Guenther
(This used to be commit 29396a1bd8)
2007-10-10 12:16:39 -05:00
Jeremy Allison
5d3456b22e r20270: Even with the dual daemon mode the parent winbindd
still needs to contact the DC's for non async requests
like enumerate users/groups etc. Now that online
DC detection is tied to async events we must enable
the processing of events in the main loop of winbindd.
Finally got rid of the last hard coded domain->initialized = 1
code in init_child_recv() - now all domain->initialized = True
gets done only in the connection manager code when either
we're online and have spoken to the DC or are offline and
we know we can't talk to the DC.
Jeremy.
(This used to be commit b3c98057fb)
2007-10-10 12:16:38 -05:00
Herb Lewis
e59e787b48 r20269: merge -r20264:20267 from SAMBA_3_0_24
more no previous prototype warnings
(This used to be commit 41be182f78)
2007-10-10 12:16:38 -05:00
Herb Lewis
55ed1d5945 r20261: merge 20260 from samba_3_0_24
clean up a bunch of no previous prototype warnings
(This used to be commit c60687db11)
2007-10-10 12:16:37 -05:00
Günther Deschner
bd7b2c76f3 r20254: The pam_chauthtok needs to go through the async interface as well.
This fixes pam password changes in the online case.

Guenther
(This used to be commit 2d2de1ac27)
2007-10-10 12:16:37 -05:00
Simo Sorce
03b1445450 r20252: Revert back to const, but I have a fleble feeling we should go the ther way.
(This used to be commit 2048d49150)
2007-10-10 12:16:36 -05:00
Jeremy Allison
5115931024 r20250: If we've come from being globally offline we
don't have a check online event handler set.
We need to add one once we're been asked to
go back online as this is the only way to actually
go into the online state. Doh ! :-).
Jeremy.
(This used to be commit 5d36c4e031)
2007-10-10 12:16:36 -05:00
Günther Deschner
fb6d54dbab r20249: Fail when parsing invalid options in _pam_parse.
Guenther
(This used to be commit f6c9421abd)
2007-10-10 12:16:36 -05:00
Herb Lewis
ef4c2088c5 r20245: merge 20244 from samba_3_0_24
get rid of more nested extern declarations warnings
(This used to be commit e9df051f52)
2007-10-10 12:16:36 -05:00
Simo Sorce
bb3cf31184 r20242: these are not really const as we set them in the function
(This used to be commit 6a0260fb04)
2007-10-10 12:16:35 -05:00
Günther Deschner
9291e634c0 r20241: Slightly improve readability of the pam_vsyslog replacement function.
Guenther
(This used to be commit 222320373f)
2007-10-10 12:16:35 -05:00
Günther Deschner
619671a718 r20240: Be a little more verbose about the credential flags when the debug flag
is set.

Guenther
(This used to be commit ecbab58826)
2007-10-10 12:16:35 -05:00
Günther Deschner
6fdbdfc86f r20239: Parse the configfile for pam_sm_setcred as well
(e.g. to get the debug flag)

Guenther
(This used to be commit 2c549f71f1)
2007-10-10 12:16:35 -05:00
Volker Lendecke
f5b3bed84f r20218: Same fix as r20217 -- can we consolidate that duplicated code a bit?
(This used to be commit fdb310f579)
2007-10-10 12:16:33 -05:00
Volker Lendecke
34a0885df0 r20217: uid_t and gid_t are not necessarily 32 bit. In assignments we get an automatic
conversion, but not when we pass pointers down to other functions.

Simo, please check.

Volker
(This used to be commit 04845f600b)
2007-10-10 12:16:33 -05:00
Simo Sorce
b1de1a6eab r20216: Fix fallback code.
A reversed check made it impossile to fallback to the Unix Domain mapping code.
Also fix a potential use of a freed array.

Jerry,
my tests shows that this code now correctly handle the fallback to Unix Domain
when our Domain member is asked for a mapped group that has a unix name different
from the Windows name against a Samba DC and we do not use winbindd but share
users/groups by other means (ldap / sync of passwd and group files)

Immediate Fix would be to discuss if we should answer back when DOMAIN\unixgroup -> SID
is asked for, in the case the unixgroup name is mapped to a different name.
IE: DOMAIN\Domain Admins -> ntadmins

Currently if we are asked for "DOMAIN\Domain Admins" we return the dom admins SID
If we are asked for "DOMAIN\ntadmins we return "not found", but we may consider to
return the Domain admins SID in this case too.

Comments are welcome on this point!

Long term fix I think is the unixinfo pipe and of course an idmap_unixinfo moudle.

Simo.
(This used to be commit 07bdbb4c21)
2007-10-10 12:16:33 -05:00
Jeremy Allison
f0c7dc544b r20207: Fix a couple more places where extra_data was
being talloc'ed off the NULL context instead
of being malloced.
Jeremy.
(This used to be commit 47bdeb4efe)
2007-10-10 12:16:32 -05:00
Jeremy Allison
bf8988feaf r20206: Start cleaning up the talloc_ctx mess.
child->mem_ctx isn't actually used for
anything, so remove it.
Jeremy.
(This used to be commit a7f294b592)
2007-10-10 12:16:31 -05:00
Günther Deschner
b49f0ae018 r20186: Fix winbind crash bug in WINBIND_GETGROUPS.
response_extra_sent() expects to free a malloced
extra_data.data while the add_XX_to_array functions all return talloced
memory now. Jeremy, please check.

Guenther
(This used to be commit 9f34c9f369)
2007-10-10 12:16:31 -05:00
Jeremy Allison
63d8197453 r20180: Ensure that pam returns the correct error messages
when offline and or doing password changes.
Jeremy.
(This used to be commit 4a74c55384)
2007-10-10 12:16:30 -05:00
Günther Deschner
3ff4f4410f r20171: Don't delete the krb5 credential if others still reference to it.
Guenther
(This used to be commit a1378979be)
2007-10-10 12:16:29 -05:00
Simo Sorce
1da72a1c3f r20155: revert, I misread
(This used to be commit 20aa6322ef)
2007-10-10 12:16:28 -05:00
Simo Sorce
7c5dba63a0 r20154: Fix nasty typo, hunting another bug
(This used to be commit bf8dc44cc2)
2007-10-10 12:16:28 -05:00
Simo Sorce
9b5354bea4 r20151: remove meaningless checks
(This used to be commit 33a55f0cfc)
2007-10-10 12:16:28 -05:00
Simo Sorce
25fe484101 r20150: better memory handling for some functions, make sure we don't
leak memory by using the wrong(long lived)  mem context
(This used to be commit a28cdd6e74)
2007-10-10 12:16:27 -05:00
Jeremy Allison
6b232e8c1f r20146: Now online checks are fully async we can do them
every cache timeout times.
Jeremy.
(This used to be commit 5d364bc5cc)
2007-10-10 12:16:27 -05:00
Jeremy Allison
ebb8161e1c r20140: Make online/offline detection completely asynchronous.
Now I've done this I might be able to reduce the probe
timeout and reduce the backoff algorithm, going back
to checking every cache time seconds (5 mins by default),
as the parent or forked domain child will never block.
Jeremy.
(This used to be commit d0add5f946)
2007-10-10 12:16:27 -05:00
Jim McDonough
86a11183f7 r20136: Fix #4290. Properly compute time to password expiration in message from
pam_winbind.  Thanks to Andrew Benham <andrew.benham@thus.net>
(This used to be commit 0d03f51379)
2007-10-10 12:16:27 -05:00
Herb Lewis
791f48f167 r20124: clean up nested extern declaration warnings
(This used to be commit ac3eb7813e)
2007-10-10 12:16:26 -05:00
Simo Sorce
7165944469 r20118: Fix some more warnings
(This used to be commit b6db21ff65)
2007-10-10 12:16:26 -05:00
Simo Sorce
79416a5226 r20117: 1st Error in the merge
(This used to be commit 5e46c43a2e)
2007-10-10 12:16:25 -05:00
Simo Sorce
4225f9a4bd r20116: Start merging in the work done to create the new idmap subsystem.
Simo.
(This used to be commit 50cd8bffee)
2007-10-10 12:16:25 -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
Jeremy Allison
5ce139751b r20087: Ensure we clean up any random pending events we
may have inherited from our parent in the winbindd
forked child.
Jeremy.
(This used to be commit 0a1352f440)
2007-10-10 12:16:23 -05:00
Jeremy Allison
5be92d0d18 r20082: When fork_domain_child is forked when we're offline
the child inherits *all* active check_online timout handlers.
This is bad when it's not our domain (ie. BUILTIN).
Jeremy.
(This used to be commit 8d815ec4c1)
2007-10-10 12:16:23 -05:00
Jeremy Allison
1c6de687f1 r20060: Fix the timout calculation.
Jeremy.
(This used to be commit 017be792f3)
2007-10-10 12:16:23 -05:00
Jeremy Allison
b59412e6bf r20058: Ensure we actually do the increasing time
calculation when in offline mode.
Jeremy.
(This used to be commit b7dc67ab2a)
2007-10-10 12:16:23 -05:00
Jeremy Allison
155083547a r20057: Attempt to fix connect timeouts when connected on
a network but not one on which any home DC's can
be found (hotel network problem). Still testing
but this is getting close.
Jeremy.
(This used to be commit 369c9e4138)
2007-10-10 12:16:23 -05:00
Jeremy Allison
490e3205bc r20035: Fix obvious horrible bug in falling back to MS-RPC
methods.
Jeremy.
(This used to be commit 7ac4ae4b51)
2007-10-10 12:16:21 -05:00
Jeremy Allison
4c98afb2de r19975: Deal with 2 keytypes I messed previously (DR/DE).
Fix code that mistakenly assumed tdb_traverse
returned 0 or -1, it actually returns -1 or the
number of entries traversed. Add a static as another
way to return the bad cache value.
Jeremy.
(This used to be commit 5266a70ae9)
2007-10-10 12:16:16 -05:00
Jeremy Allison
913222d76a r19974: Add freelist check for cache. Fix testing of entry
names (all except SEQNUM are *not* null terminated
strings).
Jeremy.
(This used to be commit bcb68260ba)
2007-10-10 12:16:16 -05:00
Jeremy Allison
2941b044b3 r19958: Add check for WINBIND_OFFLINE key.
Jeremy.
(This used to be commit 270e84db6d)
2007-10-10 12:16:15 -05:00
Jeremy Allison
ed34ffb147 r19957: Initial framework to make winbindd robust
against tdb corruption. Needs fleshing out
(and I forgot one record type) and needs helpful
suggestion from Volker to validate freelist,
but should give an idea of how this will look.
Jeremy.
(This used to be commit 8eb53f74e4)
2007-10-10 12:16:15 -05:00
Gerald Carter
95bfb97547 r19809: remove winbind blacklist parameter
(This used to be commit 40cff14498)
2007-10-10 12:15:57 -05:00
Gerald Carter
8fa0a80b49 r19754: * When using a krb5 session setup, we don't fill in the server_name
string the clis_state struct.  So call saf_store() after we
  have the short domain name in the lsa_query_inof_policy code.

* Remove unused server string in saf_delete()
(This used to be commit 3eddae2f20)
2007-10-10 12:15:53 -05:00
Jeremy Allison
8f723972ae r19710: Fix memory leak in get_conf_item_string(). As
we're just doing strchr on a const string there's
no need to strdup it before, we're never modifying
it. Just remove the variable "parm".
Jeremy.
(This used to be commit 1af18f613b)
2007-10-10 12:15:48 -05:00
Simo Sorce
b903eb231a r19703: Don't free a string if you want to return it!
(This used to be commit 3fed72ac3e)
2007-10-10 12:15:48 -05:00
Volker Lendecke
782d33e1c8 r19686: Fix the build
(This used to be commit 28ac023581)
2007-10-10 12:15:46 -05:00
Volker Lendecke
5f3a692748 r19667: Fix incorrect null check
(This used to be commit dc9cdf37e9)
2007-10-10 12:15:46 -05:00
Volker Lendecke
bf6bb74985 r19657: Correctly check for malloc failure
(This used to be commit e5b5c9b058)
2007-10-10 12:15:45 -05:00
Volker Lendecke
8371c0e44c r19656: Correctly check for malloc failure
(This used to be commit 3d0661b039)
2007-10-10 12:15:45 -05:00
Günther Deschner
61a38bd4b8 r19651: Fix interesting bug with the automatic site coverage in Active Directory:
When having DC-less sites, AD assigns DCs from other sites to that site
that does not have it's own DC. The most reliable way for us to identify
the nearest DC - in that and all other cases - is the closest_dc flag in
the CLDAP reply.

Guenther
(This used to be commit ff004f7284)
2007-10-10 12:15:44 -05:00
James Peach
9a02736348 r19626: Coalesce usage of DUMP_CORE. Fix formatting on chdir error message
in core dump path.
(This used to be commit 9a51fba71c)
2007-10-10 12:15:42 -05:00
Gerald Carter
80d40172ef r19420: Remove strequal and use strcmp() instead. Meant to
make the change before theprevious commit.
(This used to be commit 815388c4c8)
2007-10-10 12:15:34 -05:00
Gerald Carter
2145eff91d r19419: BUG 4109: Patch from Timur Bakeyev. Fix bug causing smbd to turn off
winbindd and fail to disable the _NO_WINBIND environment.
(This used to be commit a6366b40b3)
2007-10-10 12:15:34 -05:00
Jeremy Allison
e070996cc3 r19413: Now we're calling init_dc_connection, this code
is completely useless (and in fact harmful :-) in
that it causes a winbindd error where there should
be none.
Jeremy.
(This used to be commit acf5419d62)
2007-10-10 12:15:33 -05:00
Jeremy Allison
d273a2ef1d r19399: Now Guenther discovered one crash dereferencing domain->backends,
get paranoid. I don't think this can really happen, but let's be
sure.
Jeremy.
(This used to be commit be4709984b)
2007-10-10 12:15:33 -05:00
Günther Deschner
5afaa37662 r19394: When we fail to get the list of trusted domains, make sure to return
WINBINDD_ERROR.

Guenther
(This used to be commit 6089b3007b)
2007-10-10 12:15:32 -05:00
Günther Deschner
edba79e500 r19391: Fix crash bug within the winbind caching method.
That one was hard to find: when coming from offline mode and switching
to online, a refresh sequence number call (using the default MS-RPC
mechanism) may reset domain->backend to NULL (by the set_domain_online
event). We need to make sure to reidentify the remote domain in that
case.

Guenther
(This used to be commit 4d6503d137)
2007-10-10 12:15:32 -05:00
Günther Deschner
21344a731c r19371: Add two missing refresh_sequence_number calls where they are missing
just before writing to the winbind cache tdb.

Guenther
(This used to be commit bd8548998b)
2007-10-10 12:15:32 -05:00
Günther Deschner
b26b8f95e9 r19351: Also export the info3 profilepath via the PAM_WINBIND_PROFILEPATH data
field.

Guenther
(This used to be commit 66b92f27fa)
2007-10-10 12:15:30 -05:00
Günther Deschner
da6e42b47f r19349: Fix invalid free on the PAM_WINBIND_PWD_LAST_SET data.
Guenther
(This used to be commit a4d17ee9c9)
2007-10-10 12:15:30 -05:00
Günther Deschner
e42f449fcc r19348: Fix uninitialized dictionary handle, found by valgrind.
Guenther
(This used to be commit 9621bb420a)
2007-10-10 12:15:30 -05:00
Günther Deschner
258f7b50dc r19340: Wait longer then 10 seconds for a samr_query_groupmem lookup to succeed.
Guenther
(This used to be commit 37dd019e21)
2007-10-10 12:15:29 -05:00
Jeremy Allison
25cba8669d r19302: Use TALLOC_ZERO_P not TALLOC_P to ensure unused
fields are initialized to zero.
Jeremy.
(This used to be commit 8a0ff70e8e)
2007-10-10 12:15:29 -05:00
Jeremy Allison
76022f73d6 r19301: Correct debug statement.
(This used to be commit 3ea8399bc9)
2007-10-10 12:15:29 -05:00
Jeremy Allison
4a942c592a r19300: Fix null deref in debug statement.
Jeremy.
(This used to be commit c55b9111f6)
2007-10-10 12:15:29 -05:00
Volker Lendecke
7d2aa0d3f1 r19287: As requested by Bjoern Jacke <bjoern@j3e.de>: Check in the NetBSD winbind module by Luke
Mewburn.

Volker
(This used to be commit 104f5e9ec9)
2007-10-10 12:15:28 -05:00
Jeremy Allison
94d565b36b r19272: Ensure we return 1 member in the optimized case.
(This used to be commit cc6cdabf19)
2007-10-10 12:15:28 -05:00
Jeremy Allison
25f0f624f8 r19271: Test the "hack" for "Domain Users" as agreed with
Jerry.
If "enum users" is set to false, and the group being looked
up is the Domain Users SID: S-1-5-domain-513, then for the
list of members check if the querying user is in that group,
and if so only return that user as the gr_mem array.
We can change this to a different parameter than "enum users"
if neccessaey, or parameterize the group list we do this for.
Jeremy.
(This used to be commit 91b40e25cc)
2007-10-10 12:15:27 -05:00
Günther Deschner
7399ab779d r19255: Add blacklist of accounts when NSS initgroups calls are coming in and
"winbind use default domain" is set. Defaults to "root, nobody, lp"
currently.

Guenther
(This used to be commit b5b42196a6)
2007-10-10 12:15:26 -05:00
Günther Deschner
96869053a5 r19254: Make sure to also wait 35 seconds to receive a Netlogon GETDC reply
here in winbindd_getdcname().

Guenther
(This used to be commit 58a181edc5)
2007-10-10 12:15:26 -05:00
Jeremy Allison
ee0ec18101 r19230: Doh ! Fix obvious crash bug.....
(This used to be commit e656027049)
2007-10-10 12:15:23 -05:00
Jeremy Allison
ed088e5ee0 r19212: Make sure domains marked internal don't do
network queries.
Jeremy.
(This used to be commit e4d5e1d90b)
2007-10-10 12:15:22 -05:00
Jeremy Allison
fe3fc9c8d5 r19209: Ensure we don't make mistakes by sending online/offline
messages to internal domains, or to domains not being
serviced by a winbindd child. Ensure the child online
offline requests are domain specific.
Jeremy.
(This used to be commit 81a9dc4b9f)
2007-10-10 12:15:22 -05:00
Jeremy Allison
9421a0a9cd r19207: Properly canonicalize incoming names to the
NSS protocols auth, chauthtok, logoff, ccache_ntlm_auth.
That way we ensure winbindd only deals with fully
qualified names internally. The NSS protocols
auth_crap and chng_pswd_auth_crap should be fixed
to do the same thing.
Jeremy.
(This used to be commit dbd2454d33)
2007-10-10 12:15:21 -05:00
Günther Deschner
b405a39714 r19206: Jeremy, for some reason storing a value-less entry in TDB does not work
anymore in 3_0. I'm just adding a time(NULL) as value for the
WINBINDD_OFFLINE key.

Guenther
(This used to be commit 2bdf9f140f)
2007-10-10 12:15:21 -05:00