summaryrefslogtreecommitdiffstats
path: root/source/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-09-12 01:25:35 +0000
committerJeremy Allison <jra@samba.org>2003-09-12 01:25:35 +0000
commitaa40a86cbe797cba4e281cb8dc09b2ae67e93dc2 (patch)
tree709a9370a800fc11b152437247fd81d559bcab0f /source/client
parent5dcf974c22b4bd54193dff876020bacd5b1691b2 (diff)
downloadsamba-aa40a86cbe797cba4e281cb8dc09b2ae67e93dc2.tar.gz
samba-aa40a86cbe797cba4e281cb8dc09b2ae67e93dc2.tar.xz
samba-aa40a86cbe797cba4e281cb8dc09b2ae67e93dc2.zip
Fix from Craig Barratt <cbarratt@users.sourceforge.net> to fix restore
with filenames > 100 chars. Jeremy.
Diffstat (limited to 'source/client')
-rw-r--r--source/client/clitar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/client/clitar.c b/source/client/clitar.c
index b01de5b8e70..f38d6fe91a5 100644
--- a/source/client/clitar.c
+++ b/source/client/clitar.c
@@ -1054,9 +1054,11 @@ static int get_dir(file_info2 finfo)
has the data. We only want the long file name, as the loop in do_tarput
will deal with the rest.
*/
-static char * get_longfilename(file_info2 finfo)
+static char *get_longfilename(file_info2 finfo)
{
- int namesize = strlen(finfo.name) + strlen(cur_dir) + 2;
+ /* finfo.size here is the length of the filename as written by the "/./@LongLink" name
+ * header call. */
+ int namesize = finfo.size + strlen(cur_dir) + 2;
char *longname = malloc(namesize);
int offset = 0, left = finfo.size;
BOOL first = True;