Project

General

Profile

Actions

Bug #14380

open

pam_modules: build errors with gcc 11

Added by Toomas Soome 10 days ago. Updated 10 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 11:

    ../unix_auth.c: In function 'error':
    ../unix_auth.c:63:16: error: '__pam_display_msg' accessing 16384 bytes in a region of size 512 [-Werror=stringop-overflow=]
       63 |         (void) __pam_display_msg(pamh, PAM_ERROR_MSG, 1, messages, NULL);
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../unix_auth.c:63:16: note: referencing argument 4 of type 'char (*)[512]'
    In file included from ../unix_auth.c:45:
    /code/illumos-gate/proto/root_i386/usr/include/security/pam_impl.h:148:1: note: in a call to function '__pam_display_msg'
      148 | __pam_display_msg(pam_handle_t *pamh, int msg_style, int num_msg,
          | ^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ../smb_passwd.c: In function 'info':
    ../smb_passwd.c:72:16: error: '__pam_display_msg' accessing 16384 bytes in a region of size 512 [-Werror=stringop-overflow=]
       72 |         (void) __pam_display_msg(pamh, PAM_TEXT_INFO, 1, &message,
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       73 |             NULL);
          |             ~~~~~
    ../smb_passwd.c:72:16: note: referencing argument 4 of type 'char (*)[512]'
    In file included from ../smb_passwd.c:36:
    /code/illumos-gate/proto/root_i386/usr/include/security/pam_impl.h:148:1: note: in a call to function '__pam_display_msg'
      148 | __pam_display_msg(pam_handle_t *pamh, int msg_style, int num_msg,
          | ^~~~~~~~~~~~~~~~~
    ../smb_passwd.c: In function 'error':
    ../smb_passwd.c:55:16: error: '__pam_display_msg' accessing 16384 bytes in a region of size 512 [-Werror=stringop-overflow=]
       55 |         (void) __pam_display_msg(pamh, PAM_ERROR_MSG, 1, &message,
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       56 |             NULL);
          |             ~~~~~
    ../smb_passwd.c:55:16: note: referencing argument 4 of type 'char (*)[512]'
    In file included from ../smb_passwd.c:36:
    /code/illumos-gate/proto/root_i386/usr/include/security/pam_impl.h:148:1: note: in a call to function '__pam_display_msg'
      148 | __pam_display_msg(pam_handle_t *pamh, int msg_style, int num_msg,
          | ^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ../krb5_authenticate.c: In function 'pam_krb5_prompter':
    ../krb5_authenticate.c:462:40: error: '__pam_display_msg' accessing 16384 bytes in a region of size 512 [-Werror=stringop-overflow=]
      462 |                                 (void) __pam_display_msg(pamh, PAM_ERROR_MSG,
          |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      463 |                                     1, errmsg, NULL);
          |                                     ~~~~~~~~~~~~~~~~
    ../krb5_authenticate.c:462:40: note: referencing argument 4 of type 'char (*)[512]'
    In file included from ../krb5_authenticate.c:28:
    /code/illumos-gate/proto/root_i386/usr/include/security/pam_impl.h:148:1: note: in a call to function '__pam_display_msg'
      148 | __pam_display_msg(pam_handle_t *pamh, int msg_style, int num_msg,
          | ^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ../dhkeys.c: In function 'remove_key':
    ../dhkeys.c:433:32: error: '__pam_display_msg' accessing 16384 bytes in a region of size 1536 [-Werror=stringop-overflow=]
      433 |                         (void) __pam_display_msg(pamh, PAM_ERROR_MSG, 3,
          |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      434 |                             msg, NULL);
          |                             ~~~~~~~~~~
    ../dhkeys.c:433:32: note: referencing argument 4 of type 'char (*)[512]'
    In file included from ../dhkeys.c:54:
    /code/illumos-gate/proto/root_i386/usr/include/security/pam_impl.h:148:1: note: in a call to function '__pam_display_msg'
      148 | __pam_display_msg(pam_handle_t *pamh, int msg_style, int num_msg,
          | ^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ../authtok_check.c: In function 'error':
    ../authtok_check.c:122:24: error: '__pam_display_msg' accessing 16384 bytes in a region of size 512 [-Werror=stringop-overflow=]
      122 |                 (void) __pam_display_msg(pamh, PAM_ERROR_MSG, 1, msg, NULL);
          |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../authtok_check.c:122:24: note: referencing argument 4 of type 'char (*)[512]'
    In file included from ../authtok_check.c:36:
    /code/illumos-gate/proto/root_i386/usr/include/security/pam_impl.h:148:1: note: in a call to function '__pam_display_msg'
      148 | __pam_display_msg(pam_handle_t *pamh, int msg_style, int num_msg,
          | ^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

The problem here is simple - __pam_display_msg() is defined to take argument of char (*)[512], but we are giving an array with 1 element instead.

Actions #1

Updated by Electric Monk 10 days ago

  • Gerrit CR set to 1925
Actions

Also available in: Atom PDF