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

157 Commits

Author SHA1 Message Date
Jeremy Allison
4cbd0c77e4 Make cli_getatr() async.
Jeremy.
2009-05-05 20:59:22 -07:00
Volker Lendecke
4949a2cfaa Fix some warnings due to uint16_t!=-1 always being true 2009-05-03 22:48:31 +02:00
Jeremy Allison
f3af298e5b Cause cli_close to return an NTSTATUS.
Jeremy.
2009-04-30 16:57:42 -07:00
Jeremy Allison
8cf78ff553 Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
Convert all uses of cli_open(), cli_nt_createXXX to NTSTATUS versions.
This is smaller than it looks, it just fixes a lot of old code.
Next up, ensure all cli_XX functions return NTSTATUS.
Jeremy.
2009-04-30 15:26:43 -07:00
Jeremy Allison
502f47c7c0 Make cli_chkpath async.
Jeremy
2009-04-22 06:46:42 -07:00
Jeremy Allison
dfc79de607 Make cli_mkdir async. Change it to return NTSTATUS.
Jeremy.
2009-04-21 05:52:34 -07:00
Jeremy Allison
66c0f3690a Fix bug #6161 - smbclient corrupts source path in tar mode
This was my fault. I broke the smbclient tar argument processing
in creating the string for chdir when removing pstrings.
Jeremy.
2009-03-05 17:19:18 -08:00
Jeremy Allison
07e0094365 Fix all warnings in source3 with gcc4.3.
Jeremy.
2008-12-31 18:06:57 -08:00
Jelmer Vernooij
4746f79d50 Use {u,}int64_t instead of SMB_BIG_{U,}INT. 2008-10-14 01:59:36 +02:00
Volker Lendecke
c8dfed63a6 Fix a brown paper bag segfault in clitar
Thanks to "No Body is Perfect" from gmail, whoever that is :-)

Volker
(cherry picked from commit 679d8dfa39)
(This used to be commit b8e1d62b8e)
2008-06-17 21:14:47 +02:00
Volker Lendecke
fa495ce1c1 Fix Coverity ID 564
finfo1==NULL just does not happen in current code
(This used to be commit 9ea0078c31)
2008-03-15 22:30:25 +01:00
Volker Lendecke
ba6c78c355 Fix Coverity ID 463
(This used to be commit 21d126c56a)
2008-01-24 16:31:55 +01:00
Volker Lendecke
587cf54c61 strtok -> strtok_r
(This used to be commit fd34ce4370)
2008-01-23 15:08:04 +01:00
Volker Lendecke
bea1659911 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.
(This used to be commit 86d9412611)
2007-12-21 09:58:20 +01:00
Volker Lendecke
d58868f2a4 C++ warning
(This used to be commit 85a7f800b6)
2007-12-09 17:04:05 +01:00
Jeremy Allison
67344a467f Remove pstring from clitar.c
Jeremy
(This used to be commit 1d5fee5038)
2007-12-07 11:28:16 -08:00
Jeremy Allison
e67a6620a7 Add popt to binaries in makefile. Hack clitar to compile until I fix it.
Jeremy.
(This used to be commit 252ef28bb8)
2007-12-06 18:08:01 -08:00
Jeremy Allison
0cfad17e4a Fix bug #4393 smbclient does not store files with zero filesize in tar-archives
from tometzky@batory.org.pl.
Jeremy.
(This used to be commit f3bd5e828a)
2007-11-16 17:06:36 -08:00
Jeremy Allison
68be9a8200 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.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Jeremy Allison
30191d1a57 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.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07: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
Stefan Metzmacher
56ba447668 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
(This used to be commit fa322f0cc9)
2007-10-10 12:18:59 -05:00
Jeremy Allison
540911001d 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.
(This used to be commit 1c9e10569c)
2007-10-10 12:18:30 -05:00
Jeremy Allison
4952fe368a 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.
(This used to be commit 8f3d530c5a)
2007-10-10 12:18:24 -05:00
Volker Lendecke
f8a17bd8bd r18047: More C++ stuff
(This used to be commit 86f4ca84f2)
2007-10-10 11:43:24 -05:00
Volker Lendecke
5196825b4c r17850: Another dummy checkin for the build farm to retry
(This used to be commit ac7087a651)
2007-10-10 11:38:53 -05:00
Jeremy Allison
a64925ddff 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.
(This used to be commit 425280a1d2)
2007-10-10 11:38:48 -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
a1e0a0e928 r16230: Fix Klocwork #861 and others. localtime and asctime
can return NULL. Ensure we check all returns correctly.
Jeremy.
(This used to be commit 6c61dc8ed6)
2007-10-10 11:17:26 -05:00
Jeremy Allison
2ebcc2933a 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.
(This used to be commit 1b73e699e1)
2007-10-10 11:16:26 -05:00
Volker Lendecke
b84029452b r14248: Fix Coverity bug # 84
(This used to be commit 811ae2b21f)
2007-10-10 11:15:20 -05:00
Volker Lendecke
0837f6b584 r14246: Fix Coverity bug # 85
(This used to be commit ebc21336d8)
2007-10-10 11:15:20 -05:00
Volker Lendecke
1c66bcef8d r14242: Fix Coverity bug # 82
(This used to be commit 9f645e9962)
2007-10-10 11:15:19 -05:00
Steve French
58752bccdd r14128: Remove warning generated by coverity scan tool (missing SAFE_FREE in error path)
(This used to be commit 33a1e26114)
2007-10-10 11:11:14 -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
Jeremy Allison
eca035db9a r13535: Fix #2353 based on a patch by William Jojo.
Jeremy.
(This used to be commit fe63a6ee06)
2007-10-10 11:10:11 -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
Jeremy Allison
a168730dda r12045: More warning fixes... Just a few more to go.
Jeremy.
(This used to be commit cd192ed79a)
2007-10-10 11:05:42 -05:00
Jeremy Allison
6d5757395a 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.
(This used to be commit 414303bc02)
2007-10-10 11:05:19 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Gerald Carter
b3e57cb3ff r5968: derrell's large file fix for libsmbclient (BUG 2505)
(This used to be commit 85be4c5df3)
2007-10-10 10:56:13 -05:00
Jeremy Allison
00340b20f9 r5687: Fix for bug #2398 from Kevin Dalley <kevin@kelphead.org>.
smbtar shouldn't assume /dev/null means dryrun.
Jeremy.
(This used to be commit 84e7b7db89)
2007-10-10 10:55:54 -05:00
Gerald Carter
66ffe14608 r5295: fix compile issue with MIT 1.4 due to broken gssapi.h
(This used to be commit f88f5e1218)
2007-10-10 10:55:37 -05:00
Jeremy Allison
acf9d61421 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.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Tim Potter
b4cf9e9505 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.
(This used to be commit 7f161702fa)
2007-10-10 10:52:55 -05:00
Jeremy Allison
3ef0710fa4 r2361: Fix the appalling toktocliplist() fn. Bug found by Luis Benvenutto.
Jeremy.
(This used to be commit d434d8e2b4)
2007-10-10 10:52:40 -05:00
Jelmer Vernooij
3382b0a21a r1320: Return an error when the last command read from stdin fails in smbclient +
prepare for better error checking in tar..
(This used to be commit 374f00b56b)
2007-10-10 10:52:06 -05:00
Jeremy Allison
7942c2826b Merge from HEAD for Amanda group.
Apply Craig Barratt's fixes to allow multiple exlusion files and patterns.
Jeremy.
(This used to be commit 0272fac8ca)
2004-03-18 23:45:15 +00:00
Jeremy Allison
a4e5e3f3a5 Fix from Craig Barratt <cbarratt@users.sourceforge.net> to fix restore
with filenames > 100 chars.
Jeremy.
(This used to be commit aa40a86cbe)
2003-09-12 01:25:35 +00:00