Index | Thread | Search

From:
Evan Silberman <evan@jklol.net>
Subject:
Re: login.conf.5: document "infinity" value in size type
To:
Evan Silberman <evan@jklol.net>
Cc:
Sebastien Marie <semarie@kapouay.eu.org>, tech@openbsd.org, landry@openbsd.org
Date:
Fri, 24 Jan 2025 23:18:29 -0800

Download raw body.

Thread
Evan Silberman <evan@jklol.net> wrote:
> Sebastien Marie <semarie@kapouay.eu.org> wrote:
> > Hi,
> > 
> > landry@ reported recently that login.conf(5) man page missed to document
> > "infinity" value for fields like "datasize-cur".
> > 
> > After looking at code in lib/libc/gen/login_cap.c (specially
> > login_getcapsize() and strtolimit() functions), valid "infinity" values
> > are:
> > - infinity
> > - inf
> > 
> > The following diff adds a sentence to "size" argument type description,
> > to mention the both keywords.
> > 
> > I reused the wording in getrlimit(2).
> > 
> > 
> > diff --git a/share/man/man5/login.conf.5 b/share/man/man5/login.conf.5
> > index 3d6d92a14c..dbbfb2b5da 100644
> > --- a/share/man/man5/login.conf.5
> > +++ b/share/man/man5/login.conf.5
> > @@ -413,6 +413,10 @@
> >  .Li t
> >  to indicate that the value is in 512-byte blocks,
> >  kilobytes, megabytes, gigabytes, or terabytes, respectively.
> > +.Ql infinity
> > +or
> > +.Ql inf
> > +is considered as infinite value for a limit.
> >  .\"
> >  .It time
> >  A time in seconds.
> > 
> > 
> > Comments or OK ?
> 
> This reads awkwardly. I'd rewrite the whole thing as:
> 
> .It size
> A number which expresses a size limit, or
> .Ql infinity
> for no limit.
> By default, the size is specified in bytes.
> It may have a trailing
> .Li b ,
> .Li k ,
> .Li m ,
> .Li g
> or
> .Li t
> to indicate that the value is in 512-byte blocks,
> kilobytes, megabytes, gigabytes, or terabytes, respectively.

Glancing at my (I think unmodified) login.conf and then at login_cap.c
it seems that it's not only the "size" type that allows "infinity" as a
value. See the definitions of login_getcaptime() and login_getcapnum().
(Neither function allows "inf".) So the factoid about "infinity"
may need to either be repeated or stated once with reference to
the size, time, and number fields.