diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-05-24 13:29:42 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2012-05-28 10:55:06 +0100 |
commit | 517368a3772f4196121881b1c7ec37acd225fece (patch) | |
tree | b31931d2025c4a4d6bb26b3a9f70e69a759adcbb /daemon/libvirtd.c | |
parent | Fix typos in RPM dependencies (diff) | |
download | libvirt-517368a3772f4196121881b1c7ec37acd225fece.tar.gz libvirt-517368a3772f4196121881b1c7ec37acd225fece.tar.bz2 libvirt-517368a3772f4196121881b1c7ec37acd225fece.zip |
Remove uid param from directory lookup APIs
Remove the uid param from virGetUserConfigDirectory,
virGetUserCacheDirectory, virGetUserRuntimeDirectory,
and virGetUserDirectory
These functions were universally called with the
results of getuid() or geteuid(). To make it practical
to port to Win32, remove the uid parameter and hardcode
geteuid()
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'daemon/libvirtd.c')
-rw-r--r-- | daemon/libvirtd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 943fef483..c74cd4309 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -242,7 +242,7 @@ daemonPidFilePath(bool privileged, char *rundir = NULL; mode_t old_umask; - if (!(rundir = virGetUserRuntimeDirectory(geteuid()))) + if (!(rundir = virGetUserRuntimeDirectory())) goto error; old_umask = umask(077); @@ -290,7 +290,7 @@ daemonUnixSocketPaths(struct daemonConfig *config, char *rundir = NULL; mode_t old_umask; - if (!(rundir = virGetUserRuntimeDirectory(geteuid()))) + if (!(rundir = virGetUserRuntimeDirectory())) goto error; old_umask = umask(077); @@ -634,7 +634,7 @@ daemonSetupLogging(struct daemonConfig *config, LOCALSTATEDIR) == -1) goto no_memory; } else { - char *logdir = virGetUserCacheDirectory(geteuid()); + char *logdir = virGetUserCacheDirectory(); mode_t old_umask; if (!logdir) @@ -783,7 +783,7 @@ static int migrateProfile(void) int ret = -1; mode_t old_umask; - if (!(home = virGetUserDirectory(geteuid()))) + if (!(home = virGetUserDirectory())) goto cleanup; if (virAsprintf(&old_base, "%s/.libvirt", home) < 0) { @@ -791,7 +791,7 @@ static int migrateProfile(void) } /* if the new directory is there or the old one is not: do nothing */ - if (!(config_dir = virGetUserConfigDirectory(geteuid()))) + if (!(config_dir = virGetUserConfigDirectory())) goto cleanup; if (!virFileIsDir(old_base) || virFileExists(config_dir)) { @@ -1112,7 +1112,7 @@ int main(int argc, char **argv) { if (privileged) { run_dir = strdup(LOCALSTATEDIR "/run/libvirt"); } else { - run_dir = virGetUserRuntimeDirectory(geteuid()); + run_dir = virGetUserRuntimeDirectory(); if (!run_dir) { VIR_ERROR(_("Can't determine user directory")); |