1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00
Commit Graph

106 Commits

Author SHA1 Message Date
Jeremy Allison
14ff2e8de9 Fix bug #7700 - Improvement of return code of smbclient
Based on an initial patch from H Hasegawa <hasegawa.hiroyuki@fujixerox.co.jp>.
Convert cli_list and associated functions to take calls that return NTSTATUS.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Oct 29 19:40:16 UTC 2010 on sn-devel-104
2010-10-29 19:40:16 +00:00
Günther Deschner
c7fe04abc7 s3-build: only include async headers where needed.
Guenther
2010-09-20 13:54:42 -07:00
Günther Deschner
4349027b63 s3-cli: fix uninitialized variable.
Volker, please check.

Guenther
2010-08-19 14:08:06 +02:00
Günther Deschner
f6ac919a91 s3-libsmb: fix some uninitialized variables.
Volker, please check.

Guenther
2010-08-19 12:36:23 +02:00
Volker Lendecke
d7c8fb21bb s3: async cli_list 2010-08-18 15:14:02 +02:00
Volker Lendecke
ee11bb8748 s3: Remove some direct cli->inbuf references in interpret_long_filename 2010-08-05 14:53:54 +02:00
Volker Lendecke
869a19f06c s3: Remove a pointless wrapper function 2010-08-05 14:53:54 +02:00
Volker Lendecke
61fb8a4fd1 s3: Explicitly pass flags2 to clistr_pull_talloc
Required to eventually make cli_list async
2010-08-05 14:53:54 +02:00
Volker Lendecke
6cb5a0d097 s3: Remove some pointless wrapper functions 2010-08-05 13:57:31 +02:00
Volker Lendecke
867626abca s3: Convert cli_list() to return NTSTATUS
If needed, the callback functions can count themselves
2010-08-04 20:32:50 +02:00
Volker Lendecke
2ff73f0df3 s3: Use data_blob_null 2010-08-04 20:32:50 +02:00
Volker Lendecke
fcdda8f443 s3: Remove "cli" from "struct finfo" 2010-07-30 17:01:33 +02:00
Volker Lendecke
dace013898 s3: Remove a typedef (struct file_info) 2010-07-27 21:05:35 +02:00
Andreas Schneider
34de8a00dd s3-libsmb: Make sure that finfo is initialized.
Found by clang-analyzer.
2010-06-28 12:56:13 +02:00
Volker Lendecke
72d2c370e2 s3: Remove unreachable code 2010-05-22 13:08:38 +02:00
Jeremy Allison
f9c9dee013 Convert from numbers to correct SMB_FIND_XX constant names.
Jeremy.
2009-11-02 16:17:36 -08:00
Jeremy Allison
e5136e9849 Remove the static "struct client_connection" mess which is part of
the problem that stops libsmbclient being thread safe. Subsidiary
DFS connections are now hung off a list inside the cli_state struct.
Much more to do in order to get libsmbclient to thread safety, but
this is a good start.
Jeremy.
2009-03-12 17:59:24 -07:00
Volker Lendecke
7f25e0da73 Decouple clistr_pull from struct cli_state->inbuf 2009-01-26 05:39:34 +01:00
Kai Blin
3144e45085 (Fixed) Final part of fix for bug #5953 - smbclient crashes: cli_list_new segmentation fault (with NAS-BASIC server). 2008-12-16 13:40:38 -08:00
Jeremy Allison
3edbc14405 Revert "Final part of fix for bug #5953 - smbclient crashes: cli_list_new segmentation fault (with NASBASIC server)."
Error in commit !

This reverts commit bbd5824140.
2008-12-16 13:31:52 -08:00
Kai Blin
bbd5824140 Final part of fix for bug #5953 - smbclient crashes: cli_list_new segmentation fault (with NASBASIC server). 2008-12-16 13:19:15 -08:00
Jeremy Allison
3878dad0c6 Fix bug #5953 - smbclient crashes: cli_list_new segmentation fault.
Jeremy.
2008-12-08 14:24:38 -08:00
Jeremy Allison
1d940490e8 Fix from Guenter Kukkukk <linux@kukkukk.com> to fix listing against
OS/2 servers. OS/2 returns eclass == ERRDOS && ecode == ERRnofiles
for a zero entry directory listing.
Jeremy.
(This used to be commit b34da62705)
2008-02-28 02:22:13 -08:00
Jeremy Allison
20d6ebe813 We don't need the extra null termination - we've
already got this in the cli_receive_trans calls.
Jeremy.
(This used to be commit 99424bba7b)
2008-02-08 22:02:00 -08:00
Jeremy Allison
0b583e4329 Make clilist work again with OS/2 (kukks help!).
Jeremy.
(This used to be commit 2e27309401)
2008-02-08 19:02:49 -08:00
Jeremy Allison
73d838a2da From kukks - prevent crashes if finfo.name == NULL.
Jeremy.
(This used to be commit 101f194795)
2008-02-08 18:44:33 -08:00
Jeremy Allison
48ea5852b6 Try and fix length and finfo calls for older clients. Working
on issues reported by kukks.
Jeremy.
(This used to be commit dcd77dd4f4)
2008-02-08 11:22:53 -08:00
Jeremy Allison
afc93255d1 Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
(This used to be commit d78045601a)
2007-12-26 17:12:36 -08:00
Volker Lendecke
1e26ecf666 Fix C++ warnings
(This used to be commit 01a5c3ea4b)
2007-12-08 09:39:36 -08:00
Jeremy Allison
4acfce6b03 Don't understand this. I have no changes here....
Jeremy.
(This used to be commit 49534432d4)
2007-12-06 10:10:16 -08:00
Jeremy Allison
8ab33fc335 Fix path length limits on cli_list (outgoing. Incoming
will be fixed with pstring elimination).
Jeremy.
(This used to be commit cd43b93d40)
2007-12-05 16:56:19 -08:00
Jeremy Allison
42c87fe6e6 Remove pstrings. Ensure we validate offsets.
Jeremy.
(This used to be commit ff06cc34e6)
2007-11-29 13:24:14 -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
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05: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
Jeremy Allison
0829e1ad1c r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message()
calls). This will allow the server to reflect back
the correct encryption context.
Jeremy.
(This used to be commit 2d80a96120)
2007-10-10 12:19:30 -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
Derrell Lipman
40665edf5e r18011: Should fix bug 3835.
Jeremy: requires your eyes...

If the remote connection timed out while cli_list() was retrieving its list of
files, the error was not returned to the user, e.g. via smbc_opendir(), so the
user didn't have a way to know to set the timeout longer and try again.  This
problem would occur when a very large directory is being read with a too-small
timeout on the cli.

Jeremy, although there were a couple of areas that needed to be handled, I
needed to make one change that you should bless, in libsmb/clientgen.c.  It
was setting

  cli->smb_rw_error = smb_read_error;

but smb_read_error is zero, so this had no effect.  I'm now doing

  cli->smb_rw_error = READ_TIMEOUT;

instead, and according to the OP, these (cumulative) changes (in a slightly
different form) solve the problem.

Please confirm this smb_rw_error change will have no other adverse effects
that you can see.

Derrell
(This used to be commit fa664b24b8)
2007-10-10 11:39:48 -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
aee6b5942a r17761: Handle times consistently across all client utils.
Fixes bugs reported in libsmbclient.
Jeremy.
(This used to be commit 42a417fb75)
2007-10-10 11:38:47 -05:00
Volker Lendecke
02eea79624 r17333: Some C++ warnings
(This used to be commit be9aaffdac)
2007-10-10 11:38:26 -05:00
Jeremy Allison
fe28eb2e41 r16541: Fix #3862 reported by jason@ncac.gwu.edu.
Jeremy.
(This used to be commit 09e11dcb23)
2007-10-10 11:18:58 -05:00
Jeremy Allison
61d2dfcd30 r15997: Fix bug in OS/2 Warp - it doesn't set the ff_last
offset correctly when doing info level 1 directory
scans. Thanks to Guenter Kukkukk <Guenter.Kukkukk@kukkukk.com>
for reporting this problem and testing the fix.
Jeremy.
(This used to be commit 65d4dfbd60)
2007-10-10 11:17:17 -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
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Derrell Lipman
f396e2248a r12758: r12127@cabra: derrell | 2006-01-03 15:22:18 -0500
remove old superfluous comment and ifdef
(This used to be commit ee7fcb43ad)
2007-10-10 11:06:02 -05:00
Jeremy Allison
76796e212c r12275: Fix memory leak found by Mikhail Kshevetskiy <kl@laska.dorms.spbu.ru>
and followed up by derrell@samba.org.
Jeremy.
(This used to be commit 5cab88f144)
2007-10-10 11:05:51 -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
Tim Potter
ab398643a4 r8572: Remove crufty #define NO_SYSLOG as it's not used at all anymore.
(This used to be commit 985dbb47d9)
2007-10-10 11:00:11 -05:00