mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
group ownership of /var/run/libvirt/
* qemud/qemud.c: applied patch from Anton Protopopov to change group ownership of /var/run/libvirt/ to unix_sock_gid. Daniel
This commit is contained in:
parent
225ba3f0af
commit
384c5cff37
@ -1,3 +1,8 @@
|
|||||||
|
Fri Apr 25 17:44:28 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* qemud/qemud.c: applied patch from Anton Protopopov to change
|
||||||
|
group ownership of /var/run/libvirt/ to unix_sock_gid.
|
||||||
|
|
||||||
Fri Apr 25 16:51:58 CEST 2008 Jim Meyering <meyering@redhat.com>
|
Fri Apr 25 16:51:58 CEST 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
avoid problems with sign-extended "char" operand to is* functions
|
avoid problems with sign-extended "char" operand to is* functions
|
||||||
|
@ -2156,6 +2156,18 @@ int main(int argc, char **argv) {
|
|||||||
if (remoteReadConfigFile (server, remote_config_file) < 0)
|
if (remoteReadConfigFile (server, remote_config_file) < 0)
|
||||||
goto error1;
|
goto error1;
|
||||||
|
|
||||||
|
/* Change the group ownership of /var/run/libvirt to unix_sock_gid */
|
||||||
|
if (getuid() != 0) {
|
||||||
|
qemudLog (QEMUD_WARN,
|
||||||
|
"%s", _("Cannot set group ownership when not running as root"));
|
||||||
|
} else {
|
||||||
|
const char *sockdirname = LOCAL_STATE_DIR "/run/libvirt";
|
||||||
|
|
||||||
|
if (chown(sockdirname, -1, unix_sock_gid) < 0)
|
||||||
|
qemudLog(QEMUD_ERR, "%s %s",
|
||||||
|
_("Failed to change group ownership of "), sockdirname);
|
||||||
|
}
|
||||||
|
|
||||||
if (godaemon) {
|
if (godaemon) {
|
||||||
openlog("libvirtd", 0, 0);
|
openlog("libvirtd", 0, 0);
|
||||||
if (qemudGoDaemon() < 0) {
|
if (qemudGoDaemon() < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user