aboutsummaryrefslogtreecommitdiffstats
path: root/g10/card-util.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/card-util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/g10/card-util.c b/g10/card-util.c
index 8f638c930..1d2e47ea2 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -577,17 +577,24 @@ change_login (const char *args)
for (args++; spacep (args); args++)
;
fp = fopen (args, "rb");
+ if (fp && is_secured_file (fileno (fp)))
+ {
+ fclose (fp);
+ fp = NULL;
+ errno = EPERM;
+ }
if (!fp)
{
- tty_printf ("can't open `%s': %s\n", args, strerror (errno));
+ tty_printf (_("can't open `%s': %s\n"), args, strerror (errno));
return -1;
}
+
data = xmalloc (254);
n = fread (data, 1, 254, fp);
fclose (fp);
if (n < 0)
{
- tty_printf ("error reading `%s': %s\n", args, strerror (errno));
+ tty_printf (_("error reading `%s': %s\n"), args, strerror (errno));
xfree (data);
return -1;
}