apparmorfs.c (84f1f787421cd83bb7dfb34d584586f6a5fe7baa) | apparmorfs.c (f8eb8a1324e81927b2c64823b2fc38386efd3fef) |
---|---|
1/* 2 * AppArmor security module 3 * 4 * This file contains AppArmor /sys/kernel/security/apparmor interface functions 5 * 6 * Copyright (C) 1998-2008 Novell/SUSE 7 * Copyright 2009-2010 Canonical Ltd. 8 * --- 12 unchanged lines hidden (view full) --- 21#include <linux/namei.h> 22#include <linux/capability.h> 23#include <linux/rcupdate.h> 24 25#include "include/apparmor.h" 26#include "include/apparmorfs.h" 27#include "include/audit.h" 28#include "include/context.h" | 1/* 2 * AppArmor security module 3 * 4 * This file contains AppArmor /sys/kernel/security/apparmor interface functions 5 * 6 * Copyright (C) 1998-2008 Novell/SUSE 7 * Copyright 2009-2010 Canonical Ltd. 8 * --- 12 unchanged lines hidden (view full) --- 21#include <linux/namei.h> 22#include <linux/capability.h> 23#include <linux/rcupdate.h> 24 25#include "include/apparmor.h" 26#include "include/apparmorfs.h" 27#include "include/audit.h" 28#include "include/context.h" |
29#include "include/crypto.h" |
|
29#include "include/policy.h" 30#include "include/resource.h" 31 32/** 33 * aa_mangle_name - mangle a profile name to std profile layout form 34 * @name: profile name to mangle (NOT NULL) 35 * @target: buffer to store mangled name, same length as @name (MAYBE NULL) 36 * --- 277 unchanged lines hidden (view full) --- 314static const struct file_operations aa_fs_profattach_fops = { 315 .owner = THIS_MODULE, 316 .open = aa_fs_seq_profattach_open, 317 .read = seq_read, 318 .llseek = seq_lseek, 319 .release = aa_fs_seq_profile_release, 320}; 321 | 30#include "include/policy.h" 31#include "include/resource.h" 32 33/** 34 * aa_mangle_name - mangle a profile name to std profile layout form 35 * @name: profile name to mangle (NOT NULL) 36 * @target: buffer to store mangled name, same length as @name (MAYBE NULL) 37 * --- 277 unchanged lines hidden (view full) --- 315static const struct file_operations aa_fs_profattach_fops = { 316 .owner = THIS_MODULE, 317 .open = aa_fs_seq_profattach_open, 318 .read = seq_read, 319 .llseek = seq_lseek, 320 .release = aa_fs_seq_profile_release, 321}; 322 |
323static int aa_fs_seq_hash_show(struct seq_file *seq, void *v) 324{ 325 struct aa_replacedby *r = seq->private; 326 struct aa_profile *profile = aa_get_profile_rcu(&r->profile); 327 unsigned int i, size = aa_hash_size(); 328 329 if (profile->hash) { 330 for (i = 0; i < size; i++) 331 seq_printf(seq, "%.2x", profile->hash[i]); 332 seq_puts(seq, "\n"); 333 } 334 335 return 0; 336} 337 338static int aa_fs_seq_hash_open(struct inode *inode, struct file *file) 339{ 340 return single_open(file, aa_fs_seq_hash_show, inode->i_private); 341} 342 343static const struct file_operations aa_fs_seq_hash_fops = { 344 .owner = THIS_MODULE, 345 .open = aa_fs_seq_hash_open, 346 .read = seq_read, 347 .llseek = seq_lseek, 348 .release = single_release, 349}; 350 |
|
322/** fns to setup dynamic per profile/namespace files **/ 323void __aa_fs_profile_rmdir(struct aa_profile *profile) 324{ 325 struct aa_profile *child; 326 int i; 327 328 if (!profile) 329 return; --- 85 unchanged lines hidden (view full) --- 415 profile->dents[AAFS_PROF_MODE] = dent; 416 417 dent = create_profile_file(dir, "attach", profile, 418 &aa_fs_profattach_fops); 419 if (IS_ERR(dent)) 420 goto fail; 421 profile->dents[AAFS_PROF_ATTACH] = dent; 422 | 351/** fns to setup dynamic per profile/namespace files **/ 352void __aa_fs_profile_rmdir(struct aa_profile *profile) 353{ 354 struct aa_profile *child; 355 int i; 356 357 if (!profile) 358 return; --- 85 unchanged lines hidden (view full) --- 444 profile->dents[AAFS_PROF_MODE] = dent; 445 446 dent = create_profile_file(dir, "attach", profile, 447 &aa_fs_profattach_fops); 448 if (IS_ERR(dent)) 449 goto fail; 450 profile->dents[AAFS_PROF_ATTACH] = dent; 451 |
452 if (profile->hash) { 453 dent = create_profile_file(dir, "sha1", profile, 454 &aa_fs_seq_hash_fops); 455 if (IS_ERR(dent)) 456 goto fail; 457 profile->dents[AAFS_PROF_HASH] = dent; 458 } 459 |
|
423 list_for_each_entry(child, &profile->base.profiles, base.list) { 424 error = __aa_fs_profile_mkdir(child, prof_child_dir(profile)); 425 if (error) 426 goto fail2; 427 } 428 429 return 0; 430 --- 504 unchanged lines hidden --- | 460 list_for_each_entry(child, &profile->base.profiles, base.list) { 461 error = __aa_fs_profile_mkdir(child, prof_child_dir(profile)); 462 if (error) 463 goto fail2; 464 } 465 466 return 0; 467 --- 504 unchanged lines hidden --- |