]> git.proxmox.com Git - qemu.git/blobdiff - qga/main.c
qga: save state directory in ga_install_service()
[qemu.git] / qga / main.c
index 1841759db270295c96262f215f92b408ac6f472c..c2ba5d91393e7ba525e4c88591b22e07c0ec9071 100644 (file)
@@ -478,7 +478,7 @@ static void become_daemon(const char *pidfile)
         }
     }
 
-    umask(0);
+    umask(S_IRWXG | S_IRWXO);
     sid = setsid();
     if (sid < 0) {
         goto fail;
@@ -1002,7 +1002,8 @@ int main(int argc, char **argv)
         case 's':
             service = optarg;
             if (strcmp(service, "install") == 0) {
-                return ga_install_service(path, log_filepath);
+                const char *fixed_state_dir;
+                return ga_install_service(path, log_filepath, state_dir);
             } else if (strcmp(service, "uninstall") == 0) {
                 return ga_uninstall_service();
             } else {