1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-09 00:23:50 +03:00
Commit Graph

2486 Commits

Author SHA1 Message Date
Jim McDonough
7ebfe2cb26 r14280: Fix Coverity #129 and 130: check before dereferencing a pointer. This
was especially silly as we checked immediately _after_ dereferencing it
:-/
2007-10-10 11:15:23 -05:00
Volker Lendecke
84e9e73f3c r14249: We've dereferenced the_acl before, no point in checking.
Fix Coverity bug # 128.

Volker
2007-10-10 11:15:20 -05:00
Volker Lendecke
c105bfae26 r14131: Fix Coverity bug # 127 2007-10-10 11:11:14 -05:00
Gerald Carter
71d960250d r14075: * add support for long variable names in smb.conf in the form of %(....)
* add support for %(DomainSID)
* replace standard_sub_XXX() functions with wrappers around their
  alloc_sub_XXX() counterparts
* add support for using SIDs in read list, et. al. (anything that
  is checked by nt_token_contains_name_in_list())
2007-10-10 11:11:09 -05:00
Günther Deschner
d236caac21 r14060: Only set the last rebind timestamp when we did rebind after a non-read
LDAP operation. That way we avoid the replication sleep after a simple
redirected search operation

Guenther
2007-10-10 11:11:09 -05:00
Jeremy Allison
b9980bddf5 r14020: Coverity bug CID #66. Missing free on error exit.
Jeremy.
2007-10-10 11:11:05 -05:00
Jeremy Allison
7c6e274cd5 r14002: Quick fix for Coverity CID #12.
Jeremy
2007-10-10 11:11:04 -05:00
Jeremy Allison
b9de6c9269 r13999: Quick fix for Coverity bug #11.
Jeremy.
2007-10-10 11:11:04 -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
8d18344140 r13971: Fix Coverity bugs #209 - #213 - it detected mistakes
in the pointer aliasing once realloc could change
a pointer. This was in the bugzilla.samba.org database
as #687 but we never figured out what it was !
Jeremy.
2007-10-10 11:11:02 -05:00
Jim McDonough
6bf879bee3 r13948: Fix the build. Remove rpcclient.h include. 2007-10-10 11:11:01 -05:00
Günther Deschner
7e80d5358e r13945: Move display_sec.c to lib/ (as suggested by Volker).
Guenther
2007-10-10 11:11:00 -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
Volker Lendecke
7c098ca0ae r13693: More Solaris/LDAP fixes from Bjoern <bjoern@j3e.de> 2007-10-10 11:10:24 -05:00
Jeremy Allison
07d1037e17 r13682: Actually give a developer a prayer of finding out where
random error messages are coming from. Yes I'm pissed as
I'm working on a live issue right now...
Jeremy.
2007-10-10 11:10:23 -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
92c251fdf0 r13601: * Remove unused code from pdb_ldap.c
* Add a 'struct passwd *' to the struct samu for later reference
  (I know this may be controversial but its easily reverted which is
  is why I'm checking this is as a seaparate patch before I get
  too deep).
* Remove unix_homedir from struct samu {} and update the pdb wrapper
  functions associated with it.
2007-10-10 11:10:18 -05:00
Gerald Carter
cf9140ad26 r13591: I really have no idea how this code ever worked. And I have
no idea why no one (including myself) caught this with a compiler
warning....Make sure new_chunk() actually returns a pointer
to the allocated memory.

SAMBA_3_0 now works again on Solaris.
2007-10-10 11:10:16 -05:00
Gerald Carter
af57e4a4cc r13574: fix build; talloctort.c should not use the TALLOC_FREE() macro 2007-10-10 11:10:15 -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
Günther Deschner
69fb189a6b r13566: Fix EA support for AIX.
Patch from Bjoern Jacke <bjacke-at-sernet-dot-de>.

Guenther
2007-10-10 11:10:14 -05:00
Jeremy Allison
a2fb436fc5 r13539: Add 128 bit creds processing client and server. Thanks to Andrew Bartlett's
Samba4 code.
Jeremy.
2007-10-10 11:10:11 -05:00
Jeremy Allison
6ec0e9124a r13521: Implement LOOKUPNAME3 and 4.
Jeremy.
2007-10-10 11:10:09 -05:00
Volker Lendecke
bb40e544de r13494: Merge the stuff I've done in head the last days.
Volker
2007-10-10 11:10:06 -05:00
Gerald Carter
7a2da5f0cc r13460: by popular demand....
* remove pdb_context data structure
* set default group for DOMAIN_RID_GUEST user as RID 513 (just
  like Windows)
* Allow RID 513 to resolve to always resolve to a name
* Remove auto mapping of guest account primary group given the
  previous 2 changes
2007-10-10 11:10:04 -05:00
Jeremy Allison
95793d7e64 r13427: Fix ctime -> st_ctime.
Jeremy.
2007-10-10 11:10:01 -05:00
Jeremy Allison
07132d8796 r13423: Write wrapper functions (and configure tests) so we can
always assume we can get a struct timespec out of a stat
struct. This will allow us to portably move to nsec timestamps
on files and directories in the file server code in future.
Jeremy.
2007-10-10 11:10:01 -05:00
Günther Deschner
286f6fc233 r13409: No functional changes, just some DEBUG cleanup.
Guenther
2007-10-10 11:09:59 -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
Simo Sorce
e9bcc24b13 r13374: new revision of the snprintf replace code
still missing a configure test to make us
substitute our snprintf to system one when
the system one does not have positional parameters support
2007-10-10 11:06:27 -05:00
Volker Lendecke
fc73690a70 r13350: Implement rpccli_samr_set_domain_info. Weird that it was not around :-)
Implement 'net rpc shell account' -- An editor for account policies

nt_time_to_unix_abs changed its argument which to me seems wrong, and I could
not find a caller that depends on this. So I changed it. Applied some more
const in time.c.

Volker
2007-10-10 11:06:26 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Gerald Carter
6c3480f9ae r13310: first round of server affinity patches for winbindd & net ads join 2007-10-10 11:06:23 -05:00
Jeremy Allison
23f16cbc2e r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
2007-10-10 11:06:21 -05:00
Gerald Carter
0b8ed8136b r13231: apparently strncat() is converted to strcat() on RH7.3 and similar systems. Fix the build on those boxes 2007-10-10 11:06:19 -05:00
Gerald Carter
d40f06018b r13093: adding vendor patch level string as announced on samba-technical ml 2007-10-10 11:06:13 -05:00
Lars Müller
6ff25eb840 r13058: Add %w macro for the winbind seperator which allows us for example
valid users = %S, %D%w%S
2007-10-10 11:06:12 -05:00
Günther Deschner
3a6e41a0cb r13024: Add is_null_sid.
GUenther
2007-10-10 11:06:11 -05:00
James Peach
2163e4b6b4 r12953: Support the TCP_FASTACK socket option if it is available. Note that this will
not acutally help, but it is good to be complete.
2007-10-10 11:06:09 -05:00
Gerald Carter
68399ce04c r12912: patch from Tony Mountifield <tony@softins.co.uk> for BUG 3327 (fix bad access to gencache.tdb after fork() in smbmount 2007-10-10 11:06:06 -05:00
Jeremy Allison
b76c7b6132 r12855: Remove erroneous commenting out of valgrind fix.
Jeremy.
2007-10-10 11:06:05 -05:00
Günther Deschner
f78c7f8abe r12714: Fix segfault in pdb_nds.c.
Guenther
2007-10-10 11:06:01 -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
Gerald Carter
be32f10609 r12398: adding Guenther's account policy migration fix 2007-10-10 11:05:54 -05:00
Jeremy Allison
7ccff8071a r12387: Make string_to_sid a little more silent.
Jeremy.
2007-10-10 11:05:54 -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
Volker Lendecke
3f1dad5fdb r12306: Reformatting 2007-10-10 11:05:53 -05:00
Volker Lendecke
e7f348fcf8 r12303: Move split_domain_and_name to util_getent.c and make it static there.
Volker
2007-10-10 11:05:52 -05:00
Volker Lendecke
95094ef758 r12291: Make getgroups_user static.
Jeremy, there's a #ifdef'ed 0 call to this in your usershare code. We need to
talk about what exactly what you intend to do here and in what scenarios.

Volker
2007-10-10 11:05:52 -05:00
Jeremy Allison
0c7b8a7637 r12279: unix_mask_match has been broken for *ever*... (How).
Ensure it returns a BOOL.
Jerry (and anyone else) please check this, I think
all uses are now correct but could do with another
set of eyes. Essential for 3.0.21 release.
Jeremy.
2007-10-10 11:05:51 -05:00