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