xbps-create: if a symlink points to an unexistent file store symlink target as is.
Seen in recent builds when building the systemd binpkg: [chroot] => Building systemd-194_1.x86_64.xbps... xbps-create.real: main.c:219: ftw_cb: Assertion `p' failed. Which was asserting in a symlink that was pointing to a file provided by the udev pkg, therefore realpath(3) failed.
This commit is contained in:
parent
b13df00ded
commit
42c21e1c3c
@ -216,9 +216,17 @@ ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf)
|
|||||||
*/
|
*/
|
||||||
if (strncmp(buf, "../", 3) == 0) {
|
if (strncmp(buf, "../", 3) == 0) {
|
||||||
p = realpath(fpath, NULL);
|
p = realpath(fpath, NULL);
|
||||||
assert(p);
|
if (p == NULL) {
|
||||||
xe->target = strdup(p + strlen(destdir));
|
/*
|
||||||
free(p);
|
* This symlink points to an unexistent file,
|
||||||
|
* which might be provided in another package.
|
||||||
|
* So let's use the same target.
|
||||||
|
*/
|
||||||
|
xe->target = strdup(buf);
|
||||||
|
} else {
|
||||||
|
xe->target = strdup(p + strlen(destdir));
|
||||||
|
free(p);
|
||||||
|
}
|
||||||
} else if (strchr(buf, '/') == NULL) {
|
} else if (strchr(buf, '/') == NULL) {
|
||||||
p = strdup(filep);
|
p = strdup(filep);
|
||||||
assert(p);
|
assert(p);
|
||||||
|
Loading…
Reference in New Issue
Block a user