- Previously rpmbuild silently ignored %dir (and trailing slash)
on eg regular files and symlinks and just packaged whatever was
on disk. If the packager specifies something as a directory, ensure
it actually is one and error out otherwise to guard against eg
upstream unexpectly changing a directory to something else.
(cherry picked from commit
f9f74db13e3bd94debcd7c33194e27649e5adfca)
}
}
+ /* Error out when a non-directory is specified as one in spec */
+ if (fl->cur.isDir && !S_ISDIR(statp->st_mode)) {
+ rpmlog(RPMLOG_ERR, _("Not a directory: %s\n"), diskPath);
+ goto exit;
+ }
+
/* Don't recurse into explicit %dir, don't double-recurse from fts */
if ((fl->cur.isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) {
return recurseDir(fl, diskPath);