1. 12 7月, 2013 10 次提交
    • E
      util: add virGetGroupList · 75c12564
      Eric Blake 提交于
      Since neither getpwuid_r() nor initgroups() are safe to call in
      between fork and exec (they obtain a mutex, but if some other
      thread in the parent also held the mutex at the time of the fork,
      the child will deadlock), we have to split out the functionality
      that is unsafe.  At least glibc's initgroups() uses getgrouplist
      under the hood, so the ideal split is to expose getgrouplist for
      use before a fork.  Gnulib already gives us a nice wrapper via
      mgetgroups; we wrap it once more to look up by uid instead of name.
      
      * bootstrap.conf (gnulib_modules): Add mgetgroups.
      * src/util/virutil.h (virGetGroupList): New declaration.
      * src/util/virutil.c (virGetGroupList): New function.
      * src/libvirt_private.syms (virutil.h): Export it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      75c12564
    • E
      util: improve user lookup helper · c1983ba4
      Eric Blake 提交于
      A future patch needs to look up pw_gid; but it is wasteful
      to crawl through getpwuid_r twice for two separate pieces
      of information, and annoying to copy that much boilerplate
      code for doing the crawl.  The current internal-only
      virGetUserEnt is also a rather awkward interface; it's easier
      to just design it to let callers request multiple pieces of
      data as needed from one traversal.
      
      And while at it, I noticed that virGetXDGDirectory could deref
      NULL if the getpwuid_r lookup fails.
      
      * src/util/virutil.c (virGetUserEnt): Alter signature.
      (virGetUserDirectory, virGetXDGDirectory, virGetUserName): Adjust
      callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c1983ba4
    • J
      qemu_hostdev: Resolve Coverity issue · a5fcea55
      John Ferlan 提交于
      Recent changes uncovered a possibility that 'last_processed_hostdev_vf'
      was set to -1 in 'qemuPrepareHostdevPCIDevices' and would cause problems
      in for loop end condition in the 'resetvfnetconfig' label if the
      variable was never set to 'i' due to 'qemuDomainHostdevNetConfigReplace'
      failure.
      a5fcea55
    • J
      storage_backend: Resolve Coverity issue · ba3427a0
      John Ferlan 提交于
      The switch statement in 'virStorageBackendCreateQemuImgOpts' used the
      for loop end condition 'VIR_STORAGE_FILE_FEATURE_LAST' as a possible value,
      but since that cannot happen Coverity spits out a DEADCODE message. Adding
      the Coverity tag just removes the Coverity message
      ba3427a0
    • J
      virsh-nodedev: Resolve Coverity issues · f926804a
      John Ferlan 提交于
      Recent changes uncovered FORWARD_NULL and NEGATIVE_RETURNS problems with
      the processing of the 'ndevices' and its associated allocated arrays in
      'vshNodeDeviceListCollect' due to the possibility of returning -1 in a
      call and using the returned value as a for loop index end condition.
      f926804a
    • J
      virsh-interface: Resolve Coverity issues · 50210ab9
      John Ferlan 提交于
      Recent changes uncovered FORWARD_NULL and NEGATIVE_RETURNS problems with
      the processing of the 'nActiveIfaces' and 'nInactiveIfaces' and their
      associated allocated arrays in 'vshInterfaceListCollect' due to the
      possibility of returning -1 in a call and using the return value as a
      for loop index end condition.
      50210ab9
    • J
      virsh-domain-monitor: Resolve Coverity issues · 0cfd40ac
      John Ferlan 提交于
      Recent changes uncovered a pair of NEGATIVE_RETURNS when processing the
      'nnames' in 'vshDomainListCollect' in the for loop due to possible -1 value.
      0cfd40ac
    • J
      testutils: Resolve Coverity issues · 8283ef9e
      John Ferlan 提交于
      Recent changes uncovered a NEGATIVE_RETURNS in the return from sysconf()
      when processing a for loop in virtTestCaptureProgramExecChild() in
      testutils.c
      
      Code review uncovered 3 other code paths with the same condition that
      weren't found by Covirity, so fixed those as well.
      8283ef9e
    • J
      hellolibvirt: Resolve Coverity issues · 07768096
      John Ferlan 提交于
      Recent changes uncovered a NEGATIVE_RETURNS when processing 'numNames'
      in 'showDomains' in the for loop after a possible -1 return.
      07768096
    • E
      maint: update to latest gnulib · 7961ad21
      Eric Blake 提交于
      Future patches need LGPLv2+ versions of some modules that had
      recent license changes; but separating the gnulib update from
      the actual use of the modules makes it easier to backport to
      an older version while avoiding a submodule update (assuming,
      of course, that the backport is to a system where glibc provides
      adequate functionaliy without needing the gnulib module).
      
      * .gnulib: Update to latest, for modules needed in later patches.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7961ad21
  2. 11 7月, 2013 30 次提交