[Buildroot] BR2_DL_DIR permissions

Pesce Luca Luca.Pesce at vimar.com
Tue Nov 15 07:21:04 UTC 2022


Hi all,
    it seems that it is not possible to setup a rw BR2_DL_DIR location shared
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).

Buildroot's root Makefile imposes 'umask 0022' (REQ_UMASK = 0022), which means
that every file/folder created by BR will have no write perm for the group, including
the per-package download directories under BR2_DL_DIR (which will have drwxr-xr-x perms).
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.

A possible solution would be to chmod 775 the dl dir inside dl-wrapper script,
after the actual download, like it already does for the tmpf file (output file
of the download backend).
A more radical solution would be to change that global REQ_UMASK value to 0002,
or to change the root Makefile logic in order to set umask only if the system
one is more restrictive than 0022 (it seems to me that the default umask on
moderm distros is 0002, so keeping it intact, without resetting it, would suffice).

I am not really aware of BR's internals on file permissions management, so any
thought or comment on this would be highly appreciated.

Thanks and regards,
Luca


More information about the buildroot mailing list