1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

20275 Commits

Author SHA1 Message Date
Günther Deschner
913fb138aa r25134: Fix Bug #4968 and make dns updates work with heimdal as well (again,
gss_import_name() needs to follow the same logic as in the LDAP sasl wrapping
(see -r25133).

Tested with MIT 1.2.7, 1.3.6, 1.4.3, 1.5.1, 1.6.1 and Heimdal 0.7.2, 1.0,
1.0.1.

Guenther
2007-10-10 12:30:43 -05:00
Günther Deschner
cb2dc715e3 r25133: Fix sasl wrapping (for ldap sign&seal).
The gss_import_name() broke as we switched from the internal MIT OID
"gss_nt_krb5_principal" to "GSS_KRB5_NT_PRINCIPAL_NAME" and didn't switch from
passing the krb5_principal (or better: a pointer to that, see MIT's "*HORRIBLE*
bug") to pass the string principal directly.

Jerry, Jeremy, neither I could figure out the need of passing in a
krb5_principal at all nor could I reproduce the crash you were seeing.

I sucessfully tested the code (now importing a string) with MIT 1.2.7, 1.3.6,
1.4.3, 1.5.1, 1.6.1 and Heimdal 0.7.2, 1.0, 1.0.1.

Guenther
2007-10-10 12:30:43 -05:00
Stefan Metzmacher
2e13e05fa9 r25130: make use only of base types which are provided by libreplace
in winbind client and nss/pam stuff

metze
2007-10-10 12:30:43 -05:00
Stefan Metzmacher
b3ee9adf28 r25128: _XOPEN_SOURCE_EXTENDED and socklen_t are always provided by libreplace
metze
2007-10-10 12:30:42 -05:00
Stefan Metzmacher
5afa66970e r25125: create prototypes for 'bool ' functions
metze
2007-10-10 12:30:42 -05:00
Jeremy Allison
6552e52979 r25121: Remove pstring limits from much of our string handling function.
Still a few left (mainly the substitute ones).
Jeremy.
2007-10-10 12:30:42 -05:00
Jeremy Allison
9cc70e3ccf r25120: One more warning.
Jeremy.
2007-10-10 12:30:42 -05:00
Jeremy Allison
0e655ac946 r25119: Fix a couple of warnings.
Jeremy.
2007-10-10 12:30:42 -05:00
Jeremy Allison
7632f8fb40 r25118: More pstring elimination.
Jeremy.
2007-10-10 12:30:41 -05:00
Jeremy Allison
7f0db75fb0 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
2007-10-10 12:30:41 -05:00
Jeremy Allison
93c42fd9b5 r25116: Fix talloc_asprintf_append to do the right thing with
truncated strings.
Jeremy.
2007-10-10 12:30:41 -05:00
Jeremy Allison
0c9a8c4dff r25111: Move to talloced pathnames on most code paths.
There are now ony 17 pstrings left in reply.c,
and these will be easy to remove (and I'll be
doing that shortly). Had to fix an interesting
bug in pull_ucs2_base_talloc() when a source
string is not null terminated :-).
Jeremy.
2007-10-10 12:30:41 -05:00
Günther Deschner
2dea9464bb r25109: Remove obsolete argument from ads_guess_service_principal().
Guenther
2007-10-10 12:30:41 -05:00
Günther Deschner
f31949ec34 r25108: Make ifdef labyrinth in sasl code a bit more readable.
Guenther
2007-10-10 12:30:40 -05:00
Simo Sorce
6ce01bf413 r25107: Fix const warning caused by the way I reformatted this 2007-10-10 12:30:40 -05:00
Jeremy Allison
a28a35f9cd r25104: Fix extra lines added by mistake.
Jeremy.
2007-10-10 12:30:40 -05:00
Jeremy Allison
b3f0d39d11 r25103: Ensure we don't return unwritten memory (valgrind caught).
Jeremy.
2007-10-10 12:30:40 -05:00
Jeremy Allison
cf6b6f9c3a r25102: Rewrite msdfs code to use talloced filenames. Passes make test
and make valgrindtest. Final step will be to change srvstr_get_path()
to return talloced memory in the major codepaths.
Jeremy.
2007-10-10 12:30:40 -05:00
Gerald Carter
aa768a4a20 r25099: Commit fix for CVE-2007-4138 from 3.0.26 release. 2007-10-10 12:30:39 -05:00
Michael Adam
6c3c20e6c4 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
2007-10-10 12:30:39 -05:00
Michael Adam
9c03cdf3a4 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
2007-10-10 12:30:39 -05:00
Michael Adam
d8676f30d5 r25087: Reformatting: Get rid of an abundance of leading tabs... 2007-10-10 12:30:39 -05:00
Michael Adam
2322fe5cd7 r25086: Fix interdomain trusts (this povides the fix expected in r22709):
Fix winbindd on a Samba DC talking to a trusted domain DC by
making it use the trusted domain password...

Michael

I hope this does not brake any other setup.
2007-10-10 12:30:38 -05:00
Günther Deschner
7e4dcf8e7e r25080: Once we decrypted the packet but have timing problems (closkew, tkt not yet or
no longer valid) there is no point to bother the keytab routines.

Guenther
2007-10-10 12:30:38 -05:00
Stefan Metzmacher
6e238fe5b4 r25074: as all requests in the winbindd child are sync, we can use talloc_tos()
metze
2007-10-10 12:30:38 -05:00
Günther Deschner
9b85f7ca43 r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
LSARPC_DS pipe, continue with no_lsarpc_ds mode here as well to get
domain->initialized set to True. This avoids permanent scanning of Samba3 DCs
in winbindd. Thanks Michael, for pointing this out.

Guenther
2007-10-10 12:30:38 -05:00
Simo Sorce
f624a269bf r25064: We use BOOL/True/False not bool/true/false 2007-10-10 12:30:38 -05:00
Simo Sorce
6316a9c14d r25063: Fix segfault in smbldp_set_creds when we want to use anonymous, the
code was not passing in the "anon" flag correctly and was passing
NULL pointers.
2007-10-10 12:30:38 -05:00
Simo Sorce
1850d1c10f r25062: Reformat, remove trailing spaces and fit lines into 80 columns 2007-10-10 12:30:37 -05:00
Volker Lendecke
f2ce4a803c r25061: Pro-actively shut up Coverity :-) 2007-10-10 12:30:37 -05:00
Simo Sorce
7a4d465890 r25060: Fix formatting, remove trailing spaces and cut lines longer than 80 chars 2007-10-10 12:30:37 -05:00
Simo Sorce
17a7d33b3b r25059: Apply to 3.2 as well 2007-10-10 12:30:37 -05:00
Volker Lendecke
638c848c9a r25055: Add file_id_string_tos
This removes file_id_string_static and file_id_string_static2
2007-10-10 12:30:36 -05:00
Andrew Bartlett
87d39f61b4 r25049: Set new, more secure defaults for Samba 3.2.
Andrew Bartlett
2007-10-10 12:30:36 -05:00
Volker Lendecke
0c5657b5ef r25040: Add "net sam rights"
Not strictly in the SAM, but close enough. This command acts directly on
the local tdb, no running smbd required

This also changes the root-only check to a warning
2007-10-10 12:30:36 -05:00
Volker Lendecke
9e53f50e94 r25036: Fix a become/unbecome_root() pair 2007-10-10 12:30:36 -05:00
Lars Müller
50879e6de5 r25032: Contact an off site DC if non is available on site. 2007-10-10 12:30:36 -05:00
Lars Müller
287604a1c7 r25030: ip_srv_nonsite and count_nonsite are initialized in get_kdc_list() in any
case.
2007-10-10 12:30:36 -05:00
Volker Lendecke
858f7b7d78 r25025: Remove an unused function 2007-10-10 12:30:35 -05:00
Volker Lendecke
bc8b74dbfe r25024: Fix a whole bunch of Coverity bugs
The callers of get_domain_group_from_sid() with some justification
expected map->gid to be initialized when get_domain_group_from_sid
returned True.
2007-10-10 12:30:35 -05:00
Jeremy Allison
5ba12eefbe r25023: Coverity #455. Not actually a bug, but this clarifies
the code a lot.
Jeremy.
2007-10-10 12:30:35 -05:00
Jeremy Allison
6a237600b8 r25022: Fix coverity #395. Resource leak on error.
Jeremy.
2007-10-10 12:30:35 -05:00
Jeremy Allison
f789186086 r25021: Fix coverity #435. Use of -1.
Jeremy.
2007-10-10 12:30:35 -05:00
Jeremy Allison
82b3656b4b r25020: Fix coverity #374, possible null deref.
Jeremy.
2007-10-10 12:30:34 -05:00
Jeremy Allison
a58de8cee5 r25019: Fix coverity bug #105, run #332. Use of uninitialized variable.
Jeremy.
2007-10-10 12:30:34 -05:00
Jeremy Allison
2e0999c1df r25011: We don't use mangle_map any more.
Jeremy.
2007-10-10 12:30:33 -05:00
Jeremy Allison
dee8beba7a r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based
interface. More development will come on top of this. Remove the
"mangled map" parameter.
Jeremy.
2007-10-10 12:30:32 -05:00
Michael Adam
6026d13253 r25002: Refactor out code duplication created by the previous
unification of r24998.

Michael
2007-10-10 12:30:32 -05:00
Michael Adam
dab9ffe602 r24999: Use the new regval_compose() function in regval_ctr_addvalue().
Michael
2007-10-10 12:30:32 -05:00
Michael Adam
f4caa2d7d4 r24998: Add a function regval_compose() to compose a REGISTRY_VALUE from
input data. Use this function in a first step to refactor
the canonicalization code of smbconf_store_values().

Michael
2007-10-10 12:30:32 -05:00
Michael Adam
1ee1b75113 r24996: Eliminate more trailing spaces... 2007-10-10 12:30:32 -05:00
Volker Lendecke
613b9fcd18 r24993: Apply some const 2007-10-10 12:30:32 -05:00
Michael Adam
2e99e141c3 r24991: Kill all those lots of trailing whitespaces from secrets.c.
These red bars in vi really hurt my eyes... :-o

Michael
2007-10-10 12:30:31 -05:00
Michael Adam
b9e76a479e r24990: Kill an incredible amount of trailing whitespaces...
Further reformat get_trust_pw to conform to coding rules.

Michael
2007-10-10 12:30:31 -05:00
Derrell Lipman
e746aaaf4d r24981: - Use the formal syntax for calling functions through pointers. I've wanted
to make this change for ages, but now with the issue of "open" requiring it,
  this is the time to just do all of them.

Derrell
2007-10-10 12:30:31 -05:00
Stefan Metzmacher
18e830a935 r24978: move domain_init_recv() near the functions that uses it
metze
2007-10-10 12:30:31 -05:00
Rafal Szczesniak
3a9b5eabf9 r24977: Ensure negative caching for name2sid, sid2name and rids2names
mappings.

rafal
2007-10-10 12:30:31 -05:00
Stefan Metzmacher
ab15f5c3e7 r24974: catch SIGINT and SIGQUIT like SIGTERM
metze
2007-10-10 12:30:30 -05:00
Michael Adam
aa043bb446 r24970: Polish some comments and add my (C).
Michael
2007-10-10 12:30:30 -05:00
Simo Sorce
113d62682a r24969: Fwd port "open" patch 2007-10-10 12:30:30 -05:00
Michael Adam
5d94c3dab2 r24955: Reformat some object lists in Makefile.in to minimize the diff. 2007-10-10 12:30:30 -05:00
Günther Deschner
9df961914c r24954: Fix the build without krb5.
Guenther
2007-10-10 12:30:30 -05:00
Günther Deschner
800645d538 r24952: Set the kdc locator env vars. This makes the krb5 locator plugin fully
operational (from within winbindd and outside).

Guenther
2007-10-10 12:30:30 -05:00
Volker Lendecke
3abf06efc1 r24951: Warn if "os level" > 255
Thanks to Karolin Seeger <ks@sernet.de>
2007-10-10 12:30:29 -05:00
Volker Lendecke
df648d47ff r24949: Remove some static buffers 2007-10-10 12:30:29 -05:00
Volker Lendecke
cddb9f11d5 r24943: Some stackframes 2007-10-10 12:30:29 -05:00
Günther Deschner
62426a0555 r24920: Reformatting.
Guenther
2007-10-10 12:30:29 -05:00
Volker Lendecke
e0b4fb55e3 r24903: One more tick in #if 0 code 2007-10-10 12:30:29 -05:00
Volker Lendecke
1b39374a17 r24902: DEBUG might use talloc_tos() itself... 2007-10-10 12:30:28 -05:00
Michael Adam
f379a5c47d r24879: Activate the winbindd cache-validation message handler.
Now the winbindd cache can be checked at runtime by
calling "smbcontrol winbindd validate-cache".

For the execution of the validation code, I fork a child
and in the child restore the default SIGCHLD handler in
order for the fork/waitpid mechanism of tdb_validate to work.

Michael
2007-10-10 12:30:28 -05:00
Michael Adam
9b25355dd6 r24877: Don't panic in tdb validation code when the fork or waitpid fails.
Return error instead.

Michael
2007-10-10 12:30:28 -05:00
Derrell Lipman
1f122352b0 r24864: - Correct failure of libsmbclient against a version of Windows found on a NAS
device.  The device resets a NBT connection on port 139 when it receives a
  NetBIOS keepalive request.  That request should be supported when NetBIOS is
  in use; Windows is behaving badly.

  libsmbclient needs a way to determine if a connection is still alive, and
  was using a NetBIOS keepalive request if port 139 was in use (on the
  assumption that it was probably NBT), and getpeername() when port 139 was
  not being used (assuming naked transport).

  This patch simplifies the code by exclusively using getpeername() to check
  whether a connection is still alive.  The NetBIOS keepalive request is
  optional anyway (with preference being given to using TCP mechanisms for the
  same purpose), so this should be both simpler and more reliable.

Derrell
2007-10-10 12:30:28 -05:00
Rafal Szczesniak
86af9fedad r24853: Rename function as Jerry asked.
s/net_use_upn_machine_account/net_use_krb_machine_account/

rafal
2007-10-10 12:30:28 -05:00
Michael Adam
dc0b08e659 r24848: Make tdb_validate() take an open tdb handle instead of a file name.
A new wrapper tdb_validate_open() takes a filename an opens and closes
the tdb before and after calling tdb_validate() respectively.

winbindd_validata_cache_nobackup() now dynamically calls one of
the above functions depending on whether the cache tdb has already
been opened or not.

Michael
2007-10-10 12:30:27 -05:00
Michael Adam
cb3583b392 r24847: Change standard failure return code of tdb_validate from "-1" to "1".
(This is more safely used with casts from int to uint8, e.g.)

Michael
2007-10-10 12:30:27 -05:00
Michael Adam
f1bbf9bc18 r24845: Fix a segfault in smbcontrol when called with parameters but no extra args.
Michael
2007-10-10 12:30:27 -05:00
Michael Adam
ef92d505c0 r24843: Add a "validate-cache" control message to winbindd.
So there is a new subcommand "smbcontrol winbindd validate-cache" now.

This change provides the infrastructure:
The function currently returns "true" unconditionally.
The call of a real cache validation function will be incorporated
in subsequent changes.

Michael
2007-10-10 12:30:27 -05:00
Günther Deschner
205ef6ab3e r24842: Fix build warning.
Guenther
2007-10-10 12:30:27 -05:00
Günther Deschner
ce7c816083 r24841: The locator has no dependencies to ldap libs anymore. Also fix the build.
Guenther
2007-10-10 12:30:27 -05:00
Günther Deschner
28f9b8d98d r24838: Now for real: build the locator, if we can.
Guenther
2007-10-10 12:30:26 -05:00
Michael Adam
58d31e057b r24836: Initialize some uninitialized variables.
This prevents a segfault when get_kdc_ip_string() is called
with sitename == NULL.

Michael
2007-10-10 12:30:26 -05:00
Günther Deschner
af90c6949c r24833: Move locator to nsswitch (does not belong to libads anymore).
Guenther
2007-10-10 12:30:26 -05:00
Günther Deschner
7f42fe4e08 r24832: In the winbind-locator recursion case, try to pick up the kdc from the
environment.

Guenther
2007-10-10 12:30:26 -05:00
Michael Adam
b3dcadbed0 r24830: Add a winbindd cache validation function that does not do
backup and corrupt file handling. (To be used in subsequent
changes.)
2007-10-10 12:30:26 -05:00
Michael Adam
9062665208 r24829: Make use of a variable, that is available... :-) 2007-10-10 12:30:26 -05:00
Michael Adam
55020b07b5 r24828: Give smbcontrol an initial talloc stackframe. 2007-10-10 12:30:25 -05:00
Michael Adam
dbe38995ec r24827: Give smbstatus an initial talloc stackframe.
Rewrite main() so as to exit only at a single point
where the stack frame is freed, too.

Michael
2007-10-10 12:30:25 -05:00
Volker Lendecke
0a9171f9ef r24826: Fix two memleaks in idmap_cache.c, bug 4917
Thanks again to Patrick Rynhart for persisting :-)

Simo, please check!
2007-10-10 12:30:25 -05:00
Michael Adam
705336ee10 r24825: Give testparm an initial talloc stackframe, so it does not complain
it is leaking.
2007-10-10 12:30:25 -05:00
Michael Adam
c97600b96f r24824: Create an initial talloc stackframe for the net binary. 2007-10-10 12:30:25 -05:00
Jeremy Allison
c6c8f5a897 r24813: Reformat to 80 columns.
Jeremy.
2007-10-10 12:30:25 -05:00
Jeremy Allison
0cdf046dae r24811: Simple reformatting to fit the 80 columns rule.
Jeremy.
2007-10-10 12:30:24 -05:00
Volker Lendecke
6585ea2cb7 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
2007-10-10 12:30:24 -05:00
Jeremy Allison
229e02d732 r24808: Fix the same problem Volker noticed.
For some funny reason us4/gcc seems to fall over the '

Jeremy.
2007-10-10 12:30:23 -05:00
Günther Deschner
46dbd6034e r24807: Add WINBINDD_LOCATOR_KDC_ADDRESS env which will be used for the case when the
locator gets called from within winbindd.

Guenther
2007-10-10 12:30:23 -05:00
Günther Deschner
cd1fccaf8f r24806: Fix the build, sorry...
Guenther
2007-10-10 12:30:23 -05:00
Günther Deschner
91d10fe159 r24805: When we can build the locator, build it.
Guenther
2007-10-10 12:30:23 -05:00
Günther Deschner
f5b3de4d30 r24804: As a temporary workaround, also try to guess the server's principal in the
"not_defined_in_RFC4178@please_ignore" case to make at least LDAP SASL binds
succeed with windows server 2008.

Guenther
2007-10-10 12:30:23 -05:00
Volker Lendecke
08e309e955 r24803: For some funny reason us4/gcc seems to fall over the ' 2007-10-10 12:30:22 -05:00
Volker Lendecke
1f396cc237 r24802: Activate new tests
RAW-SAMBA3CASEINSENSITIVE and RAW-SAMBA3POSIXTIMEDLOCK
2007-10-10 12:30:22 -05:00