From: Evan Silberman Subject: Re: login.conf.5: document "infinity" value in size type To: Evan Silberman Cc: Sebastien Marie , tech@openbsd.org, landry@openbsd.org Date: Fri, 24 Jan 2025 23:18:29 -0800 Evan Silberman wrote: > Sebastien Marie 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.