1. 28 11月, 2019 1 次提交
    • M
      nss: Don't fail on empty files · d7dd4e1f
      Michal Privoznik 提交于
      Before we rewrote nss plugin so that it doesn't use libvirt's
      internal functions it used virLeaseReadCustomLeaseFile() to parse
      .status files. After the rewrite it's using read() + yajl_parse()
      + yajl_complete_parse(). There's one catch though,
      virLeaseReadCustomLeaseFile() skipped over empty files.
      
      An empty .status file is created when a network is started. This
      is because we configure dnsmasq to use our leasehelper. So the
      first thing it does it calls it as follows:
      
        DNSMASQ_INTERFACE=virbr0 /usr/libexec/libvirt_leaseshelper init
      
      which causes the leasehelper to create empty virbr0.status file.
      If there is only one libvirt network then that is no problem -
      there are no other .status files to parse anyway. But if there
      are two or more networks then the first empty .status file causes
      whole parsing process and subsequently the whole name lookup
      process to fail.
      
      Fixes: v5.7.0-rc1~343
      Reported-by: NPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d7dd4e1f
  2. 30 9月, 2019 1 次提交
    • M
      nss: Compare addresses iff their family matches · b62ef642
      Michal Privoznik 提交于
      When parsing leases file, appendAddr() is called to append parsed
      tuple (address, expiry time, family) into an array. Whilst doing
      so, the array is searched for possible duplicate. This is done by
      comparing each item of the array by passed @family: if @family is
      AF_INET then the item is viewed as IPv4 address. Similarly, if
      @family is AF_INET6 then the item is viewed as IPv6 address. This
      is not exactly right - the array can contain addresses of both
      families and thus the address family of each item of the array
      must be considered.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      b62ef642
  3. 09 8月, 2019 2 次提交
  4. 08 8月, 2019 1 次提交
    • D
      tools: avoid accidentally using files from gnulib · 8242ce4f
      Daniel P. Berrangé 提交于
      The AM_CPPFLAGS setting includes the gnulib headers, which
      means we can get some replacement functions defined. Since
      virt-login-shell and the NSS module intentionally don't link
      to gnulib, these replacement functions causes link failures.
      
      This was seen cross-compiling on Debian for example:
      
      virt-login-shell.o: In function `main':
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:81: undefined reference to `rpl_strerror'
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:66: undefined reference to `rpl_strerror'
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:75: undefined reference to `rpl_strerror'
      
      The only way to avoid these replacement gnulib headers is
      to drop the -Ignulib/lib flags. We do still want to use
      gnulib for configmake.h and intprops.h, but those can be
      included via their full path.
      
      We must also stop using internal.h, since that expects
      -Ignulib/lib to be on the include path in order to resolve
      the verify.h header.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      8242ce4f
  5. 07 8月, 2019 3 次提交