diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-06-24 22:16:00 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:34:54 -0400 |
commit | e2bf69077acefee5247bb661faac2552d29ba7ba (patch) | |
tree | 946adb588df8647f2476fb2f66996e6231521687 /security/tomoyo/file.c | |
parent | 8e5686874bcb882f69d5c04e6b38dc92b97facea (diff) |
TOMOYO: Rename symbols.
Use shorter name in order to make it easier to fit 80 columns limit.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/file.c')
-rw-r--r-- | security/tomoyo/file.c | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c index e7687ebdc5f6..f7877fa80f14 100644 --- a/security/tomoyo/file.c +++ b/security/tomoyo/file.c | |||
@@ -179,7 +179,7 @@ static int tomoyo_audit_path_log(struct tomoyo_request_info *r) | |||
179 | return 0; | 179 | return 0; |
180 | tomoyo_warn_log(r, "%s %s", operation, filename->name); | 180 | tomoyo_warn_log(r, "%s %s", operation, filename->name); |
181 | return tomoyo_supervisor(r, "allow_%s %s\n", operation, | 181 | return tomoyo_supervisor(r, "allow_%s %s\n", operation, |
182 | tomoyo_file_pattern(filename)); | 182 | tomoyo_pattern(filename)); |
183 | } | 183 | } |
184 | 184 | ||
185 | /** | 185 | /** |
@@ -199,8 +199,8 @@ static int tomoyo_audit_path2_log(struct tomoyo_request_info *r) | |||
199 | tomoyo_warn_log(r, "%s %s %s", operation, filename1->name, | 199 | tomoyo_warn_log(r, "%s %s %s", operation, filename1->name, |
200 | filename2->name); | 200 | filename2->name); |
201 | return tomoyo_supervisor(r, "allow_%s %s %s\n", operation, | 201 | return tomoyo_supervisor(r, "allow_%s %s %s\n", operation, |
202 | tomoyo_file_pattern(filename1), | 202 | tomoyo_pattern(filename1), |
203 | tomoyo_file_pattern(filename2)); | 203 | tomoyo_pattern(filename2)); |
204 | } | 204 | } |
205 | 205 | ||
206 | /** | 206 | /** |
@@ -222,8 +222,7 @@ static int tomoyo_audit_mkdev_log(struct tomoyo_request_info *r) | |||
222 | tomoyo_warn_log(r, "%s %s 0%o %u %u", operation, filename->name, mode, | 222 | tomoyo_warn_log(r, "%s %s 0%o %u %u", operation, filename->name, mode, |
223 | major, minor); | 223 | major, minor); |
224 | return tomoyo_supervisor(r, "allow_%s %s 0%o %u %u\n", operation, | 224 | return tomoyo_supervisor(r, "allow_%s %s 0%o %u %u\n", operation, |
225 | tomoyo_file_pattern(filename), mode, major, | 225 | tomoyo_pattern(filename), mode, major, minor); |
226 | minor); | ||
227 | } | 226 | } |
228 | 227 | ||
229 | /** | 228 | /** |
@@ -262,20 +261,20 @@ static int tomoyo_audit_path_number_log(struct tomoyo_request_info *r) | |||
262 | radix); | 261 | radix); |
263 | tomoyo_warn_log(r, "%s %s %s", operation, filename->name, buffer); | 262 | tomoyo_warn_log(r, "%s %s %s", operation, filename->name, buffer); |
264 | return tomoyo_supervisor(r, "allow_%s %s %s\n", operation, | 263 | return tomoyo_supervisor(r, "allow_%s %s %s\n", operation, |
265 | tomoyo_file_pattern(filename), buffer); | 264 | tomoyo_pattern(filename), buffer); |
266 | } | 265 | } |
267 | 266 | ||
268 | static bool tomoyo_same_globally_readable(const struct tomoyo_acl_head *a, | 267 | static bool tomoyo_same_globally_readable(const struct tomoyo_acl_head *a, |
269 | const struct tomoyo_acl_head *b) | 268 | const struct tomoyo_acl_head *b) |
270 | { | 269 | { |
271 | return container_of(a, struct tomoyo_globally_readable_file_entry, | 270 | return container_of(a, struct tomoyo_readable_file, |
272 | head)->filename == | 271 | head)->filename == |
273 | container_of(b, struct tomoyo_globally_readable_file_entry, | 272 | container_of(b, struct tomoyo_readable_file, |
274 | head)->filename; | 273 | head)->filename; |
275 | } | 274 | } |
276 | 275 | ||
277 | /** | 276 | /** |
278 | * tomoyo_update_globally_readable_entry - Update "struct tomoyo_globally_readable_file_entry" list. | 277 | * tomoyo_update_globally_readable_entry - Update "struct tomoyo_readable_file" list. |
279 | * | 278 | * |
280 | * @filename: Filename unconditionally permitted to open() for reading. | 279 | * @filename: Filename unconditionally permitted to open() for reading. |
281 | * @is_delete: True if it is a delete request. | 280 | * @is_delete: True if it is a delete request. |
@@ -287,7 +286,7 @@ static bool tomoyo_same_globally_readable(const struct tomoyo_acl_head *a, | |||
287 | static int tomoyo_update_globally_readable_entry(const char *filename, | 286 | static int tomoyo_update_globally_readable_entry(const char *filename, |
288 | const bool is_delete) | 287 | const bool is_delete) |
289 | { | 288 | { |
290 | struct tomoyo_globally_readable_file_entry e = { }; | 289 | struct tomoyo_readable_file e = { }; |
291 | int error; | 290 | int error; |
292 | 291 | ||
293 | if (!tomoyo_correct_word(filename)) | 292 | if (!tomoyo_correct_word(filename)) |
@@ -315,7 +314,7 @@ static int tomoyo_update_globally_readable_entry(const char *filename, | |||
315 | static bool tomoyo_globally_readable_file(const struct tomoyo_path_info * | 314 | static bool tomoyo_globally_readable_file(const struct tomoyo_path_info * |
316 | filename) | 315 | filename) |
317 | { | 316 | { |
318 | struct tomoyo_globally_readable_file_entry *ptr; | 317 | struct tomoyo_readable_file *ptr; |
319 | bool found = false; | 318 | bool found = false; |
320 | 319 | ||
321 | list_for_each_entry_rcu(ptr, &tomoyo_policy_list | 320 | list_for_each_entry_rcu(ptr, &tomoyo_policy_list |
@@ -330,7 +329,7 @@ static bool tomoyo_globally_readable_file(const struct tomoyo_path_info * | |||
330 | } | 329 | } |
331 | 330 | ||
332 | /** | 331 | /** |
333 | * tomoyo_write_globally_readable_policy - Write "struct tomoyo_globally_readable_file_entry" list. | 332 | * tomoyo_write_globally_readable - Write "struct tomoyo_readable_file" list. |
334 | * | 333 | * |
335 | * @data: String to parse. | 334 | * @data: String to parse. |
336 | * @is_delete: True if it is a delete request. | 335 | * @is_delete: True if it is a delete request. |
@@ -339,7 +338,7 @@ static bool tomoyo_globally_readable_file(const struct tomoyo_path_info * | |||
339 | * | 338 | * |
340 | * Caller holds tomoyo_read_lock(). | 339 | * Caller holds tomoyo_read_lock(). |
341 | */ | 340 | */ |
342 | int tomoyo_write_globally_readable_policy(char *data, const bool is_delete) | 341 | int tomoyo_write_globally_readable(char *data, const bool is_delete) |
343 | { | 342 | { |
344 | return tomoyo_update_globally_readable_entry(data, is_delete); | 343 | return tomoyo_update_globally_readable_entry(data, is_delete); |
345 | } | 344 | } |
@@ -347,12 +346,12 @@ int tomoyo_write_globally_readable_policy(char *data, const bool is_delete) | |||
347 | static bool tomoyo_same_pattern(const struct tomoyo_acl_head *a, | 346 | static bool tomoyo_same_pattern(const struct tomoyo_acl_head *a, |
348 | const struct tomoyo_acl_head *b) | 347 | const struct tomoyo_acl_head *b) |
349 | { | 348 | { |
350 | return container_of(a, struct tomoyo_pattern_entry, head)->pattern == | 349 | return container_of(a, struct tomoyo_no_pattern, head)->pattern == |
351 | container_of(b, struct tomoyo_pattern_entry, head)->pattern; | 350 | container_of(b, struct tomoyo_no_pattern, head)->pattern; |
352 | } | 351 | } |
353 | 352 | ||
354 | /** | 353 | /** |
355 | * tomoyo_update_file_pattern_entry - Update "struct tomoyo_pattern_entry" list. | 354 | * tomoyo_update_file_pattern_entry - Update "struct tomoyo_no_pattern" list. |
356 | * | 355 | * |
357 | * @pattern: Pathname pattern. | 356 | * @pattern: Pathname pattern. |
358 | * @is_delete: True if it is a delete request. | 357 | * @is_delete: True if it is a delete request. |
@@ -364,7 +363,7 @@ static bool tomoyo_same_pattern(const struct tomoyo_acl_head *a, | |||
364 | static int tomoyo_update_file_pattern_entry(const char *pattern, | 363 | static int tomoyo_update_file_pattern_entry(const char *pattern, |
365 | const bool is_delete) | 364 | const bool is_delete) |
366 | { | 365 | { |
367 | struct tomoyo_pattern_entry e = { }; | 366 | struct tomoyo_no_pattern e = { }; |
368 | int error; | 367 | int error; |
369 | 368 | ||
370 | if (!tomoyo_correct_word(pattern)) | 369 | if (!tomoyo_correct_word(pattern)) |
@@ -380,7 +379,7 @@ static int tomoyo_update_file_pattern_entry(const char *pattern, | |||
380 | } | 379 | } |
381 | 380 | ||
382 | /** | 381 | /** |
383 | * tomoyo_file_pattern - Get patterned pathname. | 382 | * tomoyo_pattern - Get patterned pathname. |
384 | * | 383 | * |
385 | * @filename: The filename to find patterned pathname. | 384 | * @filename: The filename to find patterned pathname. |
386 | * | 385 | * |
@@ -388,9 +387,9 @@ static int tomoyo_update_file_pattern_entry(const char *pattern, | |||
388 | * | 387 | * |
389 | * Caller holds tomoyo_read_lock(). | 388 | * Caller holds tomoyo_read_lock(). |
390 | */ | 389 | */ |
391 | const char *tomoyo_file_pattern(const struct tomoyo_path_info *filename) | 390 | const char *tomoyo_pattern(const struct tomoyo_path_info *filename) |
392 | { | 391 | { |
393 | struct tomoyo_pattern_entry *ptr; | 392 | struct tomoyo_no_pattern *ptr; |
394 | const struct tomoyo_path_info *pattern = NULL; | 393 | const struct tomoyo_path_info *pattern = NULL; |
395 | 394 | ||
396 | list_for_each_entry_rcu(ptr, &tomoyo_policy_list[TOMOYO_ID_PATTERN], | 395 | list_for_each_entry_rcu(ptr, &tomoyo_policy_list[TOMOYO_ID_PATTERN], |
@@ -413,7 +412,7 @@ const char *tomoyo_file_pattern(const struct tomoyo_path_info *filename) | |||
413 | } | 412 | } |
414 | 413 | ||
415 | /** | 414 | /** |
416 | * tomoyo_write_pattern_policy - Write "struct tomoyo_pattern_entry" list. | 415 | * tomoyo_write_pattern - Write "struct tomoyo_no_pattern" list. |
417 | * | 416 | * |
418 | * @data: String to parse. | 417 | * @data: String to parse. |
419 | * @is_delete: True if it is a delete request. | 418 | * @is_delete: True if it is a delete request. |
@@ -422,7 +421,7 @@ const char *tomoyo_file_pattern(const struct tomoyo_path_info *filename) | |||
422 | * | 421 | * |
423 | * Caller holds tomoyo_read_lock(). | 422 | * Caller holds tomoyo_read_lock(). |
424 | */ | 423 | */ |
425 | int tomoyo_write_pattern_policy(char *data, const bool is_delete) | 424 | int tomoyo_write_pattern(char *data, const bool is_delete) |
426 | { | 425 | { |
427 | return tomoyo_update_file_pattern_entry(data, is_delete); | 426 | return tomoyo_update_file_pattern_entry(data, is_delete); |
428 | } | 427 | } |
@@ -430,13 +429,13 @@ int tomoyo_write_pattern_policy(char *data, const bool is_delete) | |||
430 | static bool tomoyo_same_no_rewrite(const struct tomoyo_acl_head *a, | 429 | static bool tomoyo_same_no_rewrite(const struct tomoyo_acl_head *a, |
431 | const struct tomoyo_acl_head *b) | 430 | const struct tomoyo_acl_head *b) |
432 | { | 431 | { |
433 | return container_of(a, struct tomoyo_no_rewrite_entry, head)->pattern | 432 | return container_of(a, struct tomoyo_no_rewrite, head)->pattern |
434 | == container_of(b, struct tomoyo_no_rewrite_entry, head) | 433 | == container_of(b, struct tomoyo_no_rewrite, head) |
435 | ->pattern; | 434 | ->pattern; |
436 | } | 435 | } |
437 | 436 | ||
438 | /** | 437 | /** |
439 | * tomoyo_update_no_rewrite_entry - Update "struct tomoyo_no_rewrite_entry" list. | 438 | * tomoyo_update_no_rewrite_entry - Update "struct tomoyo_no_rewrite" list. |
440 | * | 439 | * |
441 | * @pattern: Pathname pattern that are not rewritable by default. | 440 | * @pattern: Pathname pattern that are not rewritable by default. |
442 | * @is_delete: True if it is a delete request. | 441 | * @is_delete: True if it is a delete request. |
@@ -448,7 +447,7 @@ static bool tomoyo_same_no_rewrite(const struct tomoyo_acl_head *a, | |||
448 | static int tomoyo_update_no_rewrite_entry(const char *pattern, | 447 | static int tomoyo_update_no_rewrite_entry(const char *pattern, |
449 | const bool is_delete) | 448 | const bool is_delete) |
450 | { | 449 | { |
451 | struct tomoyo_no_rewrite_entry e = { }; | 450 | struct tomoyo_no_rewrite e = { }; |
452 | int error; | 451 | int error; |
453 | 452 | ||
454 | if (!tomoyo_correct_word(pattern)) | 453 | if (!tomoyo_correct_word(pattern)) |
@@ -475,7 +474,7 @@ static int tomoyo_update_no_rewrite_entry(const char *pattern, | |||
475 | */ | 474 | */ |
476 | static bool tomoyo_no_rewrite_file(const struct tomoyo_path_info *filename) | 475 | static bool tomoyo_no_rewrite_file(const struct tomoyo_path_info *filename) |
477 | { | 476 | { |
478 | struct tomoyo_no_rewrite_entry *ptr; | 477 | struct tomoyo_no_rewrite *ptr; |
479 | bool found = false; | 478 | bool found = false; |
480 | 479 | ||
481 | list_for_each_entry_rcu(ptr, &tomoyo_policy_list[TOMOYO_ID_NO_REWRITE], | 480 | list_for_each_entry_rcu(ptr, &tomoyo_policy_list[TOMOYO_ID_NO_REWRITE], |
@@ -491,7 +490,7 @@ static bool tomoyo_no_rewrite_file(const struct tomoyo_path_info *filename) | |||
491 | } | 490 | } |
492 | 491 | ||
493 | /** | 492 | /** |
494 | * tomoyo_write_no_rewrite_policy - Write "struct tomoyo_no_rewrite_entry" list. | 493 | * tomoyo_write_no_rewrite - Write "struct tomoyo_no_rewrite" list. |
495 | * | 494 | * |
496 | * @data: String to parse. | 495 | * @data: String to parse. |
497 | * @is_delete: True if it is a delete request. | 496 | * @is_delete: True if it is a delete request. |
@@ -500,7 +499,7 @@ static bool tomoyo_no_rewrite_file(const struct tomoyo_path_info *filename) | |||
500 | * | 499 | * |
501 | * Caller holds tomoyo_read_lock(). | 500 | * Caller holds tomoyo_read_lock(). |
502 | */ | 501 | */ |
503 | int tomoyo_write_no_rewrite_policy(char *data, const bool is_delete) | 502 | int tomoyo_write_no_rewrite(char *data, const bool is_delete) |
504 | { | 503 | { |
505 | return tomoyo_update_no_rewrite_entry(data, is_delete); | 504 | return tomoyo_update_no_rewrite_entry(data, is_delete); |
506 | } | 505 | } |
@@ -1121,7 +1120,7 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1, | |||
1121 | } | 1120 | } |
1122 | 1121 | ||
1123 | /** | 1122 | /** |
1124 | * tomoyo_write_file_policy - Update file related list. | 1123 | * tomoyo_write_file - Update file related list. |
1125 | * | 1124 | * |
1126 | * @data: String to parse. | 1125 | * @data: String to parse. |
1127 | * @domain: Pointer to "struct tomoyo_domain_info". | 1126 | * @domain: Pointer to "struct tomoyo_domain_info". |
@@ -1131,8 +1130,8 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1, | |||
1131 | * | 1130 | * |
1132 | * Caller holds tomoyo_read_lock(). | 1131 | * Caller holds tomoyo_read_lock(). |
1133 | */ | 1132 | */ |
1134 | int tomoyo_write_file_policy(char *data, struct tomoyo_domain_info *domain, | 1133 | int tomoyo_write_file(char *data, struct tomoyo_domain_info *domain, |
1135 | const bool is_delete) | 1134 | const bool is_delete) |
1136 | { | 1135 | { |
1137 | char *w[5]; | 1136 | char *w[5]; |
1138 | u8 type; | 1137 | u8 type; |