shell.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef _SHELL_H
  2. #define _SHELL_H
  3. #ifdef HAVE_CONFIG_H
  4. #include "config.h"
  5. #endif /* HAVE_CONFIG_H */
  6. #define ERR_BINSTAT 1
  7. #define ERR_PASSWD 3
  8. #define ERR_WRONGBINDIR 4
  9. #define ERR_DATADIR 5
  10. #define ERR_TMPSTAT 8
  11. #define ERR_TMPMOD 9
  12. #define ERR_WRONGUID 12
  13. #define ERR_WRONGUNAME 13
  14. #define ERR_BADCONF 14
  15. #define ERR_BADBOT 15
  16. #define ERR_BADPASS 16
  17. #define ERR_BOTDISABLED 17
  18. #define ERR_NOBOTS 18
  19. #define ERR_NOBOT 19
  20. #define ERR_NOUSERNAME 20
  21. #define ERR_NOHOMEDIR 21
  22. #define ERR_NOTINIT 22
  23. #define ERR_TOOMANYBOTS 23
  24. #define ERR_LIBS 24
  25. #define ERR_ALREADYINIT 25
  26. #define ERR_MAX 26
  27. #define DETECT_LOGIN 1
  28. #define DETECT_TRACE 2
  29. #define DETECT_PROMISC 3
  30. #define DETECT_PROCESS 4 /* NOT USED */
  31. #define DETECT_HIJACK 5
  32. #define DET_IGNORE 0
  33. #define DET_WARN 1
  34. #define DET_REJECT 2
  35. #define DET_DIE 3
  36. #define DET_SUICIDE 4
  37. #define DETECTED_LEN 8 /* 'suicide' is longest word */
  38. namespace bd {
  39. class Stream;
  40. }
  41. void check_maxfiles();
  42. void check_mypid();
  43. void clear_tmp();
  44. const char *homedir(bool = 1);
  45. const char *my_username();
  46. void expand_tilde(char **);
  47. int shell_exec(char *, char *, char **, char **, bool = 0);
  48. int simple_exec(const char* argv[]);
  49. void check_last();
  50. void check_promisc();
  51. void check_trace(int);
  52. void check_crontab();
  53. void crontab_del();
  54. int crontab_exists(bd::Stream* = NULL, bool = 0);
  55. void crontab_create(int);
  56. void detected(int, const char *);
  57. void suicide(const char *);
  58. void werr(int) __attribute__((noreturn));
  59. const char *werr_tostr(int) __attribute__((const));
  60. int det_translate(const char *) __attribute__((pure));
  61. const char *det_translate_num(int) __attribute__((const));
  62. char *shell_escape(const char *);
  63. int mkdir_p(const char *);
  64. extern bool clear_tmpdir;
  65. #endif /* _SHELL_H */