Skip to contentSkip to conversation

fix for qemu-* looping forever on symlinks (patch attached)

Qemu-devel Michael Gilbert 3 participants 4 messages Jul 14, 2006 – Jul 15, 2006

lore
Share & tools
lore
#0 lore raw

please review the attached patch (to linux-user/path.c), which i believe fixes the problem of qemu looping forever on symlinks when using -L. it is undesirable (i believe) for the -L option to search all subdirectories. this is in reference to debian bug #297572 (bugs.debian.org/297572).

mike gilbert

path-me.c renamed from qemu-0.8.1/linux-user/path.c +1 -1
@@ -100,7 +100,7 @@
         return;
 
     base = new_entry("", NULL, prefix+1);
-    base = add_dir_maybe(base);
+    //base = add_dir_maybe(base);
     if (base->num_entries == 0) {
         free (base);
         base = NULL;
#1 lore raw
Quoted 5 lines · Michael Gilbert

please review the attached patch (to linux-user/path.c), which i believe fixes the problem of qemu looping forever on symlinks when using -L. it is undesirable (i believe) for the -L option to search all subdirectories. this is in reference to debian bug #297572 (bugs.debian.org/297572).

Have you tried running dynamically linked executables with your patch?

The whole point of the -L option is so that it picks up target shared libraries, eg. in lib and usr/lib. By my reading your patch makes the -L option do absolutely nothing, which can't be right.

The proper fix is to do the lookups when a file is accesses (possibly with caching) not pre-scan the whole tree.

Paul

#2 lore raw
Quoted 6 lines · Paul Brook

The whole point of the -L option is so that it picks up target shared libraries, eg. in lib and usr/lib. By my reading your patch makes the -L option do absolutely nothing, which can't be right.

The proper fix is to do the lookups when a file is accesses (possibly with caching) not pre-scan the whole tree.

Is it possible to use the same cache format as ld.so (/etc/ld.so.cache)? So a command like

qemu-arm -L /target program

would make qemu look for /target/etc/ld.so.cache as its cache, and a command like:

qemu-arm -L /target /target/sbin/ldconfig

would update this cache. Unless the cache you are proposing has different purposes than ld.so's cache?

Regards,

Signature · 1 line
Anderson Lizardo
#3 lore raw
Quoted 9 lines · Anderson Lizardo
Quoted 6 lines · Paul Brook

The whole point of the -L option is so that it picks up target shared libraries, eg. in lib and usr/lib. By my reading your patch makes the -L option do absolutely nothing, which can't be right.

The proper fix is to do the lookups when a file is accesses (possibly with caching) not pre-scan the whole tree.

Is it possible to use the same cache format as ld.so

I don't think there's any point having a persistent cache, and I don't thin the ld.so format would be particularly appropriate either. Qemu just does straight filename translation.

Paul