Set umask to 0002 for ostree operations

See https://github.com/ostreedev/ostree/pull/1984 where OSTree was
changed to try to set group write on directories. We need to set a more
permissive umask to take advantage of it.

This is all done to support writing to the OSTree repo from OpenShift
projects that run as a random UID, but have ftpsync (gid:263) in their
supplemental groups. For more context see: https://pagure.io/releng/issue/8811#comment-629051

Signed-off-by: Mohan Boddu <mboddu@bhujji.com>
This commit is contained in:
Mohan Boddu 2020-04-08 17:22:57 -04:00
parent d3de094b4c
commit da4228e163

View File

@ -187,6 +187,10 @@ $RSYNCPREFIX rm "$RSYNCSECTARGET/.composeinfo"
$RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCSECTARGET/" --name "$NEWCOMPOSE_ID" $RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCSECTARGET/" --name "$NEWCOMPOSE_ID"
# sync Silverblue to the unified ostree repo # sync Silverblue to the unified ostree repo
# Set the umask to so directories can get group write
# https://pagure.io/releng/issue/8811
old_umask=$(umask)
umask 0002
for arch in x86_64 ppc64le aarch64; do for arch in x86_64 ppc64le aarch64; do
ref="fedora/32/${arch}/silverblue" ref="fedora/32/${arch}/silverblue"
if ! ostree --repo=$OSTREESRCREPO rev-parse "${ref}"; then continue; fi if ! ostree --repo=$OSTREESRCREPO rev-parse "${ref}"; then continue; fi
@ -194,6 +198,8 @@ for arch in x86_64 ppc64le aarch64; do
ostree pull-local --repo=$OSTREEDESTREPO $OSTREESRCREPO --depth=-1 "${ref}" ostree pull-local --repo=$OSTREEDESTREPO $OSTREESRCREPO --depth=-1 "${ref}"
ostree summary -u --repo=$OSTREEDESTREPO # update summary file ostree summary -u --repo=$OSTREEDESTREPO # update summary file
done done
# Set to old umask
umask $old_umask
# Tell interested persons that the rsync is done. # Tell interested persons that the rsync is done.
send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete