Re: DNS using Name Service Switch module and Casper

2021-01-14 Thread Mark Johnston
On Sun, Jan 10, 2021 at 04:32:13PM +0300, Vasily Postnicov wrote: > This is as minimal as I can get. If I knew where to find, what to fix, I > would never waste my time seeking for help on mailing lists. > > Just put FreeBSD in that damn bhyve and play with it, get your hands dirty, > you are the

Re: DNS using Name Service Switch module and Casper

2021-01-10 Thread Vasily Postnicov
This is as minimal as I can get. If I knew where to find, what to fix, I would never waste my time seeking for help on mailing lists. Just put FreeBSD in that damn bhyve and play with it, get your hands dirty, you are the developer after all, not me! Your knowledge of FreeBSD is supposedly much gr

Re: DNS using Name Service Switch module and Casper

2021-01-09 Thread Konstantin Belousov
On Sat, Jan 09, 2021 at 08:25:46PM +0300, Vasily Postnicov wrote: > Brilliant! It took me almost a day to dive into ZeroMQ to reassure > myself that there is nothing wrong with it. When I tried to write > minimal test programs which call fork after pthread_create() in all > combinations. When I rea

Re: DNS using Name Service Switch module and Casper

2021-01-09 Thread Vasily Postnicov
Oh, I almost forgot. I am on f2b794e now сб, 9 янв. 2021 г. в 20:25, Vasily Postnicov : > > Brilliant! It took me almost a day to dive into ZeroMQ to reassure > myself that there is nothing wrong with it. When I tried to write > minimal test programs which call fork after pthread_create() in all >

Re: DNS using Name Service Switch module and Casper

2021-01-09 Thread Vasily Postnicov
Brilliant! It took me almost a day to dive into ZeroMQ to reassure myself that there is nothing wrong with it. When I tried to write minimal test programs which call fork after pthread_create() in all combinations. When I realized that NSS stub module is what I need. Instructions: 1) Compile NSS

Re: DNS using Name Service Switch module and Casper

2021-01-09 Thread Mark Johnston
On Sat, Jan 09, 2021 at 04:16:49PM +0300, Vasily Postnicov wrote: > Turns out, if you do not specify either -4 or -6 to ping, unsandboxed > getaddrinfo() will be called in /usr/src/sbin/ping/main.c, line 139. > (what's the point in sandboxing then, lol?) This somehow affects > sandboxing. Indeed,

Re: DNS using Name Service Switch module and Casper

2021-01-09 Thread Vasily Postnicov
Turns out, if you do not specify either -4 or -6 to ping, unsandboxed getaddrinfo() will be called in /usr/src/sbin/ping/main.c, line 139. (what's the point in sandboxing then, lol?) This somehow affects sandboxing. Look at the screenshot, it explains where fork() gets stuck. https://photos.app.go

Re: DNS using Name Service Switch module and Casper

2021-01-08 Thread Konstantin Belousov
On Fri, Jan 08, 2021 at 08:17:25PM +0300, Vasily Postnicov wrote: > I have noticed that after I kill stuck ping, the process spawned with > cap_init() remains. I cannot even kill it with SIGKILL. This is the > output of procstat on such a process. > > > vasily 969 0.0 0.1 26428 6532 v0

Re: DNS using Name Service Switch module and Casper

2021-01-08 Thread Vasily Postnicov
Nevermind my last question. ZeroMQ is written on C++. Here is shown how you can execute everything with almost empty main. https://stackoverflow.com/questions/38717534/how-do-i-start-a-c-thread-at-program-startup For C the only way is to use __attribute__((constructor)) AFAIK пт, 8 янв. 2021 г.,

Re: DNS using Name Service Switch module and Casper

2021-01-08 Thread Vasily Postnicov
I have noticed that after I kill stuck ping, the process spawned with cap_init() remains. I cannot even kill it with SIGKILL. This is the output of procstat on such a process. vasily 969 0.0 0.1 26428 6532 v0 I22:430:00.00 ping vonbraun.local vasily 983 0.0 0.1 26428 65

Re: DNS using Name Service Switch module and Casper

2021-01-08 Thread Mark Johnston
On Wed, Jan 06, 2021 at 07:08:14PM +0300, Vasily Postnicov wrote: > That's what I found. > > At first, ping calls cap_init() in capdns_setup(). cap_init() forks a > process, then the parent returns and the child calls casper_main_loop(). > The child and the parent both have a socket to communicate

Re: DNS using Name Service Switch module and Casper

2021-01-06 Thread Vasily Postnicov
That's what I found. At first, ping calls cap_init() in capdns_setup(). cap_init() forks a process, then the parent returns and the child calls casper_main_loop(). The child and the parent both have a socket to communicate. casper_main_loop() calls zygote_init() and that one blocks on fork(). I do

Re: DNS using Name Service Switch module and Casper

2021-01-05 Thread Mark Johnston
On Tue, Jan 05, 2021 at 10:02:37AM +0300, Vasily Postnicov wrote: > Hello. I wrote a simple daemon called ZeroDNS which provides functionality > similar to multicast DNS, namely it discovers other participating machines > over the LAN and stores their hostname and IPv4 address pairs. > > Here is a