shell.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_MAX 23
  24. #define DETECT_LOGIN 1
  25. #define DETECT_TRACE 2
  26. #define DETECT_PROMISC 3
  27. #define DETECT_PROCESS 4 /* NOT USED */
  28. #define DETECT_HIJACK 5
  29. #define DET_IGNORE 0
  30. #define DET_WARN 1
  31. #define DET_REJECT 2
  32. #define DET_DIE 3
  33. #define DET_SUICIDE 4
  34. #define DETECTED_LEN 8 /* 'suicide' is longest word */
  35. namespace bd {
  36. class Stream;
  37. }
  38. void check_maxfiles();
  39. void check_mypid();
  40. void clear_tmp();
  41. char *homedir(bool = 1);
  42. char *my_username();
  43. void expand_tilde(char **);
  44. int shell_exec(char *, char *, char **, char **, bool = 0);
  45. int simple_exec(const char* argv[]);
  46. #ifndef CYGWIN_HACKS
  47. void check_last();
  48. void check_promisc();
  49. void check_trace(int);
  50. void check_crontab();
  51. void crontab_del();
  52. int crontab_exists(bd::Stream* = NULL, bool = 0);
  53. void crontab_create(int);
  54. void detected(int, const char *);
  55. #endif /* !CYGWIN_HACKS */
  56. void suicide(const char *);
  57. void werr(int) __attribute__((noreturn));
  58. const char *werr_tostr(int);
  59. int det_translate(const char *);
  60. const char *det_translate_num(int);
  61. char *shell_escape(const char *);
  62. int mkdir_p(const char *);
  63. extern bool clear_tmpdir;
  64. #endif /* _SHELL_H */