1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

93802 Commits

Author SHA1 Message Date
Jose A. Rivera
9a9e56943d passdb: Patch memory leak in pdb_ldap.c
Moved the call to the talloc autofree function to as early a point as
possible. init_ldap_from_sam() already calls smbldap_set_mod(), and there's
a chance that the init will fail after having already allocated memory for
&mods.

Coverity-Id: 1167997
Change-Id: Ic26bfb3c530f90aa885e447b8409deba49708d64
Reviewed-by: Ira Cooper	<ira@samba.org>
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
2014-02-21 16:55:47 -05:00
Andreas Schneider
293aac0508 testprogs: Fix pkinit test with system ldb.
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Feb 21 17:58:24 CET 2014 on sn-devel-104
2014-02-21 17:58:24 +01:00
Andreas Schneider
069015bee9 testprogs: Fix kinit test with system ldb.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2014-02-21 15:59:28 +01:00
Andreas Schneider
f26db53273 nsswitch: Fix idmap rfc2307 test with system ldb.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2014-02-21 15:59:28 +01:00
Andreas Schneider
153dfc514c selftest: Use the absolute path to the ldb modules.
This fixes 'make test' on Fedora with external ldb.

Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2014-02-21 15:59:28 +01:00
Santosh Kumar Pradhan
d871a31e61 heimdal: Use krb5_free_default_realm() for free()
The resource allocated by krb5_default_default_realm() should be
free()'d by krb5_free_default_realm() instead of plain free()
for better readability.

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-21 15:59:28 +01:00
Santosh Kumar Pradhan
58e7e564d7 kdc: Free the resource which is not used anymore
In samba_kdc_firstkey() routine, krb5_get_default_realm() allocates
memory for "realm" but never used afterwards. Free() the leaked memory.

CID: 1107223

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-21 15:59:28 +01:00
Gregor Beck
66fb0ce955 s3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()
As a domain member we should always use a DC of our own domain.

It would be possible to pass all sids in one single dcerpc_wbint_LookupSids()
call. For now we just fix bug.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-21 15:59:28 +01:00
Gregor Beck
3413e64149 s3:winbindd: fix _wbint_LookupSids() on error
We need to make sure that r->out.domains remains valid,
otherwise we're not able to marshall the response.

Note that wbint_LookupSids() has [out,ref] lsa_RefDomainList *domains,
while lsa_LookupSids() has [out,ref] lsa_RefDomainList **domains.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-21 15:59:28 +01:00
Stefan Metzmacher
33f10d06ba s3:smbd: avoid invalid lock_order panic triggered by "CTDB_SRVID_RELEASE_IP"
If smbd_server_connection_terminate("CTDB_SRVID_RELEASE_IP") is triggered from
within ctdbd_migrate(), we got a smb_panic complaining about invalid
lock_order, as ctdbd_migrate is called from dbwrap_fetch_locked().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10444
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 21 14:51:51 CET 2014 on sn-devel-104
2014-02-21 14:51:51 +01:00
Stefan Metzmacher
9677fae6aa s3:lib/ctdbd_conn: let release_ip_handler return bool
If it returns true the passed ip address matched and we
let a nested ctdb operation fail with NT_STATUS_ADDRESS_CLOSED.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-02-21 12:48:31 +01:00
Stefan Metzmacher
52ccb40d59 s3:smbd: maintain smbd_server_connection->status
If this isn't NT_STATUS_OK, we skip any io on the socket.

This avoids possible problems during shutdown.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-02-21 11:48:12 +01:00
Stefan Metzmacher
58c71bee40 s3:smbd: simplify exit_server_common()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-02-21 11:47:18 +01:00
David Disseldorp
913b2a172d clitar: don't panic, propagate talloc errors upwards
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb 21 02:49:36 CET 2014 on sn-devel-104
2014-02-21 02:49:35 +01:00
David Disseldorp
83a653fadb clitar: propagate make_remote_path() talloc errors
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:03:02 +13:00
David Disseldorp
55de6d60ef clitar: return allocation errors from is_subpath()
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:02:57 +13:00
David Disseldorp
852259773b clitar: add error return to tar_path_in_list()
In preparation for propagation of memory allocation errors from
is_subpath().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:02:52 +13:00
David Disseldorp
6d5b56dc7a clitar: add error return to tar_extract_skip_path()
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:02:48 +13:00
David Disseldorp
4d9e1b68b7 clitar: add error return to tar_create_skip_path()
In preparation for propagation of memory allocation errors from
tar_path_in_list() and friends.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:02:43 +13:00
David Disseldorp
385f0c9ea0 clitar: check for path_base_name() allocation errors
Add a separate NTSTATUS return code, as base string may be NULL on
successful return.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-02-21 12:02:43 +13:00
Volker Lendecke
72696c3f5a lib: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 20 22:58:59 CET 2014 on sn-devel-104
2014-02-20 22:58:58 +01:00
Volker Lendecke
eb4b319a8e messaging: Fix a memleak on error in messaging_tdb_init
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2014-02-20 11:43:08 -08:00
Volker Lendecke
69300c034f lib: Avoid a strlen call in xx_path()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2014-02-20 11:43:08 -08:00
Volker Lendecke
efed82cb69 krb5_locator: Slightly simplify code
This makes it a bit easier to read for me

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2014-02-20 11:43:08 -08:00
Santosh Kumar Pradhan
30cd122beb winbindd: Avoid using deallocated memory
Failure in ads_search_retry() deallocates the memory occupied
by "ads" which should not be used after.

CID: 242096

Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2014-02-20 11:41:51 -08:00
Volker Lendecke
bd55fdbf09 messaging: Enforce just one messaging context
The current messaging implementation is based on a tdb indexed by server_id. If
we have more than one messaging context in a process, messages might not arrive
at the right context and be dropped, depending on which signal handler is
triggered first.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-19 16:38:30 -08:00
Volker Lendecke
fb35d17e43 vfstext: Use just one messaging_context in vfstest
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-19 16:38:30 -08:00
Volker Lendecke
a93aaec77e spoolssd: Use only one messaging_context per process
After the fork, the code created a fresh messaging_context before doing the
reinit_after_fork. This means to have two initialized messaging contexts in
that process. This patch aligns spoolssd with lsad.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-19 16:38:30 -08:00
Christian Ambach
8f0d06fa5e heimdal_build: only enable libintl functions if everything was found
do not rely on intl.h being available but also on the functions being usable
This should fix the build on HP-UX

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
Signed-off-by: Christian Ambach <ambi@samba.org>

Change-Id: I5dd88d2d5216b778624778455cca99b32d0be58f
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 20 01:28:24 CET 2014 on sn-devel-104
2014-02-20 01:28:24 +01:00
Garming Sam
0c8e9cc757 param: add const to a local variable to prevent a warning about lp_fstype
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Idc9217eb812b018fed933f84c2c4f1818f8f9372
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:28 +13:00
Garming Sam
8246e53bb6 param: remove lp_dnsdomain from s3
With the use of the shared globals structure, lp_dnsdomain is no longer used in the code and removing it would remove a notable special case

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I59526c40c58e132a134d67fa7944dfeacd05f4c6
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:24 +13:00
Garming Sam
a7d2f9a08e param: change s3_param.h from a generated file to a static one
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I131e37ec92f7a826caec382023915c5e4b4c52be
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:20 +13:00
Garming Sam
0941789063 param: remove generated loadparm ctx table file and include it directly
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I5f1d42e3ae6495accf7a711938cc28c03ab2cd62
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:17 +13:00
Garming Sam
9780113846 param: use loadparm_globals struct instead of lp function pointers in s3_helpers
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I4507cdbf111b7f9dca3ca18ee2bf242ffdfeb4e7
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:13 +13:00
Garming Sam
12aa85a90c lib/param: rename lp_string to lpcfg_string
This avoids the confusion with lp_string in source3.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Ic6df23b9e5986f7d1fd6253e30ebfdc1a3a45a41
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:09 +13:00
Garming Sam
1fb1f6bc0d lib/param: handle non-constant strings properly by passing in a memory context
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Ic6bb1c709defd2b0f35fc7b877da0badca385776
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:06 +13:00
Garming Sam
bce62e6000 s4: pass down a memory context when performing share_string_option, to allow substitutions
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I24b36db3ac11834c3268b2da929e214c10268b16
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:00 +13:00
David Disseldorp
497f0327a0 build: check for libarchive version via pkgconfig
The previous libarchive linker and header file check was not suitible
for older libarchive versions that do not provide the function
archive_read_support_filter_all().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Feb 19 20:19:07 CET 2014 on sn-devel-104
2014-02-19 20:19:07 +01:00
David Disseldorp
43227c3d9f cli: do not dump libarchive absence warning on startup
tar_parse_args() already prints the warning if a tarmode argument is
provided.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-19 18:22:31 +01:00
Andreas Schneider
6759008666 s3-clitar: Fix identation.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
995118484f s3-clitar: Simplify is_subpath().
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
3b207dc0f3 s3-clitar: Improve readabilty of fix_unix_path().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
ef150e7dfa s3-clitar: Improve readabilty of max_token().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
4f6552c63b s3-clitar: Improve readabilty of make_remote_path().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
98ede411e3 s3-clitar: Improve readabilty of tar_path_in_list().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
2ccba45d30 s3-clitar: Improve readabilty of tar_read_inclusion_file().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
f955bc4b5d s3-clitar: Improve readabilty of tar_set_newer_than().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
75dbb27115 s3-clitar: Improve readabilty of tar_send_file().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
f58ef3878e s3-clitar: Improve readabilty of tar_extract().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00
Andreas Schneider
f8ac29d1ac s3-clitar: Improve readabilty of get_file_callback().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-19 18:22:30 +01:00