From Bugzilla Helper: User-Agent: Mozilla/4.78 [en] (WinNT; U) Description of problem: if the package_spec file passed into rpm has /.../ in the directory, something inside rpm drops one of the '.': [root]# rpm -bb -vv /.../pcd.spec error: Unable to open /../pcd.spec: No such file or directory error: Name field must be present in package: (main package) error: Version field must be present in package: (main package) error: Release field must be present in package: (main package) error: Summary field must be present in package: (main package) error: Group field must be present in package: (main package) error: License field must be present in package: (main package) [root]# ls -l /.../pcd.spec -rw-r--r-- 1 root root 3771 Jan 9 15:33 /.../pcd.spec my pcd.spec file also has a /.../whatever directory listed as BuildRoot Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. have spec file in /.../ directory 2. execute rpm -bb -vv /.../your_spec_file Actual Results: first line of output: /../whatever.spec: No such file or directory Expected Results: it should have found the /.../whatever.spec file Additional info: works ok w/ RPM that ships with RedHat 6.2; fails on 6.2 with 4.0.2-6x and on 7.2 with 4.0.3-1.03 strace shows rpmb getting called ok: execve("/usr/lib/rpm/rpmb", ["/usr/lib/rpm/rpmb", "-bb", "--verbose", "--verbose", "--", "/.../pcd.spec"], [/* 26 vars */]) = 0 and it opened afterward: open("/etc/rpm/macros", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/rpm/i686-linux/macros", O_RDONLY) = -1 ENOENT (No such file or directory) open("/root/.rpmmacros", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/.../pcd.spec", {st_mode=S_IFREG|0644, st_size=3771, ...}) = 0 open("/.../pcd.spec", O_RDONLY) = 4 but the next open fails: brk(0x8063000) = 0x8063000 brk(0x8066000) = 0x8066000 open("/../pcd.spec", O_RDONLY) = -1 ENOENT (No such file or directory)
Created attachment 42131 [details] output of 'strace -o rpm_strace -f rpm -bb -vv /.../pcd.spec' on gold RedHat 7.2 system.
Yes, rpm cleans all it's file paths. Why do you care whether rpm handles /.../?
DFS 'mounts' onto /.../ which is where I'm hitting this. Yes, DFS is not supported on Linux, but there is a DFS-NFS mapper that allows you to mount a dfs directories via nfs. (DFS is a new/improved/different AFS.) So, rpm is not cleanning properly. What is rpm expecting /.../ to mean? thx.bri.
Try hacking on rpmCleanPath() in rpmio/macro.c, that's where the dirty is done. If you get something that works, please send me a patch.
A small change to rpmCleanPath() in rpmio/macro.c seemed to do the trick: [root@pdoslinux rpmio]# diff macro.c macro.c.fix 1624c1624,1629 < if (begin && s[1] == '.') { --- > /* Check that it is ../, so that we don't interpret */ > /* ..?(i.e. "...") or ..* (i.e. "..bogus") as "..". */ > /* in the case of "...", this ends up being processed*/ > /* as "../.", and the last '.' is stripped. This */ > /* would not be correct processing. */ > if (begin && s[1] == '.' && (s[2] == '/' || s[2] == '\0')) {
Got it, thanks for the patch. Should be in rpm-4.0.4-0.21 and later.