• R/O
  • SSH
  • HTTPS

tomoyo: コミット


コミットメタ情報

リビジョン6840 (tree)
日時2020-11-03 19:07:46
作者kumaneko

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- trunk/1.8.x/ccs-tools/kernel_test/ccs_file_test.c (revision 6839)
+++ trunk/1.8.x/ccs-tools/kernel_test/ccs_file_test.c (revision 6840)
@@ -112,8 +112,10 @@
112112 show_result(sysctl(name, 3, 0, 0, buffer, size));
113113 }
114114
115- show_prompt("uselib()");
116- show_result(uselib("/tmp/uselib"));
115+ if (uselib("/") != EOF || errno != ENOSYS) {
116+ show_prompt("uselib()");
117+ show_result(uselib("/tmp/uselib"));
118+ }
117119
118120 {
119121 int pipe_fd[2] = { EOF, EOF };
--- trunk/1.8.x/ccs-tools/kernel_test/ccs_new_file_test.c (revision 6839)
+++ trunk/1.8.x/ccs-tools/kernel_test/ccs_new_file_test.c (revision 6840)
@@ -182,12 +182,14 @@
182182 show_result(sysctl(name, 3, buffer, &size, buffer, size), 0);
183183 }
184184
185- policy = "file read /tmp/uselib "
186- "path1.uid=0 path1.parent.uid=0 10=10-100";
187- write_domain_policy(policy, 0);
188- show_result(uselib("/tmp/uselib"), 1);
189- write_domain_policy(policy, 1);
190- show_result(uselib("/tmp/uselib"), 0);
185+ if (uselib("/") != EOF || errno != ENOSYS) {
186+ policy = "file read /tmp/uselib "
187+ "path1.uid=0 path1.parent.uid=0 10=10-100";
188+ write_domain_policy(policy, 0);
189+ show_result(uselib("/tmp/uselib"), 1);
190+ write_domain_policy(policy, 1);
191+ show_result(uselib("/tmp/uselib"), 0);
192+ }
191193
192194 policy = "file write /dev/null";
193195 fd = open("/dev/null", O_WRONLY);
--- trunk/2.6.x/tomoyo-tools/kernel_test/tomoyo_file_test.c (revision 6839)
+++ trunk/2.6.x/tomoyo-tools/kernel_test/tomoyo_file_test.c (revision 6840)
@@ -99,7 +99,9 @@
9999 static void stage_file_test(void)
100100 {
101101 int fd;
102- {
102+ static int version_name[] = { CTL_KERN, KERN_VERSION };
103+ if (sysctl(version_name, 2, NULL, NULL, 0, 0) != EOF ||
104+ errno != ENOSYS) {
103105 static int name[] = { CTL_NET, NET_IPV4,
104106 NET_IPV4_LOCAL_PORT_RANGE };
105107 int buffer[2] = { 32768, 61000 };
@@ -110,8 +112,10 @@
110112 show_result(sysctl(name, 3, 0, 0, buffer, size));
111113 }
112114
113- show_prompt("uselib()");
114- show_result(uselib("/tmp/uselib"));
115+ if (uselib("/") != EOF || errno != ENOSYS) {
116+ show_prompt("uselib()");
117+ show_result(uselib("/tmp/uselib"));
118+ }
115119
116120 {
117121 int pipe_fd[2] = { EOF, EOF };
--- trunk/2.6.x/tomoyo-tools/kernel_test/tomoyo_new_file_test.c (revision 6839)
+++ trunk/2.6.x/tomoyo-tools/kernel_test/tomoyo_new_file_test.c (revision 6840)
@@ -113,6 +113,7 @@
113113
114114 static void stage_file_test(void)
115115 {
116+ static int version_name[] = { CTL_KERN, KERN_VERSION };
116117 static int name[] = { CTL_NET, NET_IPV4, NET_IPV4_LOCAL_PORT_RANGE };
117118 int buffer[2] = { 32768, 61000 };
118119 size_t size = sizeof(buffer);
@@ -149,41 +150,46 @@
149150 set_profile(3, "file::unmount");
150151 set_profile(3, "file::pivot_root");
151152
152- policy = "file read proc:/sys/net/ipv4/ip_local_port_range "
153- "task.uid=0 task.gid=0";
154- write_domain_policy(policy, 0);
155- show_result(sysctl(name, 3, buffer, &size, 0, 0), 1);
156- write_domain_policy(policy, 1);
157- show_result(sysctl(name, 3, buffer, &size, 0, 0), 0);
153+ if (sysctl(version_name, 2, NULL, NULL, 0, 0) != EOF ||
154+ errno != ENOSYS) {
155+ policy = "file read proc:/sys/net/ipv4/ip_local_port_range "
156+ "task.uid=0 task.gid=0";
157+ write_domain_policy(policy, 0);
158+ show_result(sysctl(name, 3, buffer, &size, 0, 0), 1);
159+ write_domain_policy(policy, 1);
160+ show_result(sysctl(name, 3, buffer, &size, 0, 0), 0);
158161
159- policy = "file write proc:/sys/net/ipv4/ip_local_port_range "
160- "task.euid=0 0=0 1-100=10-1000";
161- write_domain_policy(policy, 0);
162- show_result(sysctl(name, 3, 0, 0, buffer, size), 1);
163- write_domain_policy(policy, 1);
164- show_result(sysctl(name, 3, 0, 0, buffer, size), 0);
162+ policy = "file write proc:/sys/net/ipv4/ip_local_port_range "
163+ "task.euid=0 0=0 1-100=10-1000";
164+ write_domain_policy(policy, 0);
165+ show_result(sysctl(name, 3, 0, 0, buffer, size), 1);
166+ write_domain_policy(policy, 1);
167+ show_result(sysctl(name, 3, 0, 0, buffer, size), 0);
165168
166- policy = "file read proc:/sys/net/ipv4/ip_local_port_range "
167- "1!=10-100";
168- write_domain_policy(policy, 0);
169- policy = "file write proc:/sys/net/ipv4/ip_local_port_range "
170- "1!=10-100";
171- write_domain_policy(policy, 0);
172- show_result(sysctl(name, 3, buffer, &size, buffer, size), 1);
173- policy = "file read proc:/sys/net/ipv4/ip_local_port_range "
174- "1!=10-100";
175- write_domain_policy(policy, 1);
176- policy = "file write proc:/sys/net/ipv4/ip_local_port_range "
177- "1!=10-100";
178- write_domain_policy(policy, 1);
179- show_result(sysctl(name, 3, buffer, &size, buffer, size), 0);
169+ policy = "file read proc:/sys/net/ipv4/ip_local_port_range "
170+ "1!=10-100";
171+ write_domain_policy(policy, 0);
172+ policy = "file write proc:/sys/net/ipv4/ip_local_port_range "
173+ "1!=10-100";
174+ write_domain_policy(policy, 0);
175+ show_result(sysctl(name, 3, buffer, &size, buffer, size), 1);
176+ policy = "file read proc:/sys/net/ipv4/ip_local_port_range "
177+ "1!=10-100";
178+ write_domain_policy(policy, 1);
179+ policy = "file write proc:/sys/net/ipv4/ip_local_port_range "
180+ "1!=10-100";
181+ write_domain_policy(policy, 1);
182+ show_result(sysctl(name, 3, buffer, &size, buffer, size), 0);
183+ }
180184
181- policy = "file read /tmp/uselib "
182- "path1.uid=0 path1.parent.uid=0 10=10-100";
183- write_domain_policy(policy, 0);
184- show_result(uselib("/tmp/uselib"), 1);
185- write_domain_policy(policy, 1);
186- show_result(uselib("/tmp/uselib"), 0);
185+ if (uselib("/") != EOF || errno != ENOSYS) {
186+ policy = "file read /tmp/uselib "
187+ "path1.uid=0 path1.parent.uid=0 10=10-100";
188+ write_domain_policy(policy, 0);
189+ show_result(uselib("/tmp/uselib"), 1);
190+ write_domain_policy(policy, 1);
191+ show_result(uselib("/tmp/uselib"), 0);
192+ }
187193
188194 policy = "file write /dev/null";
189195 fd = open("/dev/null", O_WRONLY);
旧リポジトリブラウザで表示