aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command-ssh.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-08-26 08:47:42 +0000
committerWerner Koch <[email protected]>2010-08-26 08:47:42 +0000
commita400cfe14eebd960d12829f642c183d0ca424f26 (patch)
treeeec981956a3ab9f5c73deae52308893861f295f1 /agent/command-ssh.c
parentChanged option names. (diff)
downloadgnupg-a400cfe14eebd960d12829f642c183d0ca424f26.tar.gz
gnupg-a400cfe14eebd960d12829f642c183d0ca424f26.zip
.
Diffstat (limited to '')
-rw-r--r--agent/command-ssh.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index f5e4eaa98..128cf5548 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -678,18 +678,16 @@ open_control_file (FILE **r_fp, int append)
fp = fopen (fname, append? "a+":"r");
if (!fp && errno == ENOENT)
{
- /* Fixme: "x" is a GNU extension. We might want to use the es_
- functions here. */
- fp = fopen (fname, "wx");
- if (!fp)
+ estream_t stream = es_fopen (fname, "wx,mode=-rw-r");
+ if (!stream)
{
- err = gpg_error (gpg_err_code_from_errno (errno));
+ err = gpg_error_from_syserror ();
log_error (_("can't create `%s': %s\n"), fname, gpg_strerror (err));
xfree (fname);
return err;
}
- fputs (sshcontrolblurb, fp);
- fclose (fp);
+ es_fputs (sshcontrolblurb, stream);
+ es_fclose (stream);
fp = fopen (fname, append? "a+":"r");
}