summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2012-01-28 16:38:48 +0000
committererdgeist <erdgeist@erdgeist.org>2012-01-28 16:38:48 +0000
commitda4aef57542d34206f9b1f1290c9ab7a8da655ff (patch)
tree70ecb5acae41db8725cbd0d305ec6c5d78591c0e
parent9a22c2885615333241230a7f2f49e7b9c200f957 (diff)
Remove schg flags from old basejail before installing a new one over it
-rwxr-xr-xezjail-admin9
1 files changed, 7 insertions, 2 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 5b8610f..7be039b 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -260,8 +260,6 @@ ezjail_splitworld() {
260 # Fill basejail from installed world 260 # Fill basejail from installed world
261 cd "${ezjail_jailfull}" || exerr "Error: Cant access temporary Jail directory." 261 cd "${ezjail_jailfull}" || exerr "Error: Cant access temporary Jail directory."
262 262
263 # This mkdir is important, since cpio will create intermediate
264 # directories with permission 0700 which is bad
265 if [ "${ezjail_use_zfs}" = "YES" ]; then 263 if [ "${ezjail_use_zfs}" = "YES" ]; then
266 echo "ZFS: create the basejail" 264 echo "ZFS: create the basejail"
267 echo "/sbin/zfs create -p -o mountpoint=${ezjail_jaildir} ${ezjail_zfs_properties} ${ezjail_jailzfs}" 265 echo "/sbin/zfs create -p -o mountpoint=${ezjail_jaildir} ${ezjail_zfs_properties} ${ezjail_jailzfs}"
@@ -269,6 +267,13 @@ ezjail_splitworld() {
269 /sbin/zfs create -p ${ezjail_jailzfs}/basejail 267 /sbin/zfs create -p ${ezjail_jailzfs}/basejail
270 /sbin/zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"` 268 /sbin/zfs snapshot ${ezjail_jailzfs}/basejail@`date -v -7d +"%C%y%m%d_%H:%M:%S"`
271 fi 269 fi
270
271 # Remove schg flags from old basejail binaries. The flags
272 # will be re-added in the cpio for the new basejail
273 [ -d "${ezjail_jailbase}" ] && chflags -R noschg "${ezjail_jailbase}"
274
275 # This mkdir is important, since cpio will create intermediate
276 # directories with permission 0700 which is bad
272 mkdir -p "${ezjail_jailbase}/usr" 277 mkdir -p "${ezjail_jailbase}/usr"
273 for dir in ${ezjail_dirlist}; do 278 for dir in ${ezjail_dirlist}; do
274 find ${dir} | cpio -d -p -v "${ezjail_jailbase}" || exerr "Error: Installation of ${dir} failed." 279 find ${dir} | cpio -d -p -v "${ezjail_jailbase}" || exerr "Error: Installation of ${dir} failed."