Re: seccomp system call

2015-05-05 Thread Nicolas Bedos
On Mon May 04, Damien Miller wrote: > Personally, I think seccomp-bpf could be a superior alternative to > systrace and I'd love to see an implementation. Other developers (inc. > Theo) are skeptical though, but this is probably a case where the > argument won't be settled without a concrete implem

seccomp system call

2015-05-03 Thread Nicolas Bedos
I am wondering if the seccomp system call [1] would be welcomed in the OpenBSD tree. I remember it was among the subjects of last year's Google Summer of Code. If there is still interest in having it implemented, I am willing to work on it: I have a diff that creates the system call and allows secc

syslogd: log socket path truncation

2014-12-02 Thread Nicolas Bedos
hen tries to change the mode of "$testdir/log" which fails since the file does not exist. The diff below checks for truncation as suggested in strlcpy(3). Nicolas Bedos Index: src/usr.sbin/syslogd/syslogd.c === RCS fil

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-26 Thread Nicolas Bedos
Last update, with Tobias's help. The following diff - changes MAXPATHLEN from sys/param.h to PATH_MAX from limits.h - adds a missing prototype for sane_count - locate.bigram and locate.code now abort when reading a pathname exceeding PATH_MAX bytes on stdin Index: src/usr.bin/locate//bigram

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-25 Thread Nicolas Bedos
Again, thank you for your suggestions. I didn't thought about factoring out the len/sizeof comparisons. I have also added the free() call, and an errx() call when a pathname is too long. Nicolas Bedos Index: src/usr.bin/locate//bigram/locate.bigram.c =

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-24 Thread Nicolas Bedos
iff. It does indeed look less 'fragile' ! In locate.code.c 'mbuf' is never free()d: it is only allocated for the last line of input and after processing this line the program ends. I hope it is ok. Nicolas Bedos Index: src

locate(1): ignore paths longer than MAXPATHLEN

2014-11-23 Thread Nicolas Bedos
ardcoding PATH_MAX? I ran /etc/weekly with the new binaries and didn't notice any unexpected changes in the locate database. Nicolas Bedos Index: src/usr.bin/locate//bigram/locate.bigram.c === RCS file: /cvs/src/usr.bin/loca

systrace: modify calloc() size argument

2014-11-16 Thread Nicolas Bedos
sizeof(*reverse). For the sake of consistency I also modified the malloc call on line 145. Regress tests run fine. Nicolas Bedos Index: src/bin/systrace/alias.c === RCS file: /cvs/src/bin/systrace/alias.c,v retrieving revision 1.6 di

Re: locate - change sizeof(char **) to sizeof(char *)

2014-11-15 Thread Nicolas Bedos
Ted Unangst wrote: > I think using sizeof(*dbv) would be the better idiom. Here's an updated diff, including Tobias Stoeckmann's fix. Index: src/usr.bin/locate/locate/util.c === RCS file: /cvs/src/usr.bin/locate/locate/util.c,v retr

locate - change sizeof(char **) to sizeof(char *)

2014-11-15 Thread Nicolas Bedos
sponding diff below. No binary change on amd64 since sizeof(char **) == sizeof(char *). Nicolas Bedos Index: usr.bin/locate/locate/util.c === RCS file: /cvs/src/usr.bin/locate/locate/util.c,v retrieving revision 1.11 diff -u -p -u -r

[diff] wc - type consistency

2014-10-09 Thread Nicolas Bedos
The following diff improves type consistency in wc: the return type of read() is ssize_t, so the type of 'len' should be ssize_t too. There is no reason for it to be an int. Nicolas Bedos Index: src/usr.bin/wc/wc.c ==