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

180 Commits

Author SHA1 Message Date
Jeremy Allison
810f760afd Add talloc versions of all the next_token() functions.
Now I can really start removing fixed length strings...
Jeremy.
(This used to be commit 0ae61e2654)
2007-11-30 13:09:04 -08:00
Jeremy Allison
4c6b01b0ef Remove more pstring. Unify talloc_sub functions to make
them a better match for replacing string_sub. Remove
more unused code.
Jeremy.
(This used to be commit ae7885711f)
2007-11-19 18:56:22 -08:00
Jeremy Allison
51b46147f2 Remove smbldap_get_single_pstring() and all pstrings
from pdb_ldap.c. I don't have an LDAP passdb setup here,
so I'm going to need some help on testing this.
Jeremy.
(This used to be commit 00760451b6)
2007-11-14 16:05:42 -08:00
Jeremy Allison
79266500cd Remove all pstrings from smbd/chgpasswd.c.
Jeremy.
(This used to be commit eaf14c701b)
2007-11-12 15:02:50 -08:00
Volker Lendecke
62b97b0156 Make base64_encode_data_blob return a talloced string
(This used to be commit 5f205ab48d)
2007-11-09 15:12:30 +01:00
Volker Lendecke
2d73e86cce Remove unnecessary code
SAFE_FREE checks for NULL anyway, and SMB_STRDUP panics on failure
(This used to be commit 4cdebda39b)
2007-11-05 03:40:31 +01:00
Jeremy Allison
e054affb7b Fix bug in writing names into gencache
as well as 2 typos where AF_INET6 was mistypes as AF_INET.
JERRY YOU NEED THESE FIXES.
Fixes smbclient -L localhost -U%
Bugs reported by Kukks (thanks kukks).
Jeremy.
(This used to be commit f109f82622)
2007-10-25 19:07:25 -07:00
Jeremy Allison
f88b7a076b This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
(This used to be commit 98e154c312)
2007-10-24 14:16:54 -07:00
Jeremy Allison
bb126d1f49 Reformatting fix for new coding guidelines. BOOL ->bool.
Jeremy.
(This used to be commit 315215e20e)
2007-10-17 12:10:12 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Volker Lendecke
ad97bcf813 r25184: Fix some C++ warnings and an uninitialized variable
(This used to be commit b64df8a3c5)
2007-10-10 12:30:49 -05:00
Jeremy Allison
eacd314057 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
(This used to be commit 39c211a702)
2007-10-10 12:30:44 -05:00
Jeremy Allison
af3de3fa71 r25121: Remove pstring limits from much of our string handling function.
Still a few left (mainly the substitute ones).
Jeremy.
(This used to be commit 6552e52979)
2007-10-10 12:30:42 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
32ba5145b8 r23518: Remove the silly assumption that string_replace requires a pstring.
Jeremy, I am always very confused about the different length arguments
in convert_string and friends. Can you take a look at the change in
string_replace and verify it's ok? Thanks!

While at it, remove the pstring limit for strhasupper and strhaslower.
(This used to be commit e6e5703658)
2007-10-10 12:23:25 -05:00
Simo Sorce
34bc0e1883 r23356: We missed to add the 'c' character to the list of valid ones for
shell escaping.

I hate this kind of bugs more than how Jeremy hates off by ones :(

Simo.
(This used to be commit 42d846ff87)
2007-10-10 12:23:09 -05:00
Gerald Carter
d34f6bb969 r22852: merge fixes for CVE-2007-2446 and CVE-2007-2447 to all branches
(This used to be commit f65214be68)
2007-10-10 12:22:02 -05:00
Jeremy Allison
0a2cc569a1 r22045: As Volker noticed, skip_string's last argument is
redundent. Remove it.
Jeremy.
(This used to be commit 140881cfbb)
2007-10-10 12:19:05 -05:00
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