Page MenuHomeFreeBSD

login.conf: Remove never used ignoretime/ignoretime@
ClosedPublic

Authored by michaelo on Thu, Oct 9, 11:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 9, 3:51 PM
Unknown Object (File)
Thu, Oct 9, 3:37 PM
Unknown Object (File)
Thu, Oct 9, 3:35 PM
Unknown Object (File)
Thu, Oct 9, 3:14 PM
Unknown Object (File)
Thu, Oct 9, 3:09 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Anyone willing to review? This is a simple cleanup.

I can't find any references to these in sources, indeed.

Smeone from src should approve as well. Other than that, LGTM.

This revision is now accepted and ready to land.Sun, Oct 12, 11:16 AM

I can't find any references to these in sources, indeed.

Smeone from src should approve as well. Other than that, LGTM.

Added src group.

This options plays together with times.allow and times.deny, that are still documented in the login.conf. I think deeper digging is required to see if this is indeed a cruft or actually a functional thing. If it is cruft, then documentation in login.conf on times.allow/times.deny is also cruft.

If it ever existed it existed in lib/libutil/login_ok.c and lib/libutil/login_times.c. Even the original import to FreeBSD does mention ignoretime.

If it ever existed it existed in lib/libutil/login_ok.c and lib/libutil/login_times.c. Even the original import to FreeBSD does mention ignoretime.

Both are still used, but ignoretime does not even appear in the initial import:

osipovmi@deblndw011x:~/var/Projekte/freebsd/src (pr-240378)
$ grep -F -r -e times.allow -e times.deny .
./lib/libutil/login.conf.5:.It "times.allow     list            List of time periods during which"
./lib/libutil/login.conf.5:.It "times.deny      list            List of time periods during which logins are"
./lib/libutil/login.conf.5:.Em times.allow
./lib/libutil/login.conf.5:.Em times.deny
./lib/libutil/login.conf.5:.Em times.allow
./lib/libutil/login.conf.5:.Em times.deny
./lib/libutil/login.conf.5:.Em times.allow
./lib/libutil/login_ok.3:.Em times.allow
./lib/libutil/login_ok.3:.Em times.deny
./lib/libutil/login_ok.3:.Em times.allow
./lib/libutil/login_ok.3:.Em times.deny
./lib/libutil/login_ok.3:.Em times.allow
./lib/libutil/login_ok.3:.Em times.deny
./lib/libutil/login_ok.c:         lt = login_timelist(lc, "times.allow", &ltimesno, &ltimes);
./lib/libutil/login_ok.c:             lt = login_timelist(lc, "times.deny", &ltimesno, &ltimes);
./lib/libutil/login_times.3:.Ar times.allow
./lib/libutil/login_times.3:.Ar times.deny

Import commit: 68bbf3adb0b5def46b5174261657b038543972e3

So we have two options:

  • Remove ignoretime
  • Implement ignoretime

Simple patch (untested):

@@ -218,6 +218,11 @@
 auth_timeok(login_cap_t *lc, time_t t)
 {
     int     rc = 1; /* Default is ok */
+
+    /* Bypass time restrictions if ignoretime is set */
+    if (lc != NULL && login_getcapbool(lc, "ignoretime", 0)) {
+        return rc;
+    }

     if (lc != NULL && t != (time_t)0 && t != (time_t)-1) {
         struct tm   *tptr;

Bugzilla does not contain any issues that ignoretime does not work. Weird, not never obviously used.

michaelo retitled this revision from login.conf: Remove long obsolete ignoretime/ignoretime@ to login.conf: Remove never used ignoretime/ignoretime@.Mon, Oct 13, 9:48 AM

LGTM.

Thanks for bringing the patch in Michael.

I was also very surprised when I come across it, both that it didn't seem to be mentioned anywhere in the source tree and that no one had noticed before me.