diff options
Diffstat (limited to 'camel/camel-tcp-stream-openssl.c')
-rw-r--r-- | camel/camel-tcp-stream-openssl.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/camel/camel-tcp-stream-openssl.c b/camel/camel-tcp-stream-openssl.c index f83b309de7..6dedeadab7 100644 --- a/camel/camel-tcp-stream-openssl.c +++ b/camel/camel-tcp-stream-openssl.c @@ -499,16 +499,19 @@ static gboolean ssl_cert_is_saved (const char *certid) { char *filename; - int fd; + struct stat st; + int ret; filename = g_strdup_printf ("%s/.camel_certs/%s", getenv ("HOME"), certid); - fd = open (filename, O_RDONLY); + if (stat (filename, &st) == -1) { + g_free (filename); + return FALSE; + } + g_free (filename); - if (fd != -1) - close (fd); - return fd != -1; + return st.st_uid == getuid (); } static int |