Source: autopkgtest
Version: 3.9
Severity: normal
Tags: patch

Hi,

umask must be set to 0022, otherwise ordinary users will not be able to
read generated files, eg: /etc/apt/sources.list, if root has a stricter
umask then the default (and adt-setup-vm is called as root).

Regards,
Christian

>From 8fdcbf7b7e6983c58aed920ca839c40003d2d051 Mon Sep 17 00:00:00 2001
From: Christian Kastner <c...@kvr.at>
Date: Sun, 11 Jan 2015 01:15:25 +0100
Subject: adt-setup-vm: set umask to 0022

adt-setup-vm is called as root. If root has a stricter umask, eg: 0027, then
ordinary users within the VM will not be able to read generated files such as
/etc/apt/sources.list. Therefore, ensure it is at 0022.
---
 tools/adt-setup-vm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/adt-setup-vm b/tools/adt-setup-vm
index 933b1c0..cb0c9bb 100755
--- a/tools/adt-setup-vm
+++ b/tools/adt-setup-vm
@@ -15,6 +15,9 @@
 
 set -eu
 
+# Created files should be readable by user adt (this script is called as root)
+umask 0022
+
 if [ "${1:-}" = "--help" ]; then
     echo "Usage: $0 [chroot dir]"
     echo "if chroot dir is not given, run on the main system (for running in VMs)"
-- 
2.1.4


Reply via email to