diff options
author | jbj <devnull@localhost> | 1999-12-02 17:07:29 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-12-02 17:07:29 +0000 |
commit | 2b8dc2ee5bee229a7e7886ee79e9dd4b2f8c6922 (patch) | |
tree | 79d1c558be3e9b1ae93a9907348abbbc7f46b935 /build | |
parent | 7e8b64d33591bad6c877d6fe7660107cb339d7f5 (diff) | |
download | librpm-tizen-2b8dc2ee5bee229a7e7886ee79e9dd4b2f8c6922.tar.gz librpm-tizen-2b8dc2ee5bee229a7e7886ee79e9dd4b2f8c6922.tar.bz2 librpm-tizen-2b8dc2ee5bee229a7e7886ee79e9dd4b2f8c6922.zip |
fail to package if absolute symlink points within build root.
CVS patchset: 3452
CVS date: 1999/12/02 17:07:29
Diffstat (limited to 'build')
-rw-r--r-- | build/files.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/build/files.c b/build/files.c index 24b6e3c9e..7b3b4c3f9 100644 --- a/build/files.c +++ b/build/files.c @@ -886,8 +886,20 @@ static void genCpioListAndHeader(struct FileList *fl, &s, 1); buf[0] = '\0'; - if (S_ISLNK(flp->fl_mode)) - buf[readlink(flp->diskURL, buf, BUFSIZ)] = '\0'; + if (S_ISLNK(flp->fl_mode)) { + buf[Readlink(flp->diskURL, buf, BUFSIZ)] = '\0'; + if (fl->buildRootURL) { + const char * buildRoot; + (void) urlPath(fl->buildRootURL, &buildRoot); + + if (buf[0] == '/' && strcmp(buildRoot, "/") && + !strncmp(buf, buildRoot, strlen(buildRoot))) { + rpmError(RPMERR_BADSPEC, _("Symlink points to BuildRoot: %s -> %s"), + flp->fileURL, buf); + fl->processingFailed = 1; + } + } + } s = buf; headerAddOrAppendEntry(h, RPMTAG_FILELINKTOS, RPM_STRING_ARRAY_TYPE, &s, 1); |