All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file
       [not found] <20090211213312.919E8189338@amethyst.openembedded.net>
@ 2009-03-03 12:36 ` Krzysztof Kotlenga
  2009-03-03 12:53   ` Frans Meulenbroeks
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kotlenga @ 2009-03-03 12:36 UTC (permalink / raw)
  To: openembedded-devel

> Module: openembedded.git
> Branch: org.openembedded.dev
> Commit: 4e1b79d2d824ae7e0204251a09e852c24045c54a
> URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=4e1b79d2d824ae7e0204251a09e852c24045c54a
> 
> Author: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
> Date:   Wed Feb 11 22:32:06 2009 +0100
> 
> opkg: fix bug that occured with file names of exactly 100 chars in
> the tar file
> 
> ---
> 
>  packages/opkg/files/opkg_unarchive.patch |   13 +++++++++++++

Hi,
this is actually a new bug, it causes paths in .list files being cut at
99 characters. I've run into this issue when I couldn't find gcc in
meta-toolchain.

-- 
kjk



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file
  2009-03-03 12:36 ` [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file Krzysztof Kotlenga
@ 2009-03-03 12:53   ` Frans Meulenbroeks
  2009-03-03 17:22     ` Krzysztof Kotlenga
  0 siblings, 1 reply; 6+ messages in thread
From: Frans Meulenbroeks @ 2009-03-03 12:53 UTC (permalink / raw)
  To: openembedded-devel

2009/3/3 Krzysztof Kotlenga <pocek@users.sf.net>:
>> Module: openembedded.git
>> Branch: org.openembedded.dev
>> Commit: 4e1b79d2d824ae7e0204251a09e852c24045c54a
>> URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=4e1b79d2d824ae7e0204251a09e852c24045c54a
>>
>> Author: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
>> Date:   Wed Feb 11 22:32:06 2009 +0100
>>
>> opkg: fix bug that occured with file names of exactly 100 chars in
>> the tar file
>>
>> ---
>>
>>  packages/opkg/files/opkg_unarchive.patch |   13 +++++++++++++
>
> Hi,
> this is actually a new bug, it causes paths in .list files being cut at
> 99 characters. I've run into this issue when I couldn't find gcc in
> meta-toolchain.
>
> --
> kjk
>

I don't have time today to look into this (all day & evening hooked up
at work). Probably tomorrow.
Anyway, appending the 0 byte is no good as tar_entry->name[100] is
already out of bounds.

For now I suggest undoing my patch. I'll come up with a better solution a.s.a.p.
Guess this needs to be fixed at the place where tar_entry->name is
used (the issue was that this array was 100 bytes and got followed by
the mode (.e.g 000644), so without my patch you got files like:
.....xml000644). this happens if the file name is exactly 100 chars

Apologies for any inconvenience.

Frans



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file
  2009-03-03 12:53   ` Frans Meulenbroeks
@ 2009-03-03 17:22     ` Krzysztof Kotlenga
  2009-03-04  1:00       ` Tick
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kotlenga @ 2009-03-03 17:22 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Frans Meulenbroeks wrote:

> Anyway, appending the 0 byte is no good as tar_entry->name[100] is
> already out of bounds.

http://tiny.cc/964UD looks good enough. It's interesting that we have
to trace bugs already fixed upstream years ago.

-- 
kjk

[-- Attachment #2: opkg.diff --]
[-- Type: text/x-patch, Size: 1011 bytes --]

Index: libbb/unarchive.c
===================================================================
--- libbb/unarchive.c	(revision 201)
+++ libbb/unarchive.c	(working copy)
@@ -600,16 +600,16 @@
                 linkname = NULL;
         } else
 #endif
-        if (tar.formated.prefix[0] == 0) {
-                tar_entry->name = strdup(tar.formated.name);
-        } else {                                              
-                tar_entry->name = concat_path_file(tar.formated.prefix, tar.formated.name);
+        {
+                tar_entry->name = xstrndup(tar.formated.name, 100);
+
+                if (tar.formated.prefix[0]) {
+                        char *temp = tar_entry->name;
+                        tar_entry->name = concat_path_file(tar.formated.prefix, temp);
+                        free(temp);
+                }
         }
 
-	if (strlen(tar_entry->name) > 100) {
-		tar_entry->name[100] = 0;
-	}
-
 	// tar_entry->name = xstrdup(tar.formated.name);
 
 /*

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file
  2009-03-03 17:22     ` Krzysztof Kotlenga
@ 2009-03-04  1:00       ` Tick
  2009-03-04 10:26         ` Krzysztof Kotlenga
  0 siblings, 1 reply; 6+ messages in thread
From: Tick @ 2009-03-04  1:00 UTC (permalink / raw)
  To: openembedded-devel

Hi kjk,
  Thanks, patch applied as R203

Regards,
Tick

2009/3/4 Krzysztof Kotlenga <pocek@users.sf.net>:
> Frans Meulenbroeks wrote:
>
>> Anyway, appending the 0 byte is no good as tar_entry->name[100] is
>> already out of bounds.
>
> http://tiny.cc/964UD looks good enough. It's interesting that we have
> to trace bugs already fixed upstream years ago.
>
> --
> kjk
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file
  2009-03-04  1:00       ` Tick
@ 2009-03-04 10:26         ` Krzysztof Kotlenga
  2009-03-04 10:47           ` Koen Kooi
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kotlenga @ 2009-03-04 10:26 UTC (permalink / raw)
  To: openembedded-devel

Tick wrote:

> Hi kjk,
>   Thanks, patch applied as R203

Thanks Tick.
Since Koen has bumped opkg SRCREV to r203, now we have one problem
left: opkg_unarchive.patch has to be disabled/removed. Otherwise it
breaks what was fixed here.

-- 
kjk



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file
  2009-03-04 10:26         ` Krzysztof Kotlenga
@ 2009-03-04 10:47           ` Koen Kooi
  0 siblings, 0 replies; 6+ messages in thread
From: Koen Kooi @ 2009-03-04 10:47 UTC (permalink / raw)
  To: openembedded-devel

On 04-03-09 11:26, Krzysztof Kotlenga wrote:
> Tick wrote:
>
>> Hi kjk,
>>    Thanks, patch applied as R203
>
> Thanks Tick.
> Since Koen has bumped opkg SRCREV to r203, now we have one problem
> left: opkg_unarchive.patch has to be disabled/removed. Otherwise it
> breaks what was fixed here.

Oops, forgot to commit that bit, sorry. It's in now.

regards,

Koen





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-04 10:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090211213312.919E8189338@amethyst.openembedded.net>
2009-03-03 12:36 ` [oe-commits] Frans Meulenbroeks : opkg: fix bug that occured with file names of exactly 100 chars in the tar file Krzysztof Kotlenga
2009-03-03 12:53   ` Frans Meulenbroeks
2009-03-03 17:22     ` Krzysztof Kotlenga
2009-03-04  1:00       ` Tick
2009-03-04 10:26         ` Krzysztof Kotlenga
2009-03-04 10:47           ` Koen Kooi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.