remote: Fix memory leak on error path when deserializing bulk stats

The 'elem' variable along with the domain object would be leaked when
taking the error path.

Found by coverity.
spec: Fix preun script for daemon

%systemd_preun macro cannot be split into several lines.

https://bugzilla.redhat.com/show_bug.cgi?id=1136736

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
qemu: ensure sane umask for qemu process

Add umask to _virCommand, allow user to set umask to command.
Set umask(002) to qemu process to overwrite the default umask
of 022 set by many distros, so that unix sockets created for
virtio-serial has expected permissions.

Fix problem reported here:
https://sourceware.org/bugzilla/show_bug.cgi?id=13078#c11
https://bugzilla.novell.com/show_bug.cgi?id=888166

To use virtio-serial device, unix socket created for chardev with
default umask(022) has insufficient permissions.
e.g.:
-device virtio-serial \
-chardev socket,path=/tmp/foo,server,nowait,id=foo \
-device virtserialport,chardev=foo,name=org.fedoraproject.port.0

srwxr-xr-x 1 qemu qemu 0 21. Jul 14:19 /tmp/somefile.sock

Other users in the same group (like real user, test engines, etc)
cannot write to this socket.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
sanlock: Avoid freeing uninitialized value

https://bugzilla.redhat.com/show_bug.cgi?id=1136788
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
util: don't shadow global umask declaration

Commit 0e1a1a8c introduced umask for virCommand, but the variables
used emit a warning on older compilers about shadowed global
declaration.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
command: test umask support

Add testsuite coverage for the recent commit 0e1a1a8.

* tests/commandhelper.c (main): Output umask.
* tests/commandtest.c (test15): Also test umask.
(mymain): Add test.
* tests/commanddata/*.log: Update expected output.

Signed-off-by: Eric Blake <eblake@redhat.com>
util: add virJSONValueCopy

Faster version of virJSONValueFromString(virJSONValueToString()).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
admin2

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
subserver

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
asdf
server->subserver

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
adminProgram

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
fdsa

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
admiiin

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
getserver

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
hafo

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
priv->srv

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
i2j

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
fish

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
fish

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>