securebits.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #ifndef _LINUX_SECUREBITS_H
  2. #define _LINUX_SECUREBITS_H 1
  3. #define SECUREBITS_DEFAULT 0x00000000
  4. extern unsigned securebits;
  5. /* When set UID 0 has no special privileges. When unset, we support
  6. inheritance of root-permissions and suid-root executable under
  7. compatibility mode. We raise the effective and inheritable bitmasks
  8. *of the executable file* if the effective uid of the new process is
  9. 0. If the real uid is 0, we raise the inheritable bitmask of the
  10. executable file. */
  11. #define SECURE_NOROOT 0
  12. /* When set, setuid to/from uid 0 does not trigger capability-"fixes"
  13. to be compatible with old programs relying on set*uid to loose
  14. privileges. When unset, setuid doesn't change privileges. */
  15. #define SECURE_NO_SETUID_FIXUP 2
  16. /* Each securesetting is implemented using two bits. One bit specify
  17. whether the setting is on or off. The other bit specify whether the
  18. setting is fixed or not. A setting which is fixed cannot be changed
  19. from user-level. */
  20. #define issecure(X) ( (1 << (X+1)) & SECUREBITS_DEFAULT ? \
  21. (1 << (X)) & SECUREBITS_DEFAULT : \
  22. (1 << (X)) & securebits )
  23. #endif /* !_LINUX_SECUREBITS_H */