Description: Check return values of write()
Author: Ilya Barygin <barygin@gmail.com>
Bug-Ubuntu: https://launchpad.net/bugs/374498

--- gnome-gpg-0.6.0.orig/gnome-gpg.c
+++ gnome-gpg-0.6.0/gnome-gpg.c
@@ -173,8 +173,10 @@ handle_get_passphrase (const char *keyid
   }
   gnome_keyring_found_list_free(found_items);
     
-  write (passphrase_fd, passphrase, strlen (passphrase));
-  write (passphrase_fd, "\n", 1);
+  if (write (passphrase_fd, passphrase, strlen (passphrase)) != strlen (passphrase) ||
+      write (passphrase_fd, "\n", 1) != 1) {
+    error_dialog (_("Couldn't write passphrase to file"));
+  }
 
   if (keyring_available && save_password) {
     gchar *nice_name = g_strdup_printf (_("GNU Privacy Guard passphrase for key ID: %s"),
