1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00

455 Commits

Author SHA1 Message Date
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
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
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
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -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
Jeremy Allison
d202aae3c8 r11446: Remove unused fn. Remove unneeded strncpy use.
Jeremy.
2007-10-10 11:05:16 -05:00
Jeremy Allison
de27b0eef2 r11159: Added some const to fix warnings.
Jeremy.
2007-10-10 11:05:04 -05:00
Jeremy Allison
d720867a78 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
2007-10-10 11:05:02 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Jeremy Allison
c5b79a6709 r9536: Fix one more DIR -> SMB_STRUCT_DIR typo.
Jeremy.
2007-10-10 11:01:12 -05:00
Jeremy Allison
f00d41a9dc r9325: Remember to ignore FILE_SHARE_DELETE when mapping to old share
modes for display.
Jeremy.
2007-10-10 11:00:33 -05:00
Jeremy Allison
c7fe18761e r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work
into the tree). I'll test this over the weekend....
Jerry - in looking at the difference between the two trees there
seem to be some printing/ntprinting.c and registry changes we might
want to examine to try keep in sync.
Jeremy.
2007-10-10 10:58:18 -05:00
Jeremy Allison
9506b8e145 r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
2007-10-10 10:58:00 -05:00
Jeremy Allison
e9b8d23d61 r7842: With the patch I sent Steve yesterday this gives us complete POSIX pathnames.
ie. files containing : and \ can be accessed from Linux.
Jeremy.
2007-10-10 10:57:59 -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
81ffb0dbbb r6942: * merging the registry changes back to the 3.0 tree
* removing the testprns tool
2007-10-10 10:56:57 -05:00
Jeremy Allison
482f7e0e37 r6890: Refactor printing interface to take offset into job. Fixes bug
where large print jobs can have out-of-order offsets. Bug found
by Arcady Chernyak <Arcady.Chernyak@efi.com>
Jeremy.
2007-10-10 10:56:56 -05:00
Jeremy Allison
5b86e3dcdf r6550: Move function make_dir_struct from util to dir.c
Jeremy.
2007-10-10 10:56:45 -05:00
Herb Lewis
58e307664e r6502: add LOCKING debug class - pull PRINTINGDB class definition from trunk
so our numbers don't get out of sync
2007-10-10 10:56:43 -05:00
Jeremy Allison
c0b99c692b r6495: Bugfix for #2596 by James Peach @ SGI. Fix become_root link issues and one IRIX
stack backtrace bug.
Jeremy.
2007-10-10 10:56:43 -05:00
Volker Lendecke
61d40ac60d r6445: Make us survive the PARANOID_MALLOC_CHECKER. Should we enable that for
--enable-developer=yes?

Volker
2007-10-10 10:56:41 -05:00
Volker Lendecke
f0bb44ac58 r6351: This is quite a large and intrusive patch, but there are not many pieces that
can be taken out of it, so I decided to commit this in one lump. It changes
the passdb enumerating functions to use ldap paged results where possible. In
particular the samr calls querydispinfo, enumdomusers and friends have
undergone significant internal changes. I have tested this extensively with
rpcclient and a bit with usrmgr.exe. More tests and the merge to trunk will
follow later.

The code is based on a first implementation by Günther Deschner, but has
evolved quite a bit since then.

Volker
2007-10-10 10:56:38 -05:00
Herb Lewis
efea76ac71 r6225: get rid of warnings from my compiler about nested externs 2007-10-10 10:56:30 -05:00
Jeremy Allison
8c64cd368f r6106: Fix bug #2551. It turns out that the incoming flags2 flag FLAGS2_LONG_PATH_COMPONENTS
determines if a reply is uppercased on a SMBsearch request, not the protocol level.
This could clear up quite a few hacks going forward I think.
Jeremy.
2007-10-10 10:56:22 -05:00
Volker Lendecke
3a67865169 r6080: Port some of the non-critical changes from HEAD to 3_0. The main one is the
change in pdb_enum_alias_memberships to match samr.idl a bit closer.

Volker
2007-10-10 10:56:20 -05:00
Jeremy Allison
80e788143a r6049: Ensure "dos filetime" checks file ACLs correctly. May fix Excel "read-only"
issue.
Jeremy.
2007-10-10 10:56:18 -05:00
Jeremy Allison
67f6473f50 r6044: Ensure the old search calls always ask mask_match to translate
patterns like ????????.??? - even if using an NT1 protocol.
Matches W2K3 behavior.
Jeremy.
2007-10-10 10:56:18 -05:00
Jeremy Allison
cf8949f684 r6022: Fix for bug #2533. Incorrect dir listings from OS/2 clients.
Jeremy.
2007-10-10 10:56:16 -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
Jeremy Allison
228d1e1649 r5100: We should only care about case-sensitivity when *reading* an incoming
filename, not returning one. Makes us pass one more Samba4 RAW-SEARCH test.
Jeremy.
2007-10-10 10:55:15 -05:00
Jeremy Allison
9d131e9419 r5066: A couple of small fixes from James Peach @ SGI.
Jeremy.
2007-10-10 10:55:13 -05:00
Jeremy Allison
465c207ffb r4581: From Derrell.Lipman@UnwiredUniverse.com. Use nanosleep instead of select
when we have it in smb_msleep.
Jeremy.
2007-10-10 10:53:48 -05:00
Jeremy Allison
0a7d17bc9b r4120: Never, ever, doubt valgrind :-). Fix order of evaluation bug that's been in the
bitmap code for ever. Remove silly extra space in paranoid malloc.
Jeremy.
2007-10-10 10:53:34 -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
65dfae7ea4 r3946: Fix for bugid #2085 reported by Jason Mader <jason@ncac.gwu.edu>. Use consistent
enum type for Protocol extern.
Jeremy.
2007-10-10 10:53:26 -05:00
Günther Deschner
14a0292250 r3650: Allow to call spoolss-server as "localhost".
Guenther
2007-10-10 10:53:11 -05:00
Andrew Bartlett
dc19f16169 r2868: Well, I'm not quite sure what I'm doing back in Samba 3.0, but anyway...
I've been grumbling about under-efficient calls in SAMR, and finally
got around to fixing some of them.

We now call sys_getgroups() (which in turn calls initgroups(), until
glibc 3.4 is released) to figure out a user's group membership.  This
is far, far more efficient than scanning all the groups looking for a
match, and is still the 'posix way', just using an effiecient call.

The seperate issue of 'who is in this group' remains, but this one has
been biting some people.

I need to talk to VL about how best to exersise nasty corner cases,
but my initial tests hold strong.  (The code is also much simpiler
than before, which has to count for something :-)

Andrew Bartlett
2007-10-10 10:52:55 -05:00
Andrew Tridgell
4ce0505bc3 r2824: restored the is_case_sensitive option to ms_fnmatch() in Samba3. It is
very rarely used, but we sohuldn't be removing a feature in a minor
release of this kind.
2007-10-10 10:52:54 -05:00
Rafal Szczesniak
982912f0c8 r2813: Fix the build.
At least temporarily, since I've got the impression that _real_ fix
is more complex...

rafal
2007-10-10 10:52:53 -05:00
Gerald Carter
57db8ca91f r2768: BUG 1519: save the hostname used in the open_printer_ex() for later reuse when filling in the spolss replies (also gets rid of get_called_name() 2007-10-10 10:52:52 -05:00
Gerald Carter
7474c6a446 r2133: Several fixes:
* BUG 1627: fix for NIS compiles on HPUX 11.00, AIX 4.3 and 5.1
  patch from Olaf Flebbe <o.flebbe@science-computing.de>.
  Will need to watch this one in the build farm.

* Fix bug found by rwf@loonybin.net where the PRINT_ATTRIBUTE_PUBLISHED
  was getting reset by attempts to sanitize the defined attributes
  (PRINTER_ATTRIBUTE_SAMBA)

* Resolve name conflict on DEC OSF-5.1 (inspired by patch from
  Adharsh Praveen <rprav@india.hp.com>)

* Work around parsing error in the print change notify code
  (not that the alignment bug is still there but reording the
   entries in the array works around it).

* remove duplicate declaration of getprintprocdir from rpcclient.
2007-10-10 10:52:32 -05:00
Paul Green
8b1c2126af r1890: Cut down on debug messages from is_in_path. paulg 2007-10-10 10:52:23 -05:00
Jeremy Allison
f0f2e28958 r1215: Intermediate checkin of the new keytab code. I need to make sure I
haven't broken krb5 ticket verification in the mainline code path,
also need to check with valgrind. Everything now compiles (MIT, need
to also check Heimdal) and the "net keytab" utility code will follow.
Jeremy.
2007-10-10 10:52:00 -05:00
Jeremy Allison
33fa4b8b27 r1156: Ensure new remote arch of CIFSFS is seen.
Jeremy.
2007-10-10 10:51:57 -05:00
Gerald Carter
8ee268f0ed r647: fix for setting the called name to by our IP if the called name was *SMBSERVER and *SMBSERV -- fixes issue with connecting to printers via \ip.ad.dr.ess\printer UNC path 2007-10-10 10:51:32 -05:00
Jeremy Allison
ea41d69427 r645: Patch from kawasa_r@itg.hitachi.co.jp to correctly enable core dumps.
Jeremy.
2007-10-10 10:51:32 -05:00
Jeremy Allison
578a508509 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.
2007-10-10 10:51:30 -05:00
Andrew Bartlett
d0b820562b Given how often a panic has to do with malloc() problems, don't tempt
things more by calling SAFE_FREE() just before we exit our panic handler.

Andrew Bartlett
-
Jeremy Allison
0272fac8ca Merge from HEAD for Amanda group.
Apply Craig Barratt's fixes to allow multiple exlusion files and patterns.
Jeremy.
-