patch-honeyd_c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. $OpenBSD: patch-honeyd_c,v 1.4 2007/07/25 22:27:01 rui Exp $
  2. --- honeyd.c.orig Mon May 28 07:12:52 2007
  3. +++ honeyd.c Wed Jul 18 11:55:08 2007
  4. @@ -163,8 +163,8 @@ int honeyd_show_data_dir;
  5. int honeyd_show_version;
  6. int honeyd_show_usage;
  7. int honeyd_debug;
  8. -uid_t honeyd_uid = 32767;
  9. -gid_t honeyd_gid = 32767;
  10. +uid_t honeyd_uid = 546;
  11. +gid_t honeyd_gid = 546;
  12. int honeyd_needsroot; /* Need different IDs */
  13. int honeyd_disable_webserver = 0;
  14. int honeyd_disable_update = 0;
  15. @@ -434,12 +434,6 @@ honeyd_init(void)
  16. /* Record our start time */
  17. gettimeofday(&honeyd_uptime, NULL);
  18. - /* Find the correct ids for nobody */
  19. - if ((pwd = getpwnam("nobody")) != NULL) {
  20. - honeyd_uid = pwd->pw_uid;
  21. - honeyd_gid = pwd->pw_gid;
  22. - }
  23. -
  24. /* Initalize ongoing connection state */
  25. SPLAY_INIT(&tcpcons);
  26. TAILQ_INIT(&tcplru);
  27. @@ -3256,6 +3250,13 @@ main(int argc, char *argv[])
  28. /* We need reproduceable random numbers for regression testing */
  29. if (setrand)
  30. rand_set(honeyd_rand, &setrand, sizeof(setrand));
  31. +
  32. + /*
  33. + * Set the environment variable EVENT_NOKQUEUE to Yes because
  34. + * kqueue support doesn't handle BPF descriptors
  35. + */
  36. + if (setenv("EVENT_NOKQUEUE", "Yes", 1))
  37. + printf("EVENT_NOKQUEUE set");
  38. /* disables event methods that don't work for bpf */