[Buildroot] R: [PATCH] support/download/dl-wrapper: make the whole dl_dir writeable for the group

Pesce Luca Luca.Pesce at vimar.com
Thu Dec 1 07:17:46 UTC 2022


Sorry, forgot to put Yann in cc, as utils/get-developers suggests.

Luca

________________________________________
Da: Pesce Luca <Luca.Pesce at vimar.com>
Inviato: mercoledì 30 novembre 2022 14:43
A: buildroot at buildroot.org
Cc: Pesce Luca
Oggetto: [PATCH] support/download/dl-wrapper: make the whole dl_dir writeable for the group

Root makefile imposes 'umask 0022', which means that every file/folder in
the per-package download directories has no write permission for the group.
These are writeable just for the owner - the user that issued the first build
that populated the per-package dl dir for the first time (say user A).
Thus, if a BR package changes its version (e.g. for buildroot update), and
another user (say user B, in the same group of A) starts a build, BR fails the
creation of package-xxx.tar.gz inside the dl dir, because user B has no write
permissions on that path. Furthermore, in the case of the git backend, this
makes the git cache not updatable by a different user.

So, to allow sharing of a rw BR2_DL_DIR location among users of the same group
on a host machine (e.g. a build server used by many users, all belonging to a
certain "developers" group), set group write permission to the whole package
dl dir.

Signed-off-by: Luca Pesce <luca.pesce at vimar.com>
---
 support/download/dl-wrapper | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 09a6ac1..b7a4319 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -190,6 +190,10 @@ main() {
     new_mode=$(printf "%04o" $((0${new_mode} & ~0$(umask))))
     chmod ${new_mode} "${tmp_output}"

+    # Make the whole dl_dir writeable for the group, so other users within
+    # the group can download new versions and update any vcs cache in it.
+    chmod -f -R g+w "${dl_dir}"
+
     # We must *not* unlink tmp_output, otherwise there is a small window
     # during which another download process may create the same tmp_output
     # name (very, very unlikely; but not impossible.)
--
2.7.4




More information about the buildroot mailing list