342 |
tmp[i] = 0; buf++; |
tmp[i] = 0; buf++; |
343 |
*minor = atol (tmp); |
*minor = atol (tmp); |
344 |
i=0; |
i=0; |
345 |
while (buf && isdigit( *buf ) && i < 8) |
while (buf && isdigit (*buf) && i < 8) |
346 |
tmp[i++] = *buf++; |
tmp[i++] = *buf++; |
347 |
tmp[i] = 0; |
tmp[i] = 0; |
348 |
*patch = atol (tmp); |
*patch = atol (tmp); |
358 |
{ |
{ |
359 |
gpgme_ctx_t ctx; |
gpgme_ctx_t ctx; |
360 |
gpgme_engine_info_t inf; |
gpgme_engine_info_t inf; |
361 |
char * eng = NULL; |
char *eng = NULL; |
362 |
int major=0, minor=0, patch=0; |
int major=0, minor=0, patch=0; |
363 |
int rc; |
int rc = 1; |
364 |
|
|
365 |
gpgme_new (&ctx); |
gpgme_new (&ctx); |
366 |
inf = gpgme_ctx_get_engine_info (ctx); |
inf = gpgme_ctx_get_engine_info (ctx); |
368 |
gpgme_release (ctx); |
gpgme_release (ctx); |
369 |
return -1; |
return -1; |
370 |
} |
} |
371 |
|
|
372 |
/* We need to exec GPG again to find out if IDEA is available. */ |
/* We need to exec GPG again to find out if IDEA is available. */ |
373 |
if (gpg_get_version (&eng)) |
if (gpg_get_version (&eng)) |
374 |
return -1; |
return -1; |
375 |
if (strstr (eng, "IDEA")) |
if (strstr (eng, "IDEA")) |
376 |
idea_available = 1; |
idea_available = 1; |
377 |
free (eng); |
free (eng); |
378 |
rc = parse_version_nr( inf->version, &major, &minor, &patch ); |
rc = parse_version_nr (inf->version, &major, &minor, &patch); |
379 |
if( rc ) { |
if (rc) { |
380 |
gpgme_release (ctx); |
gpgme_release (ctx); |
381 |
return rc; |
return rc; |
382 |
} |
} |
383 |
/* FIXME: This check is wrong! */ |
|
384 |
if (major < *r_major || minor < *r_minor) |
if (major > *r_major) |
|
rc = 1; |
|
|
else { |
|
|
if (patch < *r_patch) |
|
|
rc = 1; |
|
385 |
rc = 0; |
rc = 0; |
386 |
} |
else if (major == *r_major && minor > *r_minor) |
387 |
|
rc = 0; |
388 |
|
else if (major == *r_major && minor == *r_minor && |
389 |
|
patch >= *r_patch) |
390 |
|
rc = 0; |
391 |
|
|
392 |
*r_major = major; |
*r_major = major; |
393 |
*r_minor = minor; |
*r_minor = minor; |
394 |
*r_patch = patch; |
*r_patch = patch; |
789 |
} |
} |
790 |
|
|
791 |
|
|
792 |
|
/* Check the file permissions of the public keyring. |
793 |
|
If @showmsg is 1 output a message in case of errors. |
794 |
|
Return value: 1 if read-only attribute |
795 |
|
2 if file is opened by another process exclusively. */ |
796 |
int |
int |
797 |
gpg_check_permissions (int showmsg) |
gpg_check_permissions (int showmsg) |
798 |
{ |
{ |
819 |
} |
} |
820 |
} |
} |
821 |
else if (ans == IDNO) { |
else if (ans == IDNO) { |
822 |
/* |
/* All commands with write access will be disabled. */ |
|
msg_box (NULL, _("All commands with write access to the keyring\n" |
|
|
"will be disabled."), _("GPG Information"), MB_INFO); |
|
|
*/ |
|
823 |
failed = 1; |
failed = 1; |
824 |
} |
} |
825 |
} |
} |
837 |
} |
} |
838 |
free_if_alloc (name); |
free_if_alloc (name); |
839 |
return failed; |
return failed; |
840 |
} /* gpg_check_permissions */ |
} |
841 |
|
|
842 |
|
|
843 |
/* Check the GPG home dir. If all methods failed, try to |
/* Check the GPG home dir. If all methods failed, try to |