ima.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2008 IBM Corporation
  3. * Author: Mimi Zohar <zohar@us.ibm.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, version 2 of the License.
  8. */
  9. #ifndef _LINUX_IMA_H
  10. #define _LINUX_IMA_H
  11. #include <linux/fs.h>
  12. struct linux_binprm;
  13. #ifdef CONFIG_IMA
  14. extern int ima_bprm_check(struct linux_binprm *bprm);
  15. extern int ima_inode_alloc(struct inode *inode);
  16. extern void ima_inode_free(struct inode *inode);
  17. extern int ima_file_check(struct file *file, int mask);
  18. extern void ima_file_free(struct file *file);
  19. extern int ima_file_mmap(struct file *file, unsigned long prot);
  20. #else
  21. static inline int ima_bprm_check(struct linux_binprm *bprm)
  22. {
  23. return 0;
  24. }
  25. static inline int ima_inode_alloc(struct inode *inode)
  26. {
  27. return 0;
  28. }
  29. static inline void ima_inode_free(struct inode *inode)
  30. {
  31. return;
  32. }
  33. static inline int ima_file_check(struct file *file, int mask)
  34. {
  35. return 0;
  36. }
  37. static inline void ima_file_free(struct file *file)
  38. {
  39. return;
  40. }
  41. static inline int ima_file_mmap(struct file *file, unsigned long prot)
  42. {
  43. return 0;
  44. }
  45. #endif /* CONFIG_IMA_H */
  46. #endif /* _LINUX_IMA_H */