1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-19 23:17:05 +03:00

162 Commits

Author SHA1 Message Date
Jeremy Allison
140881cfbb r22045: As Volker noticed, skip_string's last argument is
redundent. Remove it.
Jeremy.
2007-10-10 12:19:05 -05:00
Jeremy Allison
c3a565081d r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,
but I've no option.
Jeremy.
2007-10-10 12:19:01 -05:00
Jeremy Allison
437cb7c888 r20208: Change sprintf_append() never to use malloc,
but always use a talloc context.
Thanks to simo for pointing this out.
Jeremy.
2007-10-10 12:16:32 -05:00
Jeremy Allison
0ffca7559e 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.
2007-10-10 12:16:24 -05:00
Volker Lendecke
016ddce120 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
2007-10-10 12:15:55 -05:00
Jeremy Allison
ece00b70a4 r18787: Fix the strlen_m and strlen_m_term code by merging
in (and using elsewhere) next_codepoint from Samba4.
Jerry please test.
Jeremy.
2007-10-10 12:00:57 -05:00
Stefan Metzmacher
9f3599a7ca r18652: libreplace has replacements for strndup and strnlen
metze
2007-10-10 11:52:19 -05:00
Jeremy Allison
84e8cc0593 r17866: Fix possible null deref - found by Stanford checker.
Jeremy.
2007-10-10 11:38:55 -05:00
Jeremy Allison
cfd39c2804 r17862: Fix possible NULL deref (like rev 17861) found by the
Stanford group.
Jeremy.
2007-10-10 11:38:54 -05:00
Volker Lendecke
1e4ee728df r17316: More C++ warnings -- 456 left 2007-10-10 11:38:25 -05:00
Jeremy Allison
9dafb7f48c 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.
2007-10-10 11:19:14 -05:00
Jeremy Allison
1d21a3dec9 r16595: Klocwork #2067. Fix possible memleak on error exit.
Jeremy.
2007-10-10 11:19:02 -05:00
Jeremy Allison
b1fc2d8b99 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.
2007-10-10 11:19:00 -05:00
Derrell Lipman
d90061aa93 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
2007-10-10 11:19:00 -05:00
Jeremy Allison
99605ce296 r16375: Klocwork #1670.
Jeremy.
2007-10-10 11:18:50 -05:00
Günther Deschner
5557ada694 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
2007-10-10 11:16:33 -05:00
Gerald Carter
1e0b79e591 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) 2007-10-10 11:15:55 -05:00
Jeremy Allison
841c9b1847 r13975: Re-fix Coverity #156 - I had left the hidden arg. inconsistent
between Realloc and realloc_array.
Jeremy.
2007-10-10 11:11:02 -05:00
Jeremy Allison
1d710d06a2 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.
2007-10-10 11:10:59 -05:00
Günther Deschner
b2eac2e6eb 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
2007-10-10 11:10:19 -05:00
Gerald Carter
b65be8874a r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
2007-10-10 11:10:14 -05:00
Gerald Carter
6c4ede6cee 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
2007-10-10 11:09:58 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Jeremy Allison
c2752347eb 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.
2007-10-10 11:05:58 -05:00
Volker Lendecke
be6c9012da 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
2007-10-10 11:05:53 -05:00
Jeremy Allison
183a470511 r9282: Whitespace.
Jeremy.
2007-10-10 11:00:31 -05:00
Jeremy Allison
816e2fbb39 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.
2007-10-10 11:00:29 -05:00
Volker Lendecke
c78760d71e r9201: Ouch.... :-( 2007-10-10 11:00:28 -05:00
Volker Lendecke
c7d10e2c83 r9198: Convert hex_encode and strhex_to_data_blob to take a talloc context.
Volker
2007-10-10 11:00:27 -05:00
Günther Deschner
dccf777f42 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
2007-10-10 11:00:15 -05:00
Gerald Carter
2f5de718a9 r8506: BUG 2853: don't strip out characters like '$' from printer names
when substituting for the lpq command.
2007-10-10 11:00:07 -05:00
Jim McDonough
cb5634a305 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.
2007-10-10 10:58:18 -05:00
Gerald Carter
a0ac9a8ffd r7415: * big change -- volker's new async winbindd from trunk 2007-10-10 10:57:08 -05:00
Gerald Carter
9727d05241 r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1 2007-10-10 10:57:02 -05:00
Derrell Lipman
994694f7f2 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.
2007-10-10 10:56:24 -05:00
Gerald Carter
4e0ac63c36 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).
2007-10-10 10:56:15 -05:00
Gerald Carter
9e77da9320 r5961: final round of compiler warning fixes based on feedback from Jason Mader 2007-10-10 10:56:13 -05:00
Gerald Carter
f3f315b14d r5956: more compile warngin fixes from the Mr. Mader 2007-10-10 10:56:11 -05:00
Günther Deschner
45a2a7bedb r5954: Fix some compiler warnings and add missing exclude-block in "net rpc
share migrate" (found by Lars Mueller <lmuelle@suse.de>).

Guenther
2007-10-10 10:56:11 -05:00
Gerald Carter
7dfafa712d r5953: more compiler cleanups; moved SID_LIST from smb.h to privileges.c to cleanup the name space 2007-10-10 10:56:11 -05:00
Gerald Carter
17239d609f r5158: BUG 2263: patch from Timur Bakeyev <timur@com.bat.ru> to guard base64_encode_data_blob() against empty blobs 2007-10-10 10:55:30 -05:00
Jeremy Allison
9d131e9419 r5066: A couple of small fixes from James Peach @ SGI.
Jeremy.
2007-10-10 10:55:13 -05:00
Gerald Carter
ccdff4a998 r4746: add server support for lsa_enum_acct_rights(); last checkin for the night 2007-10-10 10:53:54 -05:00
Jeremy Allison
c3f9c81a8f r4334: Fix for bugid #2186 - from Buck Huppmann <buckh@pobox.com>
to prevent uninitialized creds being freed.
Jeremy.
2007-10-10 10:53:44 -05:00
Jeremy Allison
620f2e608f 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.
2007-10-10 10:53:32 -05:00
Jeremy Allison
ca9516520f r2605: Fix stupid typo in back-port of Samba4 fix.
Jeremy.
2007-10-10 10:52:47 -05:00
Jeremy Allison
0465e2d23d 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.
2007-10-10 10:52:47 -05:00
Jeremy Allison
d434d8e2b4 r2361: Fix the appalling toktocliplist() fn. Bug found by Luis Benvenutto.
Jeremy.
2007-10-10 10:52:40 -05:00
Jeremy Allison
615aa6e914 r2175: Fix for #1546 from fumiya@samba.gr.jp. Preserve errno in MB strupper_m/strlower_m.
Jeremy.
2007-10-10 10:52:34 -05:00
Jeremy Allison
3f0707132a r2111: Fix memleak with valid names.
Jeremy.
2007-10-10 10:52:31 -05:00