Range checking on config file

2018-01-02 Thread Hal Murray via devel
Unless I missed something, the code processing gonfig slots can't distinguish -1 from 0x or the equivalent decimal number. They both come through as T_Integer. There is no T_Unsigned The checking code gets to pull it as either xx->val.i or xx->val.u struct attr_val_tag { attr_va

Re: Range checking on config file

2018-01-02 Thread Eric S. Raymond via devel
Hal Murray via devel : > > Unless I missed something, the code processing gonfig slots can't distinguish > -1 from 0x or the equivalent decimal number. > They both come through as T_Integer. There is no T_Unsigned > > The checking code gets to pull it as either xx->val.i or xx->val.u >

Re: Range checking on config file

2018-01-02 Thread Hal Murray via devel
>> Unless I missed something, the code processing gonfig slots can't distinguish >> -1 from 0x or the equivalent decimal number. ... > That is correct. Is this leading to a bug? I don't know of a case where it currently causes problems. We might be able to find one if we look hard eno

Re: Range checking on config file

2018-01-02 Thread Eric S. Raymond via devel
Hal Murray : > I don't see any simple fix. I assume the clean fix is to add T_Unsigned. Yes, I think so. I'm divided in my mind about whether to fix this. It's not really right, but adding the extra complexity wouldn't necessarily buy us anything either. It's quite unlikely the problem case wil

Anybody use NFS and crypto keys?

2018-01-02 Thread Hal Murray via devel
I'm working on the documentation for ntpkeygen. It's got various comments involving NFS. I can't match what's written with what I know about NFS and ntpd. But I don't use NFS. This is tangled up with asciidoc's prefixdir If you had secrets, would you get them over NFS? Does anybody put anyth

Re: Range checking on config file

2018-01-02 Thread Hal Murray via devel
> I'm divided in my mind about whether to fix this. It's not really right, ... Do we have a good place to document it? It's possible that the Bison parser does range checks and doesn't allow the nasty case. -- These are my opinions. I hate spam. __

Re: Range checking on config file

2018-01-02 Thread Eric S. Raymond via devel
Hal Murray : > > I'm divided in my mind about whether to fix this. It's not really right, > > ... > > Do we have a good place to document it? The internals tour, maybe. > It's possible that the Bison parser does range checks and doesn't allow the > nasty case. It doesn't. I know that code q

Re: More install troubles

2018-01-02 Thread Gary E. Miller via devel
Yo Hal! On Mon, 01 Jan 2018 23:04:59 -0800 Hal Murray via devel wrote: > From docs/asciidoc.conf: > > # This is to help distribution packagers > # Change this to match install paths, and then build documentation > prefixdir=/usr/local Why is this not automatic from 'waf config' ? RGDS GARY --

Re: More install troubles

2018-01-02 Thread Hal Murray via devel
> Why is this not automatic from 'waf config' ? Probably because nobody ever wrote the code. But I think it's buggy anyway. The only place it's used is for /etc/ which probably doesn't want a prefix. No replies to my NFS query yet. I'll probably procrastinate a bit. If I don't get any enlig

Re: More install troubles

2018-01-02 Thread Richard Laager via devel
On 01/02/2018 03:31 PM, Hal Murray via devel wrote: >> Why is this not automatic from 'waf config' ? > > Probably because nobody ever wrote the code. I assumed the question was rhetorical and was to be interpreted as the statement: That should come from 'waf config'. > But I think it's buggy any

File protection mystery

2018-01-02 Thread Hal Murray via devel
I've been experimenting with running ntpd as setuid ntp. I can't figure out how it is reading my keys file. -r. 1 root root 1072 Oct 5 2015 /etc/ntp/ntpkey_MD5key_deb2.example. com.3653024474 lrwxrwxrwx. 1 root root 41 Dec 3 2016 /etc/ntp/ntp.keys -> ntpkey_MD5key_deb2.example.co

Re: More install troubles

2018-01-02 Thread Hal Murray via devel
> When you want "/etc", use SYSCONFDIR. That defaults to PREFIX/etc, but would > be changed to just /etc for a distro package. See: ./waf configure --help Thanks, but... Does anybody actually run with a config file in /usr/local/etc/? If that is interesting, we have more troubles than just the

Re: More install troubles

2018-01-02 Thread Richard Laager via devel
On 01/02/2018 04:12 PM, Hal Murray wrote: > Does anybody actually run with a config file in /usr/local/etc/? I don't know. I don't. I tend to build distro packages out of my stuff, using /usr and /etc. Barring that, I'm either installing to /usr/local temporarily and don't care that much, or I'm i

Re: File protection mystery

2018-01-02 Thread Eric S. Raymond via devel
Hal Murray via devel : > Can anybody explain how this is "working"? If you read the droproot code, I think you will quickly achieve enlightenment. -- http://www.catb.org/~esr/";>Eric S. Raymond My work is funded by the Internet Civil Engineering Institute: https://icei.org Please

Re: File protection mystery

2018-01-02 Thread Richard Laager via devel
On 01/02/2018 04:36 PM, Eric S. Raymond via devel wrote: > Hal Murray via devel : >> Can anybody explain how this is "working"? > > If you read the droproot code, I think you will quickly achieve enlightenment. Can you elaborate? In this case, from my understanding, Hal isn't starting it as root,

Re: File protection mystery

2018-01-02 Thread Hal Murray via devel
Found it. (It was right in front of my eyes.) setcap isn't doing what I expect. My install script says: setcap cap_ipc_lock,cap_sys_nice,cap_sys_time,cap_net_bind_service=pe \ /usr/local/sbin/ntpd Note the =pe on the end. But getcap says: /usr/local/sbin/ntpd = cap_net_bind_

Re: File protection mystery

2018-01-02 Thread Eric S. Raymond via devel
Hal Murray via devel : > > Found it. (It was right in front of my eyes.) > > setcap isn't doing what I expect. > > My install script says: > setcap cap_ipc_lock,cap_sys_nice,cap_sys_time,cap_net_bind_service=pe \ > /usr/local/sbin/ntpd > > Note the =pe on the end. > > But ge

Re: File protection mystery

2018-01-02 Thread Hal Murray via devel
>> Anybody understand setcap? > Alas, I've never used it. I think I've figured out what is going on. The capabilities on a file are OR-ed in to what you start with. Thus if you run it as non-root, you get the specified capabilities. If you run it as root, you start with root's capabilities.