IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
When doing a CTDB standalone build we don't want to use dynconfig,
since this introduces a lot of unwanted complexity. To avoid this,
either:
* charset needs to be nobbled to avoid loading the case tables, since
this depends on dynconfig; or
* charset needs to be avoid completely, so some functions need to be
replaced with their ASCII counterparts.
The 2nd options seems more honest and less error-prone.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
samba-util depends on Samba-specific code. Exclude this code from
samba-util-core. When told to, via SAMBA_UTIL_CORE_ONLY, only build
samba-util-core and dependencies. When SAMBA_UTIL_CORE_ONLY is not
defined then the behaviour should be unchanged.
Standalone builds of CTDB will be done against samba-util-core to
avoid pulling in Samba-specific code.
An alternative would be to remove the Samba-dependent code from
samba-util. However, some of it is used by OpenChange.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
The include files added to xfile.h are already included
unconditionally elsewhere (replace.h, samba_util.h, ...) so Samba
can't be built without them.
To minimise dependencies, only include specific util headers instead
of samba_util.h.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc.
https://bugzilla.samba.org/show_bug.cgi?id=10831
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
These were moved in commit 8e704e4107
when util_str.c was not shared.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 19 20:34:05 CEST 2014 on sn-devel-104
This is part of an attempt to untangle charset from util.c.
Most of this was moved from util_str.c in commit
55903e6f91. next_token() was moved from
charset to util.c in commit 4be643d4ce
so that it would be alongside next_token_talloc().
Now that util_str.c is in shared lib/util it is no longer necessary to
have these in util.c.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
This function depends on genrand.c, which depends on lib/crypto. This
way the other IDR tree code can be used without lib/crypto.
While doing this, create idtree.h and idtree_random.h and clean up the
includes.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Compiling utilities with includes.h is confusing because includes.h
could come from source3, source4 or ctdb. Utilities should be
independent of such things.
Add a minimal set of fined-grained includes that attempts to avoid the
catch-all samba_util.h. A comment indicates what is used from
samba_util.h so that future clean-ups are easier.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
These:
[ 44/309] Compiling ../lib/util/charset/util_unistr_w.c
../../lib/util/charset/util_unistr_w.c: In function ‘strlower_w’:
../../lib/util/charset/util_unistr_w.c:182:127: warning: right-hand operand of comma expression has no effect [-Wunused-value]
COPY_UCS2_CHAR(s,&v);
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
This is not the nicest code and needs to be replaced. Remove it from
common.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
async_connect_send() needs this, and I don't want to pull in samba-util
just for this
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
srvstr_push_fn() now returns an NTSTATUS reporting any
string conversion failure.
We need to get serious about returning character set conversion errors
inside smbd.
Bug 10775 - smbd crashes when accessing garbage filenames
https://bugzilla.samba.org/show_bug.cgi?id=10775
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 15 20:34:56 CEST 2014 on sn-devel-104
This makes us fallback to strcasecmp early if any INVALID_CODEPOINT
appears. Without this patch we just continue to compare if both strings
happen to have an INVALID_CODEPOINT in the same spot.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
When either string has a bad conversion, we fall back to
doing raw ascii byte comparisons using strcasecmp(). This
is wrong - we should fall back to strncasecmp.
The problem is we've already stepped past the character
that failed the conversion, so we're not re-testing those
characters for comparison. This can have the effect of
causing strncasecmp_m_handle() to report that two strings
are identical when they are not, if the failed conversion
takes place at the end of the string.
The correct behavior is to step back to the point of
the string(s) that failed the conversion, and continue
the test from there.
This is a litle trickier than the previous fix, as
it requires converting the incoming n variable from
remaining characters to compare to remaining bytes to
compare.
As bytes are always the smallest character size
(1 byte) then it's safe to convert the remaining
characters to check by decrementing the source string
by the last character length (in bytes) and incrementing
the remaining bytes to scan by the same value, then
calling strncasecmp() with the stepped back strings
remaining.
Signed-off-by: Jeremy Allison <jra@samba.org>
When either string has a bad conversion, we fall back to
doing raw ascii byte comparisons using strcasecmp().
The problem is we've already stepped past the character
that failed the conversion, so we're not re-testing those
characters for comparison. This can have the effect of
causing strcasecmp_m_handle() to report that two strings
are identical when they are not, if the failed conversion
takes place at the end of the string.
The correct behavior is to step back to the point of
the string(s) that failed the conversion, and continue
the test from there.
Found by <lev@zadarastorage.com> when investigating bug
10716 - smbd constantly crashes when filename contains non-ascii character.
Given the normal character set of utf-8, and an on
disk filename of ISO-8859-1 of file-é on disk hex
value: 66 69 6c 65 2d e9, an incoming open given the
correct utf8 name of file-é will collide when it
should not.
Fixes:
Bug 10716 - smbd constantly crashes when filename contains non-ascii character
https://bugzilla.samba.org/show_bug.cgi?id=10716
Signed-off-by: Jeremy Allison <jra@samba.org>
In the future this might become a library, but even with the SUBSYSTEM
it should be clear what debug.c depends upon.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 2 00:36:50 CEST 2014 on sn-devel-104
This factors out the essential code from close_low_fds for one file
descriptor: Redirect a fd to /dev/null
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10735
CVE-2014-3560: unstrcpy macro length is invalid
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Fri Aug 1 22:10:23 CEST 2014 on sn-devel-104