mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 05:06:39 +00:00
package/dropbear: fix when readlink is from busybox
Busybox "readlink -f" does not canonicalise paths when the target is missing, while coreutils do. Fix that by: - making an absolute symlink - dropping "-f" when calling readlink Fixes #8276. Reported-by: Jason Tang <tang@jtang.org> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Paul Cercueil <paul@crapouillou.net> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Jason Tang <tang@jtang.org> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
7deaa277fd
commit
29a0f05579
@ -18,7 +18,7 @@ start() {
|
|||||||
# - the filesystem is RW (i.e. we can rm the symlink),
|
# - the filesystem is RW (i.e. we can rm the symlink),
|
||||||
# replace the symlink with an actual directory
|
# replace the symlink with an actual directory
|
||||||
if [ -L /etc/dropbear \
|
if [ -L /etc/dropbear \
|
||||||
-a "$(readlink -f /etc/dropbear)" = "/var/run/dropbear" ]
|
-a "$(readlink /etc/dropbear)" = "/var/run/dropbear" ]
|
||||||
then
|
then
|
||||||
if rm -f /etc/dropbear; then
|
if rm -f /etc/dropbear; then
|
||||||
mkdir -p /etc/dropbear
|
mkdir -p /etc/dropbear
|
||||||
|
@ -93,7 +93,7 @@ define DROPBEAR_INSTALL_TARGET_CMDS
|
|||||||
for f in $(DROPBEAR_TARGET_BINS); do \
|
for f in $(DROPBEAR_TARGET_BINS); do \
|
||||||
ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
|
ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
|
||||||
done
|
done
|
||||||
ln -snf ../var/run/dropbear $(TARGET_DIR)/etc/dropbear
|
ln -snf /var/run/dropbear $(TARGET_DIR)/etc/dropbear
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(autotools-package))
|
$(eval $(autotools-package))
|
||||||
|
@ -10,7 +10,7 @@ After=syslog.target network.target auditd.service
|
|||||||
# replace the symlink with an actual directory
|
# replace the symlink with an actual directory
|
||||||
ExecStartPre=/bin/sh -c '\
|
ExecStartPre=/bin/sh -c '\
|
||||||
if [ -L /etc/dropbear \
|
if [ -L /etc/dropbear \
|
||||||
-a "$(readlink -f /etc/dropbear)" = "/var/run/dropbear" ]; then \
|
-a "$(readlink /etc/dropbear)" = "/var/run/dropbear" ]; then \
|
||||||
if rm -f /etc/dropbear; then \
|
if rm -f /etc/dropbear; then \
|
||||||
mkdir -p /etc/dropbear; \
|
mkdir -p /etc/dropbear; \
|
||||||
else \
|
else \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user