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

5377 Commits

Author SHA1 Message Date
Andrew Tridgell
0189087e25 s3-charcnv: fixed converted_size return in fast paths 2011-03-25 04:37:06 +01:00
Andrew Tridgell
f08ec2296e s3-charcnv: removed unused function
lp_failed_convert_char() is not needed any more
2011-03-25 04:37:06 +01:00
Andrew Bartlett
b5616adc8a lib/util/charset rename iconv_convenience to iconv_handle
This better reflects what this structure is

Andrew Bartlett
2011-03-25 04:37:06 +01:00
Andrew Tridgell
7824111d07 s3-charcnv: convert_string_internal() should not display errors
debug error display happens in the convert_string() outer function
2011-03-25 04:37:06 +01:00
Andrew Tridgell
d85dbfb3db s3-string: removed the conv_silent global
use convert_string_error() instead

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
232fb016a1 s3-string: removed last use of conv_silent
This replaces the push_ascii_nstring() implementation with a call to
convert_string_error()

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Bartlett
64258a300f s3-charcnv Add convert_string_error()
This function returns errors rather than printing them.

Andrew Bartlett
2011-03-25 04:37:06 +01:00
Andrew Tridgell
aaae4123b9 unistr: moved some UCS2 macros into util_unistr
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-25 04:37:06 +01:00
Andrew Tridgell
5ed2039e1e s3-string: sec_len==-1 support is no longer needed
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
3ceb353939 s3-lib: make pull_ucs2_base_talloc static
it is local to charcnv.c
2011-03-25 04:37:06 +01:00
Andrew Tridgell
f705fc9002 s3-string: moved fstring functions into their own file
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Michael Adam
8812148e24 s3:dbwrap_ctdb: fix non-locked fetch on persistent db's causing corruption
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-25 01:26:32 +01:00
Günther Deschner
68529bc14e s3-charcnv: remove unused labels.
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-24 23:54:25 +01:00
Günther Deschner
63bb64d531 s3-netapi: use cli_get_session_key() in netapi.
Guenther
2011-03-24 23:08:22 +01:00
Jeremy Allison
5176a0b2af Fix is_myname_or_ipaddr() to be robust against strange DNS setups.
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-24 13:07:36 -07:00
Andrew Tridgell
15e84a9a09 charcnv: removed the allow_badcharcnv and allow_bad_conv options to 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-24 01:47:26 +01:00
Volker Lendecke
177df3c25b s3: Fix a shadowed declaration warning
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 23 17:19:01 CET 2011 on sn-devel-104
2011-03-23 17:19:01 +01:00
Volker Lendecke
67fa593ade s3: Include prctl where it is actually used 2011-03-23 16:30:28 +01:00
Volker Lendecke
da8d36ce96 s3: Attempt to fix the build on FreeBSD 2011-03-23 16:30:27 +01:00
Andrew Bartlett
41051fd3d3 lib/util: Merge basic string length and comparison functions
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-23 08:21:54 +01:00
Andrew Bartlett
89fd1cb767 s3-lib prepare Samba3 to use common codepoint based string functions
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-23 17:32:44 +11:00
Andrew Bartlett
1d22c3919d s3-safe_str: Futher simplify the macros by removing indirection
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-23 12:49:39 +11:00
Andrew Bartlett
1923b78209 s3-lib Remove the clobber_region() code.
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-23 12:49:39 +11:00
Andrew Tridgell
580997ede0 fault: get fault.c ready for use by s4
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-23 11:03:57 +11:00
Andrew Tridgell
058c3bb923 fault: moved s3 fault.c to top level 2011-03-23 11:03:57 +11:00
Andrew Tridgell
c8297073db s3-fault: removed the cont_fn from fault_setup()
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-22 05:07:58 +01:00
Volker Lendecke
4828feddb7 s3: Fix early tldap_search cancels
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-20 11:26:57 +01:00
Christian Ambach
ed46dfc4f1 s3: use getgrset() when it is available
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-19 10:09:38 +01:00
Günther Deschner
c53e7f8d58 s3-build: use HAVE_ADS define in some more places.
Guenther
2011-03-19 00:11:18 +01:00
Günther Deschner
1d516f0d76 s3-username: rename static getpwnam_alloc to getpwnam_alloc_cached.
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-17 00:32:40 +01:00
Günther Deschner
3aa9d3005a s3-build: only include asn1 headers where actually needed.
Guenther
2011-03-16 23:46:18 +01:00
Volker Lendecke
ab37eae79c s3: Fix Coverity ID 2231, REVERSE_INULL
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-16 22:51:52 +01:00
Günther Deschner
9f9e195124 s3-packet: only include packet.h where needed.
Guenther
2011-03-16 16:56:47 +01:00
Günther Deschner
1f6aecb5cf s3-interfaces: only include interfaces.h where needed.
Guenther
2011-03-16 16:56:46 +01:00
Günther Deschner
fad0112373 s3-build: stop including ldap and lber headers everywhere in the code.
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-16 10:54:50 +01:00
Volker Lendecke
831ff4519e s3: Use jenkins hash for str_checksum, fix bug 8010
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-16 01:15:41 +01:00
Volker Lendecke
b0667f7fda s3: Remove some unused code 2011-03-15 09:15:36 +01:00
Volker Lendecke
a4d7b3a1df s3: "hex_encode" does the same as "binary_string" 2011-03-15 09:15:35 +01:00
Jeremy Allison
e59a950c04 Fix bug #8005 - smbtorture4 BASE-TCONDEV fails when tested on Samba
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-14 16:12:31 -07:00
Volker Lendecke
8dfa224c13 s3: Change tldap_entry_attributes to the "array,count" convention
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Mar 14 22:02:35 CET 2011 on sn-devel-104
2011-03-14 22:02:35 +01:00
Volker Lendecke
16b007c223 Quite some callers of sid_split_rid do not care about the rid 2011-03-10 18:48:34 +01:00
Andreas Schneider
b181cd8465 s3-smbd: Increase debug level von context messages. 2011-03-09 09:28:42 +01:00
Volker Lendecke
7b139a49dc s3: Use dom_sid_string_buf in sid_to_fstring
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar  3 22:56:57 CET 2011 on sn-devel-104
2011-03-03 22:56:56 +01:00
Günther Deschner
93db9489fd s3-libds: use already existing ../libds/common/flag_mapping.h header.
Guenther
2011-03-02 22:17:17 +01:00
Michael Adam
d9945e9369 s3:idmap_cache: remove an leftover wip comment
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Mar  2 14:55:20 CET 2011 on sn-devel-104
2011-03-02 14:55:20 +01:00
Gregor Beck
8aa69c1f81 s3: adjust loglevel for idmap_cache
Signed-off-by: Michael Adam <obnox@samba.org>
2011-03-02 14:10:22 +01:00
Günther Deschner
ea29261186 s3-sessionid: avoid global include of sessionid.h
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar  2 12:58:12 CET 2011 on sn-devel-104
2011-03-02 12:58:12 +01:00
Günther Deschner
8643683dd8 s3-server_id: only include server_id where needed.
Guenther
2011-03-02 12:12:31 +01:00
Andrew Bartlett
5f5ca913b7 lib/util: new merged debug system
This is the s3 debug system, with a number of changes to tidy it up
for common use.  The debug class system is simplified by the removal of the
ISSET table, the system no longer attempts to cope with assignment of
DEBUGLEVEL, and the full class table is always available (rather than
just DEBUGLEVEL_CLASS[DBCG_ALL]) from startup.  It is also no longer
confusingly described as a hack, but as the initial table.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Mar  1 04:32:12 CET 2011 on sn-devel-104
2011-03-01 04:32:12 +01:00
Andrew Bartlett
ec1009f7a0 s3-debug Always use C99 true/false rather than True and False
This will help with the merge into the common code.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Mar  1 02:58:55 CET 2011 on sn-devel-104
2011-03-01 02:58:55 +01:00