core/pkg-generic: sanitise FOO_OVERRIDE_SRCDIR
PATCH 1/1 core/pkg-generic: sanitise FOO_OVERRIDE_SRCDIR
In case FOO_OVERRIDE_SRCDIR has trailing spaces, like so:
FOO_OVERRIDE_SRCDIR = /path/to/sources\x20
we would end up with a rsync command like so:
rsync -au /path/to/sources / /path/to/build/foo
which would effectively rsync the whole vfs, eventually filling the whole disk... :-(
So, just qstrip the variable before use.
--- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +1 -1
@@ -102,7 +102,7 @@ $(BUILD_DIR)/%/.stamp_rsynced: @$(call MESSAGE,"Syncing from source dir $(SRCDIR)") @test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1) $(foreach hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep)) - rsync -au $(RSYNC_VCS_EXCLUSIONS) $(SRCDIR)/ $(@D) + rsync -au $(RSYNC_VCS_EXCLUSIONS) $(call qstrip,$(SRCDIR))/ $(@D) $(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep)) $(Q)touch $@
Signature · 1 line
1.9.1
Thomas Petazzoni
AppliedPATCH 1/1 core/pkg-generic: sanitise FOO_OVERRIDE_SRCDIR
Dear Yann E. MORIN,
Quoted 9 lines · Yann E. MORIN
In case
FOO_OVERRIDE_SRCDIRhas trailing spaces, like so:
FOO_OVERRIDE_SRCDIR= /path/to/sources\x20we would end up with a rsync command like so:
rsync -au /path/to/sources / /path/to/build/foowhich would effectively rsync the whole vfs, eventually filling the whole disk... :-(
Quoted 7 lines
So, just qstrip the variable before use.
Reported-by Thomas Petazzoni <[email protected]>Signed-off-by "Yann E. MORIN" <[email protected]>--- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com