[Tomoyo-dev 245] Re: /.init の修正

アーカイブの一覧に戻る

Kensuke Nezu nez****@samba*****
2007年 7月 13日 (金) 16:30:58 JST


根津です。

from-****@i-lov***** wrote:
>  熊猫です。
> 
>> Do you want to enable TOMOYO Linux?[Y/n]
>> (input "N" key within 10 seconds)
> それができると嬉しいのですが /bin/bash では
> 1文字だけ入力するという方法が無いような気がします。
> /sbin/getkey が全てのディストリで使えれば良いんですけど。

え?ありますよw
build-inのreadには、

> -n nchars 
> read returns after reading nchars characters rather than waiting for a complete line of input. 

があります。なので、

> if [ "x$STATUS" == "x" ]; then
> 	TMOUT=10
> 	while :
> 	  do
> 	  echo "Press 'Enter' or wait for $TMOUT seconds to use default status."
> 	  echo "You may input 'disabled' and press 'Enter' to disable MAC in case of emergency."
> 	  STATUS=""
read -p "> " -n 1 -t $TMOUT STATUS
case $STATUS in
  d|D)	STATUS="disabled" ;;
  b|B)  STATUS="boottest" ;;
  *)	STATUS="" ;;
esac
[ "x$STATUS" != "x" ] && break
> 	  [ -r $POLICY_DIR/status-$STATUS.txt ] && break
> 	  [ "x$STATUS" == "xTOMOYO_NOLOAD" ] && TOMOYO_NOLOAD=1
> 	  [ "x$STATUS" == "xTOMOYO_QUIET" ] && TOMOYO_QUIET=1
> 	done
> fi

でいいはずです。

-- 
------
根津 研介 日本Sambaユーザ会/NTTデータ先端技術(株)
Microsoft MVP for Windows Security(Apr 2005 - Mar 2008)
802.11セキュリティサイト:http://www.famm.jp/wireless
 ※「SELinuxシステム管理―セキュアOSの基礎と運用」
    http://www.oreilly.co.jp/books/4873112257/
 ※「実用SSH第2版−セキュアシェル徹底活用ガイド」
    http://www.oreilly.co.jp/books/4873112877/




tomoyo-dev メーリングリストの案内
アーカイブの一覧に戻る