qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/26] configure, meson: convert pam detection to meson


From: Richard Henderson
Subject: Re: [PATCH 05/26] configure, meson: convert pam detection to meson
Date: Wed, 9 Jun 2021 08:46:22 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 6/8/21 1:20 PM, Daniel P. Berrangé wrote:
On Tue, Jun 08, 2021 at 12:45:51PM -0700, Richard Henderson wrote:
On 6/8/21 4:22 AM, Paolo Bonzini wrote:
+pam = not_found
+if not get_option('auth_pam').auto() or have_system
+  pam = cc.find_library('pam', has_headers: ['security/pam_appl.h'],

The condition doesn't look right.
Why are we looking for pam if --disable-pam-auth?

Surely

   if not get_option('auth_pam').disabled() and have_system

This isn't entirely obvious at first glance, but the line after
the one you quote with the 'required' param makes it "do the
right thing (tm)".

The 'auth_pam' option is a tri-state taking 'enabled', 'disabled'
and 'auto', with 'auto' being the default state. When a tri-state
value is passed as the value of the 'required' parameter, then

    required==enabled   is interpreted as 'required=true'
    required==auto      is interpreted as 'required=false'
    required==disabled  means the entire call is a no-op

So this logic:

  if not get_option('auth_pam').auto() or have_system
     pam = cc.find_library('pam', has_headers: ['security/pam_appl.h'],
                           required: get_option('auth_pam'),
                          ...)

Means

   => If 'auto' is set, then only look for the library if we're
      building system emulators. In this case 'required:' will
      evaluate to 'false', and so we'll gracefully degrade
      if the library is missing.

If not have_system, there's no point in looking for pam *at all* regardless of get_option().

   => If 'disabled' is set, then the 'find_library' call
      will not look for anything, immediately return a
      'not found' result and let the caller carry on.

This is not true. If 'required: false', find_library *will* look for the library, but it will allow it to be missing.

From the meson docs:

    meson.get_compiler('c').find_library('m', required: false),
...
The `required: false` means the build will continue when using another C library
that does not separate the maths library. See [Add math library (-lm)
portably](howtox.md#add-math-library-lm-portably).
So if auto, and not system, we will look for (and maybe find) pam. But then... I guess through a complex sequence of events arrives at

  softmmu_ss.add(authz, blockdev, chardev, crypto, io, qmp)

So pam doesn't get included into the user-only binaries anyway, but, geez.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]