1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-15 16:23:49 +03:00
Commit Graph

84 Commits

Author SHA1 Message Date
Jeremy Allison
b34da62705 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.
2008-02-28 02:22:13 -08:00
Jeremy Allison
99424bba7b We don't need the extra null termination - we've
already got this in the cli_receive_trans calls.
Jeremy.
2008-02-08 22:02:00 -08:00
Jeremy Allison
2e27309401 Make clilist work again with OS/2 (kukks help!).
Jeremy.
2008-02-08 19:02:49 -08:00
Jeremy Allison
101f194795 From kukks - prevent crashes if finfo.name == NULL.
Jeremy.
2008-02-08 18:44:33 -08:00
Jeremy Allison
dcd77dd4f4 Try and fix length and finfo calls for older clients. Working
on issues reported by kukks.
Jeremy.
2008-02-08 11:22:53 -08:00
Jeremy Allison
d78045601a Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
2007-12-26 17:12:36 -08:00
Volker Lendecke
01a5c3ea4b Fix C++ warnings 2007-12-08 09:39:36 -08:00
Jeremy Allison
49534432d4 Don't understand this. I have no changes here....
Jeremy.
2007-12-06 10:10:16 -08:00
Jeremy Allison
cd43b93d40 Fix path length limits on cli_list (outgoing. Incoming
will be fixed with pstring elimination).
Jeremy.
2007-12-05 16:56:19 -08:00
Jeremy Allison
ff06cc34e6 Remove pstrings. Ensure we validate offsets.
Jeremy.
2007-11-29 13:24:14 -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
Gerald (Jerry) Carter
5c6c8e1fe9 [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. 2007-10-10 15:34:30 -05: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
Jeremy Allison
2d80a96120 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.
2007-10-10 12:19:30 -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
Derrell Lipman
fa664b24b8 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
2007-10-10 11:39:48 -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
42a417fb75 r17761: Handle times consistently across all client utils.
Fixes bugs reported in libsmbclient.
Jeremy.
2007-10-10 11:38:47 -05:00
Volker Lendecke
be9aaffdac r17333: Some C++ warnings 2007-10-10 11:38:26 -05:00
Jeremy Allison
09e11dcb23 r16541: Fix #3862 reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:18:58 -05:00
Jeremy Allison
65d4dfbd60 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.
2007-10-10 11:17:17 -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
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Derrell Lipman
ee7fcb43ad r12758: r12127@cabra: derrell | 2006-01-03 15:22:18 -0500
remove old superfluous comment and ifdef
2007-10-10 11:06:02 -05:00
Jeremy Allison
5cab88f144 r12275: Fix memory leak found by Mikhail Kshevetskiy <kl@laska.dorms.spbu.ru>
and followed up by derrell@samba.org.
Jeremy.
2007-10-10 11:05:51 -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
Tim Potter
985dbb47d9 r8572: Remove crufty #define NO_SYSLOG as it's not used at all anymore. 2007-10-10 11:00:11 -05:00
Jeremy Allison
f9063b383e r7157: Ensure we abort a directory listing if we see the same
name twice between packets.
Jeremy.
2007-10-10 10:57:04 -05:00
Jeremy Allison
848940d5a9 r7151: Fix for bug #2698. If a unicode to unix charset conversion fails (due to buggy iconv?) we can
be left with a filename that doesn't exist on the remote machine. If we then do a findnext
with this file the server gets confused and restarts from the beginning of the directory,
causing directory listing loops. Fix this by keeping a copy of the "raw" filename data and
length and using this as the argument to findnext. This won't fix the incorrect iconv
conversion into the finfo struct but at least it ensures that directory listings always
terminate. Tested against NTFS and FAT directories.
Jeremy.
2007-10-10 10:57:03 -05:00
Jeremy Allison
8227675d3d r6994: Fix for bugid #2729 - it turns out resume keys are *mandatory* for
a search when listing a W2K and above server from a FATxx filesystem
only. Thanks to Steve Langasek <vorlon@debian.org> for giving me the
essential info that allowed me to reproduce and thus fix this.
Jeremy.
2007-10-10 10:56:59 -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
5ded615679 r5991: Fixup last entry offset correctly for level 260.
Should fix bug found by Derrell.Lipman@UnwiredUniverse.com.
Jeremy.
2007-10-10 10:56:14 -05:00
Jeremy Allison
08616ad80d r5975: Re-arrange code and comments to make more sense.
Jeremy.
2007-10-10 10:56:14 -05:00
Jeremy Allison
b0de2d761f r5973: Fix up overwrite of last 2 bytes on clilist (could cause coredump).
Jeremy.
2007-10-10 10:56:14 -05:00
Jeremy Allison
2ed7e30cbb r5970: Fix old bug where ff_searchcount was being compared -1 ! This caused a
filename to be processed twice.
Jeremy.
2007-10-10 10:56:13 -05:00
Jeremy Allison
214a2cbe5a r5967: Fix typo bug where flags overwrote info level.
Jeremy.
2007-10-10 10:56:13 -05:00
Jeremy Allison
710bceee32 r5723: Add missing part of fix for #2271. After analysing the actions of a XP
client against a Samba server. It never uses the "continue" flag, but always
does "new search, continue from this file" instead. Change our client code
to do the same (it appears that's all they test in W2K etc.).
Jeremy.
2007-10-10 10:55:57 -05:00
Jeremy Allison
4f2da9ecf1 r5702: Fix bug #2271. Correctly pull out and use resume names in a
directory listing (we were incorrectly understanding what was
returned in the "last name" entry).
Jeremy.
2007-10-10 10:55:55 -05:00
Gerald Carter
d4443807bc r5577: get recurse; dir working across single level dfs referrals 2007-10-10 10:55:48 -05:00
Gerald Carter
53d6a5f9d1 r5520: fix last remaining dfs issues with smbclient.
* all the unix extension commands should work
* send the correct TRANS2_FINDFIRST format to 2k to
  get a listing from a msdfs root share (tested against
  smbd as well).
* mkdir, rmdir, etc... all seem ok.

I'm sure bugs will pop up so keep testing.

Last thing I plan on doing is to clean up the horrible
mess with connection management in smbclient and global
variables (so i can move the cli_cm_xx() routines to a
separate file).
2007-10-10 10:55:44 -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
Jim McDonough
4319df7fdc Janitor for tpot...bugzilla #1098, msleep already exists on aix -
Jeremy Allison
ad06edd1bb Fixes to check for wraps which could cause coredumps.
Jeremy.
-
Jeremy Allison
2093a3130d Correct fix (removed the earlier band-aid) for what I thought was a signing
bug with w2k. Turns out that when we're doing a trans/trans2/nttrans call
the MID and send_sequence_number and reply_sequence_number must remain constant.
This was something we got very wrong in earlier versions of Samba. I can now
get a directory listing from WINNT\SYSTEM32 with the older earlier parameters
for clilist.c
This still needs to be fixed for the server side of Samba, client appears to
be working happily now (I'm doing a signed smbtar download of an entire W2K3
image to test this :-).
Jeremy.
-
Jeremy Allison
677d3a3c4c Fix bug we discovered in W2K client signing on secondary trans2 packets.
Use W2K parameters. tpot please re-test smbclient with your problem
directory.
Jeremy.
-
Jeremy Allison
b8f6b83646 Eliminate valgrind error when client gets bad sig on list. Some reformatting.
Jeremy.
-
Andrew Bartlett
c5b604e2ee Jeremy merged across my string parinoia fixes, but forgot to enable them! :-)
This patch catches up on the rest of the work - as much string checking
as is possible is done at compile time, and the rest at runtime.

Lots of code converted to pstrcpy() etc, and other code reworked to correctly
call sizeof().

Andrew Bartlett
-
Jeremy Allison
33b11d5eb5 Change size parameters from signed to unsigned to fix up warnings.
Jeremy.
-
Gerald Carter
0fb724b321 *lots of small merges form HEAD
*sync up configure.in
*don't build torture tools in make all
*make sure to remove torture tools as part of make clean
-