public inbox for gentoo-musl@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-musl] realpath() gives wrong result on a chroot musl system
@ 2016-06-06 14:11 Lei Zhang
  2016-06-06 15:23 ` Anthony G. Basile
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lei Zhang @ 2016-06-06 14:11 UTC (permalink / raw
  To: gentoo-musl, Luca Barbato

Hi,

I was trying to run clang (built specifically for musl) on a chroot
musl system, and met some strange issue. After some investigation, it
turns out the function realpath() is giving me wrong results.

I can reproduce the error with the following code snippet:

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

int main(int argc, char** argv) {
    const char* path = "/usr/bin/clang"; // suppose this is a valid path
    char resolved[PATH_MAX];
    char* ret = realpath(path, resolved);

    if (ret)
        printf("%s\n", ret);
}

If I build it against musl, it gives correct result on my host, but
wrong result on chroot; If I build it against glibc (statically, since
there's no glibc on chroot), it gives correct results on both
environments. So it looks like musl is to blame on the chroot
environment. I haven't yet confirmed if it's a bug.

Any thoughts?

BTW, I built my musl system with the GRS tool, using the
desktop-amd64-musl-hardened profile.


Regards,
Lei


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

end of thread, other threads:[~2016-06-07  1:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-06 14:11 [gentoo-musl] realpath() gives wrong result on a chroot musl system Lei Zhang
2016-06-06 15:23 ` Anthony G. Basile
2016-06-06 22:04 ` Felix Janda
2016-06-07  0:19   ` Lei Zhang
2016-06-07  1:44     ` Lei Zhang
     [not found] ` <b08c7775-50c5-db8b-c5b2-211ab0600e02@gentoo.org>
2016-06-07  0:05   ` [gentoo-musl] " Lei Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox