파일 보호 모드 수정하기설치하는 도중에 어떤 프로그램들은 CD로부터 직접 실행된다. 불행하게도 FTP
프로그램은 복사되는 파일과 디렉토리의 보호 모드를 언제나 보존하지는 않는다.
따라서 디렉토리를 CD에 굽기 전에 프로그램, 쉘 스크립트, 공유 라이브러리에
실행 퍼미션이 주어져 있는지를 확인하는 것이 필요하다. 그렇게 하려면
아래의 updatePerm 스크립트를 배포판의 로컬 복사본에 실행시키면 된다.#!/bin/bash
RHVERSION=6.0
LIST=/tmp/er3hd3w25
CDDIR=/jaz/redhat-${RHVERSION}
# Find all directories, and make sure they have +x permission
find $CDDIR -type d -exec chmod -c 755 {} \;
# Find all files that are executables, shell or perl scripts
find $CDDIR -type f | file -f - | grep -v RPM \
| egrep -i 'executable|perl|bourne|shell' | cut -f1 -d: > $LIST
# Find shared libraries
find $CDDIR -name \*.so >> $LIST
# Make them executable
while read file
do
if [ ! -x $file ] ; then
chmod -c 755 $file
fi
done < $LIST
/bin/rm $LIST
exit 0