From takedakn @ nttdata.co.jp Fri Feb 16 11:48:00 2007 From: takedakn @ nttdata.co.jp (Kentaro Takeda) Date: Fri, 16 Feb 2007 11:48:00 +0900 Subject: [Tomoyo-dev 1] =?iso-2022-jp?b?ZWRpdHBvbGljeRskQiRORn5OT016GyhC?= =?iso-2022-jp?b?GyRCTnIbKEI=?= Message-ID: <45D51B60.1030004@nttdata.co.jp> 武田です。1げっと。 editpolicyについて、入力履歴を1つに統一するという提案です。 現在editpolicyには以下の4つの画面があります。 ・ドメイン遷移ツリー ・各ドメインのアクセス許可 ・システムポリシー ・例外ポリシー 'a'キーで追加した履歴を、↑で呼び出せるようになっていますが、 現在のeditpolicyでは4つの画面それぞれで独立した履歴を持っています。 たとえば、ドメイン遷移ツリーで /bin/hoge /bin/fuga を追加したとしても、この履歴はドメイン遷移ツリー画面のみで有効で、 例外ポリシーで'a' ↑と押しても表示されません。 画面ごとで履歴を分けず、editpolicy全体で共通の入力履歴とすれば、 ドメインをkeep_domain指定する、などの操作がやりやすくなると思います。 Insertキーで現在の行を履歴に追加できるので、 /usr/sbin/sshd /bin/zsh をkeep_domainしたい、というときは、 1. ドメイン遷移ツリーの" /usr/sbin/sshd /bin/zsh"の行でInsert 2. Tabで例外ポリシー画面に移る 3. 'a' ↑で" /usr/sbin/sshd /bin/zsh"を1行入力に表示 4. 頭にkeep_domainを追加してEnter という感じの操作ができるようになります。 -- 武田健太郎 (Kentaro Takeda) takedakn @ nttdata.co.jp 株式会社NTTデータ 基盤システム事業本部 オープンソース開発センタ 技術開発担当 From from-tomoyo-dev @ i-love.sakura.ne.jp Fri Feb 16 12:37:16 2007 From: from-tomoyo-dev @ i-love.sakura.ne.jp (from-tomoyo-dev @ i-love.sakura.ne.jp) Date: Fri, 16 Feb 2007 12:37:16 +0900 Subject: [Tomoyo-dev 2] =?iso-2022-jp?b?UmU6IGVkaXRwb2xpY3kgGyRCJE4bKEI=?= =?iso-2022-jp?b?GyRCRn5OT016TnIbKEI=?= In-Reply-To: <45D51B60.1030004@nttdata.co.jp> References: <45D51B60.1030004@nttdata.co.jp> Message-ID: <200702160337.l1G3bGOq075850@www262.sakura.ne.jp>  熊猫です。 > editpolicyについて、入力履歴を1つに統一するという提案です。 ご提案ありがとうございます。 > 画面ごとで履歴を分けず、editpolicy全体で共通の入力履歴とすれば、 > ドメインをkeep_domain指定する、などの操作がやりやすくなると思います。 パッチを作成しました。 tar -zxf ccs-tools-1.3.2-20070214.tar.gz cd ccstools patch -p1 で以下の内容を適用してみてください(Webメールからなので添付ファイルが使えません(汗))。 コンパイルは make -s だけです。 いかがでしょうか? ----- パッチの始まり ----- diff -ur ccstools/ccstools.c ccstools.new/ccstools.c --- ccstools/ccstools.c 2007-02-14 00:00:00.000000000 +0900 +++ ccstools.new/ccstools.c 2007-02-16 12:15:30.000000000 +0900 @@ -2555,18 +2555,14 @@ static int GenericListLoop(void) { static char *last_error = NULL; static const int max_readline_history = 20; - static const char **readline_history[MAXSCREEN]; - static int readline_history_count[MAXSCREEN]; + static const char **readline_history = NULL; + static int readline_history_count = 0; static char *search_buffer[MAXSCREEN]; static int saved_current_y[MAXSCREEN]; static int saved_current_item_index[MAXSCREEN]; static int first = 1; if (first) { - int i; - for (i = 0; i < MAXSCREEN; i++) { - readline_history[i] = malloc(max_readline_history * sizeof(const char *)); - } - memset(readline_history_count, 0, sizeof(readline_history_count)); + readline_history = malloc(max_readline_history * sizeof(const char *)); memset(saved_current_y, 0, sizeof(saved_current_y)); memset(saved_current_item_index, 0, sizeof(saved_current_item_index)); memset(search_buffer, 0, sizeof(search_buffer)); @@ -2666,9 +2662,9 @@ int index; char *line; input_path: - line = simple_readline(window_height - 1, 0, "Search> ", readline_history[current_screen], readline_history_count[current_screen], 4000, 8); + line = simple_readline(window_height - 1, 0, "Search> ", readline_history, readline_history_count, 4000, 8); if (line && *line) { - readline_history_count[current_screen] = simple_add_history(line, readline_history[current_screen], readline_history_count[current_screen], max_readline_history); + readline_history_count = simple_add_history(line, readline_history, readline_history_count, max_readline_history); free(search_buffer[current_screen]); search_buffer[current_screen] = line; line = NULL; for (index = 0; index < list_item_count[current_screen]; index++) { const char *cp = (current_screen == SCREEN_DOMAIN_LIST) ? GetLastName(index) : generic_acl_list[index]; @@ -2756,9 +2752,9 @@ case 'a': case 'A': { - char *line = simple_readline(window_height - 1, 0, "Enter new entry> ", readline_history[current_screen], readline_history_count[current_screen], 8192, 8); + char *line = simple_readline(window_height - 1, 0, "Enter new entry> ", readline_history, readline_history_count, 8192, 8); if (line && *line) { - readline_history_count[current_screen] = simple_add_history(line, readline_history[current_screen], readline_history_count[current_screen], max_readline_history); + readline_history_count = simple_add_history(line, readline_history, readline_history_count, max_readline_history); if (current_screen == SCREEN_DOMAIN_LIST && !IsCorrectDomain(line)) { const int len = strlen(line) + 128; if ((last_error = (char *) realloc(last_error, len)) == NULL) OutOfMemory(); @@ -2839,7 +2835,7 @@ max_eat_col[current_screen] = max_col; goto start2; case KEY_IC: - if (current >= 0) readline_history_count[current_screen] = simple_add_history(current_screen == SCREEN_DOMAIN_LIST ? DomainName(current) : generic_acl_list[current], readline_history[current_screen], readline_history_count[current_screen], max_readline_history); + if (current >= 0) readline_history_count = simple_add_history(current_screen == SCREEN_DOMAIN_LIST ? DomainName(current) : generic_acl_list[current], readline_history, readline_history_count, max_readline_history); break; case '?': { ----- パッチの終わり ----- From k.takeda26 @ gmail.com Fri Feb 16 12:44:12 2007 From: k.takeda26 @ gmail.com (Kentaro Takeda) Date: Fri, 16 Feb 2007 12:44:12 +0900 Subject: [Tomoyo-dev 3] =?iso-2022-jp?b?UmU6IGVkaXRwb2xpY3kgGyRCJE4bKEI=?= =?iso-2022-jp?b?GyRCRn5OT016TnIbKEI=?= In-Reply-To: <200702160337.l1G3bGOq075850@www262.sakura.ne.jp> References: <45D51B60.1030004@nttdata.co.jp> <200702160337.l1G3bGOq075850@www262.sakura.ne.jp> Message-ID: <5fb14edc0702151944h4f3e72fct75f16e69ba35419f@mail.gmail.com> 武田です。相変わらず仕事はやいですね…。 パッチ適用後、履歴が共通になったのを確認しました。 特にドメインポリシーと例外ポリシーは密接ですので共通なほうが便利ですね。 (そもそも1.3.2のeditpolicy便利すぎ…) From haradats @ gmail.com Wed Feb 28 22:42:38 2007 From: haradats @ gmail.com (Toshiharu Harada) Date: Wed, 28 Feb 2007 22:42:38 +0900 Subject: [Tomoyo-dev 4] =?iso-2022-jp?b?GyRCMytILzYoTk88VCRySmc9OCQ3GyhC?= =?iso-2022-jp?b?GyRCJF4kORsoQg==?= Message-ID: <9d732d950702280542k573888c5v3ddd49a35757da15@mail.gmail.com> TOMOYO Linuxプロジェクトでは、広く開発協力者を募集する ことにしました。 募集の概要: http://sourceforge.jp/forum/forum.php?forum_id=11317 開発関係者用Wiki(最新の情報はこちらを参照下さい): http://tomoyo.sourceforge.jp/wiki/?Develop 多くの方々の参加をお待ちしています。 -- Toshiharu Harada haradats @ gmail.com