File: post_setup_forbid_home

package info (click to toggle)
piuparts 1.6.0
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 72,532 kB
  • sloc: python: 8,240; sh: 4,367; makefile: 171
file content (27 lines) | stat: -rwxr-xr-x 468 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -e

case ${PIUPARTS_OBJECTS%%=*} in
	TARBALL)
		# skip while creating the tarball
		exit 0
		;;
esac

case $PIUPARTS_DISTRIBUTION in
	lenny|squeeze)
		exit 0
		;;
esac

if [ -d /home ]; then
	echo "Disabling /home"
	mv /home /home.distrib
	if dpkg-divert --help | grep -q -e --no-rename ; then
		dpkg-divert --no-rename /home
	else
		dpkg-divert /home
	fi
	echo "This is a dummy file to prevent creating directories in /home" > /home
	chmod 000 /home
fi