Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 449194 - "find -- Finding Files" improvements
Summary: "find -- Finding Files" improvements
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Devmanual Team
URL: http://devmanual.gentoo.org/tools-ref...
Whiteboard:
Keywords:
: 449196 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-29 15:14 UTC by Julian Ospald
Modified: 2013-01-19 11:13 UTC (History)
1 user (show)

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


Attachments
text.xml.diff (text.xml.diff,5.32 KB, patch)
2012-12-29 19:38 UTC, Julian Ospald
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2012-12-29 15:14:16 UTC
as per the manpage and gnu manual https://www.gnu.org/software/findutils/manual/html_mono/find.html#Security-Considerations-for-find "-exec" should be avoided, especially because of race conditions

"-execdir" is considered more secure

the devmanual should warn about this
Comment 1 Ulrich Müller gentoo-dev 2012-12-29 15:28:58 UTC
> as per the manpage and gnu manual
> https://www.gnu.org/software/findutils/manual/html_mono/find.html#Security-
> Considerations-for-find "-exec" should be avoided, especially because of
> race conditions

In ebuild context, directories typically aren't writeable by random users. (If they are, you have a problem anyway.) So unless I'm missing something, this should not be an issue.

> "-execdir" is considered more secure

But much less portable. GNU find cannot be assumed for EAPIs 0 to 4.
Comment 2 Julian Ospald 2012-12-29 15:55:08 UTC
(In reply to comment #1)
> > as per the manpage and gnu manual
> > https://www.gnu.org/software/findutils/manual/html_mono/find.html#Security-
> > Considerations-for-find "-exec" should be avoided, especially because of
> > race conditions
> 
> In ebuild context, directories typically aren't writeable by random users.
> (If they are, you have a problem anyway.) So unless I'm missing something,
> this should not be an issue.

We use find also in wrapper scripts. It should at least be updated to regards of non-ebuild usage.

> 
> > "-execdir" is considered more secure
> 
> But much less portable. GNU find cannot be assumed for EAPIs 0 to 4.

from reading the manpage it's at least available in BSD too
Comment 3 Julian Ospald 2012-12-29 19:31:30 UTC
*** Bug 449196 has been marked as a duplicate of this bug. ***
Comment 4 Julian Ospald 2012-12-29 19:38:18 UTC
Created attachment 333702 [details, diff]
text.xml.diff

other improvements:
- while loop
- more examples
- more detailed table
- show POSIX compliance in table
Comment 5 Markos Chandras (RETIRED) gentoo-dev 2013-01-14 20:13:51 UTC
(In reply to comment #4)
> Created attachment 333702 [details, diff] [details, diff]
> text.xml.diff
> 
> other improvements:
> - while loop
> - more examples
> - more detailed table
> - show POSIX compliance in table

looks good to me
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2013-01-19 10:15:21 UTC
Please commit it or attach a git formatted patch so I can commit it for you
Comment 7 Julian Ospald 2013-01-19 11:13:54 UTC
fixed in 1752d89466e1f0be790b3a82f9a61bab2d1497c5