From a4256940da049f91bbbea5e53e469a59ea9c10f7 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 25 Oct 2013 21:20:58 +0200 Subject: Imported Upstream version 0.9.8.8 --- src/settings/plugins/keyfile/writer.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/settings/plugins/keyfile/writer.c') diff --git a/src/settings/plugins/keyfile/writer.c b/src/settings/plugins/keyfile/writer.c index 0b8c1592..38061a5d 100644 --- a/src/settings/plugins/keyfile/writer.c +++ b/src/settings/plugins/keyfile/writer.c @@ -990,6 +990,7 @@ _internal_write_connection (NMConnection *connection, char *filename = NULL, *path; const char *id; WriteInfo info; + GError *local_err = NULL; if (out_path) g_return_val_if_fail (*out_path == NULL, FALSE); @@ -1054,7 +1055,16 @@ _internal_write_connection (NMConnection *connection, if (existing_path != NULL && strcmp (path, existing_path) != 0) unlink (existing_path); - g_file_set_contents (path, data, len, error); + g_file_set_contents (path, data, len, &local_err); + if (local_err) { + g_set_error (error, KEYFILE_PLUGIN_ERROR, 0, + "%s.%d: error writing to file '%s': %s", __FILE__, __LINE__, + path, local_err->message); + g_error_free (local_err); + g_free (path); + goto out; + } + if (chown (path, owner_uid, owner_grp) < 0) { g_set_error (error, KEYFILE_PLUGIN_ERROR, 0, "%s.%d: error chowning '%s': %d", __FILE__, __LINE__, -- cgit 1.3.0-6-gf8a5