summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
2011-03-30s3-includes: only include system/syslog.h when needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-winbind: remove global inclusion of libwbclient.Günther Deschner2-0/+61
Guenther
2011-03-30lib/util/util_pw: share more code between lib/util/util_pw.c and ↵Günther Deschner2-35/+1
source3/lib/username.c Guenther
2011-03-30lib/util/util_pw: share sys_get{pw,gr} group of calls.Günther Deschner3-44/+2
Guenther
2011-03-29charconv: Fix the slow-path character conversionsVolker Lendecke1-3/+3
This reverts a part of 0189087e257f. That one might have fixed the fast path, but it broke the slow path. convert_string_internal returns 0/-1 despite the size_t result type and the misleading comment. If you follow the path to smb_iconv and for example iconv_copy(), you will see that this routine returns 0 even after it copied something. How to check: Use German locale, and do an smbclient "allinfo" on a file modified in march (März in German). Notice the "ä". Before 0189087 this printed correctly, after 0189087 it cut off the fields after the M for März. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Mar 29 19:17:41 CEST 2011 on sn-devel-104
2011-03-29=?UTF-8?q?alpha=5Fstrcpy()=20is=20a=20utility=20function=20which=20reportedly:David Disseldorp1-3/+9
=20Strips=20out=20all=20but=20'a-Z0-9'=20and=20the=20character=20in=20other=5Fsafe=5Fchars=20and =20replaces=20with=20'=5F'. =20This=20statement=20does=20not=20currently=20hold=20true=20in=20all=20cases=20(e.g.=20src=20=3D =20"=D0=A2=D0=90=D0=9D=D0=A6=D0=95=D0=92=D0=90=D0=A2=D0=AC").?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
2011-03-27s3: Fix Coverity ID 590: DEADCODEVolker Lendecke1-4/+0
2011-03-25Fix bug 8040 - smbclient segfaults when a Cyrillic netbios name or workgroup ↵Jeremy Allison1-2/+23
is configured. As discovered by David Disseldorp <ddiss@suse.de>, convert_string_talloc() doesn't always return consistent results for a zero length string. The API states an incoming string must *always* contain the terminating null, but unfotunately too much code expects passing in a zero source length to return a null terminated string, so at least ensure we return a correct null string in the required character set and return the correct length. Also ensure we cannot return a zero length for a converted string (we ensure that the returned buffer is always allocated and zero terminated anyway) as calling code depends on the fact that returning true from this function will *always* return a non-zero length (as it must include the terminating null). Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Mar 25 23:25:40 CET 2011 on sn-devel-104
2011-03-25s3-netapi: fix memoryleak while not using talloc_tos() in ↵Günther Deschner2-6/+6
cli_get_session_key() usage. Thanks Volker! Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Mar 25 18:21:18 CET 2011 on sn-devel-104
2011-03-25s3-charcnv: fixed converted_size return in fast pathsAndrew Tridgell1-9/+20
2011-03-25s3-charcnv: removed unused functionAndrew Tridgell1-7/+0
lp_failed_convert_char() is not needed any more
2011-03-25lib/util/charset rename iconv_convenience to iconv_handleAndrew Bartlett1-7/+7
This better reflects what this structure is Andrew Bartlett
2011-03-25s3-charcnv: convert_string_internal() should not display errorsAndrew Tridgell1-31/+4
debug error display happens in the convert_string() outer function
2011-03-25s3-string: removed the conv_silent globalAndrew Tridgell1-29/+17
use convert_string_error() instead Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25s3-string: removed last use of conv_silentAndrew Tridgell1-31/+11
This replaces the push_ascii_nstring() implementation with a call to convert_string_error() Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25s3-charcnv Add convert_string_error()Andrew Bartlett1-18/+71
This function returns errors rather than printing them. Andrew Bartlett
2011-03-25unistr: moved some UCS2 macros into util_unistrAndrew Tridgell1-0/+9
we need to move towards eliminating smb_ucs2_t. This moves a couple of the related macros into the only file they are used in Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25s3-string: sec_len==-1 support is no longer neededAndrew Tridgell1-41/+20
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25s3-lib: make pull_ucs2_base_talloc staticAndrew Tridgell1-6/+6
it is local to charcnv.c
2011-03-25s3-string: moved fstring functions into their own fileAndrew Tridgell2-105/+131
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25s3:dbwrap_ctdb: fix non-locked fetch on persistent db's causing corruptionMichael Adam1-2/+34
When doing a non-locking fetch on a record of a persistent db when no transaction is running, the old behaviour was to fetch locally and do a ctdb call when the record was not found in the local db. The call is useless for persistent dbs anyway since they are only written to using transactions and hence kept in sync, but it is also harmful, because a ctdb call will bump the record RSN when it does actually migrate the record from one node to another. Recently, ctdb has been changed to make all calls do a migration. This uncovered the client misbehaviour for persistent dbs, because now _each_ non-locking fetch will render the persistent db inconsistent: A subsequent transaction which touches the record in question will fail because the RSNs are out of sync. This patch fixes this old bug. Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Mar 25 01:26:32 CET 2011 on sn-devel-104
2011-03-24s3-charcnv: remove unused labels.Günther Deschner1-6/+0
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Thu Mar 24 23:54:25 CET 2011 on sn-devel-104
2011-03-24s3-netapi: use cli_get_session_key() in netapi.Günther Deschner2-6/+53
Guenther
2011-03-24Fix is_myname_or_ipaddr() to be robust against strange DNS setups.Jeremy Allison1-30/+56
If IPv6 DNS names are turned on, but Samba isn't configured to listen on an IPv6 interface, then is_myname_or_ipaddr() can return false on a valid DNS name that it should detect is our own. If the IPv6 addr is returned by preference, then looking at the first addr only causes is_myname_or_ipaddr() to fail. We need to look at all the addresses returned by the DNS lookup and check all of them against our interface list. This is an order N^2 lookup, but there shouldn't be enough addresses to make this a practical problem. Jeremy.
2011-03-24charcnv: removed the allow_badcharcnv and allow_bad_conv options to ↵Andrew Tridgell5-210/+33
convert_string*() we shouldn't accept bad multi-byte strings, it just hides problems Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-23s3: Fix a shadowed declaration warningVolker Lendecke1-3/+3
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Mar 23 17:19:01 CET 2011 on sn-devel-104
2011-03-23s3: Include prctl where it is actually usedVolker Lendecke1-0/+4
2011-03-23s3: Attempt to fix the build on FreeBSDVolker Lendecke1-0/+4
2011-03-23lib/util: Merge basic string length and comparison functionsAndrew Bartlett1-292/+0
These functions now use the codepoints for more accurate string handling and now form common code. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Mar 23 08:21:54 CET 2011 on sn-devel-104
2011-03-23s3-lib prepare Samba3 to use common codepoint based string functionsAndrew Bartlett1-108/+82
This patch changes the source3 util_str.c functions so that the next patch just contains the move into common code, without code changes. Andrew Bartlett
2011-03-23s3-safe_str: Futher simplify the macros by removing indirectionAndrew Bartlett1-5/+5
Now that we don't need to pass in the function name and string, another level of indirection can be safely removed, and the operation of these macros made much clearer. Andrew Bartlett
2011-03-23s3-lib Remove the clobber_region() code.Andrew Bartlett5-197/+37
This code wrote to the full buffer in fstrcpy(), pstrcpy() and other fixed-length string manipulation functions. The hope of this code was to find out at run time if we were mixing up pstring and fstring etc, and to record where this came from. It has a runtime performance impact (particularly if compiled with --enable-developer). It is being removed because of the complexity it adds, and the distinct lack of bugs that this complexity has been credited in finding. The macro-based compile-time checking of string sizes remains. Andrew Bartlett
2011-03-23fault: get fault.c ready for use by s4Andrew Tridgell2-1/+333
this moves the s3 specific dumpcore code into source3/lib/dumpcore.c, and uses a function pointer to setup which smb_panic call to use
2011-03-23fault: moved s3 fault.c to top levelAndrew Tridgell1-381/+0
2011-03-22s3-fault: removed the cont_fn from fault_setup()Andrew Tridgell1-17/+2
cont_fn() was supposed to be a way to continue after a seg fault. It could never be called however, as smb_panic() from fault_report() could never return, as dump_core() never returns at the end of smb_panic() Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Mar 22 05:07:58 CET 2011 on sn-devel-104
2011-03-20s3: Fix early tldap_search cancelsVolker Lendecke1-1/+1
A callback of tldap_search_send might not interested in the rest of the results and could do a TALLOC_FREE of the search request. In this case, "subreq" is already free'ed. So we have to set it to pending before the callback is called. The TALLOC_FREE of the search request will set it to non-pending again via tldap_msg_destructor. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Mar 20 11:26:57 CET 2011 on sn-devel-104
2011-03-19s3: use getgrset() when it is availableChristian Ambach1-2/+57
When getgrouplist() is not defined, use getgrset() if it is defined instead of using the initgroups() + getgroups() combo Major contributions from Yannick Bergeron <yaberger@ca.ibm.com> Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sat Mar 19 10:09:38 CET 2011 on sn-devel-104
2011-03-19s3-build: use HAVE_ADS define in some more places.Günther Deschner1-1/+1
Guenther
2011-03-17s3-username: rename static getpwnam_alloc to getpwnam_alloc_cached.Günther Deschner1-5/+5
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Thu Mar 17 00:32:40 CET 2011 on sn-devel-104
2011-03-16s3-build: only include asn1 headers where actually needed.Günther Deschner2-0/+2
Guenther
2011-03-16s3: Fix Coverity ID 2231, REVERSE_INULLVolker Lendecke1-2/+3
No point in checking for !ctx after dereferencing it Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Mar 16 22:51:52 CET 2011 on sn-devel-104
2011-03-16s3-packet: only include packet.h where needed.Günther Deschner2-0/+2
Guenther
2011-03-16s3-interfaces: only include interfaces.h where needed.Günther Deschner4-0/+4
Guenther
2011-03-16s3-build: stop including ldap and lber headers everywhere in the code.Günther Deschner1-0/+1
Instead use new header smb_ldap.h where all LDAP API related things are handled, while smbldap.h only deals with our smbldap_X() API. Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Mar 16 10:54:51 CET 2011 on sn-devel-104
2011-03-16s3: Use jenkins hash for str_checksum, fix bug 8010Volker Lendecke1-11/+2
From the bugreport: I have a folder with ~90 photos: IMG_XXXX.JPG where XXXX is a four digit number, almost consecutive (photos from camera for one day). Current implementation gives about 30 different checksums for this set of files. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Mar 16 01:15:41 CET 2011 on sn-devel-104
2011-03-15s3: Remove some unused codeVolker Lendecke1-41/+0
2011-03-15s3: "hex_encode" does the same as "binary_string"Volker Lendecke1-1/+1
2011-03-14Fix bug #8005 - smbtorture4 BASE-TCONDEV fails when tested on SambaJeremy Allison1-2/+6
When pulling non-aligned ucs2 strings, we neglected to add in the pad byte to the buffer length we've eaten. This caused the device string in TCONX (which seems to be one of the few places that uses non-aligned ucs2 strings) to be incorrectly read. Volker please check. Jeremy.
2011-03-14s3: Change tldap_entry_attributes to the "array,count" conventionVolker Lendecke2-3/+4
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Mar 14 22:02:35 CET 2011 on sn-devel-104
2011-03-10Quite some callers of sid_split_rid do not care about the ridVolker Lendecke1-2/+1