Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Tom Yan
archiso
Commits
b922e8bc
Verified
Commit
b922e8bc
authored
Jul 20, 2020
by
nl6720
Browse files
Set up custom user home directories and their permissions
parent
78fe6560
Changes
2
Hide whitespace changes
Inline
Side-by-side
configs/baseline/build.sh
View file @
b922e8bc
...
...
@@ -39,6 +39,20 @@ make_custom_airootfs() {
cp
-af
--no-preserve
=
ownership
--
"
${
script_path
}
/airootfs/."
"
${
_airootfs
}
"
[[
-e
"
${
_airootfs
}
/etc/shadow"
]]
&&
chmod
-f
0400
--
"
${
_airootfs
}
/etc/shadow"
[[
-e
"
${
_airootfs
}
/etc/gshadow"
]]
&&
chmod
-f
0400
--
"
${
_airootfs
}
/etc/gshadow"
# Set up user home directories and permissions
if
[[
-e
"
${
_airootfs
}
/etc/passwd"
]]
;
then
while
IFS
=
':'
read
-a
passwd
-r
;
do
[[
"
${
passwd
[5]
}
"
==
'/'
]]
&&
continue
if
[[
-d
"
${
_airootfs
}${
passwd
[5]
}
"
]]
;
then
chown
-hR
--
"
${
passwd
[2]
}
:
${
passwd
[3]
}
"
"
${
_airootfs
}${
passwd
[5]
}
"
chmod
-f
0750
--
"
${
_airootfs
}${
passwd
[5]
}
"
else
install
-d
-m
0750
-o
"
${
passwd
[2]
}
"
-g
"
${
passwd
[3]
}
"
--
"
${
_airootfs
}${
passwd
[5]
}
"
fi
done
<
"
${
_airootfs
}
/etc/passwd"
fi
fi
}
...
...
configs/releng/build.sh
View file @
b922e8bc
...
...
@@ -69,7 +69,20 @@ make_custom_airootfs() {
[[
-e
"
${
_airootfs
}
/etc/shadow"
]]
&&
chmod
-f
0400
--
"
${
_airootfs
}
/etc/shadow"
[[
-e
"
${
_airootfs
}
/etc/gshadow"
]]
&&
chmod
-f
0400
--
"
${
_airootfs
}
/etc/gshadow"
[[
-e
"
${
_airootfs
}
/root"
]]
&&
chmod
-f
0750
--
"
${
_airootfs
}
/root"
# Set up user home directories and permissions
if
[[
-e
"
${
_airootfs
}
/etc/passwd"
]]
;
then
while
IFS
=
':'
read
-a
passwd
-r
;
do
[[
"
${
passwd
[5]
}
"
==
'/'
]]
&&
continue
if
[[
-d
"
${
_airootfs
}${
passwd
[5]
}
"
]]
;
then
chown
-hR
--
"
${
passwd
[2]
}
:
${
passwd
[3]
}
"
"
${
_airootfs
}${
passwd
[5]
}
"
chmod
-f
0750
--
"
${
_airootfs
}${
passwd
[5]
}
"
else
install
-d
-m
0750
-o
"
${
passwd
[2]
}
"
-g
"
${
passwd
[3]
}
"
--
"
${
_airootfs
}${
passwd
[5]
}
"
fi
done
<
"
${
_airootfs
}
/etc/passwd"
fi
fi
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment