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

211 Commits

Author SHA1 Message Date
Jeremy Allison
261c004d7b r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,
but I've no option.
Jeremy.
(This used to be commit c3a565081d)
2007-10-10 12:19:01 -05:00
Jeremy Allison
a179d2f495 r20208: Change sprintf_append() never to use malloc,
but always use a talloc context.
Thanks to simo for pointing this out.
Jeremy.
(This used to be commit 437cb7c888)
2007-10-10 12:16:32 -05:00
Jeremy Allison
63609fbb04 r20090: Fix a class of bugs found by James Peach. Ensure
we never mix malloc and talloc'ed contexts in the
add_XX_to_array() and add_XX_to_array_unique()
calls. Ensure that these calls always return
False on out of memory, True otherwise and always
check them. Ensure that the relevent parts of
the conn struct and the nt_user_tokens are
TALLOC_DESTROYED not SAFE_FREE'd.
James - this should fix your crash bug in both
branches.
Jeremy.
(This used to be commit 0ffca7559e)
2007-10-10 12:16:24 -05:00
Volker Lendecke
30db93664c r19786: My last checkin to winreg_StringBuf killed rpccli_winreg_EnumKeys against
W2k3. The server requires that size==0 in the [in] name. Somehow I get the
feeling that something is badly wrong here....

I did not yet recreate the gen_ndr equivalent, see next mail.

Volker
(This used to be commit 016ddce120)
2007-10-10 12:15:55 -05:00
Jeremy Allison
f18c9365ca r18787: Fix the strlen_m and strlen_m_term code by merging
in (and using elsewhere) next_codepoint from Samba4.
Jerry please test.
Jeremy.
(This used to be commit ece00b70a4)
2007-10-10 12:00:57 -05:00
Stefan Metzmacher
ac76c1804c r18652: libreplace has replacements for strndup and strnlen
metze
(This used to be commit 9f3599a7ca)
2007-10-10 11:52:19 -05:00
Jeremy Allison
767820e462 r17866: Fix possible null deref - found by Stanford checker.
Jeremy.
(This used to be commit 84e8cc0593)
2007-10-10 11:38:55 -05:00
Jeremy Allison
fb0ed72caa r17862: Fix possible NULL deref (like rev 17861) found by the
Stanford group.
Jeremy.
(This used to be commit cfd39c2804)
2007-10-10 11:38:54 -05:00
Volker Lendecke
e23781b3b3 r17316: More C++ warnings -- 456 left
(This used to be commit 1e4ee728df)
2007-10-10 11:38:25 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
35a57320f8 r16595: Klocwork #2067. Fix possible memleak on error exit.
Jeremy.
(This used to be commit 1d21a3dec9)
2007-10-10 11:19:02 -05:00
Jeremy Allison
b000e8f083 r16554: Sorry, just had to change this. Don't use int when
you're passing a BOOL parameter, don't use "clever"
code in while statement - make things easier and
clearer to understand when triggering something
with an if.
Jeremy.
(This used to be commit b1fc2d8b99)
2007-10-10 11:19:00 -05:00
Derrell Lipman
9220a7bb7b r16552: Fix bug 3849.
Added a next_token_no_ltrim() function which does not strip leading separator
characters.  The new function is used only where really necessary, even though
it could reasonably be used in many more places, to avoid superfluous code
changes.

Derrell
(This used to be commit d90061aa93)
2007-10-10 11:19:00 -05:00
Jeremy Allison
0c88eedbeb r16375: Klocwork #1670.
Jeremy.
(This used to be commit 99605ce296)
2007-10-10 11:18:50 -05:00
Günther Deschner
34e810076d r15305: Let winbind search by sid directly (or in windows terms: "bind to a
sid"); works in all AD versions I tested. Also add "net ads sid" search
tool.

Guenther
(This used to be commit 5557ada694)
2007-10-10 11:16:33 -05:00
Gerald Carter
bbf666e447 r15003: patch based on code from Arkady Glabek <aglabek@centeris.com> to ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms)
(This used to be commit 1e0b79e591)
2007-10-10 11:15:55 -05:00
Jeremy Allison
71272fc441 r13975: Re-fix Coverity #156 - I had left the hidden arg. inconsistent
between Realloc and realloc_array.
Jeremy.
(This used to be commit 841c9b1847)
2007-10-10 11:11:02 -05:00
Jeremy Allison
894358a8f3 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Günther Deschner
cab298856a r13622: Allow to rename machine accounts in a Samba Domain. This still uses the
"rename user script" to do the rename of the posix machine account (this
might be changed later). Fixes #2331.

Guenther
(This used to be commit b2eac2e6eb)
2007-10-10 11:10:19 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Gerald Carter
ef3f2c9675 r13393: Do not initialize the lp_svcctl_list() value since it is handled
internally in services_db.c now.  This prevents internal services from
being listed twice (one internal and one external) when no
'svcctl list' parameter is explcitly set in smb.conf
(This used to be commit 6c4ede6cee)
2007-10-10 11:09:58 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Jeremy Allison
5a4881bf39 r12522: Try and fix bug #2926 by removing setlocale(LC_ALL, "C")
and replace calls to isupper/islower/toupper/tolower with
ASCII equivalents (mapping into _w variants).
Jeremy.
(This used to be commit c2752347eb)
2007-10-10 11:05:58 -05:00
Volker Lendecke
28fb5b6f97 r12313: Introduce yet another copy of the string_sub function:
talloc_string_sub. Someone with time on his hands could convert all the
callers of all_string_sub to this.

realloc_string_sub is *only* called from within substitute.c, it could be
moved there I think.

Volker
(This used to be commit be6c9012da)
2007-10-10 11:05:53 -05:00
Jeremy Allison
e04754b295 r9282: Whitespace.
Jeremy.
(This used to be commit 183a470511)
2007-10-10 11:00:31 -05:00
Jeremy Allison
e4edd95275 r9271: Fix problems with german umlauts - strcmp_w was broken (needs to always re-call macro
on termination). Fix all other cases where this was also occurring.
Jeremy.
(This used to be commit 816e2fbb39)
2007-10-10 11:00:29 -05:00
Volker Lendecke
a389bf7ae5 r9201: Ouch.... :-(
(This used to be commit c78760d71e)
2007-10-10 11:00:28 -05:00
Volker Lendecke
db8c38340b r9198: Convert hex_encode and strhex_to_data_blob to take a talloc context.
Volker
(This used to be commit c7d10e2c83)
2007-10-10 11:00:27 -05:00
Günther Deschner
0b98400cc0 r8686: Revert %LOGONSERVER%-substitution. The substition is done on the client,
not on the server.

We now preserve this windows variable (important for vampired setups)
and correctly substitute only the "%L"s in strings like:

        "%LOGONSERVER% %L %lOgOnSeRvEr% %L".

Guenther
(This used to be commit dccf777f42)
2007-10-10 11:00:15 -05:00
Gerald Carter
eb1123e500 r8506: BUG 2853: don't strip out characters like '$' from printer names
when substituting for the lpq command.
(This used to be commit 2f5de718a9)
2007-10-10 11:00:07 -05:00
Jim McDonough
e0ffbfc558 r8189: commit vampire ldif patch, mostly from Don Watson (dwatson@us.ibm.com). Yes,
that's my copyright...that's just how we have to do things at big blue.

Adds subcommand to vampire to allow data to be put into an ldif file instead
of actually writing to the passdb.  See "net rpc help vampire" for usage
info.  This should be added to docs as well.
(This used to be commit cb5634a305)
2007-10-10 10:58:18 -05:00
Gerald Carter
fed660877c r7415: * big change -- volker's new async winbindd from trunk
(This used to be commit a0ac9a8ffd)
2007-10-10 10:57:08 -05:00
Gerald Carter
f24d88cf9d r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1
(This used to be commit 9727d05241)
2007-10-10 10:57:02 -05:00
Derrell Lipman
9840db418b r6149: Fixes bugs #2498 and 2484.
1. using smbc_getxattr() et al, one may now request all access control
   entities in the ACL without getting all other NT attributes.
2. added the ability to exclude specified attributes from the result set
   provided by smbc_getxattr() et al, when requesting all attributes,
   all NT attributes, or all DOS attributes.
3. eliminated all compiler warnings, including when --enable-developer
   compiler flags are in use.  removed -Wcast-qual flag from list, as that
   is specifically to force warnings in the case of casting away qualifiers.

Note: In the process of eliminating compiler warnings, a few nasties were
      discovered.  In the file libads/sasl.c, PRIVATE kerberos interfaces
      are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED
      kerberos interfaces are being used.  Someone who knows kerberos
      should look at these and determine if there is an alternate method
      of accomplishing the task.
(This used to be commit 994694f7f2)
2007-10-10 10:56:24 -05:00
Gerald Carter
5d1cb8e79e r6014: rather large change set....
pulling back all recent rpc changes from trunk into
3.0.  I've tested a compile and so don't think I've missed
any files.  But if so, just mail me and I'll clean backup
in a couple of hours.

Changes include \winreg, \eventlog, \svcctl, and
general parse_misc.c updates.

I am planning on bracketing the event code with an
#ifdef ENABLE_EVENTLOG until I finish merging Marcin's
changes (very soon).
(This used to be commit 4e0ac63c36)
2007-10-10 10:56:15 -05:00
Gerald Carter
93e04e941e r5961: final round of compiler warning fixes based on feedback from Jason Mader
(This used to be commit 9e77da9320)
2007-10-10 10:56:13 -05:00
Gerald Carter
73d1950c01 r5956: more compile warngin fixes from the Mr. Mader
(This used to be commit f3f315b14d)
2007-10-10 10:56:11 -05:00
Günther Deschner
7c198517da r5954: Fix some compiler warnings and add missing exclude-block in "net rpc
share migrate" (found by Lars Mueller <lmuelle@suse.de>).

Guenther
(This used to be commit 45a2a7bedb)
2007-10-10 10:56:11 -05:00
Gerald Carter
0d57995304 r5953: more compiler cleanups; moved SID_LIST from smb.h to privileges.c to cleanup the name space
(This used to be commit 7dfafa712d)
2007-10-10 10:56:11 -05:00
Gerald Carter
6fd5918b06 r5158: BUG 2263: patch from Timur Bakeyev <timur@com.bat.ru> to guard base64_encode_data_blob() against empty blobs
(This used to be commit 17239d609f)
2007-10-10 10:55:30 -05:00
Jeremy Allison
8ac31b5034 r5066: A couple of small fixes from James Peach @ SGI.
Jeremy.
(This used to be commit 9d131e9419)
2007-10-10 10:55:13 -05:00
Gerald Carter
ff90927478 r4746: add server support for lsa_enum_acct_rights(); last checkin for the night
(This used to be commit ccdff4a998)
2007-10-10 10:53:54 -05:00
Jeremy Allison
44bac2bf7b r4334: Fix for bugid #2186 - from Buck Huppmann <buckh@pobox.com>
to prevent uninitialized creds being freed.
Jeremy.
(This used to be commit c3f9c81a8f)
2007-10-10 10:53:44 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
bd5a0ed2f6 r2605: Fix stupid typo in back-port of Samba4 fix.
Jeremy.
(This used to be commit ca9516520f)
2007-10-10 10:52:47 -05:00
Jeremy Allison
b2cd6300d7 r2578: Pick up optimisation from Samba4 - thanks tridge !
- I recently found out that charaters below 0x3F are guaranteed not to
  occur as secondary bytes in any multi-byte character set. This
  allows for a very simple optimisation in strchr_m() and
  strrchr_m(). It might be a good idea to pick this up for Samba3.
Jeremy.
(This used to be commit 0465e2d23d)
2007-10-10 10:52:47 -05:00
Jeremy Allison
3ef0710fa4 r2361: Fix the appalling toktocliplist() fn. Bug found by Luis Benvenutto.
Jeremy.
(This used to be commit d434d8e2b4)
2007-10-10 10:52:40 -05:00
Jeremy Allison
c5b11b56aa r2175: Fix for #1546 from fumiya@samba.gr.jp. Preserve errno in MB strupper_m/strlower_m.
Jeremy.
(This used to be commit 615aa6e914)
2007-10-10 10:52:34 -05:00
Jeremy Allison
58a1460330 r2111: Fix memleak with valid names.
Jeremy.
(This used to be commit 3f0707132a)
2007-10-10 10:52:31 -05:00
Simo Sorce
804cfb20a0 r2070: Let's try to overload srnlen and strndup for AIX where they are natly broken.
(This used to be commit 98feb3318f)
2007-10-10 10:52:29 -05:00
Gerald Carter
0c6d7f28d6 r1570: merging changes from 3.0.5
(This used to be commit 430cf63b91)
2007-10-10 10:52:15 -05:00
Gerald Carter
7e6734a0dd r1087: BUG 1221: revert old change that used single and double quotes as delimters in next_token(), and change print_parameter() to print out parm values surrounded by double quotes (instead of single quotes)
(This used to be commit b0739b073a)
2007-10-10 10:51:54 -05:00
Jeremy Allison
e0da56a848 r570: Remove lots of globals to handle case issues - move them
to connection struct entries (as they should have been from
the start). Jerry, once you've cut over to 3.0.4 release
branch I'll add this to 3.0 also.
- Jerry cut over :-).
Jeremy.
(This used to be commit 578a508509)
2007-10-10 10:51:30 -05:00
Gerald Carter
7af3777ab3 r116: volker's patch for local group and group nesting
(This used to be commit b393469d95)
2007-10-10 10:51:10 -05:00
Andrew Bartlett
82285f2e0e r104: Fix ntlm_auth by adding the new strhex_to_data_blob() call.
Andrew Bartlett
(This used to be commit 0693b9e79f)
2007-10-10 10:51:09 -05:00
Jeremy Allison
6b9dbbcd24 Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com (MORIYAMA Masayuki).
Don't use nstrings to hold workgroup and netbios names. The problem with them is that MB netbios
and workgroup names in unix charset (particularly utf8) may be up to 3x bigger than the name
when represented in dos charset (ie. cp932). So go back to using fstrings for these but
translate into nstrings (ie. 16 byte length values) for transport on the wire.
Jeremy.
(This used to be commit b4ea493599)
2004-03-13 02:16:21 +00:00
Andrew Bartlett
32665c36c8 Given how core this code is, I figure it should have it's own testsuite.
Big thanks to tpot and mbp for showing how easy it can be to write a simple
unit test, and for providing the STF.

This also changes the strstr_m() code to use strstr_w() (avoiding
duplication) and fixes it so that it passes the STF.

(We now always restart before doing the unicode run, until sombody can
show me why the testsuite is wrong).

Andrew Bartlett
(This used to be commit a893a324f3)
2004-03-09 11:15:44 +00:00
Andrew Bartlett
151faf6935 JRA's recent strstr_m work really badly broke our string_sub code.
For example:

strstr_m("%v foo bar", "%v") would fail...

only strstr_m("foo %v", "%v") could work.

I wonder what else this broke...

Fix is to move to using strncmp() inside the strstr_m function.

Tested on ASCII only.

Andrew Bartlett
(This used to be commit 44d304f84c)
2004-03-09 09:56:33 +00:00
Jeremy Allison
c9b7cbbfa5 Added strstr_m() function. Use in all places where we might run into mb
(should fix the mb service name problem, can't remember the bugid).
Jeremy.
(This used to be commit 94a272b9a8)
2004-03-09 00:17:14 +00:00
Jeremy Allison
142ef0e829 Missed SAFE_FREE (typo).
Jeremy.
(This used to be commit ac1d03c05b)
2004-02-13 22:34:29 +00:00
Jeremy Allison
e3d755c5b2 Added Andrew Bartlett's patch to use an allocated buffer for count_chars.
Jeremy.
(This used to be commit cdbeb7d2eb)
2004-02-13 22:06:25 +00:00
Jeremy Allison
da371e74bb Fix final valgrind errors with #830. Catch mb conversion error that may not
terminate correctly.
Jeremy.
(This used to be commit 49142c6352)
2004-02-04 20:28:51 +00:00
Volker Lendecke
aa7a675025 Fix decoding of base64. We got the length wrong when the result was not
an exact multiple of 3.

I also wrote a torture test and it survived some minutes of random stuff
coded/decoded up to 16 MB data. But that would be a bit too embarassing to
commit... :-)

Volker
(This used to be commit 6d22f0d8c3)
2004-01-23 12:04:07 +00:00
Jeremy Allison
e82bfa5cf6 Fix for bug #922. Fast path not called for strlower_m() and strupper_m().
From ab@samba.org (Alexander Bokovoy).
Jeremy.
(This used to be commit fac9e6d712)
2004-01-07 23:21:36 +00:00
Andrew Bartlett
3b38606491 Fix bug 916 - do not perform a + -> space substitution for squid URL encoded
strings, only form input in SWAT.

Andrew Bartlett
(This used to be commit 8d54f5fe0c)
2003-12-25 09:37:41 +00:00
Gerald Carter
11f4893145 Ensure that items in a list of strings containing whitespace
are written out surrounded by single quotes.  This means that
both double and single quotes are now used to surround
strings in smb.conf.  This is a slight change from the previous
behavior but needed or else things like

    printer admin = +ntadmin, 'VALE\Domain, Admin'

get written to smb.conf by SWAT.
(This used to be commit 5bf91c79d6)
2003-11-22 04:33:36 +00:00
Rafal Szczesniak
a63010bae7 Added useful information to debug lines.
Patch by metze.


rafal
(This used to be commit 2eef3c7bc1)
2003-11-19 22:56:02 +00:00
Rafal Szczesniak
8e76781ff2 Useful debug message. Patch by metze.
rafal
(This used to be commit 8b06364b53)
2003-11-18 19:15:29 +00:00
Richard Sharpe
0b5019ffc9 Squelch some warnings with more casty-foo.
(This used to be commit d165a49d86)
2003-11-13 17:30:25 +00:00
Tim Potter
fbb8f131c2 Fix more 64-bit printf warnings.
(This used to be commit 23443e3aa0)
2003-11-03 14:34:25 +00:00
Jeremy Allison
cba653c30a Fix for MacOS/X which uses STUPID BROKEN UNICODE COMPOSE CHARACTERS !
(rant off :-). Inspired by work from Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>.
Also add MacOSX/Darwin configure fixes.
Jerry - can we put this in 3.0 release ? :-).
Jeremy.
(This used to be commit f23acb4ca5)
2003-09-13 22:41:21 +00:00
Jeremy Allison
76d0a7ca08 Fix from Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>. Revered
condition meant fast-path in strchr_m was not being used. Doh !
Jeremy.
(This used to be commit f23c9d36b0)
2003-09-12 21:41:18 +00:00
Jeremy Allison
ec9f544561 Fix stupid typo bug causing CPU spin. Spotted by Markus Ungermann <ungermann@elzet80.de>
Jeremy.
(This used to be commit c5ed59b37b)
2003-09-10 18:03:24 +00:00
Jeremy Allison
94f59f5492 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
(This used to be commit f35e9a8b90)
2003-09-05 19:59:55 +00:00
Gerald Carter
5a74bdd7aa fix bug 397: use a variant of alloc_sub_basic() for string lists.
(This used to be commit 62d5611df0)
2003-09-05 05:32:32 +00:00
Jeremy Allison
ff78c21f51 Hand optimisatinos for strrchr_m using the properties we know about MB
character sets and how we use this call.
Jeremy.
(This used to be commit a9709700ee)
2003-09-05 01:33:22 +00:00
Jeremy Allison
08c3907f4e Fastpath strchr_m for ASCII.
Jeremy.
(This used to be commit b3176f2ec2)
2003-09-04 23:26:13 +00:00
Jeremy Allison
245fbf7efb Used cachegrind to track down some bottlenecks.
Removed calls to clobber_region when not compiling with developer as
they were hiding speed problems.
Added fast path to convert_string() when dealing with ascii -> ascii,
ucs2-le to ascii and ascii to ucs2-le with values <= 0x7F. This
gives a speedup of 22% on my nbench tests.
Next I will do this on convert_string_allocate.
Jeremy.
(This used to be commit ef140d15ea)
2003-09-04 01:12:39 +00:00
Jeremy Allison
9c570af333 Fix up overlapping memcpy -> memmove found by valgrind.
Jeremy.
(This used to be commit e0c1460c6b)
2003-09-03 00:56:43 +00:00
Gerald Carter
6153bc0f5b fix bug 289; make sure to reset the offset into a string when reallocating space
(This used to be commit 66dd20c7ea)
2003-08-25 20:42:24 +00:00
Herb Lewis
aa39cc37da get rid of more compiler warnings
(This used to be commit 398bd14fc6)
2003-08-15 04:42:05 +00:00
Herb Lewis
0fc41a8962 get rid of const as these things really are not const
(This used to be commit 61bea183a2)
2003-08-15 02:25:41 +00:00
Andrew Bartlett
4b3e0268b5 Use push_ucs2_allocate(), rather than convert_string_allocate() directly.
Remove strdup_upper/strdup_lower from their old file, now that they have
been moved to charcnv.c

Note that string_replace assumes that s is a pstring.  (doco change only)

Andrew Bartlett
(This used to be commit 6c9056029b)
2003-07-27 02:40:06 +00:00
Tim Potter
7d833de662 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
(This used to be commit 59dae1da66)
2003-07-25 04:24:40 +00:00
Tim Potter
77373f1f8e More printf fixes - size_t is long on some architectures.
(This used to be commit ba4d334b82)
2003-07-24 23:46:27 +00:00
Andrew Bartlett
e45b66ba8a Fix StrCaseCmp() to avoid calling smb_panic() on invalid multibyte strings.
This fix results in
 - we no longer use fixed-size buffers in StrCaseCmp (previously limited to
   a pstring)
 - we return strcmp(s, t) if either of the strings is invalid
 - for non-ascii cases, we call iconv twice, not 4 times.

The basic idea with this fix is that if a string is not valid in the currnet
charset, then (unless it is byte-equivilant) it cannot be case-equivilant
to any other string.

This should address the majority of our smb_panic() cases on this matter.  It
will not fix them all - we still call unix_strupper(), aka strupper_m()
elsewhere, but this was being called on every file in the directory when
we performed unix_convert().

Tested with the stf unit tests for this routine.

Andrew Bartlett
(This used to be commit 9918fa7314)
2003-07-19 00:36:43 +00:00
Jeremy Allison
ce72beb2b5 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
(This used to be commit ff222716a0)
2003-07-03 19:11:31 +00:00
Jeremy Allison
af4d658894 Added fix for Japanese case names in statcache - these can change
size on upper casing. Based on patch from monyo@home.monyo.com.
Jeremy.
(This used to be commit 72e382e99b)
2003-07-02 20:01:51 +00:00
Gerald Carter
f51d769dd3 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
(This used to be commit d7f7fcda42)
2003-06-25 17:41:05 +00:00
Alexander Bokovoy
e8573c8fa9 Add NT quota support. Patch from Stefan (metze) Metzemacher
1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab
2. Disabled by default and when requested, will be probed and enabled only on Linux where it works
3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far
Documentation to follow
(This used to be commit 4bf022ce9e)
2003-05-12 01:20:17 +00:00
Gerald Carter
d15cd357c7 merge in metze' smbcquotas patch from HEAD
(This used to be commit b6a7704888)
2003-04-15 19:51:17 +00:00
Andrew Bartlett
9ad1ddc793 Don't set zero length for the base64 decoded string (fixes swat auth).
Andrew Bartlett
(This used to be commit 7ab39cba6a)
2003-04-02 00:17:03 +00:00
Andrew Bartlett
53beee9e56 (merge from HEAD)
NTLM Authentication:

- Add a 'privileged' mode to Winbindd.  This is achieved by means of a directory
  under lockdir, that the admin can change the group access for.

- This mode is now required to access with 'CRAP' authentication feature.
- This *will* break the current SQUID helper, so I've fixed up our ntlm_auth
  replacement:
 - Update our NTLMSSP code to cope with 'datagram' mode, where we don't get a
   challenge.
 - Use this to make our ntlm_auth utility suitable for use in current Squid 2.5
   servers.
 - Tested - works for Win2k clients, but not Win9X at present.  NTLMSSP updates
   are needed.
 - Now uses fgets(), not x_fgets() to cope with Squid environment (I think
   somthing to do with non-blocking stdin).

- Add much more robust connection code to wb_common.c - it will not connect to
  a server of a different protocol version, and it will automatically try and
  reconnect to the 'privileged' pipe if possible.
  - This could help with 'privileged' idmap operations etc in future.

- Add a generic HEX encode routine to util_str.c,
- fix a small line of dodgy C in StrnCpy_fn()

- Correctly pull our 'session key' out of the info3 from th the DC.  This is
  used in both the auth code, and in for export over the winbind pipe to
  ntlm_auth.

- Given the user's challenge/response and access to the privileged pipe,
  allow external access to the 'session key'.  To be used for MSCHAPv2
  integration.

Andrew Bartlett
(This used to be commit ec071ca3dc)
2003-03-24 09:54:13 +00:00
Jim McDonough
6c6fb121cd use strnlen to prevent coredumps
(This used to be commit 5078436d83)
2003-03-19 20:50:56 +00:00
Jeremy Allison
84e99fe898 Merge mbp's HEAD changes.
Jeremy.
(This used to be commit da1271a95f)
2003-03-18 21:21:21 +00:00
Jeremy Allison
d332200c25 Merge in the developer string options from HEAD. We need to ensure 3.0
is as stable as possible in the string department and some pain now
will help later :-).
Jeremy.
(This used to be commit 86e3eddac6)
2003-03-18 01:48:11 +00:00
Andrew Bartlett
467f1028f4 Merge from (earlier) HEAD - doxygen.
I'm not merging the current HEAD string stuff quite yet.
(This used to be commit 9b8d12e081)
2003-03-17 22:42:01 +00:00
Andrew Bartlett
266ec4aac0 Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.
Andrew Bartlett
(This used to be commit 9ef0d40c3f)
2003-02-24 03:09:08 +00:00
Jim McDonough
17ec9642cd base64_decode() with heimdal libs, so I've renamed it base64_decode_inplace().
(This used to be commit d510ff85fb)
2003-02-18 23:17:59 +00:00
Andrew Tridgell
50edc1a831 merge from head
(This used to be commit fd3216dbcb)
2003-02-07 04:11:36 +00:00