[libvirt] [PATCH 2/3] BSD: Ensure process creation timestamp is init'd

Daniel P. Berrange berrange at redhat.com
Fri Sep 27 16:17:08 UTC 2013


On Tue, Sep 24, 2013 at 11:44:55AM -0500, Doug Goldstein wrote:
> While BSDs don't support process creation timestamp information via
> PEERCRED for Unix sockets, we need to actually initialize the value
> because it is used by the libvirt code.
> ---
>  src/rpc/virnetsocket.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
> index 49c6ddc..152c5fc 100644
> --- a/src/rpc/virnetsocket.c
> +++ b/src/rpc/virnetsocket.c
> @@ -1153,7 +1153,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
>                                  uid_t *uid,
>                                  gid_t *gid,
>                                  pid_t *pid,
> -                                unsigned long long *timestamp ATTRIBUTE_UNUSED)
> +                                unsigned long long *timestamp)
>  {
>      struct xucred cr;
>      socklen_t cr_len = sizeof(cr);
> @@ -1178,7 +1178,9 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
>          return -1;
>      }
>  
> +    /* PID and process creation time are not supported on BSDs */
>      *pid = -1;
> +    *timestamp = -1;
>      *uid = cr.cr_uid;
>      *gid = cr.cr_gid;

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list