mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
update hooks: migrate paths to userpriv settings
Now that we're enabling userpriv for the chroot, we need to fix all the paths that might be owned by root to the right user. BUG=chromium-os:3616 TEST=`./update_chroot` on a system with root-owned files in the various paths changed them all to my user Change-Id: I3655c851d5844524ec77c3476cee7a6e9d70ce0d CQ-DEPEND=Id513c0b8b380d57dd3e150917a969d0bf36883fc Reviewed-on: https://gerrit.chromium.org/gerrit/24216 Reviewed-by: David James <davidjames@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
7d2634e5da
commit
6e52ff1f3d
17
chroot_version_hooks.d/38_host_userpriv
Normal file
17
chroot_version_hooks.d/38_host_userpriv
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Migrate to userpriv for building things. We need to clean out old
|
||||
# dirs that might have files owned by root:root.
|
||||
|
||||
eval $(portageq envvar -v PORTAGE_{TMPDIR,USERNAME,GRPNAME} DISTDIR PKGDIR)
|
||||
: ${PORTAGE_TMPDIR:=/var/tmp/portage}
|
||||
: ${PORTAGE_USERNAME:=${USER}}
|
||||
: ${PORTAGE_GRPNAME:=portage}
|
||||
: ${DISTDIR:=/var/cache/distfiles/host}
|
||||
: ${PKGDIR:=/var/lib/portage/pkgs}
|
||||
|
||||
exec sudo find "${PORTAGE_TMPDIR}" "${DISTDIR}" "${PKGDIR}" \
|
||||
'(' -uid 0 -o -gid 0 ')' \
|
||||
-exec chown -h "${PORTAGE_USERNAME}:${PORTAGE_GRPNAME}" {} +
|
Loading…
x
Reference in New Issue
Block a user