• R/O
  • HTTP
  • SSH
  • HTTPS

origin: Commit

gpet(Gui Policy Editor for TOMOYO Linux) repository


Commit MetaInfo

Revisiona25fd5ac0590d7343499461c5b9be06f6b68e474 (tree)
Zeit2011-09-06 23:41:30
Autoryocto <yocto@user...>
Commiteryocto

Log Message

v.0.4pre TOMOYO Linux 2.4 対応

メインライン版 TOMOYO Linux 2.4 対応
動作確認未

Ändern Zusammenfassung

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
22
33 0.4 Released
44
5+ * Support TOMOYO Linux 2.4
6+
57 * The version of ccstools used was changed from 1.8.1 to 1.8.2p4.
68
79 * Support policy namespace.
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -2,6 +2,8 @@
22
33 0.4 Released
44
5+ * TOMOYO Linux 2.4 対応
6+
57 * ベースとなるccs-editpolicyをccstools 1.8.2p4 20110820版 に変更
68
79 * ポリシー名前空間対応
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,8 +8,8 @@ msgid ""
88 msgstr ""
99 "Project-Id-Version: 0.1\n"
1010 "Report-Msgid-Bugs-To: \n"
11-"POT-Creation-Date: 2011-09-05 17:05+0900\n"
12-"PO-Revision-Date: 2011-09-05 17:05+0900\n"
11+"POT-Creation-Date: 2011-09-06 23:33+0900\n"
12+"PO-Revision-Date: 2011-09-06 23:33+0900\n"
1313 "Last-Translator: Yoshihiro Kusuno <yocto@users.sourceforge.jp>\n"
1414 "Language-Team: Japanese < >\n"
1515 "Language: \n"
@@ -194,7 +194,7 @@ msgstr "ドメインポリシーを別ウィンドウで表示します。"
194194 msgid "Process State"
195195 msgstr "プロセス 一覧"
196196
197-#: ../src/menu.c:774
197+#: ../src/menu.c:776
198198 #, c-format
199199 msgid ""
200200 "<span foreground='red' size='x-large'><b>Delete</b> the %d selected "
@@ -203,7 +203,7 @@ msgstr ""
203203 "<span foreground='red' size='x-large'>選択した %d行の例外ポリシーを<b>削除</"
204204 "b>します。</span>"
205205
206-#: ../src/menu.c:777
206+#: ../src/menu.c:779
207207 #, c-format
208208 msgid ""
209209 "<span foreground='red' size='x-large'><b>Delete</b> the selected exception "
@@ -212,7 +212,7 @@ msgstr ""
212212 "<span foreground='red' size='x-large'>選択した 例外ポリシーを<b>削除</b>しま"
213213 "す。</span>"
214214
215-#: ../src/menu.c:794
215+#: ../src/menu.c:796
216216 #, c-format
217217 msgid ""
218218 "<span foreground='red' size='x-large'><b>Delete</b> the %d selected domains?"
@@ -221,7 +221,7 @@ msgstr ""
221221 "<span foreground='red' size='x-large'>選択した %d行のドメインを<b>削除</b>し"
222222 "ます。</span>"
223223
224-#: ../src/menu.c:797
224+#: ../src/menu.c:799
225225 #, c-format
226226 msgid ""
227227 "<span foreground='red' size='x-large'><b>Delete</b> the selected domain?</"
@@ -230,7 +230,7 @@ msgstr ""
230230 "<span foreground='red' size='x-large'>選択した ドメインを<b>削除</b>します。"
231231 "</span>"
232232
233-#: ../src/menu.c:816
233+#: ../src/menu.c:818
234234 #, c-format
235235 msgid ""
236236 "<span foreground='blue' size='x-large'><b>Delete</b> the %d selected "
@@ -239,7 +239,7 @@ msgstr ""
239239 "<span foreground='red' size='x-large'>選択した %d行のポリシーを<b>削除</b>し"
240240 "ます。</span>"
241241
242-#: ../src/menu.c:819
242+#: ../src/menu.c:821
243243 #, c-format
244244 msgid ""
245245 "<span foreground='blue' size='x-large'><b>Delete</b> the selected policy?</"
@@ -248,43 +248,43 @@ msgstr ""
248248 "<span foreground='red' size='x-large'>選択した ポリシーを<b>削除</b>します。"
249249 "</span>"
250250
251-#: ../src/menu.c:1053
251+#: ../src/menu.c:1055
252252 msgid "Add Domain"
253253 msgstr "ドメインを追加します。"
254254
255-#: ../src/menu.c:1060
255+#: ../src/menu.c:1062
256256 msgid "Add Acl"
257257 msgstr "ドメインに対するアクセス許可を追加します。"
258258
259-#: ../src/menu.c:1072
259+#: ../src/menu.c:1074
260260 msgid "Add Exception"
261261 msgstr "例外ポリシーを追加します。"
262262
263-#: ../src/menu.c:1080
263+#: ../src/menu.c:1082
264264 msgid "Add Profile (0 - 255)"
265265 msgstr "プロファイルを追加します。 (0 - 255)"
266266
267-#: ../src/menu.c:1088
267+#: ../src/menu.c:1090
268268 msgid "Add Namespace"
269269 msgstr "ポリシー名前空間を追加します。"
270270
271-#: ../src/menu.c:1230
271+#: ../src/menu.c:1232
272272 msgid "Profile list"
273273 msgstr "プロファイルを選択します。"
274274
275-#: ../src/menu.c:1305
275+#: ../src/menu.c:1307
276276 msgid "Profile Edit"
277277 msgstr "プロファイルを変更します。"
278278
279-#: ../src/menu.c:1389
279+#: ../src/menu.c:1391
280280 msgid "Yoshihiro Kusuno <yocto@users.sourceforge.jp>"
281-msgstr "クスノ <yocto@users.sourceforge.jp>"
281+msgstr "クスノ <yocto@users.sourceforge.jp>"
282282
283-#: ../src/menu.c:1390
283+#: ../src/menu.c:1392
284284 msgid "ccstools --- kumaneko san"
285285 msgstr "ccstools --- 熊猫さん"
286286
287-#: ../src/menu.c:1392
287+#: ../src/menu.c:1394
288288 msgid "Yoshihiro Kusuno"
289289 msgstr "クスノ"
290290
--- a/src/gpet.h
+++ b/src/gpet.h
@@ -128,14 +128,15 @@ int delete_exp_policy(struct ccs_domain_policy3 *dp, char **err_buff,
128128 struct ccs_generic_acl *ga, int count);
129129 int delete_manager_policy(
130130 struct ccs_generic_acl *ga, int count, char **err_buff);
131-int is_offline(void);
132-int is_network(void);
131+_Bool is_offline(void);
132+_Bool is_network(void);
133133 char *get_remote_ip(char *str_ip);
134134 const char *get_policy_dir(void);
135135 const char *get_domain_last_name(const int index);
136136 int get_find_target_domain(const int index);
137137 const char *get_ns_name(void);
138138 void put_ns_name(const char *namespace);
139+_Bool is_ccs(void);
139140
140141 // gpet.c
141142 gchar *decode_from_octal_str(const char *name);
--- a/src/interface.inc
+++ b/src/interface.inc
@@ -559,12 +559,12 @@ int delete_manager_policy(
559559 return result;
560560 }
561561
562-int is_offline(void)
562+_Bool is_offline(void)
563563 {
564564 return ccs_offline_mode;
565565 }
566566
567-int is_network(void)
567+_Bool is_network(void)
568568 {
569569 return ccs_network_mode;
570570 }
@@ -602,3 +602,16 @@ void put_ns_name(const char *namespace)
602602 {
603603 ccs_current_ns = ccs_savename(namespace);
604604 }
605+
606+/*-------+---------+---------+---------+---------+---------+---------+--------*/
607+static _Bool gpet_is_ccs_flag;
608+static void set_ccs_flag(void)
609+{
610+// if (!is_offline() && !is_network())
611+ gpet_is_ccs_flag = chdir(TOMOYO_PROC_POLICY_DIR) ? true : false;
612+}
613+
614+_Bool is_ccs(void)
615+{
616+ return gpet_is_ccs_flag;
617+}
--- a/src/menu.c
+++ b/src/menu.c
@@ -1404,7 +1404,7 @@ static void show_about_dialog(void)
14041404 gtk_about_dialog_set_copyright(about,
14051405 "Copyright(C) 2010,2011 TOMOYO Linux Project");
14061406 gtk_about_dialog_set_comments(about,
1407- "Gui Policy Editor for TOMOYO Linux 1.8.2"
1407+ "Gui Policy Editor for TOMOYO Linux 2.4 , 1.8.2"
14081408 " or AKARI 1.0.17"
14091409 "\n(based on ccs-editpolicy:ccstools)");
14101410 gtk_about_dialog_set_website(about, "http://sourceforge.jp/projects/gpet/");
--- a/src/usr_sbin/ccstools.h
+++ b/src/usr_sbin/ccstools.h
@@ -51,6 +51,36 @@
5151
5252 /***** CONSTANTS DEFINITION START *****/
5353
54+#ifdef __GPET
55+_Bool is_ccs(void);
56+#define CCS_PROC_POLICY_DIR "/proc/ccs/"
57+#define TOMOYO_PROC_POLICY_DIR "/sys/kernel/security/tomoyo/"
58+
59+#define CCS_PROC_POLICY_DOMAIN_POLICY \
60+ is_ccs() ? "/proc/ccs/domain_policy" : \
61+ "/sys/kernel/security/tomoyo/domain_policy"
62+#define CCS_PROC_POLICY_EXCEPTION_POLICY \
63+ is_ccs() ? "/proc/ccs/exception_policy" : \
64+ "/sys/kernel/security/tomoyo/exception_policy"
65+#define CCS_PROC_POLICY_AUDIT \
66+ is_ccs() ? "/proc/ccs/audit" : \
67+ "/sys/kernel/security/tomoyo/audit"
68+#define CCS_PROC_POLICY_MANAGER \
69+ is_ccs() ? "/proc/ccs/manager" : \
70+ "/sys/kernel/security/tomoyo/manager"
71+#define CCS_PROC_POLICY_STAT \
72+ is_ccs() ? "/proc/ccs/stat" : \
73+ "/sys/kernel/security/tomoyo/stat"
74+#define CCS_PROC_POLICY_PROCESS_STATUS \
75+ is_ccs() ? "/proc/ccs/.process_status" : \
76+ "/sys/kernel/security/tomoyo/.process_status"
77+#define CCS_PROC_POLICY_PROFILE \
78+ is_ccs() ? "/proc/ccs/profile" : \
79+ "/sys/kernel/security/tomoyo/profile"
80+#define CCS_PROC_POLICY_QUERY \
81+ is_ccs() ? "/proc/ccs/query" : \
82+ "/sys/kernel/security/tomoyo/query"
83+#else
5484 #define CCS_PROC_POLICY_DIR "/proc/ccs/"
5585 #define CCS_PROC_POLICY_DOMAIN_POLICY "/proc/ccs/domain_policy"
5686 #define CCS_PROC_POLICY_EXCEPTION_POLICY "/proc/ccs/exception_policy"
@@ -60,6 +90,7 @@
6090 #define CCS_PROC_POLICY_PROCESS_STATUS "/proc/ccs/.process_status"
6191 #define CCS_PROC_POLICY_PROFILE "/proc/ccs/profile"
6292 #define CCS_PROC_POLICY_QUERY "/proc/ccs/query"
93+#endif /* __GPET */
6394
6495 /***** CONSTANTS DEFINITION END *****/
6596
--- a/src/usr_sbin/editpolicy.c
+++ b/src/usr_sbin/editpolicy.c
@@ -3563,6 +3563,7 @@ static void ccs_save_offline(void)
35633563 }
35643564
35653565 #ifdef __GPET /* gpet */
3566+static void set_ccs_flag(void);
35663567 int gpet_main(void);
35673568 int ccs_main(int argc, char *argv[])
35683569 #else
@@ -3570,6 +3571,9 @@ int main(int argc, char *argv[])
35703571 #endif /* gpet */
35713572 {
35723573 ccs_parse_args(argc, argv);
3574+#ifdef __GPET /* gpet */
3575+ set_ccs_flag();
3576+#endif /* gpet */
35733577 ccs_editpolicy_init_keyword_map();
35743578 if (ccs_offline_mode)
35753579 ccs_load_offline();
Show on old repository browser