aboutsummaryrefslogtreecommitdiffstats
path: root/src/ClientFile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClientFile.cxx')
-rw-r--r--src/ClientFile.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/ClientFile.cxx b/src/ClientFile.cxx
index 69bc465b4..a460310be 100644
--- a/src/ClientFile.cxx
+++ b/src/ClientFile.cxx
@@ -21,9 +21,10 @@
#include "ClientFile.hxx"
#include "Client.hxx"
#include "protocol/Ack.hxx"
-#include "io_error.h"
#include "fs/Path.hxx"
#include "fs/FileSystem.hxx"
+#include "util/Error.hxx"
+#include "util/Domain.hxx"
#include <sys/stat.h>
#include <sys/types.h>
@@ -32,14 +33,13 @@
bool
client_allow_file(const Client *client, const Path &path_fs,
- GError **error_r)
+ Error &error)
{
#ifdef WIN32
(void)client;
(void)path_fs;
- g_set_error(error_r, ack_quark(), ACK_ERROR_PERMISSION,
- "Access denied");
+ error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied");
return false;
#else
const int uid = client_get_uid(client);
@@ -50,21 +50,19 @@ client_allow_file(const Client *client, const Path &path_fs,
if (uid <= 0) {
/* unauthenticated client */
- g_set_error(error_r, ack_quark(), ACK_ERROR_PERMISSION,
- "Access denied");
+ error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied");
return false;
}
struct stat st;
if (!StatFile(path_fs, st)) {
- set_error_errno(error_r);
+ error.SetErrno();
return false;
}
if (st.st_uid != (uid_t)uid && (st.st_mode & 0444) != 0444) {
/* client is not owner */
- g_set_error(error_r, ack_quark(), ACK_ERROR_PERMISSION,
- "Access denied");
+ error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied");
return false;
}