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

147 Commits

Author SHA1 Message Date
Volker Lendecke
9ea0078c31 Fix Coverity ID 564
finfo1==NULL just does not happen in current code
2008-03-15 22:30:25 +01:00
Volker Lendecke
21d126c56a Fix Coverity ID 463 2008-01-24 16:31:55 +01:00
Volker Lendecke
fd34ce4370 strtok -> strtok_r 2008-01-23 15:08:04 +01:00
Volker Lendecke
86d9412611 Remove next_token_nr_talloc and its associated global
Only client.c and clitar.c used this, I think they should carry the static
themselves. Also move the a bit funny routine toktocliplist to clitar.c, the
only place where it is used.
2007-12-21 09:58:20 +01:00
Volker Lendecke
85a7f800b6 C++ warning 2007-12-09 17:04:05 +01:00
Jeremy Allison
1d5fee5038 Remove pstring from clitar.c
Jeremy
2007-12-07 11:28:16 -08:00
Jeremy Allison
252ef28bb8 Add popt to binaries in makefile. Hack clitar to compile until I fix it.
Jeremy.
2007-12-06 18:08:01 -08:00
Jeremy Allison
f3bd5e828a Fix bug #4393 smbclient does not store files with zero filesize in tar-archives
from tometzky@batory.org.pl.
Jeremy.
2007-11-16 17:06:36 -08:00
Jeremy Allison
1ea3ac8014 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
2007-11-15 14:19:52 -08:00
Jeremy Allison
f35a266b3c RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
2007-10-18 17:40:25 -07:00
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Stefan Metzmacher
fa322f0cc9 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
2007-10-10 12:18:59 -05:00
Jeremy Allison
1c9e10569c r21768: Fix the client dfs code such that smbclient can
process deep dfs links (ie. links that go to non root
parts of a share). Make the directory handling conanonical
in POSIX and Windows pathname processing.
dfs should not be fully working in client tools. Please
bug me if not.
Jeremy.
2007-10-10 12:18:30 -05:00
Jeremy Allison
8f3d530c5a r21714: Change the VFS interface to use struct timespec
for utimes - change the call to ntimes. This preserves
nsec timestamps we get from stat (if the system supports
it) and only maps back down to usec or sec resolution
on time set. Looks bigger than it is as I had to move
lots of internal code from using time_t and struct utimebuf
to struct timespec.
Jeremy.
2007-10-10 12:18:24 -05:00
Volker Lendecke
86f4ca84f2 r18047: More C++ stuff 2007-10-10 11:43:24 -05:00
Volker Lendecke
ac7087a651 r17850: Another dummy checkin for the build farm to retry 2007-10-10 11:38:53 -05:00
Jeremy Allison
425280a1d2 r17800: Start using struct timespec internally for file times
on the wire. This allows us to go to nsec resolution
for systems that support it. It should also now be
easy to add a correct "create time" (birth time)
for systems that support it (*BSD). I'll be watching
the build farm closely after this one for breakage :-).
Jeremy.
2007-10-10 11:38:48 -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
6c61dc8ed6 r16230: Fix Klocwork #861 and others. localtime and asctime
can return NULL. Ensure we check all returns correctly.
Jeremy.
2007-10-10 11:17:26 -05:00
Jeremy Allison
1b73e699e1 r15141: Fix for #3592 inspired by Justin Best <justinb@pdxmission.org>.
Ignore a file in a tar output if the first read fails. Also
cope with <2GB read fail.
Jeremy.
2007-10-10 11:16:26 -05:00
Volker Lendecke
811ae2b21f r14248: Fix Coverity bug # 84 2007-10-10 11:15:20 -05:00
Volker Lendecke
ebc21336d8 r14246: Fix Coverity bug # 85 2007-10-10 11:15:20 -05:00
Volker Lendecke
9f645e9962 r14242: Fix Coverity bug # 82 2007-10-10 11:15:19 -05:00
Steve French
33a1e26114 r14128: Remove warning generated by coverity scan tool (missing SAFE_FREE in error path) 2007-10-10 11:11:14 -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
Jeremy Allison
fe63a6ee06 r13535: Fix #2353 based on a patch by William Jojo.
Jeremy.
2007-10-10 11:10:11 -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
Jeremy Allison
cd192ed79a r12045: More warning fixes... Just a few more to go.
Jeremy.
2007-10-10 11:05:42 -05:00
Jeremy Allison
414303bc02 r11511: A classic "friday night check-in" :-). This moves much
of the Samba4 timezone handling code back into Samba3.
Gets rid of "kludge-gmt" and removes the effectiveness
of the parameter "time offset" (I can add this back
in very easily if needed) - it's no longer being
looked at. I'm hoping this will fix the problems people
have been having with DST transitions. I'll start comprehensive
testing tomorrow, but for now all modifications are done.
Splits time get/set functions into srv_XXX and cli_XXX
as they need to look at different timezone offsets.
Get rid of much of the "efficiency" cruft that was
added to Samba back in the day when the C library
timezone handling functions were slow.
Jeremy.
2007-10-10 11:05:19 -05:00
Herb Lewis
efea76ac71 r6225: get rid of warnings from my compiler about nested externs 2007-10-10 10:56:30 -05:00
Gerald Carter
85be4c5df3 r5968: derrell's large file fix for libsmbclient (BUG 2505) 2007-10-10 10:56:13 -05:00
Jeremy Allison
84e7b7db89 r5687: Fix for bug #2398 from Kevin Dalley <kevin@kelphead.org>.
smbtar shouldn't assume /dev/null means dryrun.
Jeremy.
2007-10-10 10:55:54 -05:00
Gerald Carter
f88f5e1218 r5295: fix compile issue with MIT 1.4 due to broken gssapi.h 2007-10-10 10:55:37 -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
Tim Potter
7f161702fa r2835: Since we always have -I. and -I$(srcdir) in CFLAGS, we can get rid of
'..' from all #include preprocessor commands.   This fixes bugzilla #1880
where OpenVMS gets confused about the '.' characters.
2007-10-10 10:52:55 -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
Jelmer Vernooij
374f00b56b r1320: Return an error when the last command read from stdin fails in smbclient +
prepare for better error checking in tar..
2007-10-10 10:52:06 -05:00
Jeremy Allison
0272fac8ca Merge from HEAD for Amanda group.
Apply Craig Barratt's fixes to allow multiple exlusion files and patterns.
Jeremy.
-
Jeremy Allison
aa40a86cbe Fix from Craig Barratt <cbarratt@users.sourceforge.net> to fix restore
with filenames > 100 chars.
Jeremy.
-
Jeremy Allison
e2b73477e7 Proposed patch for #308. Needs testing.
Jeremy
-
Tim Potter
a46e58e2b6 Print an error instead of crashing if no argument is specified for
smbclient -T

Fixes bug 345.
-
Volker Lendecke
e3b36906c5 Apply a little const -
Jeremy Allison
520bee397d Reversed replacement. Oops.
Jeremy.
-
Jeremy Allison
455ed2d51d Get rid of MAXPATHLEN, move to standard PATH_MAX.
Jeremy.
-
Jeremy Allison
c4af1ec735 Fix the option processing for smbtar. Does no one check this !
Jeremy.
-
Jeremy Allison
5ef75fa366 Finish reformatting.
Jeremy.
-
Jeremy Allison
77f2a91549 Reformat lots of clitar code as I hate the style so much :-).
Jeremy.
-
Jeremy Allison
94b30e7b4a Reformat clitar option processing - getting ready to fix it for popt...
Jeremy.
-
Tim Potter
b54183a7b2 Fix from Dragan Krnic for handling files in tar archives > 8GB.
Fixes bug 102.
-