Re: change closelog(3) description

2017-08-30 Thread Todd C. Miller
On Wed, 30 Aug 2017 12:49:43 -0600, "Theo de Raadt" wrote:

> > > How about "discard resources", or something more nebulous.  Especially
> > > if it frightens signal handler authors.
> > 
> > I understand what you are getting at but that seems so vague as to
> > be unhelpful.
> 
> Precisely how is it vague?

It gives no indication of what resources might be allocated.

> The manual is telling people to follow an open/close idiom, only in
> certain circumstances.
> 
> But in our cases, it doesn't close any fd.  Or discard any resources.
> It kind of does nothing.

Sure, but we are the outlier here.  On other systems there will be
at least one file descriptor.

> What we want to do is leave enough text that people will follow the
> model.  And warn them.  But not be more precise than that.

I understand what you mean, I'm just not convinced such nebulous
language is helpful.

 - todd



Re: change closelog(3) description

2017-08-30 Thread Theo de Raadt
> > How about "discard resources", or something more nebulous.  Especially
> > if it frightens signal handler authors.
> 
> I understand what you are getting at but that seems so vague as to
> be unhelpful.

Precisely how is it vague?

The manual is telling people to follow an open/close idiom, only in
certain circumstances.

But in our cases, it doesn't close any fd.  Or discard any resources.
It kind of does nothing.

What we want to do is leave enough text that people will follow the
model.  And warn them.  But not be more precise than that.



Re: change closelog(3) description

2017-08-30 Thread Todd C. Miller
On Wed, 30 Aug 2017 12:24:38 -0600, "Theo de Raadt" wrote:

> How about "discard resources", or something more nebulous.  Especially
> if it frightens signal handler authors.

I understand what you are getting at but that seems so vague as to
be unhelpful.

 - todd



Re: change closelog(3) description

2017-08-30 Thread Theo de Raadt
> > On Wed, Aug 30, 2017 at 10:35:16AM -0600, Todd C. Miller wrote:
> > > We don't actually have any log file descriptors since we have
> > > sendsyslog(2) so make the description a bit more generic.
> > > It is also closer to what POSIX says.
> > > 
> > > OK?
> > 
> > The term "log file" could be misunderstood as refering to a log file.
> > 
> > Is "... will close any open file descriptor for logging." better?
> 
> Possibly.  I don't like using "log file" either.  POSIX says any
> file descriptors opened by openlog() or syslog().  So perhaps:
> 
> The
> .Fn closelog
> function will close any file descriptors opened by the
> .Fn openlog ,
> .Fn openlog_r ,
> .Fn syslog
> or
> .Fn syslog_r
> functions.

How about "discard resources", or something more nebulous.  Especially
if it frightens signal handler authors.



Re: change closelog(3) description

2017-08-30 Thread Alexander Bluhm
On Wed, Aug 30, 2017 at 12:09:13PM -0600, Todd C. Miller wrote:
> The
> .Fn closelog
> function will close any file descriptors opened by the
> .Fn openlog ,
> .Fn openlog_r ,
> .Fn syslog
> or
> .Fn syslog_r
> functions.
> 
> What do you think?

OK bluhm@



Re: change closelog(3) description

2017-08-30 Thread Jason McIntyre
On Wed, Aug 30, 2017 at 12:09:13PM -0600, Todd C. Miller wrote:
> On Wed, 30 Aug 2017 20:04:57 +0200, Alexander Bluhm wrote:
> 
> > On Wed, Aug 30, 2017 at 10:35:16AM -0600, Todd C. Miller wrote:
> > > We don't actually have any log file descriptors since we have
> > > sendsyslog(2) so make the description a bit more generic.
> > > It is also closer to what POSIX says.
> > > 
> > > OK?
> > 
> > The term "log file" could be misunderstood as refering to a log file.
> > 
> > Is "... will close any open file descriptor for logging." better?
> 
> Possibly.  I don't like using "log file" either.  POSIX says any
> file descriptors opened by openlog() or syslog().  So perhaps:
> 
> The
> .Fn closelog
> function will close any file descriptors opened by the
> .Fn openlog ,
> .Fn openlog_r ,
> .Fn syslog
> or
> .Fn syslog_r
> functions.
> 
> What do you think?
> 
>  - todd
> 

i misread the original diff also. i think what you propose now is clearer.
jmc



Re: change closelog(3) description

2017-08-30 Thread Todd C. Miller
On Wed, 30 Aug 2017 20:04:57 +0200, Alexander Bluhm wrote:

> On Wed, Aug 30, 2017 at 10:35:16AM -0600, Todd C. Miller wrote:
> > We don't actually have any log file descriptors since we have
> > sendsyslog(2) so make the description a bit more generic.
> > It is also closer to what POSIX says.
> > 
> > OK?
> 
> The term "log file" could be misunderstood as refering to a log file.
> 
> Is "... will close any open file descriptor for logging." better?

Possibly.  I don't like using "log file" either.  POSIX says any
file descriptors opened by openlog() or syslog().  So perhaps:

The
.Fn closelog
function will close any file descriptors opened by the
.Fn openlog ,
.Fn openlog_r ,
.Fn syslog
or
.Fn syslog_r
functions.

What do you think?

 - todd



Re: change closelog(3) description

2017-08-30 Thread Alexander Bluhm
On Wed, Aug 30, 2017 at 10:35:16AM -0600, Todd C. Miller wrote:
> We don't actually have any log file descriptors since we have
> sendsyslog(2) so make the description a bit more generic.
> It is also closer to what POSIX says.
> 
> OK?

The term "log file" could be misunderstood as refering to a log file.

Is "... will close any open file descriptor for logging." better?

bluhm

> Index: lib/libc/gen/syslog.3
> ===
> RCS file: /cvs/src/lib/libc/gen/syslog.3,v
> retrieving revision 1.34
> diff -u -p -u -r1.34 syslog.3
> --- lib/libc/gen/syslog.3 29 Aug 2017 18:23:01 -  1.34
> +++ lib/libc/gen/syslog.3 30 Aug 2017 16:26:50 -
> @@ -273,7 +273,7 @@ reentrant functions.
>  .Pp
>  The
>  .Fn closelog
> -function can be used to close the log file.
> +function will close any open log file descriptors.
>  .Fn closelog_r
>  does the same thing but in a reentrant way and takes an additional
>  pointer to a