1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-10 13:57:47 +03:00

2875 Commits

Author SHA1 Message Date
Jeremy Allison
13c3abf031 r15022: Fix core dumps on normal server exit.
Jeremy.
2007-10-10 11:15:57 -05:00
Jeremy Allison
dc6a13da33 r15020: Fix issue with samba4 netbench torture tester,
it sends break replies to "break to none from level2"
requests and it shouldn't. Just don't log a debug
level zero message.
Jeremy.
2007-10-10 11:15:57 -05:00
Jeremy Allison
08e52ead03 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
2007-10-10 11:15:57 -05:00
Jeremy Allison
7769b678f2 r14989: Fix from Mathias Dietz <MDIETZ@de.ibm.com>. EPERM can be
a valid return from getting an xattr. Don't disable if
we get it.
Jeremy.
2007-10-10 11:15:55 -05:00
Jeremy Allison
c88af597d0 r14986: Fix OS/2 directory delete bug found by kukks.
(Thanks a lot for all your hard work on this).
We were caching the results of *all* directory
scans, not just the results that match the
client wildcard. This actually made no sense,
as only matches on the client wildcard can be
returned to the client and so might need to
be searched for in the cache. This fixes the
directory cache to only cache entries that we
return to the client.
Jeremy.
2007-10-10 11:15:55 -05:00
Jeremy Allison
3cd5c3df0d r14954: Fix #3569 based on William Jojo's work. AIX also
has the linear posix locking issue which causes
CLEAR_IF_FIRST to cause performance problems.
As we know we're in a daemon architecture with
long-lived parent we can avoid this in the Samba
case. Add a comment explaining this.
Jeremy.
2007-10-10 11:15:55 -05:00
James Peach
56bc02d644 r14898: This change is an attempt to improve the quality of the information that
is produced when a process exits abnormally.

First, we coalesce the core dumping code so that we greatly improve our
odds of being able to produce a core file, even in the case of a memory
fault. I've removed duplicates of dump_core() and split it in two to
reduce the amount of work needed to actually do the dump.

Second, we refactor the exit_server code path to always log an explanation
and a stack trace. My goal is to always produce enough log information
for us to be able to explain any server exit, though there is a risk
that this could produce too much log information on a flaky network.

Finally, smbcontrol has gained a smbd fault injection operation to test
the changes above. This is only enabled for developer builds.
2007-10-10 11:15:53 -05:00
Stefan Metzmacher
b98dd258a7 r14883: add 'smbd:sharedelay' option, so that we can speed up BASE-DENY2 in make test
as done in samba4

metze
2007-10-10 11:15:52 -05:00
Gerald Carter
4ab372f4ca r14855: Various fixes:
* depreacte 'acl group control' after discussion with Jeremy
  and implement functionality as part of 'dos filemode'
* fix winbindd on a non-member server to expand local groups
* prevent code previously only used by smbd from blindly
  turning _NO_WINBINDD back on
2007-10-10 11:15:51 -05:00
Jeremy Allison
9a763da073 r14849: Fix >= that should be >. Too strict condition
checked by Volker.
Jeremy.
2007-10-10 11:15:50 -05:00
Jeremy Allison
9c5e26a56a r14847: Tell static checkers that exit_server() doesn't
return.
Jeremy.
2007-10-10 11:15:50 -05:00
Jeremy Allison
2454af392a r14790: Fix possible null deref. Coverity #277.
Jeremy.
2007-10-10 11:15:48 -05:00
Jeremy Allison
fd98427f64 r14746: Add the Samba4 replacements for opendir/readdir etc. to
Samba3 - with some 64-bit macro madness. Attempt to fix
the broken directory handling in the *BSD-of-the-month
club.
Jeremy.
2007-10-10 11:15:45 -05:00
Volker Lendecke
b6b72f8c6a r14695: Patch from Björn Jacke:
- add DMAPI/XDSM support for AIX
- find JFS DMAPI libs on Linux when only they are available

Volker
2007-10-10 11:15:44 -05:00
James Peach
0ebbfc867c r14669: Remove duplicate source caused by running patch(1) once too often. 2007-10-10 11:15:42 -05:00
James Peach
514a767c57 r14668: Set the FILE_STATUS_OFFLINE bit by observing the events a DMAPI-based
HSM is interested in. Tested on both IRIX and SLES9.
2007-10-10 11:15:42 -05:00
Stefan Metzmacher
c3a9f30e2a r14618: add --no-process-group to all server programms
to make the following possible:

timelimit 20000 bin/nmbd -F -S --no-process-group
timelimit 20000 bin/smbd -F -S --no-process-group

this is needed to 'make test' working without losing child processes

metze
2007-10-10 11:15:39 -05:00
Jeremy Allison
306061c93d r14602: Fix another logic bug in new oplock handling. Just
because lck->num_share_modes != 0 doesn't mean that
there *are* other valid share modes. They may be
all marked "UNUSED" or be deferred open entries.
In that case don't downgrade the granted oplock to
level2 needlessly - a client can have an exclusive
oplock in this case. The original code handled this
correctly in the lck->num_share_modes == 0 case but
not in the case where there were no valid share modes
but lck->num_share_modes != 0. I'll clean up my
Samba4 torture tester for this and commit it tomorrow.
Jeremy.
2007-10-10 11:15:39 -05:00
James Peach
763f4c0148 r14600: Refactor capability interface from being IRIX-specific to using only
the POSIX interface. Note that this removes support for inherited
capabilities. This wasn't used, and probably should not be.
2007-10-10 11:15:39 -05:00
Jeremy Allison
c2488db727 r14596: Fix a logic bug with multiple oplock contention.
The sad thing is the core of this bug fix is just
removing a paranoia "exit_server" call, as the
rest of the logic was already correct :-).

Lots of comments to explain the logic added.

I will look at adding tests to exercise this,
might be possible.

Jeremy.
2007-10-10 11:15:38 -05:00
James Peach
0809e2cb1d r14574: Allow use of sendfile as long as the write cache has not been enabled
on the particular file we are performing I/O on, irrespective of whether
the write cache is globally enabled
2007-10-10 11:15:37 -05:00
Volker Lendecke
19e9bc03f8 r14559: Oplocks have changed, process_smb can be static again 2007-10-10 11:15:37 -05:00
Jeremy Allison
71e8158042 r14460: SMBexit closes by pid and vuid. Tested with smbtorture.
Jeremy.
2007-10-10 11:15:31 -05:00
Jeremy Allison
f65d7afe19 r14387: Try and fix the coverity issues (#53, #54) with negative
sink by ensuring all uses of rpcstr_push are consistent
with a size_t dest size arg.
Jeremy.
2007-10-10 11:15:27 -05:00
Jeremy Allison
b8397c9f33 r14357: Try and fix Coverity #169 by making the pointer
aliasing clearer. This isn't a bug but a code
clarification.
Jeremy.
 line, and those below, will be ignored--

M    source/smbd/posix_acls.c
2007-10-10 11:15:26 -05:00
Jeremy Allison
415530bd08 r14336: Try and quieten coverity #53 and #54. Make it obvious
we're using -1 as a special size_t case by casting.
Jeremy.
2007-10-10 11:15:25 -05:00
Jeremy Allison
0483807872 r14229: Something Coverity hasn't caught (yet) but I've gotten
sensitive to null derefs. get_timed_events_timeout()
can potentially return NULL. Cope with this.
Jeremy.
2007-10-10 11:15:18 -05:00
James Peach
5429c495c5 r14207: Convert the lp_acl_compatibility() param into an enum. 2007-10-10 11:15:16 -05:00
Jeremy Allison
c0f906ac8d r14170: Paranioa fix for sesssetup.
Fix Coverity bug #26. Guard against NULL ref.
Jeremy.
2007-10-10 11:15:15 -05:00
Jeremy Allison
754818f8cc r14168: Fix Coverity #219. I think this is a false coverity
warning as it seems to get confused with assignment
and comparison. Clarify the code anyway.
Jeremy.
2007-10-10 11:15:14 -05:00
Günther Deschner
773e33c971 r14130: Remove make_server_info_pac alltogether, make_server_info_info3 does
already do what we need.

Guenther
2007-10-10 11:11:14 -05:00
Gerald Carter
8dafa45b97 r14112: * fix checks on return code from register_vuid() which could actually
fail and we would still return success in the SMBsesssetup reply :-(
* Make sure to create the local token for the server_fino struct
  in reply_spnego_kerberos() so that register_vuid() does not fail.
  (how did this ever work?)
2007-10-10 11:11:13 -05:00
James Peach
dc96ce90e5 r14111: Work around additional typedefs in the gamin implementation
of the FAM API.
2007-10-10 11:11:12 -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
Volker Lendecke
08d7fd31ab r13983: Fix Coverity bug # 111 2007-10-10 11:11:03 -05:00
Volker Lendecke
49043a756d r13980: Fix Coverity bug # 63. Jeremy, could you take a look at this?
Thanks,

Volker
2007-10-10 11:11:02 -05:00
Volker Lendecke
1345a52794 r13916: Fix Coverity bug #29. Looks like my code. I wonder how much there is still
lurking...

Volker
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
Gerald Carter
acff5163ca r13771: BUG 3534: ignore lines in the username map file with no right hand list rather than bailing out 2007-10-10 11:10:53 -05:00
Jeremy Allison
12eccc8fe4 r13759: As pointed out by Volker, it isn't much good creating
a new empty acl in remove_posix_acl if you don't bother
to set it on the file in question :-).
Jeremy.
2007-10-10 11:10:52 -05:00
Jeremy Allison
01ef957d48 r13748: Don't reference memory after we just freed it (Doh!).
Thanks to tridge's changes to the directory delete on close tests
for catching this.
Jeremy.
2007-10-10 11:10:52 -05:00
Jeremy Allison
0295ed3d5c r13724: Remove unused variable. Bug #3559 from
jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:10:51 -05:00
Günther Deschner
5b89e8bc24 r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.
* Fix a couple of related parsing issues.
* in the info3 reply in a samlogon, return the ACB-flags (instead of
  returning zero)

Guenther
2007-10-10 11:10:25 -05:00
Volker Lendecke
788e52eb5d r13694: Committing patch from Aleksey Fedoseev <aleksey at fedoseev dot net> to NULL
out a pointer after talloc_destroy().

Volker
2007-10-10 11:10:24 -05:00
Gerald Carter
b698e83a82 r13675: * patch from Bjoern JACKE <samba@j3e.de> to remove the
artificial RO bit on directories in user profiles when
  profile acls = yes.
2007-10-10 11:10:22 -05:00
Jeremy Allison
ce25e6b002 r13647: Fix for standalone Samba servers and XP clients. Reverts
part of the PocketPC bugfix. I'm trying to get someone who
has a pocketpc to test this.
Jeremy.
2007-10-10 11:10:21 -05:00
Jeremy Allison
7d21cf420f r13604: Fix for bug #3512 "use spnego=no" and "server signing=auto" cause client to disconnect after negprot"
We missed one case of ignoring "BSRSPYL ".
Merge for 3.0.21c.
Jeremy.
2007-10-10 11:10:19 -05:00
Gerald Carter
6f1afa4acc r13590: * replace all pdb_init_sam[_talloc]() calls with samu_new()
* replace all pdb_{init,fill}_sam_pw() calls with samu_set_unix()
2007-10-10 11:10:16 -05:00
Gerald Carter
19b7593972 r13576: This is the beginnings of moving the SAM_ACCOUNT data structure
to make full use of the new talloc() interface.  Discussed with Volker
and Jeremy.

* remove the internal mem_ctx and simply use the talloc()
  structure as the context.
* replace the internal free_fn() with a talloc_destructor() function
* remove the unnecessary private nested structure
* rename SAM_ACCOUNT to 'struct samu' to indicate the current an
  upcoming changes.  Groups will most likely be replaced with a
  'struct samg' in the future.

Note that there are now passbd API changes.  And for the most
part, the wrapper functions remain the same.

While this code has been tested on tdb and ldap based Samba PDC's
as well as Samba member servers, there are probably still
some bugs.  The code also needs more testing under valgrind to
ensure it's not leaking memory.

But it's a start......
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