Michał Górny
2018-09-17 06:52:33 UTC
---
bin/ebuild-helpers/fowners | 15 +++++++++++++++
bin/ebuild-helpers/fperms | 15 +++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
index 68004210b..70297c6e6 100755
--- a/bin/ebuild-helpers/fowners
+++ b/bin/ebuild-helpers/fowners
@@ -8,6 +8,21 @@ if ! ___eapi_has_prefix_variables; then
EPREFIX= ED=${D}
fi
+got_owner=
+for arg; do
+ [[ ${arg} == -* ]] && continue
+ if [[ ! ${got_owner} ]]; then
+ got_owner=1
+ continue
+ fi
+ if [[ ${arg} != /* ]]; then
+ eqawarn "Relative path passed to '${0##*/}': ${arg}"
+ eqawarn "This is unsupported. Please use 'chmod' when you need to work on files"
+ eqawarn "outside the installation image (\${ED})."
+ fi
+done
+
+
# we can't prefix all arguments because
# chown takes random options
slash="/"
diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms
index c63a6abc3..f98560039 100755
--- a/bin/ebuild-helpers/fperms
+++ b/bin/ebuild-helpers/fperms
@@ -8,6 +8,21 @@ if ! ___eapi_has_prefix_variables; then
ED=${D}
fi
+got_mode=
+for arg; do
+ # - can either be an option or a mode string
+ [[ ${arg} == -* && ${arg} != -[ugorwxXst] ]] && continue
+ if [[ ! ${got_mode} ]]; then
+ got_mode=1
+ continue
+ fi
+ if [[ ${arg} != /* ]]; then
+ eqawarn "Relative path passed to '${0##*/}': ${arg}"
+ eqawarn "This is unsupported. Please use 'chmod' when you need to work on files"
+ eqawarn "outside the installation image (\${ED})."
+ fi
+done
+
# we can't prefix all arguments because
# chmod takes random options
slash="/"
bin/ebuild-helpers/fowners | 15 +++++++++++++++
bin/ebuild-helpers/fperms | 15 +++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
index 68004210b..70297c6e6 100755
--- a/bin/ebuild-helpers/fowners
+++ b/bin/ebuild-helpers/fowners
@@ -8,6 +8,21 @@ if ! ___eapi_has_prefix_variables; then
EPREFIX= ED=${D}
fi
+got_owner=
+for arg; do
+ [[ ${arg} == -* ]] && continue
+ if [[ ! ${got_owner} ]]; then
+ got_owner=1
+ continue
+ fi
+ if [[ ${arg} != /* ]]; then
+ eqawarn "Relative path passed to '${0##*/}': ${arg}"
+ eqawarn "This is unsupported. Please use 'chmod' when you need to work on files"
+ eqawarn "outside the installation image (\${ED})."
+ fi
+done
+
+
# we can't prefix all arguments because
# chown takes random options
slash="/"
diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms
index c63a6abc3..f98560039 100755
--- a/bin/ebuild-helpers/fperms
+++ b/bin/ebuild-helpers/fperms
@@ -8,6 +8,21 @@ if ! ___eapi_has_prefix_variables; then
ED=${D}
fi
+got_mode=
+for arg; do
+ # - can either be an option or a mode string
+ [[ ${arg} == -* && ${arg} != -[ugorwxXst] ]] && continue
+ if [[ ! ${got_mode} ]]; then
+ got_mode=1
+ continue
+ fi
+ if [[ ${arg} != /* ]]; then
+ eqawarn "Relative path passed to '${0##*/}': ${arg}"
+ eqawarn "This is unsupported. Please use 'chmod' when you need to work on files"
+ eqawarn "outside the installation image (\${ED})."
+ fi
+done
+
# we can't prefix all arguments because
# chmod takes random options
slash="/"
--
2.19.0
2.19.0