shadow-maint / shadow

Upstream shadow tree
Other
292 stars 228 forks source link

4.14.4 stable release #920

Closed alejandro-colomar closed 7 months ago

alejandro-colomar commented 7 months ago

I'll collect here a list of the changes I propose for 4.14.4. If you think any other change deserves to be backported, or that some of these shouldn't, please comment.

The tentative release date is 2024-02-12.

alejandro-colomar commented 7 months ago

Another build bugfix to be added to 4.14.x (and thus, before the 4.15 cut):

Cc: @hallyn , @ikerexxe

alejandro-colomar commented 7 months ago

This is ready. Unless anyone needs this soon, I'll wait until the 12th, to allow other reports to get into this release. If you want to test the 4.14.x branch before a release point, to find out any other issues, that would help. Thanks!

CC: @thesamesam , @psaavedra , @dvzrv

alejandro-colomar commented 7 months ago

Cc: @hallyn , @stoeckmann

I've cherry-picked the first commit from

(a fix for an off-by-one bug).

To allow cherry-picking without conflict, I've also cherry-picked a commit from

which silenced a warning.

alejandro-colomar commented 7 months ago

BTW, I should have included this extra info in the cherry-picked commit message. Since I forgot, I'll do it here:

Fixes: 3b7cc053872c ("lib: replace USER_NAME_MAX_LENGTH macro") Cc: @ikerexxe

I may seem to bureaucratic, but I think there's a reason. If we had included a Fixes tag, we would have realized that the same exact bug is present in a couple other places in this project, introduced in the same commit:

$ git blame HEAD^^^ -- lib/chkname.c | grep sysconf
3b7cc0538 libmisc/chkname.c (Iker Pedrosa      2023-07-19 12:05:09 +0200  80)   if (strlen (name) > sysconf(_SC_LOGIN_NAME_MAX)) {
$ git show 3b7cc0538 | grep _SC_LOGIN_NAME_MAX
    Replace it by `sysconf(_SC_LOGIN_NAME_MAX)`, which is the maximum
+   if (strlen (name) > sysconf(_SC_LOGIN_NAME_MAX)) {
+       size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
+           size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
$ grep -rn -A10 _SC_LOGIN_NAME_MAX
lib/chkname.c:82:   maxlen = sysconf(_SC_LOGIN_NAME_MAX);
lib/chkname.c-83-   if (strlen(name) >= maxlen)
lib/chkname.c-84-       return false;
lib/chkname.c-85-
lib/chkname.c-86-   return is_valid_name (name);
lib/chkname.c-87-}
lib/chkname.c-88-
lib/chkname.c-89-bool is_valid_group_name (const char *name)
lib/chkname.c-90-{
lib/chkname.c-91-   /*
lib/chkname.c-92-    * Arbitrary limit for group names.
--
src/login.c:575:        size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
src/login.c-576-        assert (NULL == username);
src/login.c-577-        username = XMALLOC(max_size + 1, char);
src/login.c-578-        username[max_size] = '\0';
src/login.c-579-        if (do_rlogin (hostname, username, max_size, term, sizeof term)) {
src/login.c-580-            preauth_flag = true;
src/login.c-581-        } else {
src/login.c-582-            free (username);
src/login.c-583-            username = NULL;
src/login.c-584-        }
src/login.c-585-    }
--
src/login.c:888:            size_t max_size = sysconf(_SC_LOGIN_NAME_MAX);
src/login.c-889-            if (subroot) {
src/login.c-890-                closelog ();
src/login.c-891-                exit (1);
src/login.c-892-            }
src/login.c-893-            preauth_flag = false;
src/login.c-894-            username = XMALLOC(max_size + 1, char);
src/login.c-895-            username[max_size] = '\0';
src/login.c-896-            login_prompt (username, max_size);
src/login.c-897-
src/login.c-898-            if ('\0' == username[0]) {

This is a reminder to myself to not cherry-pick stuff without appending a Fixes tag. I'll fix this tomorrow.