--- seahorse-plugins-2.26.0.orig/libseahorse/seahorse-gpg-options.c
+++ seahorse-plugins-2.26.0/libseahorse/seahorse-gpg-options.c
@@ -30,6 +30,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <glib/gstdio.h>
 
 #include "seahorse-gpgmex.h"
 #include "seahorse-util.h"
@@ -45,22 +46,14 @@
 static gboolean
 create_file (const gchar *file, mode_t mode, GError **err)
 {
-    int fd;
-    g_assert (err && !*err);
-    
-    if ((fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, mode)) == -1) {
-        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
-                     strerror (errno), NULL);     
-        return FALSE;
+    gchar *contents;
+	const char *skel = "/usr/share/gnupg/options.skel";
+    if (g_file_get_contents(skel, &contents, NULL, err)) {
+        if (g_file_set_contents(file, contents, -1, err)) {
+			g_chmod(file, mode);
+        } 
     }
-
-    /* Write the header when we make a new file */
-    if (write (fd, GPG_CONF_HEADER, strlen (GPG_CONF_HEADER)) == -1) {
-        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
-                     strerror (errno), NULL);     
-    }
-    
-    close (fd);
+	g_free(contents);
     return *err ? FALSE : TRUE;
 }
 
