ima.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_path_check(struct path *path, int mask);
  18. extern void ima_file_free(struct file *file);
  19. extern int ima_file_mmap(struct file *file, unsigned long prot);
  20. extern void ima_counts_get(struct file *file);
  21. #else
  22. static inline int ima_bprm_check(struct linux_binprm *bprm)
  23. {
  24. return 0;
  25. }
  26. static inline int ima_inode_alloc(struct inode *inode)
  27. {
  28. return 0;
  29. }
  30. static inline void ima_inode_free(struct inode *inode)
  31. {
  32. return;
  33. }
  34. static inline int ima_path_check(struct path *path, int mask)
  35. {
  36. return 0;
  37. }
  38. static inline void ima_file_free(struct file *file)
  39. {
  40. return;
  41. }
  42. static inline int ima_file_mmap(struct file *file, unsigned long prot)
  43. {
  44. return 0;
  45. }
  46. static inline void ima_counts_get(struct file *file)
  47. {
  48. return;
  49. }
  50. #endif /* CONFIG_IMA_H */
  51. #endif /* _LINUX_IMA_H */