Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 596102 - einstalldocs() doesn't check whether a document is really a file and not a dir
Summary: einstalldocs() doesn't check whether a document is really a file and not a dir
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 604854
  Show dependency tree
 
Reported: 2016-10-03 22:45 UTC by .
Modified: 2017-02-05 00:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description . 2016-10-03 22:45:52 UTC
Current code:

```
[[ -s ${d} ]] && docinto / && dodoc "${d}"
```

proposed code:

```
[[ -f "${d}" && -s ${d} ]] && docinto / && dodoc "${d}"
```

Also it's unknown to me what is the purpose of executing `docinto /` in the loop.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-04 06:45:58 UTC
So, yes. Looking at the algo in PMS, and the bash docs, -f + -s would indeed be more correct. And the docinto could be moved to the top of the subshell scope. Do you want to write a patch/pull request?
Comment 2 . 2016-10-04 11:07:56 UTC
Ok, so PR is here - https://github.com/gentoo/portage/pull/57. It doesn't include the docinto changes because of https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-15400012.2.2 and https://bugs.gentoo.org/show_bug.cgi?id=566654.