mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
Change all quotes in strings and comments to the new GNU standard.
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
This commit is contained in:
parent
fc00d3fcb2
commit
096e7457ec
@ -218,7 +218,7 @@ housekeeping (void)
|
|||||||
if (r->pw && r->ttl >= 0 && r->accessed + r->ttl < current)
|
if (r->pw && r->ttl >= 0 && r->accessed + r->ttl < current)
|
||||||
{
|
{
|
||||||
if (DBG_CACHE)
|
if (DBG_CACHE)
|
||||||
log_debug (" expired `%s' (%ds after last access)\n",
|
log_debug (" expired '%s' (%ds after last access)\n",
|
||||||
r->key, r->ttl);
|
r->key, r->ttl);
|
||||||
release_data (r->pw);
|
release_data (r->pw);
|
||||||
r->pw = NULL;
|
r->pw = NULL;
|
||||||
@ -240,7 +240,7 @@ housekeeping (void)
|
|||||||
if (r->pw && r->created + maxttl < current)
|
if (r->pw && r->created + maxttl < current)
|
||||||
{
|
{
|
||||||
if (DBG_CACHE)
|
if (DBG_CACHE)
|
||||||
log_debug (" expired `%s' (%lus after creation)\n",
|
log_debug (" expired '%s' (%lus after creation)\n",
|
||||||
r->key, opt.max_cache_ttl);
|
r->key, opt.max_cache_ttl);
|
||||||
release_data (r->pw);
|
release_data (r->pw);
|
||||||
r->pw = NULL;
|
r->pw = NULL;
|
||||||
@ -256,7 +256,7 @@ housekeeping (void)
|
|||||||
{
|
{
|
||||||
ITEM r2 = r->next;
|
ITEM r2 = r->next;
|
||||||
if (DBG_CACHE)
|
if (DBG_CACHE)
|
||||||
log_debug (" removed `%s' (mode %d) (slot not used for 30m)\n",
|
log_debug (" removed '%s' (mode %d) (slot not used for 30m)\n",
|
||||||
r->key, r->cache_mode);
|
r->key, r->cache_mode);
|
||||||
xfree (r);
|
xfree (r);
|
||||||
if (!rprev)
|
if (!rprev)
|
||||||
@ -287,7 +287,7 @@ agent_flush_cache (void)
|
|||||||
if (r->pw)
|
if (r->pw)
|
||||||
{
|
{
|
||||||
if (DBG_CACHE)
|
if (DBG_CACHE)
|
||||||
log_debug (" flushing `%s'\n", r->key);
|
log_debug (" flushing '%s'\n", r->key);
|
||||||
release_data (r->pw);
|
release_data (r->pw);
|
||||||
r->pw = NULL;
|
r->pw = NULL;
|
||||||
r->accessed = 0;
|
r->accessed = 0;
|
||||||
@ -311,7 +311,7 @@ agent_put_cache (const char *key, cache_mode_t cache_mode,
|
|||||||
ITEM r;
|
ITEM r;
|
||||||
|
|
||||||
if (DBG_CACHE)
|
if (DBG_CACHE)
|
||||||
log_debug ("agent_put_cache `%s' (mode %d) requested ttl=%d\n",
|
log_debug ("agent_put_cache '%s' (mode %d) requested ttl=%d\n",
|
||||||
key, cache_mode, ttl);
|
key, cache_mode, ttl);
|
||||||
housekeeping ();
|
housekeeping ();
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ agent_get_cache (const char *key, cache_mode_t cache_mode)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (DBG_CACHE)
|
if (DBG_CACHE)
|
||||||
log_debug ("agent_get_cache `%s' (mode %d) ...\n", key, cache_mode);
|
log_debug ("agent_get_cache '%s' (mode %d) ...\n", key, cache_mode);
|
||||||
housekeeping ();
|
housekeeping ();
|
||||||
|
|
||||||
for (r=thecache; r; r = r->next)
|
for (r=thecache; r; r = r->next)
|
||||||
@ -431,7 +431,7 @@ agent_get_cache (const char *key, cache_mode_t cache_mode)
|
|||||||
{
|
{
|
||||||
xfree (value);
|
xfree (value);
|
||||||
value = NULL;
|
value = NULL;
|
||||||
log_error ("retrieving cache entry `%s' failed: %s\n",
|
log_error ("retrieving cache entry '%s' failed: %s\n",
|
||||||
key, gpg_strerror (err));
|
key, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
@ -315,7 +315,7 @@ start_pinentry (ctrl_t ctrl)
|
|||||||
ASSUAN_PIPE_CONNECT_DETACHED);
|
ASSUAN_PIPE_CONNECT_DETACHED);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
log_error ("can't connect to the PIN entry module `%s': %s\n",
|
log_error ("can't connect to the PIN entry module '%s': %s\n",
|
||||||
opt.pinentry_program, gpg_strerror (rc));
|
opt.pinentry_program, gpg_strerror (rc));
|
||||||
assuan_release (ctx);
|
assuan_release (ctx);
|
||||||
return unlock_pinentry (gpg_error (GPG_ERR_NO_PIN_ENTRY));
|
return unlock_pinentry (gpg_error (GPG_ERR_NO_PIN_ENTRY));
|
||||||
@ -622,7 +622,7 @@ inq_quality (void *opaque, const char *line)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error ("unsupported inquiry `%s' from pinentry\n", line);
|
log_error ("unsupported inquiry '%s' from pinentry\n", line);
|
||||||
rc = gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
|
rc = gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ agent_scd_dump_state (void)
|
|||||||
(long)assuan_get_pid (primary_scd_ctx),
|
(long)assuan_get_pid (primary_scd_ctx),
|
||||||
primary_scd_ctx_reusable);
|
primary_scd_ctx_reusable);
|
||||||
if (socket_name)
|
if (socket_name)
|
||||||
log_info ("agent_scd_dump_state: socket=`%s'\n", socket_name);
|
log_info ("agent_scd_dump_state: socket='%s'\n", socket_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ start_scd (ctrl_t ctrl)
|
|||||||
rc = assuan_socket_connect (ctx, socket_name, 0, 0);
|
rc = assuan_socket_connect (ctx, socket_name, 0, 0);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
log_error ("can't connect to socket `%s': %s\n",
|
log_error ("can't connect to socket '%s': %s\n",
|
||||||
socket_name, gpg_strerror (rc));
|
socket_name, gpg_strerror (rc));
|
||||||
err = gpg_error (GPG_ERR_NO_SCDAEMON);
|
err = gpg_error (GPG_ERR_NO_SCDAEMON);
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -366,7 +366,7 @@ start_scd (ctrl_t ctrl)
|
|||||||
memcpy (socket_name, databuf, datalen);
|
memcpy (socket_name, databuf, datalen);
|
||||||
socket_name[datalen] = 0;
|
socket_name[datalen] = 0;
|
||||||
if (DBG_ASSUAN)
|
if (DBG_ASSUAN)
|
||||||
log_debug ("additional connections at `%s'\n", socket_name);
|
log_debug ("additional connections at '%s'\n", socket_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xfree (databuf);
|
xfree (databuf);
|
||||||
@ -763,12 +763,12 @@ inq_needpin (void *opaque, const char *line)
|
|||||||
xfree (value);
|
xfree (value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_error ("error forwarding inquiry `%s': %s\n",
|
log_error ("error forwarding inquiry '%s': %s\n",
|
||||||
line, gpg_strerror (rc));
|
line, gpg_strerror (rc));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error ("unsupported inquiry `%s'\n", line);
|
log_error ("unsupported inquiry '%s'\n", line);
|
||||||
rc = gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
|
rc = gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ open_control_file (FILE **r_fp, int append)
|
|||||||
if (!stream)
|
if (!stream)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("can't create `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("can't create '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -696,7 +696,7 @@ open_control_file (FILE **r_fp, int append)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error (gpg_err_code_from_errno (errno));
|
err = gpg_error (gpg_err_code_from_errno (errno));
|
||||||
log_error (_("can't open `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("can't open '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -769,7 +769,7 @@ search_control_file (FILE *fp, const char *hexgrip,
|
|||||||
goto next_line;
|
goto next_line;
|
||||||
if (i != 40 || !(spacep (p) || *p == '\n'))
|
if (i != 40 || !(spacep (p) || *p == '\n'))
|
||||||
{
|
{
|
||||||
log_error ("invalid formatted line in `%s', line %d\n", fname, lnr);
|
log_error ("invalid formatted line in '%s', line %d\n", fname, lnr);
|
||||||
return gpg_error (GPG_ERR_BAD_DATA);
|
return gpg_error (GPG_ERR_BAD_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ search_control_file (FILE *fp, const char *hexgrip,
|
|||||||
p = pend;
|
p = pend;
|
||||||
if (!(spacep (p) || *p == '\n') || ttl < -1)
|
if (!(spacep (p) || *p == '\n') || ttl < -1)
|
||||||
{
|
{
|
||||||
log_error ("invalid TTL value in `%s', line %d; assuming 0\n",
|
log_error ("invalid TTL value in '%s', line %d; assuming 0\n",
|
||||||
fname, lnr);
|
fname, lnr);
|
||||||
ttl = 0;
|
ttl = 0;
|
||||||
}
|
}
|
||||||
@ -795,7 +795,7 @@ search_control_file (FILE *fp, const char *hexgrip,
|
|||||||
if (p[n] == '=')
|
if (p[n] == '=')
|
||||||
{
|
{
|
||||||
log_error ("assigning a value to a flag is not yet supported; "
|
log_error ("assigning a value to a flag is not yet supported; "
|
||||||
"in `%s', line %d; flag ignored\n", fname, lnr);
|
"in '%s', line %d; flag ignored\n", fname, lnr);
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
else if (n == 7 && !memcmp (p, "confirm", 7))
|
else if (n == 7 && !memcmp (p, "confirm", 7))
|
||||||
@ -804,7 +804,7 @@ search_control_file (FILE *fp, const char *hexgrip,
|
|||||||
*r_confirm = 1;
|
*r_confirm = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_error ("invalid flag `%.*s' in `%s', line %d; ignored\n",
|
log_error ("invalid flag '%.*s' in '%s', line %d; ignored\n",
|
||||||
n, p, fname, lnr);
|
n, p, fname, lnr);
|
||||||
p += n;
|
p += n;
|
||||||
}
|
}
|
||||||
|
@ -312,9 +312,9 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
|
|||||||
char *desc;
|
char *desc;
|
||||||
if ( asprintf (&desc,
|
if ( asprintf (&desc,
|
||||||
_("Please enter the PIN%s%s%s to unlock the card"),
|
_("Please enter the PIN%s%s%s to unlock the card"),
|
||||||
info? " (`":"",
|
info? " (":"",
|
||||||
info? info:"",
|
info? info:"",
|
||||||
info? "')":"") < 0)
|
info? ")":"") < 0)
|
||||||
desc = NULL;
|
desc = NULL;
|
||||||
rc = agent_askpin (ctrl, desc?desc:info, prompt, NULL, pi);
|
rc = agent_askpin (ctrl, desc?desc:info, prompt, NULL, pi);
|
||||||
xfree (desc);
|
xfree (desc);
|
||||||
|
@ -68,7 +68,7 @@ agent_write_private_key (const unsigned char *grip,
|
|||||||
|
|
||||||
if (!force && !access (fname, F_OK))
|
if (!force && !access (fname, F_OK))
|
||||||
{
|
{
|
||||||
log_error ("secret key file `%s' already exists\n", fname);
|
log_error ("secret key file '%s' already exists\n", fname);
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
return gpg_error (GPG_ERR_EEXIST);
|
return gpg_error (GPG_ERR_EEXIST);
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ agent_write_private_key (const unsigned char *grip,
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
gpg_error_t tmperr = gpg_error_from_syserror ();
|
gpg_error_t tmperr = gpg_error_from_syserror ();
|
||||||
log_error ("can't create `%s': %s\n", fname, gpg_strerror (tmperr));
|
log_error ("can't create '%s': %s\n", fname, gpg_strerror (tmperr));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
return tmperr;
|
return tmperr;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ agent_write_private_key (const unsigned char *grip,
|
|||||||
if (es_fwrite (buffer, length, 1, fp) != 1)
|
if (es_fwrite (buffer, length, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
gpg_error_t tmperr = gpg_error_from_syserror ();
|
gpg_error_t tmperr = gpg_error_from_syserror ();
|
||||||
log_error ("error writing `%s': %s\n", fname, gpg_strerror (tmperr));
|
log_error ("error writing '%s': %s\n", fname, gpg_strerror (tmperr));
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
gnupg_remove (fname);
|
gnupg_remove (fname);
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
@ -94,7 +94,7 @@ agent_write_private_key (const unsigned char *grip,
|
|||||||
if (es_fclose (fp))
|
if (es_fclose (fp))
|
||||||
{
|
{
|
||||||
gpg_error_t tmperr = gpg_error_from_syserror ();
|
gpg_error_t tmperr = gpg_error_from_syserror ();
|
||||||
log_error ("error closing `%s': %s\n", fname, gpg_strerror (tmperr));
|
log_error ("error closing '%s': %s\n", fname, gpg_strerror (tmperr));
|
||||||
gnupg_remove (fname);
|
gnupg_remove (fname);
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
return tmperr;
|
return tmperr;
|
||||||
@ -478,7 +478,7 @@ read_key_file (const unsigned char *grip, gcry_sexp_t *result)
|
|||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
if (gpg_err_code (rc) != GPG_ERR_ENOENT)
|
if (gpg_err_code (rc) != GPG_ERR_ENOENT)
|
||||||
log_error ("can't open `%s': %s\n", fname, strerror (errno));
|
log_error ("can't open '%s': %s\n", fname, strerror (errno));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -486,7 +486,7 @@ read_key_file (const unsigned char *grip, gcry_sexp_t *result)
|
|||||||
if (fstat (es_fileno (fp), &st))
|
if (fstat (es_fileno (fp), &st))
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error ("can't stat `%s': %s\n", fname, strerror (errno));
|
log_error ("can't stat '%s': %s\n", fname, strerror (errno));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
return rc;
|
return rc;
|
||||||
@ -497,7 +497,7 @@ read_key_file (const unsigned char *grip, gcry_sexp_t *result)
|
|||||||
if (!buf)
|
if (!buf)
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error ("error allocating %zu bytes for `%s': %s\n",
|
log_error ("error allocating %zu bytes for '%s': %s\n",
|
||||||
buflen, fname, strerror (errno));
|
buflen, fname, strerror (errno));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
@ -509,7 +509,7 @@ read_key_file (const unsigned char *grip, gcry_sexp_t *result)
|
|||||||
if (es_fread (buf, buflen, 1, fp) != 1)
|
if (es_fread (buf, buflen, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error ("error reading %zu bytes from `%s': %s\n",
|
log_error ("error reading %zu bytes from '%s': %s\n",
|
||||||
buflen, fname, strerror (errno));
|
buflen, fname, strerror (errno));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
|
@ -394,7 +394,7 @@ set_debug (void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("invalid debug-level `%s' given\n"), debug_level);
|
log_error (_("invalid debug-level '%s' given\n"), debug_level);
|
||||||
opt.debug = 0; /* Reset debugging, so that prior debug
|
opt.debug = 0; /* Reset debugging, so that prior debug
|
||||||
statements won't have an undesired effect. */
|
statements won't have an undesired effect. */
|
||||||
}
|
}
|
||||||
@ -727,7 +727,7 @@ main (int argc, char **argv )
|
|||||||
if (default_config)
|
if (default_config)
|
||||||
{
|
{
|
||||||
if( parse_debug )
|
if( parse_debug )
|
||||||
log_info (_("NOTE: no default option file `%s'\n"),
|
log_info (_("NOTE: no default option file '%s'\n"),
|
||||||
configname );
|
configname );
|
||||||
/* Save the default conf file name so that
|
/* Save the default conf file name so that
|
||||||
reread_configuration is able to test whether the
|
reread_configuration is able to test whether the
|
||||||
@ -738,7 +738,7 @@ main (int argc, char **argv )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("option file `%s': %s\n"),
|
log_error (_("option file '%s': %s\n"),
|
||||||
configname, strerror(errno) );
|
configname, strerror(errno) );
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
@ -746,7 +746,7 @@ main (int argc, char **argv )
|
|||||||
configname = NULL;
|
configname = NULL;
|
||||||
}
|
}
|
||||||
if (parse_debug && configname )
|
if (parse_debug && configname )
|
||||||
log_info (_("reading options from `%s'\n"), configname );
|
log_info (_("reading options from '%s'\n"), configname );
|
||||||
default_config = 0;
|
default_config = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,7 +858,7 @@ main (int argc, char **argv )
|
|||||||
|
|
||||||
for (i=0; i < argc; i++)
|
for (i=0; i < argc; i++)
|
||||||
if (argv[i][0] == '-' && argv[i][1] == '-')
|
if (argv[i][0] == '-' && argv[i][1] == '-')
|
||||||
log_info (_("NOTE: `%s' is not considered an option\n"), argv[i]);
|
log_info (_("NOTE: '%s' is not considered an option\n"), argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
@ -1117,7 +1117,7 @@ main (int argc, char **argv )
|
|||||||
|
|
||||||
fp = es_fopen (env_file_name, "w,mode=-rw");
|
fp = es_fopen (env_file_name, "w,mode=-rw");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
log_error (_("error creating `%s': %s\n"),
|
log_error (_("error creating '%s': %s\n"),
|
||||||
env_file_name, strerror (errno));
|
env_file_name, strerror (errno));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1213,7 +1213,7 @@ main (int argc, char **argv )
|
|||||||
if ( ! close (i)
|
if ( ! close (i)
|
||||||
&& open ("/dev/null", i? O_WRONLY : O_RDONLY) == -1)
|
&& open ("/dev/null", i? O_WRONLY : O_RDONLY) == -1)
|
||||||
{
|
{
|
||||||
log_error ("failed to open `%s': %s\n",
|
log_error ("failed to open '%s': %s\n",
|
||||||
"/dev/null", strerror (errno));
|
"/dev/null", strerror (errno));
|
||||||
cleanup ();
|
cleanup ();
|
||||||
exit (1);
|
exit (1);
|
||||||
@ -1352,7 +1352,7 @@ reread_configuration (void)
|
|||||||
fp = fopen (config_filename, "r");
|
fp = fopen (config_filename, "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_info (_("option file `%s': %s\n"),
|
log_info (_("option file '%s': %s\n"),
|
||||||
config_filename, strerror(errno) );
|
config_filename, strerror(errno) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1472,7 +1472,7 @@ create_socket_name (char *standard_name, char *template)
|
|||||||
*p = 0;
|
*p = 0;
|
||||||
if (!mkdtemp (name))
|
if (!mkdtemp (name))
|
||||||
{
|
{
|
||||||
log_error (_("can't create directory `%s': %s\n"),
|
log_error (_("can't create directory '%s': %s\n"),
|
||||||
name, strerror (errno));
|
name, strerror (errno));
|
||||||
agent_exit (2);
|
agent_exit (2);
|
||||||
}
|
}
|
||||||
@ -1481,7 +1481,7 @@ create_socket_name (char *standard_name, char *template)
|
|||||||
|
|
||||||
if (strchr (name, PATHSEP_C))
|
if (strchr (name, PATHSEP_C))
|
||||||
{
|
{
|
||||||
log_error (("`%s' are not allowed in the socket name\n"), PATHSEP_S);
|
log_error (("'%s' are not allowed in the socket name\n"), PATHSEP_S);
|
||||||
agent_exit (2);
|
agent_exit (2);
|
||||||
}
|
}
|
||||||
if (strlen (name) + 1 >= DIMof (struct sockaddr_un, sun_path) )
|
if (strlen (name) + 1 >= DIMof (struct sockaddr_un, sun_path) )
|
||||||
@ -1518,7 +1518,7 @@ create_server_socket (char *name, int is_ssh, assuan_sock_nonce_t *nonce)
|
|||||||
serv_addr->sun_family = AF_UNIX;
|
serv_addr->sun_family = AF_UNIX;
|
||||||
if (strlen (name) + 1 >= sizeof (serv_addr->sun_path))
|
if (strlen (name) + 1 >= sizeof (serv_addr->sun_path))
|
||||||
{
|
{
|
||||||
log_error (_("socket name `%s' is too long\n"), name);
|
log_error (_("socket name '%s' is too long\n"), name);
|
||||||
agent_exit (2);
|
agent_exit (2);
|
||||||
}
|
}
|
||||||
strcpy (serv_addr->sun_path, name);
|
strcpy (serv_addr->sun_path, name);
|
||||||
@ -1562,7 +1562,7 @@ create_server_socket (char *name, int is_ssh, assuan_sock_nonce_t *nonce)
|
|||||||
{
|
{
|
||||||
/* We use gpg_strerror here because it allows us to get strings
|
/* We use gpg_strerror here because it allows us to get strings
|
||||||
for some W32 socket error codes. */
|
for some W32 socket error codes. */
|
||||||
log_error (_("error binding socket to `%s': %s\n"),
|
log_error (_("error binding socket to '%s': %s\n"),
|
||||||
serv_addr->sun_path,
|
serv_addr->sun_path,
|
||||||
gpg_strerror (gpg_error_from_errno (errno)));
|
gpg_strerror (gpg_error_from_errno (errno)));
|
||||||
|
|
||||||
@ -1580,7 +1580,7 @@ create_server_socket (char *name, int is_ssh, assuan_sock_nonce_t *nonce)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("listening on socket `%s'\n"), serv_addr->sun_path);
|
log_info (_("listening on socket '%s'\n"), serv_addr->sun_path);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
@ -1599,10 +1599,10 @@ create_private_keys_directory (const char *home)
|
|||||||
if (stat (fname, &statbuf) && errno == ENOENT)
|
if (stat (fname, &statbuf) && errno == ENOENT)
|
||||||
{
|
{
|
||||||
if (gnupg_mkdir (fname, "-rwx"))
|
if (gnupg_mkdir (fname, "-rwx"))
|
||||||
log_error (_("can't create directory `%s': %s\n"),
|
log_error (_("can't create directory '%s': %s\n"),
|
||||||
fname, strerror (errno) );
|
fname, strerror (errno) );
|
||||||
else if (!opt.quiet)
|
else if (!opt.quiet)
|
||||||
log_info (_("directory `%s' created\n"), fname);
|
log_info (_("directory '%s' created\n"), fname);
|
||||||
}
|
}
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
}
|
}
|
||||||
@ -1638,22 +1638,22 @@ create_directories (void)
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (gnupg_mkdir (home, "-rwx"))
|
if (gnupg_mkdir (home, "-rwx"))
|
||||||
log_error (_("can't create directory `%s': %s\n"),
|
log_error (_("can't create directory '%s': %s\n"),
|
||||||
home, strerror (errno) );
|
home, strerror (errno) );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!opt.quiet)
|
if (!opt.quiet)
|
||||||
log_info (_("directory `%s' created\n"), home);
|
log_info (_("directory '%s' created\n"), home);
|
||||||
create_private_keys_directory (home);
|
create_private_keys_directory (home);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_error (_("stat() failed for `%s': %s\n"), home, strerror (errno));
|
log_error (_("stat() failed for '%s': %s\n"), home, strerror (errno));
|
||||||
}
|
}
|
||||||
else if ( !S_ISDIR(statbuf.st_mode))
|
else if ( !S_ISDIR(statbuf.st_mode))
|
||||||
{
|
{
|
||||||
log_error (_("can't use `%s' as home directory\n"), home);
|
log_error (_("can't use '%s' as home directory\n"), home);
|
||||||
}
|
}
|
||||||
else /* exists and is a directory. */
|
else /* exists and is a directory. */
|
||||||
{
|
{
|
||||||
|
@ -275,7 +275,7 @@ send_cert_back (ctrl_t ctrl, const char *id, void *assuan_context)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (opt.verbose || !*action)
|
if (opt.verbose || !*action)
|
||||||
log_info ("error reading certificate `%s': %s%s\n",
|
log_info ("error reading certificate '%s': %s%s\n",
|
||||||
id? id:"?", gpg_strerror (rc), action);
|
id? id:"?", gpg_strerror (rc), action);
|
||||||
|
|
||||||
return *action? 0 : rc;
|
return *action? 0 : rc;
|
||||||
|
@ -191,7 +191,7 @@ make_canonical (const char *fname, const char *buf, size_t buflen)
|
|||||||
rc = gcry_sexp_sscan (&sexp, &erroff, buf, buflen);
|
rc = gcry_sexp_sscan (&sexp, &erroff, buf, buflen);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
log_error ("invalid S-Expression in `%s' (off=%u): %s\n",
|
log_error ("invalid S-Expression in '%s' (off=%u): %s\n",
|
||||||
fname, (unsigned int)erroff, gpg_strerror (rc));
|
fname, (unsigned int)erroff, gpg_strerror (rc));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
nread = fread (buf+buflen, 1, NCHUNK, fp);
|
nread = fread (buf+buflen, 1, NCHUNK, fp);
|
||||||
if (nread < NCHUNK && ferror (fp))
|
if (nread < NCHUNK && ferror (fp))
|
||||||
{
|
{
|
||||||
log_error ("error reading `[stdin]': %s\n", strerror (errno));
|
log_error ("error reading '[stdin]': %s\n", strerror (errno));
|
||||||
xfree (buf);
|
xfree (buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -275,13 +275,13 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
fp = fopen (fname, "rb");
|
fp = fopen (fname, "rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error ("can't open `%s': %s\n", fname, strerror (errno));
|
log_error ("can't open '%s': %s\n", fname, strerror (errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fstat (fileno(fp), &st))
|
if (fstat (fileno(fp), &st))
|
||||||
{
|
{
|
||||||
log_error ("can't stat `%s': %s\n", fname, strerror (errno));
|
log_error ("can't stat '%s': %s\n", fname, strerror (errno));
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -290,7 +290,7 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
buf = xmalloc (buflen+1);
|
buf = xmalloc (buflen+1);
|
||||||
if (fread (buf, buflen, 1, fp) != 1)
|
if (fread (buf, buflen, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
log_error ("error reading `%s': %s\n", fname, strerror (errno));
|
log_error ("error reading '%s': %s\n", fname, strerror (errno));
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
xfree (buf);
|
xfree (buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -107,7 +107,7 @@ test_agent_protect (void)
|
|||||||
"\xA4\x44\x3B\xA5\x3A\x52\xFC\xA8\x17\x3D\xE6\xE8\x5B\x42\xF9\x78\x3D\x4A\x78\x17"
|
"\xA4\x44\x3B\xA5\x3A\x52\xFC\xA8\x17\x3D\xE6\xE8\x5B\x42\xF9\x78\x3D\x4A\x78\x17"
|
||||||
"\xD0\x68\x0B\x29\x29\x00"
|
"\xD0\x68\x0B\x29\x29\x00"
|
||||||
};
|
};
|
||||||
/* This RSA key is the `e' value. */
|
/* This RSA key is the 'e' value. */
|
||||||
struct key_spec key_rsa_bogus_1 =
|
struct key_spec key_rsa_bogus_1 =
|
||||||
{
|
{
|
||||||
"\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73"
|
"\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73"
|
||||||
@ -177,7 +177,7 @@ test_agent_protect (void)
|
|||||||
&specs[i].result, &specs[i].resultlen, 0);
|
&specs[i].result, &specs[i].resultlen, 0);
|
||||||
if (gpg_err_code (ret) != specs[i].ret_expected)
|
if (gpg_err_code (ret) != specs[i].ret_expected)
|
||||||
{
|
{
|
||||||
printf ("agent_protect() returned `%i/%s'; expected `%i/%s'\n",
|
printf ("agent_protect() returned '%i/%s'; expected '%i/%s'\n",
|
||||||
ret, gpg_strerror (ret),
|
ret, gpg_strerror (ret),
|
||||||
specs[i].ret_expected, gpg_strerror (specs[i].ret_expected));
|
specs[i].ret_expected, gpg_strerror (specs[i].ret_expected));
|
||||||
abort ();
|
abort ();
|
||||||
|
@ -151,7 +151,7 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("error opening `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error opening '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
;
|
;
|
||||||
err = gpg_error (*line? GPG_ERR_LINE_TOO_LONG
|
err = gpg_error (*line? GPG_ERR_LINE_TOO_LONG
|
||||||
: GPG_ERR_INCOMPLETE_LINE);
|
: GPG_ERR_INCOMPLETE_LINE);
|
||||||
log_error (_("file `%s', line %d: %s\n"),
|
log_error (_("file '%s', line %d: %s\n"),
|
||||||
fname, lnr, gpg_strerror (err));
|
fname, lnr, gpg_strerror (err));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
|
|
||||||
if (!allow_include)
|
if (!allow_include)
|
||||||
{
|
{
|
||||||
log_error (_("statement \"%s\" ignored in `%s', line %d\n"),
|
log_error (_("statement \"%s\" ignored in '%s', line %d\n"),
|
||||||
"include-default", fname, lnr);
|
"include-default", fname, lnr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -197,13 +197,13 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
|
|
||||||
etcname = make_filename (gnupg_sysconfdir (), "trustlist.txt", NULL);
|
etcname = make_filename (gnupg_sysconfdir (), "trustlist.txt", NULL);
|
||||||
if ( !strcmp (etcname, fname) ) /* Same file. */
|
if ( !strcmp (etcname, fname) ) /* Same file. */
|
||||||
log_info (_("statement \"%s\" ignored in `%s', line %d\n"),
|
log_info (_("statement \"%s\" ignored in '%s', line %d\n"),
|
||||||
"include-default", fname, lnr);
|
"include-default", fname, lnr);
|
||||||
else if ( access (etcname, F_OK) && errno == ENOENT )
|
else if ( access (etcname, F_OK) && errno == ENOENT )
|
||||||
{
|
{
|
||||||
/* A non existent system trustlist is not an error.
|
/* A non existent system trustlist is not an error.
|
||||||
Just print a note. */
|
Just print a note. */
|
||||||
log_info (_("system trustlist `%s' not available\n"), etcname);
|
log_info (_("system trustlist '%s' not available\n"), etcname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -247,7 +247,7 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
n = hexcolon2bin (p, ti->fpr, 20);
|
n = hexcolon2bin (p, ti->fpr, 20);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
{
|
{
|
||||||
log_error (_("bad fingerprint in `%s', line %d\n"), fname, lnr);
|
log_error (_("bad fingerprint in '%s', line %d\n"), fname, lnr);
|
||||||
err = gpg_error (GPG_ERR_BAD_DATA);
|
err = gpg_error (GPG_ERR_BAD_DATA);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -272,14 +272,14 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("invalid keyflag in `%s', line %d\n"), fname, lnr);
|
log_error (_("invalid keyflag in '%s', line %d\n"), fname, lnr);
|
||||||
err = gpg_error (GPG_ERR_BAD_DATA);
|
err = gpg_error (GPG_ERR_BAD_DATA);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
if ( *p && !spacep (p) )
|
if ( *p && !spacep (p) )
|
||||||
{
|
{
|
||||||
log_error (_("invalid keyflag in `%s', line %d\n"), fname, lnr);
|
log_error (_("invalid keyflag in '%s', line %d\n"), fname, lnr);
|
||||||
err = gpg_error (GPG_ERR_BAD_DATA);
|
err = gpg_error (GPG_ERR_BAD_DATA);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
if (p[n] == '=')
|
if (p[n] == '=')
|
||||||
{
|
{
|
||||||
log_error ("assigning a value to a flag is not yet supported; "
|
log_error ("assigning a value to a flag is not yet supported; "
|
||||||
"in `%s', line %d\n", fname, lnr);
|
"in '%s', line %d\n", fname, lnr);
|
||||||
err = gpg_error (GPG_ERR_BAD_DATA);
|
err = gpg_error (GPG_ERR_BAD_DATA);
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
else if (n == 2 && !memcmp (p, "cm", 2))
|
else if (n == 2 && !memcmp (p, "cm", 2))
|
||||||
ti->flags.cm = 1;
|
ti->flags.cm = 1;
|
||||||
else
|
else
|
||||||
log_error ("flag `%.*s' in `%s', line %d ignored\n",
|
log_error ("flag '%.*s' in '%s', line %d ignored\n",
|
||||||
n, p, fname, lnr);
|
n, p, fname, lnr);
|
||||||
p += n;
|
p += n;
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
if ( !err && !es_feof (fp) )
|
if ( !err && !es_feof (fp) )
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("error reading `%s', line %d: %s\n"),
|
log_error (_("error reading '%s', line %d: %s\n"),
|
||||||
fname, lnr, gpg_strerror (err));
|
fname, lnr, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ read_trustfiles (void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("error opening `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error opening '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
fname = make_filename (gnupg_sysconfdir (), "trustlist.txt", NULL);
|
fname = make_filename (gnupg_sysconfdir (), "trustlist.txt", NULL);
|
||||||
@ -740,7 +740,7 @@ agent_marktrusted (ctrl_t ctrl, const char *name, const char *fpr, int flag)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("can't create `%s': %s\n", fname, gpg_strerror (err));
|
log_error ("can't create '%s': %s\n", fname, gpg_strerror (err));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
unlock_trusttable ();
|
unlock_trusttable ();
|
||||||
xfree (fprformatted);
|
xfree (fprformatted);
|
||||||
@ -754,7 +754,7 @@ agent_marktrusted (ctrl_t ctrl, const char *name, const char *fpr, int flag)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("can't open `%s': %s\n", fname, gpg_strerror (err));
|
log_error ("can't open '%s': %s\n", fname, gpg_strerror (err));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
unlock_trusttable ();
|
unlock_trusttable ();
|
||||||
xfree (fprformatted);
|
xfree (fprformatted);
|
||||||
|
@ -1269,7 +1269,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
while( arg_parse ( &pargs, opts) ) {
|
while( arg_parse ( &pargs, opts) ) {
|
||||||
switch( pargs.r_opt ) {
|
switch( pargs.r_opt ) {
|
||||||
case -1 : printf( "arg=`%s'\n", pargs.r.ret_str); break;
|
case -1 : printf( "arg='%s'\n", pargs.r.ret_str); break;
|
||||||
case 'v': opt.verbose++; break;
|
case 'v': opt.verbose++; break;
|
||||||
case 'e': opt.echo++; break;
|
case 'e': opt.echo++; break;
|
||||||
case 'd': opt.debug++; break;
|
case 'd': opt.debug++; break;
|
||||||
@ -1288,9 +1288,9 @@ main(int argc, char **argv)
|
|||||||
if( opt.debug )
|
if( opt.debug )
|
||||||
printf(" debug=%d\n", opt.debug );
|
printf(" debug=%d\n", opt.debug );
|
||||||
if( opt.outfile )
|
if( opt.outfile )
|
||||||
printf(" outfile=`%s'\n", opt.outfile );
|
printf(" outfile='%s'\n", opt.outfile );
|
||||||
if( opt.crf )
|
if( opt.crf )
|
||||||
printf(" crffile=`%s'\n", opt.crf );
|
printf(" crffile='%s'\n", opt.crf );
|
||||||
if( opt.myopt )
|
if( opt.myopt )
|
||||||
printf(" myopt=%d\n", opt.myopt );
|
printf(" myopt=%d\n", opt.myopt );
|
||||||
if( opt.a_long_one )
|
if( opt.a_long_one )
|
||||||
|
@ -398,7 +398,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
|
|||||||
agent_program = gnupg_module_name (GNUPG_MODULE_NAME_AGENT);
|
agent_program = gnupg_module_name (GNUPG_MODULE_NAME_AGENT);
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
log_info (_("no running gpg-agent - starting `%s'\n"),
|
log_info (_("no running gpg-agent - starting '%s'\n"),
|
||||||
agent_program);
|
agent_program);
|
||||||
|
|
||||||
if (status_cb)
|
if (status_cb)
|
||||||
@ -420,12 +420,12 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
|
|||||||
argv[1] = NULL;
|
argv[1] = NULL;
|
||||||
err = gnupg_spawn_process_fd (agent_program, argv, -1, -1, -1, &pid);
|
err = gnupg_spawn_process_fd (agent_program, argv, -1, -1, -1, &pid);
|
||||||
if (err)
|
if (err)
|
||||||
log_debug ("starting `%s' for testing failed: %s\n",
|
log_debug ("starting '%s' for testing failed: %s\n",
|
||||||
agent_program, gpg_strerror (err));
|
agent_program, gpg_strerror (err));
|
||||||
else if ((err = gnupg_wait_process (agent_program, pid, 1, &excode)))
|
else if ((err = gnupg_wait_process (agent_program, pid, 1, &excode)))
|
||||||
{
|
{
|
||||||
if (excode == -1)
|
if (excode == -1)
|
||||||
log_debug ("running `%s' for testing failed (wait): %s\n",
|
log_debug ("running '%s' for testing failed (wait): %s\n",
|
||||||
agent_program, gpg_strerror (err));
|
agent_program, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
gnupg_release_process (pid);
|
gnupg_release_process (pid);
|
||||||
@ -447,7 +447,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
|
|||||||
{
|
{
|
||||||
err = gnupg_spawn_process_detached (agent_program, argv,NULL);
|
err = gnupg_spawn_process_detached (agent_program, argv,NULL);
|
||||||
if (err)
|
if (err)
|
||||||
log_error ("failed to start agent `%s': %s\n",
|
log_error ("failed to start agent '%s': %s\n",
|
||||||
agent_program, gpg_strerror (err));
|
agent_program, gpg_strerror (err));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -616,7 +616,7 @@ start_new_dirmngr (assuan_context_t *r_ctx,
|
|||||||
dirmngr_program = gnupg_module_name (GNUPG_MODULE_NAME_DIRMNGR);
|
dirmngr_program = gnupg_module_name (GNUPG_MODULE_NAME_DIRMNGR);
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
log_info (_("no running Dirmngr - starting `%s'\n"),
|
log_info (_("no running Dirmngr - starting '%s'\n"),
|
||||||
dirmngr_program);
|
dirmngr_program);
|
||||||
|
|
||||||
if (status_cb)
|
if (status_cb)
|
||||||
@ -641,7 +641,7 @@ start_new_dirmngr (assuan_context_t *r_ctx,
|
|||||||
{
|
{
|
||||||
err = gnupg_spawn_process_detached (dirmngr_program, argv,NULL);
|
err = gnupg_spawn_process_detached (dirmngr_program, argv,NULL);
|
||||||
if (err)
|
if (err)
|
||||||
log_error ("failed to start the dirmngr `%s': %s\n",
|
log_error ("failed to start the dirmngr '%s': %s\n",
|
||||||
dirmngr_program, gpg_strerror (err));
|
dirmngr_program, gpg_strerror (err));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -681,7 +681,7 @@ start_new_dirmngr (assuan_context_t *r_ctx,
|
|||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error ("connecting dirmngr at `%s' failed: %s\n",
|
log_error ("connecting dirmngr at '%s' failed: %s\n",
|
||||||
sockname, gpg_strerror (err));
|
sockname, gpg_strerror (err));
|
||||||
assuan_release (ctx);
|
assuan_release (ctx);
|
||||||
return gpg_err_make (errsource, GPG_ERR_NO_DIRMNGR);
|
return gpg_err_make (errsource, GPG_ERR_NO_DIRMNGR);
|
||||||
|
@ -1216,7 +1216,7 @@ audit_print_result (audit_ctx_t ctx, estream_t out, int use_html)
|
|||||||
es_fprintf (out, " i=%d", ctx->log[idx].intvalue);
|
es_fprintf (out, " i=%d", ctx->log[idx].intvalue);
|
||||||
if (ctx->log[idx].string)
|
if (ctx->log[idx].string)
|
||||||
{
|
{
|
||||||
es_fputs (" s=`", out);
|
es_fputs (" s='", out);
|
||||||
writeout (ctx, ctx->log[idx].string);
|
writeout (ctx, ctx->log[idx].string);
|
||||||
es_fputs ("'", out);
|
es_fputs ("'", out);
|
||||||
}
|
}
|
||||||
@ -1224,7 +1224,7 @@ audit_print_result (audit_ctx_t ctx, estream_t out, int use_html)
|
|||||||
es_fprintf (out, " has_cert");
|
es_fprintf (out, " has_cert");
|
||||||
if (ctx->log[idx].have_err)
|
if (ctx->log[idx].have_err)
|
||||||
{
|
{
|
||||||
es_fputs (" err=`", out);
|
es_fputs (" err='", out);
|
||||||
writeout (ctx, gpg_strerror (ctx->log[idx].err));
|
writeout (ctx, gpg_strerror (ctx->log[idx].err));
|
||||||
es_fputs ("'", out);
|
es_fputs ("'", out);
|
||||||
}
|
}
|
||||||
@ -1304,7 +1304,7 @@ audit_print_result (audit_ctx_t ctx, estream_t out, int use_html)
|
|||||||
xfree (text);
|
xfree (text);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
writeout_para (ctx, _("No help available for `%s'."), helptag->name);
|
writeout_para (ctx, _("No help available for '%s'."), helptag->name);
|
||||||
if (use_html && ctx->helptags->next)
|
if (use_html && ctx->helptags->next)
|
||||||
es_fputs ("</li>\n", ctx->outstream);
|
es_fputs ("</li>\n", ctx->outstream);
|
||||||
if (helptag->next)
|
if (helptag->next)
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
* products derived from this software without specific prior
|
* products derived from this software without specific prior
|
||||||
* written permission.
|
* written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
@ -497,7 +497,7 @@ read_lockfile (dotlock_t h, int *same_node )
|
|||||||
if ( (fd = open (h->lockname, O_RDONLY)) == -1 )
|
if ( (fd = open (h->lockname, O_RDONLY)) == -1 )
|
||||||
{
|
{
|
||||||
int e = errno;
|
int e = errno;
|
||||||
my_info_2 ("error opening lockfile `%s': %s\n",
|
my_info_2 ("error opening lockfile '%s': %s\n",
|
||||||
h->lockname, strerror(errno) );
|
h->lockname, strerror(errno) );
|
||||||
if (buffer != buffer_space)
|
if (buffer != buffer_space)
|
||||||
jnlib_free (buffer);
|
jnlib_free (buffer);
|
||||||
@ -514,7 +514,7 @@ read_lockfile (dotlock_t h, int *same_node )
|
|||||||
continue;
|
continue;
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
my_info_1 ("error reading lockfile `%s'\n", h->lockname );
|
my_info_1 ("error reading lockfile '%s'\n", h->lockname );
|
||||||
close (fd);
|
close (fd);
|
||||||
if (buffer != buffer_space)
|
if (buffer != buffer_space)
|
||||||
jnlib_free (buffer);
|
jnlib_free (buffer);
|
||||||
@ -529,7 +529,7 @@ read_lockfile (dotlock_t h, int *same_node )
|
|||||||
|
|
||||||
if (nread < 11)
|
if (nread < 11)
|
||||||
{
|
{
|
||||||
my_info_1 ("invalid size of lockfile `%s'\n", h->lockname);
|
my_info_1 ("invalid size of lockfile '%s'\n", h->lockname);
|
||||||
if (buffer != buffer_space)
|
if (buffer != buffer_space)
|
||||||
jnlib_free (buffer);
|
jnlib_free (buffer);
|
||||||
jnlib_set_errno (0); /* Better don't return an inappropriate ERRNO. */
|
jnlib_set_errno (0); /* Better don't return an inappropriate ERRNO. */
|
||||||
@ -540,7 +540,7 @@ read_lockfile (dotlock_t h, int *same_node )
|
|||||||
|| (buffer[10] = 0, pid = atoi (buffer)) == -1
|
|| (buffer[10] = 0, pid = atoi (buffer)) == -1
|
||||||
|| !pid )
|
|| !pid )
|
||||||
{
|
{
|
||||||
my_error_2 ("invalid pid %d in lockfile `%s'\n", pid, h->lockname);
|
my_error_2 ("invalid pid %d in lockfile '%s'\n", pid, h->lockname);
|
||||||
if (buffer != buffer_space)
|
if (buffer != buffer_space)
|
||||||
jnlib_free (buffer);
|
jnlib_free (buffer);
|
||||||
jnlib_set_errno (0);
|
jnlib_set_errno (0);
|
||||||
@ -666,7 +666,7 @@ dotlock_create_unix (dotlock_t h, const char *file_to_lock)
|
|||||||
{
|
{
|
||||||
all_lockfiles = h->next;
|
all_lockfiles = h->next;
|
||||||
UNLOCK_all_lockfiles ();
|
UNLOCK_all_lockfiles ();
|
||||||
my_error_2 (_("failed to create temporary file `%s': %s\n"),
|
my_error_2 (_("failed to create temporary file '%s': %s\n"),
|
||||||
h->tname, strerror(errno));
|
h->tname, strerror(errno));
|
||||||
jnlib_free (h->tname);
|
jnlib_free (h->tname);
|
||||||
jnlib_free (h);
|
jnlib_free (h);
|
||||||
@ -691,7 +691,7 @@ dotlock_create_unix (dotlock_t h, const char *file_to_lock)
|
|||||||
h->use_o_excl = 1;
|
h->use_o_excl = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
my_error_2 ("can't check whether hardlinks are supported for `%s': %s\n",
|
my_error_2 ("can't check whether hardlinks are supported for '%s': %s\n",
|
||||||
h->tname, strerror(errno));
|
h->tname, strerror(errno));
|
||||||
goto write_failed;
|
goto write_failed;
|
||||||
}
|
}
|
||||||
@ -709,14 +709,14 @@ dotlock_create_unix (dotlock_t h, const char *file_to_lock)
|
|||||||
strcpy (stpcpy (h->lockname, file_to_lock), EXTSEP_S "lock");
|
strcpy (stpcpy (h->lockname, file_to_lock), EXTSEP_S "lock");
|
||||||
UNLOCK_all_lockfiles ();
|
UNLOCK_all_lockfiles ();
|
||||||
if (h->use_o_excl)
|
if (h->use_o_excl)
|
||||||
my_debug_1 ("locking for `%s' done via O_EXCL\n", h->lockname);
|
my_debug_1 ("locking for '%s' done via O_EXCL\n", h->lockname);
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
|
|
||||||
write_failed:
|
write_failed:
|
||||||
all_lockfiles = h->next;
|
all_lockfiles = h->next;
|
||||||
UNLOCK_all_lockfiles ();
|
UNLOCK_all_lockfiles ();
|
||||||
my_error_2 (_("error writing to `%s': %s\n"), h->tname, strerror (errno));
|
my_error_2 (_("error writing to '%s': %s\n"), h->tname, strerror (errno));
|
||||||
close (fd);
|
close (fd);
|
||||||
unlink (h->tname);
|
unlink (h->tname);
|
||||||
jnlib_free (h->tname);
|
jnlib_free (h->tname);
|
||||||
@ -780,7 +780,7 @@ dotlock_create_w32 (dotlock_t h, const char *file_to_lock)
|
|||||||
{
|
{
|
||||||
all_lockfiles = h->next;
|
all_lockfiles = h->next;
|
||||||
UNLOCK_all_lockfiles ();
|
UNLOCK_all_lockfiles ();
|
||||||
my_error_2 (_("can't create `%s': %s\n"), h->lockname, w32_strerror (-1));
|
my_error_2 (_("can't create '%s': %s\n"), h->lockname, w32_strerror (-1));
|
||||||
jnlib_free (h->lockname);
|
jnlib_free (h->lockname);
|
||||||
jnlib_free (h);
|
jnlib_free (h);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -975,7 +975,7 @@ dotlock_take_unix (dotlock_t h, long timeout)
|
|||||||
; /* Lock held by another process. */
|
; /* Lock held by another process. */
|
||||||
else if (fd == -1)
|
else if (fd == -1)
|
||||||
{
|
{
|
||||||
my_error_2 ("lock not made: open(O_EXCL) of `%s' failed: %s\n",
|
my_error_2 ("lock not made: open(O_EXCL) of '%s' failed: %s\n",
|
||||||
h->lockname, strerror (errno));
|
h->lockname, strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -994,7 +994,7 @@ dotlock_take_unix (dotlock_t h, long timeout)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Write error. */
|
/* Write error. */
|
||||||
my_error_2 ("lock not made: writing to `%s' failed: %s\n",
|
my_error_2 ("lock not made: writing to '%s' failed: %s\n",
|
||||||
h->lockname, strerror (errno));
|
h->lockname, strerror (errno));
|
||||||
close (fd);
|
close (fd);
|
||||||
unlink (h->lockname);
|
unlink (h->lockname);
|
||||||
@ -1123,7 +1123,7 @@ dotlock_take_w32 (dotlock_t h, long timeout)
|
|||||||
w32err = GetLastError ();
|
w32err = GetLastError ();
|
||||||
if (w32err != ERROR_LOCK_VIOLATION)
|
if (w32err != ERROR_LOCK_VIOLATION)
|
||||||
{
|
{
|
||||||
my_error_2 (_("lock `%s' not made: %s\n"),
|
my_error_2 (_("lock '%s' not made: %s\n"),
|
||||||
h->lockname, w32_strerror (w32err));
|
h->lockname, w32_strerror (w32err));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1173,7 +1173,7 @@ dotlock_take (dotlock_t h, long timeout)
|
|||||||
|
|
||||||
if ( h->locked )
|
if ( h->locked )
|
||||||
{
|
{
|
||||||
my_debug_1 ("Oops, `%s' is already locked\n", h->lockname);
|
my_debug_1 ("Oops, '%s' is already locked\n", h->lockname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1209,7 +1209,7 @@ dotlock_release_unix (dotlock_t h)
|
|||||||
|
|
||||||
if ( unlink( h->lockname ) )
|
if ( unlink( h->lockname ) )
|
||||||
{
|
{
|
||||||
my_error_1 ("release_dotlock: error removing lockfile `%s'\n",
|
my_error_1 ("release_dotlock: error removing lockfile '%s'\n",
|
||||||
h->lockname);
|
h->lockname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1230,7 +1230,7 @@ dotlock_release_w32 (dotlock_t h)
|
|||||||
memset (&ovl, 0, sizeof ovl);
|
memset (&ovl, 0, sizeof ovl);
|
||||||
if (!UnlockFileEx (h->lockhd, 0, 1, 0, &ovl))
|
if (!UnlockFileEx (h->lockhd, 0, 1, 0, &ovl))
|
||||||
{
|
{
|
||||||
my_error_2 ("release_dotlock: error removing lockfile `%s': %s\n",
|
my_error_2 ("release_dotlock: error removing lockfile '%s': %s\n",
|
||||||
h->lockname, w32_strerror (-1));
|
h->lockname, w32_strerror (-1));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1261,7 +1261,7 @@ dotlock_release (dotlock_t h)
|
|||||||
|
|
||||||
if ( !h->locked )
|
if ( !h->locked )
|
||||||
{
|
{
|
||||||
my_debug_1 ("Oops, `%s' is not locked\n", h->lockname);
|
my_debug_1 ("Oops, '%s' is not locked\n", h->lockname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
* products derived from this software without specific prior
|
* products derived from this software without specific prior
|
||||||
* written permission.
|
* written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
* products derived from this software without specific prior
|
* products derived from this software without specific prior
|
||||||
* written permission.
|
* written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
* products derived from this software without specific prior
|
* products derived from this software without specific prior
|
||||||
* written permission.
|
* written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
* products derived from this software without specific prior
|
* products derived from this software without specific prior
|
||||||
* written permission.
|
* written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
* products derived from this software without specific prior
|
* products derived from this software without specific prior
|
||||||
* written permission.
|
* written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
|
@ -253,7 +253,7 @@ do_exec (const char *pgmname, const char *argv[],
|
|||||||
{
|
{
|
||||||
fds[i] = open ("/dev/null", i? O_WRONLY : O_RDONLY);
|
fds[i] = open ("/dev/null", i? O_WRONLY : O_RDONLY);
|
||||||
if (fds[i] == -1)
|
if (fds[i] == -1)
|
||||||
log_fatal ("failed to open `%s': %s\n",
|
log_fatal ("failed to open '%s': %s\n",
|
||||||
"/dev/null", strerror (errno));
|
"/dev/null", strerror (errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -512,13 +512,13 @@ gnupg_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode)
|
|||||||
}
|
}
|
||||||
else if (WIFEXITED (status) && WEXITSTATUS (status) == 127)
|
else if (WIFEXITED (status) && WEXITSTATUS (status) == 127)
|
||||||
{
|
{
|
||||||
log_error (_("error running `%s': probably not installed\n"), pgmname);
|
log_error (_("error running '%s': probably not installed\n"), pgmname);
|
||||||
ec = GPG_ERR_CONFIGURATION;
|
ec = GPG_ERR_CONFIGURATION;
|
||||||
}
|
}
|
||||||
else if (WIFEXITED (status) && WEXITSTATUS (status))
|
else if (WIFEXITED (status) && WEXITSTATUS (status))
|
||||||
{
|
{
|
||||||
if (!r_exitcode)
|
if (!r_exitcode)
|
||||||
log_error (_("error running `%s': exit status %d\n"), pgmname,
|
log_error (_("error running '%s': exit status %d\n"), pgmname,
|
||||||
WEXITSTATUS (status));
|
WEXITSTATUS (status));
|
||||||
else
|
else
|
||||||
*r_exitcode = WEXITSTATUS (status);
|
*r_exitcode = WEXITSTATUS (status);
|
||||||
@ -526,7 +526,7 @@ gnupg_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode)
|
|||||||
}
|
}
|
||||||
else if (!WIFEXITED (status))
|
else if (!WIFEXITED (status))
|
||||||
{
|
{
|
||||||
log_error (_("error running `%s': terminated\n"), pgmname);
|
log_error (_("error running '%s': terminated\n"), pgmname);
|
||||||
ec = GPG_ERR_GENERAL;
|
ec = GPG_ERR_GENERAL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -285,7 +285,7 @@ w32_open_null (int for_write)
|
|||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
NULL, OPEN_EXISTING, 0, NULL);
|
NULL, OPEN_EXISTING, 0, NULL);
|
||||||
if (hfile == INVALID_HANDLE_VALUE)
|
if (hfile == INVALID_HANDLE_VALUE)
|
||||||
log_debug ("can't open `nul': %s\n", w32_strerror (-1));
|
log_debug ("can't open 'nul': %s\n", w32_strerror (-1));
|
||||||
return hfile;
|
return hfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
|
|||||||
| ((flags & 128)? DETACHED_PROCESS : 0)
|
| ((flags & 128)? DETACHED_PROCESS : 0)
|
||||||
| GetPriorityClass (GetCurrentProcess ())
|
| GetPriorityClass (GetCurrentProcess ())
|
||||||
| CREATE_SUSPENDED);
|
| CREATE_SUSPENDED);
|
||||||
/* log_debug ("CreateProcess, path=`%s' cmdline=`%s'\n", pgmname, cmdline); */
|
/* log_debug ("CreateProcess, path='%s' cmdline='%s'\n", pgmname, cmdline); */
|
||||||
if (!CreateProcess (pgmname, /* Program to start. */
|
if (!CreateProcess (pgmname, /* Program to start. */
|
||||||
cmdline, /* Command line arguments. */
|
cmdline, /* Command line arguments. */
|
||||||
&sec_attr, /* Process security attributes. */
|
&sec_attr, /* Process security attributes. */
|
||||||
@ -609,7 +609,7 @@ gnupg_spawn_process_fd (const char *pgmname, const char *argv[],
|
|||||||
si.hStdOutput = outfd == -1? stdhd[1] : (void*)_get_osfhandle (outfd);
|
si.hStdOutput = outfd == -1? stdhd[1] : (void*)_get_osfhandle (outfd);
|
||||||
si.hStdError = errfd == -1? stdhd[2] : (void*)_get_osfhandle (errfd);
|
si.hStdError = errfd == -1? stdhd[2] : (void*)_get_osfhandle (errfd);
|
||||||
|
|
||||||
/* log_debug ("CreateProcess, path=`%s' cmdline=`%s'\n", pgmname, cmdline); */
|
/* log_debug ("CreateProcess, path='%s' cmdline='%s'\n", pgmname, cmdline); */
|
||||||
if (!CreateProcess (pgmname, /* Program to start. */
|
if (!CreateProcess (pgmname, /* Program to start. */
|
||||||
cmdline, /* Command line arguments. */
|
cmdline, /* Command line arguments. */
|
||||||
&sec_attr, /* Process security attributes. */
|
&sec_attr, /* Process security attributes. */
|
||||||
@ -691,7 +691,7 @@ gnupg_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode)
|
|||||||
}
|
}
|
||||||
else if (exc)
|
else if (exc)
|
||||||
{
|
{
|
||||||
log_error (_("error running `%s': exit status %d\n"),
|
log_error (_("error running '%s': exit status %d\n"),
|
||||||
pgmname, (int)exc );
|
pgmname, (int)exc );
|
||||||
if (r_exitcode)
|
if (r_exitcode)
|
||||||
*r_exitcode = (int)exc;
|
*r_exitcode = (int)exc;
|
||||||
@ -783,7 +783,7 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[],
|
|||||||
| GetPriorityClass (GetCurrentProcess ())
|
| GetPriorityClass (GetCurrentProcess ())
|
||||||
| CREATE_NEW_PROCESS_GROUP
|
| CREATE_NEW_PROCESS_GROUP
|
||||||
| DETACHED_PROCESS);
|
| DETACHED_PROCESS);
|
||||||
/* log_debug ("CreateProcess(detached), path=`%s' cmdline=`%s'\n", */
|
/* log_debug ("CreateProcess(detached), path='%s' cmdline='%s'\n", */
|
||||||
/* pgmname, cmdline); */
|
/* pgmname, cmdline); */
|
||||||
if (!CreateProcess (pgmname, /* Program to start. */
|
if (!CreateProcess (pgmname, /* Program to start. */
|
||||||
cmdline, /* Command line arguments. */
|
cmdline, /* Command line arguments. */
|
||||||
|
@ -636,7 +636,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug ("CreateProcess, path=`%s' cmdline=`%s'\n", pgmname, cmdline);
|
log_debug ("CreateProcess, path='%s' cmdline='%s'\n", pgmname, cmdline);
|
||||||
if (!create_process (pgmname, cmdline, &pi))
|
if (!create_process (pgmname, cmdline, &pi))
|
||||||
{
|
{
|
||||||
log_error ("CreateProcess failed: %s\n", w32_strerror (-1));
|
log_error ("CreateProcess failed: %s\n", w32_strerror (-1));
|
||||||
@ -698,7 +698,7 @@ gnupg_spawn_process_fd (const char *pgmname, const char *argv[],
|
|||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
log_debug ("CreateProcess, path=`%s' cmdline=`%s'\n", pgmname, cmdline);
|
log_debug ("CreateProcess, path='%s' cmdline='%s'\n", pgmname, cmdline);
|
||||||
if (!create_process (pgmname, cmdline, &pi))
|
if (!create_process (pgmname, cmdline, &pi))
|
||||||
{
|
{
|
||||||
log_error ("CreateProcess(fd) failed: %s\n", w32_strerror (-1));
|
log_error ("CreateProcess(fd) failed: %s\n", w32_strerror (-1));
|
||||||
@ -762,7 +762,7 @@ gnupg_wait_process (const char *pgmname, pid_t pid, int hang, int *exitcode)
|
|||||||
}
|
}
|
||||||
else if (exc)
|
else if (exc)
|
||||||
{
|
{
|
||||||
log_error (_("error running `%s': exit status %d\n"),
|
log_error (_("error running '%s': exit status %d\n"),
|
||||||
pgmname, (int)exc );
|
pgmname, (int)exc );
|
||||||
if (exitcode)
|
if (exitcode)
|
||||||
*exitcode = (int)exc;
|
*exitcode = (int)exc;
|
||||||
@ -822,7 +822,7 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[],
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
/* Note: There is no detached flag under CE. */
|
/* Note: There is no detached flag under CE. */
|
||||||
log_debug ("CreateProcess, path=`%s' cmdline=`%s'\n", pgmname, cmdline);
|
log_debug ("CreateProcess, path='%s' cmdline='%s'\n", pgmname, cmdline);
|
||||||
if (!create_process (pgmname, cmdline, &pi))
|
if (!create_process (pgmname, cmdline, &pi))
|
||||||
{
|
{
|
||||||
log_error ("CreateProcess(detached) failed: %s\n", w32_strerror (-1));
|
log_error ("CreateProcess(detached) failed: %s\n", w32_strerror (-1));
|
||||||
|
@ -124,7 +124,7 @@ default_inq_cb (void *opaque, const char *line)
|
|||||||
/* We do not return errors to avoid breaking other code. */
|
/* We do not return errors to avoid breaking other code. */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_debug ("ignoring gpg-agent inquiry `%s'\n", line);
|
log_debug ("ignoring gpg-agent inquiry '%s'\n", line);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ findkey_fname (const char *key, const char *fname)
|
|||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("can't open '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ findkey_fname (const char *key, const char *fname)
|
|||||||
;
|
;
|
||||||
err = gpg_error (*line? GPG_ERR_LINE_TOO_LONG
|
err = gpg_error (*line? GPG_ERR_LINE_TOO_LONG
|
||||||
: GPG_ERR_INCOMPLETE_LINE);
|
: GPG_ERR_INCOMPLETE_LINE);
|
||||||
log_error (_("file `%s', line %d: %s\n"),
|
log_error (_("file '%s', line %d: %s\n"),
|
||||||
fname, lnr, gpg_strerror (err));
|
fname, lnr, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -86,7 +86,7 @@ findkey_fname (const char *key, const char *fname)
|
|||||||
continue;
|
continue;
|
||||||
if (*line != '.' || spacep(line+1))
|
if (*line != '.' || spacep(line+1))
|
||||||
{
|
{
|
||||||
log_info (_("file `%s', line %d: %s\n"),
|
log_info (_("file '%s', line %d: %s\n"),
|
||||||
fname, lnr, _("ignoring garbage line"));
|
fname, lnr, _("ignoring garbage line"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ findkey_fname (const char *key, const char *fname)
|
|||||||
if ( !err && ferror (fp) )
|
if ( !err && ferror (fp) )
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("error reading `%s', line %d: %s\n"),
|
log_error (_("error reading '%s', line %d: %s\n"),
|
||||||
fname, lnr, gpg_strerror (err));
|
fname, lnr, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ w32_rootdir (void)
|
|||||||
}
|
}
|
||||||
if (!p)
|
if (!p)
|
||||||
{
|
{
|
||||||
log_debug ("bad filename `%s' returned for this process\n", dir);
|
log_debug ("bad filename '%s' returned for this process\n", dir);
|
||||||
*dir = 0;
|
*dir = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1538,7 +1538,7 @@ parse_response (http_t hd)
|
|||||||
return GPG_ERR_EOF;
|
return GPG_ERR_EOF;
|
||||||
|
|
||||||
if ((hd->flags & HTTP_FLAG_LOG_RESP))
|
if ((hd->flags & HTTP_FLAG_LOG_RESP))
|
||||||
log_info ("RESP: `%.*s'\n",
|
log_info ("RESP: '%.*s'\n",
|
||||||
(int)strlen(line)-(*line&&line[1]?2:0),line);
|
(int)strlen(line)-(*line&&line[1]?2:0),line);
|
||||||
}
|
}
|
||||||
while (!*line);
|
while (!*line);
|
||||||
@ -1584,7 +1584,7 @@ parse_response (http_t hd)
|
|||||||
if ((*line == '\r' && line[1] == '\n') || *line == '\n')
|
if ((*line == '\r' && line[1] == '\n') || *line == '\n')
|
||||||
*line = 0;
|
*line = 0;
|
||||||
if ((hd->flags & HTTP_FLAG_LOG_RESP))
|
if ((hd->flags & HTTP_FLAG_LOG_RESP))
|
||||||
log_info ("RESP: `%.*s'\n",
|
log_info ("RESP: '%.*s'\n",
|
||||||
(int)strlen(line)-(*line&&line[1]?2:0),line);
|
(int)strlen(line)-(*line&&line[1]?2:0),line);
|
||||||
if (*line)
|
if (*line)
|
||||||
{
|
{
|
||||||
@ -1834,7 +1834,7 @@ connect_server (const char *server, unsigned short port,
|
|||||||
addr.sin_family = host->h_addrtype;
|
addr.sin_family = host->h_addrtype;
|
||||||
if (addr.sin_family != AF_INET)
|
if (addr.sin_family != AF_INET)
|
||||||
{
|
{
|
||||||
log_error ("unknown address family for `%s'\n",
|
log_error ("unknown address family for '%s'\n",
|
||||||
serverlist[srv].target);
|
serverlist[srv].target);
|
||||||
xfree (serverlist);
|
xfree (serverlist);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1842,7 +1842,7 @@ connect_server (const char *server, unsigned short port,
|
|||||||
addr.sin_port = htons (serverlist[srv].port);
|
addr.sin_port = htons (serverlist[srv].port);
|
||||||
if (host->h_length != 4)
|
if (host->h_length != 4)
|
||||||
{
|
{
|
||||||
log_error ("illegal address length for `%s'\n",
|
log_error ("illegal address length for '%s'\n",
|
||||||
serverlist[srv].target);
|
serverlist[srv].target);
|
||||||
xfree (serverlist);
|
xfree (serverlist);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1868,12 +1868,12 @@ connect_server (const char *server, unsigned short port,
|
|||||||
if (!connected)
|
if (!connected)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
log_error ("can't connect to `%s': %s%sec=%d\n",
|
log_error ("can't connect to '%s': %s%sec=%d\n",
|
||||||
server,
|
server,
|
||||||
hostfound? "":_("host not found"),
|
hostfound? "":_("host not found"),
|
||||||
hostfound? "":" - ", (int)WSAGetLastError());
|
hostfound? "":" - ", (int)WSAGetLastError());
|
||||||
#else
|
#else
|
||||||
log_error ("can't connect to `%s': %s\n",
|
log_error ("can't connect to '%s': %s\n",
|
||||||
server,
|
server,
|
||||||
hostfound? strerror (last_errno):"host not found");
|
hostfound? strerror (last_errno):"host not found");
|
||||||
#endif
|
#endif
|
||||||
@ -2166,7 +2166,7 @@ main (int argc, char **argv)
|
|||||||
rc = http_parse_uri (&uri, *argv, 1);
|
rc = http_parse_uri (&uri, *argv, 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
log_error ("`%s': %s\n", *argv, gpg_strerror (rc));
|
log_error ("'%s': %s\n", *argv, gpg_strerror (rc));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2208,7 +2208,7 @@ main (int argc, char **argv)
|
|||||||
rc = http_open_document (&hd, *argv, NULL, 0, NULL, tls_session, NULL, NULL);
|
rc = http_open_document (&hd, *argv, NULL, 0, NULL, tls_session, NULL, NULL);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
log_error ("can't get `%s': %s\n", *argv, gpg_strerror (rc));
|
log_error ("can't get '%s': %s\n", *argv, gpg_strerror (rc));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
log_info ("open_http_document succeeded; status=%u\n",
|
log_info ("open_http_document succeeded; status=%u\n",
|
||||||
@ -2223,7 +2223,7 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 301:
|
case 301:
|
||||||
case 302:
|
case 302:
|
||||||
printf ("Redirected to `%s'\n", http_get_header (hd, "Location"));
|
printf ("Redirected to '%s'\n", http_get_header (hd, "Location"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
http_close (hd, 0);
|
http_close (hd, 0);
|
||||||
|
@ -1074,7 +1074,7 @@ print_chain (iobuf_t a)
|
|||||||
a->filter (a->filter_ov, IOBUFCTRL_DESC, NULL,
|
a->filter (a->filter_ov, IOBUFCTRL_DESC, NULL,
|
||||||
(byte *) & desc, &dummy_len);
|
(byte *) & desc, &dummy_len);
|
||||||
|
|
||||||
log_debug ("iobuf chain: %d.%d `%s' filter_eof=%d start=%d len=%d\n",
|
log_debug ("iobuf chain: %d.%d '%s' filter_eof=%d start=%d len=%d\n",
|
||||||
a->no, a->subno, desc?desc:"?", a->filter_eof,
|
a->no, a->subno, desc?desc:"?", a->filter_eof,
|
||||||
(int) a->d.start, (int) a->d.len);
|
(int) a->d.start, (int) a->d.len);
|
||||||
}
|
}
|
||||||
@ -1132,7 +1132,7 @@ iobuf_close (iobuf_t a)
|
|||||||
log_error ("iobuf_flush failed on close: %s\n", gpg_strerror (rc));
|
log_error ("iobuf_flush failed on close: %s\n", gpg_strerror (rc));
|
||||||
|
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: close `%s'\n", a->no, a->subno,
|
log_debug ("iobuf-%d.%d: close '%s'\n", a->no, a->subno,
|
||||||
a->desc?a->desc:"?");
|
a->desc?a->desc:"?");
|
||||||
if (a->filter && (rc = a->filter (a->filter_ov, IOBUFCTRL_FREE,
|
if (a->filter && (rc = a->filter (a->filter_ov, IOBUFCTRL_FREE,
|
||||||
a->chain, NULL, &dummy_len)))
|
a->chain, NULL, &dummy_len)))
|
||||||
@ -1318,7 +1318,7 @@ iobuf_open (const char *fname)
|
|||||||
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
||||||
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: open `%s' fd=%d\n",
|
log_debug ("iobuf-%d.%d: open '%s' fd=%d\n",
|
||||||
a->no, a->subno, fname, FD2INT (fcx->fp));
|
a->no, a->subno, fname, FD2INT (fcx->fp));
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
@ -1346,7 +1346,7 @@ do_iobuf_fdopen (int fd, const char *mode, int keep_open)
|
|||||||
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
||||||
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: fdopen%s `%s'\n",
|
log_debug ("iobuf-%d.%d: fdopen%s '%s'\n",
|
||||||
a->no, a->subno, keep_open? "_nc":"", fcx->fname);
|
a->no, a->subno, keep_open? "_nc":"", fcx->fname);
|
||||||
iobuf_ioctl (a, IOBUF_IOCTL_NO_CACHE, 1, NULL);
|
iobuf_ioctl (a, IOBUF_IOCTL_NO_CACHE, 1, NULL);
|
||||||
return a;
|
return a;
|
||||||
@ -1386,7 +1386,7 @@ iobuf_esopen (estream_t estream, const char *mode, int keep_open)
|
|||||||
file_es_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
file_es_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
||||||
file_es_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
file_es_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: esopen%s `%s'\n",
|
log_debug ("iobuf-%d.%d: esopen%s '%s'\n",
|
||||||
a->no, a->subno, keep_open? "_nc":"", fcx->fname);
|
a->no, a->subno, keep_open? "_nc":"", fcx->fname);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@ -1410,7 +1410,7 @@ iobuf_sockopen (int fd, const char *mode)
|
|||||||
sock_filter (scx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
sock_filter (scx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
||||||
sock_filter (scx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
sock_filter (scx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: sockopen `%s'\n", a->no, a->subno, scx->fname);
|
log_debug ("iobuf-%d.%d: sockopen '%s'\n", a->no, a->subno, scx->fname);
|
||||||
iobuf_ioctl (a, IOBUF_IOCTL_NO_CACHE, 1, NULL);
|
iobuf_ioctl (a, IOBUF_IOCTL_NO_CACHE, 1, NULL);
|
||||||
#else
|
#else
|
||||||
a = iobuf_fdopen (fd, mode);
|
a = iobuf_fdopen (fd, mode);
|
||||||
@ -1453,7 +1453,7 @@ iobuf_create (const char *fname)
|
|||||||
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
||||||
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: create `%s'\n", a->no, a->subno,
|
log_debug ("iobuf-%d.%d: create '%s'\n", a->no, a->subno,
|
||||||
a->desc?a->desc:"?");
|
a->desc?a->desc:"?");
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
@ -1482,7 +1482,7 @@ iobuf_openrw (const char *fname)
|
|||||||
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
file_filter (fcx, IOBUFCTRL_DESC, NULL, (byte *) & a->desc, &len);
|
||||||
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
file_filter (fcx, IOBUFCTRL_INIT, NULL, NULL, &len);
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: openrw `%s'\n", a->no, a->subno,
|
log_debug ("iobuf-%d.%d: openrw '%s'\n", a->no, a->subno,
|
||||||
a->desc?a->desc:"?");
|
a->desc?a->desc:"?");
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
@ -1498,7 +1498,7 @@ iobuf_ioctl (iobuf_t a, iobuf_ioctl_t cmd, int intval, void *ptrval)
|
|||||||
the past by http.c; this ioctl is not directly used
|
the past by http.c; this ioctl is not directly used
|
||||||
anymore. */
|
anymore. */
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: ioctl `%s' keep_open=%d\n",
|
log_debug ("iobuf-%d.%d: ioctl '%s' keep_open=%d\n",
|
||||||
a ? a->no : -1, a ? a->subno : -1,
|
a ? a->no : -1, a ? a->subno : -1,
|
||||||
a && a->desc ? a->desc : "?",
|
a && a->desc ? a->desc : "?",
|
||||||
intval);
|
intval);
|
||||||
@ -1521,7 +1521,7 @@ iobuf_ioctl (iobuf_t a, iobuf_ioctl_t cmd, int intval, void *ptrval)
|
|||||||
else if (cmd == IOBUF_IOCTL_INVALIDATE_CACHE)
|
else if (cmd == IOBUF_IOCTL_INVALIDATE_CACHE)
|
||||||
{
|
{
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-*.*: ioctl `%s' invalidate\n",
|
log_debug ("iobuf-*.*: ioctl '%s' invalidate\n",
|
||||||
ptrval ? (char *) ptrval : "?");
|
ptrval ? (char *) ptrval : "?");
|
||||||
if (!a && !intval && ptrval)
|
if (!a && !intval && ptrval)
|
||||||
{
|
{
|
||||||
@ -1533,7 +1533,7 @@ iobuf_ioctl (iobuf_t a, iobuf_ioctl_t cmd, int intval, void *ptrval)
|
|||||||
else if (cmd == IOBUF_IOCTL_NO_CACHE)
|
else if (cmd == IOBUF_IOCTL_NO_CACHE)
|
||||||
{
|
{
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: ioctl `%s' no_cache=%d\n",
|
log_debug ("iobuf-%d.%d: ioctl '%s' no_cache=%d\n",
|
||||||
a ? a->no : -1, a ? a->subno : -1,
|
a ? a->no : -1, a ? a->subno : -1,
|
||||||
a && a->desc? a->desc : "?",
|
a && a->desc? a->desc : "?",
|
||||||
intval);
|
intval);
|
||||||
@ -1558,7 +1558,7 @@ iobuf_ioctl (iobuf_t a, iobuf_ioctl_t cmd, int intval, void *ptrval)
|
|||||||
/* Do a fsync on the open fd and return any errors to the caller
|
/* Do a fsync on the open fd and return any errors to the caller
|
||||||
of iobuf_ioctl. Note that we work on a file name here. */
|
of iobuf_ioctl. Note that we work on a file name here. */
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-*.*: ioctl `%s' fsync\n",
|
log_debug ("iobuf-*.*: ioctl '%s' fsync\n",
|
||||||
ptrval? (const char*)ptrval:"<null>");
|
ptrval? (const char*)ptrval:"<null>");
|
||||||
|
|
||||||
if (!a && !intval && ptrval)
|
if (!a && !intval && ptrval)
|
||||||
@ -1650,7 +1650,7 @@ iobuf_push_filter2 (iobuf_t a,
|
|||||||
|
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
{
|
{
|
||||||
log_debug ("iobuf-%d.%d: push `%s'\n", a->no, a->subno,
|
log_debug ("iobuf-%d.%d: push '%s'\n", a->no, a->subno,
|
||||||
a->desc?a->desc:"?");
|
a->desc?a->desc:"?");
|
||||||
print_chain (a);
|
print_chain (a);
|
||||||
}
|
}
|
||||||
@ -1678,7 +1678,7 @@ pop_filter (iobuf_t a, int (*f) (void *opaque, int control,
|
|||||||
BUG ();
|
BUG ();
|
||||||
|
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: pop `%s'\n", a->no, a->subno,
|
log_debug ("iobuf-%d.%d: pop '%s'\n", a->no, a->subno,
|
||||||
a->desc?a->desc:"?");
|
a->desc?a->desc:"?");
|
||||||
if (!a->filter)
|
if (!a->filter)
|
||||||
{ /* this is simple */
|
{ /* this is simple */
|
||||||
@ -1765,7 +1765,7 @@ underflow (iobuf_t a)
|
|||||||
{
|
{
|
||||||
iobuf_t b = a->chain;
|
iobuf_t b = a->chain;
|
||||||
if (DBG_IOBUF)
|
if (DBG_IOBUF)
|
||||||
log_debug ("iobuf-%d.%d: pop `%s' in underflow\n",
|
log_debug ("iobuf-%d.%d: pop '%s' in underflow\n",
|
||||||
a->no, a->subno, a->desc?a->desc:"?");
|
a->no, a->subno, a->desc?a->desc:"?");
|
||||||
xfree (a->d.buf);
|
xfree (a->d.buf);
|
||||||
xfree (a->real_fname);
|
xfree (a->real_fname);
|
||||||
|
@ -339,7 +339,7 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size)
|
|||||||
{
|
{
|
||||||
if (!cookie->quiet && !running_detached
|
if (!cookie->quiet && !running_detached
|
||||||
&& isatty (es_fileno (es_stderr)))
|
&& isatty (es_fileno (es_stderr)))
|
||||||
es_fprintf (es_stderr, "can't connect to `%s': %s\n",
|
es_fprintf (es_stderr, "can't connect to '%s': %s\n",
|
||||||
cookie->name, strerror(errno));
|
cookie->name, strerror(errno));
|
||||||
sock_close (cookie->fd);
|
sock_close (cookie->fd);
|
||||||
cookie->fd = -1;
|
cookie->fd = -1;
|
||||||
@ -389,7 +389,7 @@ fun_writer (void *cookie_arg, const void *buffer, size_t size)
|
|||||||
&& isatty (es_fileno (es_stderr)))
|
&& isatty (es_fileno (es_stderr)))
|
||||||
{
|
{
|
||||||
if (*cookie->name)
|
if (*cookie->name)
|
||||||
es_fprintf (es_stderr, "error writing to `%s': %s\n",
|
es_fprintf (es_stderr, "error writing to '%s': %s\n",
|
||||||
cookie->name, strerror(errno));
|
cookie->name, strerror(errno));
|
||||||
else
|
else
|
||||||
es_fprintf (es_stderr, "error writing to file descriptor %d: %s\n",
|
es_fprintf (es_stderr, "error writing to file descriptor %d: %s\n",
|
||||||
|
@ -392,7 +392,7 @@ agent_open (int *rfd)
|
|||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
{
|
{
|
||||||
#ifdef SPWQ_USE_LOGGING
|
#ifdef SPWQ_USE_LOGGING
|
||||||
log_error ( _("can't connect to `%s': %s\n"), infostr, strerror (errno));
|
log_error ( _("can't connect to '%s': %s\n"), infostr, strerror (errno));
|
||||||
#endif
|
#endif
|
||||||
close (fd );
|
close (fd );
|
||||||
return SPWQ_IO_ERROR;
|
return SPWQ_IO_ERROR;
|
||||||
|
@ -923,8 +923,8 @@ strsep (char **stringp, const char *delim)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* A frequent case is when the delimiter string contains only one
|
/* A frequent case is when the delimiter string contains only one
|
||||||
character. Here we don't need to call the expensive `strpbrk'
|
character. Here we don't need to call the expensive 'strpbrk'
|
||||||
function and instead work using `strchr'. */
|
function and instead work using 'strchr'. */
|
||||||
if (delim[0] == '\0' || delim[1] == '\0')
|
if (delim[0] == '\0' || delim[1] == '\0')
|
||||||
{
|
{
|
||||||
char ch = delim[0];
|
char ch = delim[0];
|
||||||
|
@ -77,7 +77,7 @@ test_b64enc_file (const char *fname)
|
|||||||
fp = fname ? fopen (fname, "r") : stdin;
|
fp = fname ? fopen (fname, "r") : stdin;
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s:%d: can't open `%s': %s\n",
|
fprintf (stderr, "%s:%d: can't open '%s': %s\n",
|
||||||
__FILE__, __LINE__, fname? fname:"[stdin]", strerror (errno));
|
__FILE__, __LINE__, fname? fname:"[stdin]", strerror (errno));
|
||||||
fail (0);
|
fail (0);
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ test_b64dec_file (const char *fname)
|
|||||||
fp = fname ? fopen (fname, "r") : stdin;
|
fp = fname ? fopen (fname, "r") : stdin;
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s:%d: can't open `%s': %s\n",
|
fprintf (stderr, "%s:%d: can't open '%s': %s\n",
|
||||||
__FILE__, __LINE__, fname? fname:"[stdin]", strerror (errno));
|
__FILE__, __LINE__, fname? fname:"[stdin]", strerror (errno));
|
||||||
fail (0);
|
fail (0);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ main (int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("CERT lookup on `%s'\n", name);
|
printf ("CERT lookup on '%s'\n", name);
|
||||||
|
|
||||||
err = get_dns_cert (name, &key, &fpr, &fpr_len, &url);
|
err = get_dns_cert (name, &key, &fpr, &fpr_len, &url);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -92,7 +92,7 @@ lock_and_unlock (const char *fname)
|
|||||||
|
|
||||||
h = dotlock_create (fname, 0);
|
h = dotlock_create (fname, 0);
|
||||||
if (!h)
|
if (!h)
|
||||||
die ("error creating lock file for `%s': %s", fname, strerror (errno));
|
die ("error creating lock file for '%s': %s", fname, strerror (errno));
|
||||||
inf ("lock created");
|
inf ("lock created");
|
||||||
|
|
||||||
while (!ctrl_c_pending)
|
while (!ctrl_c_pending)
|
||||||
|
@ -67,7 +67,7 @@ test_isotime2epoch (void)
|
|||||||
{
|
{
|
||||||
fail (idx);
|
fail (idx);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf (stderr, "string `%s' exp: %ld got: %ld\n",
|
fprintf (stderr, "string '%s' exp: %ld got: %ld\n",
|
||||||
array[idx].string, (long)array[idx].expected,
|
array[idx].string, (long)array[idx].expected,
|
||||||
(long)val);
|
(long)val);
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ test_isotime2epoch (void)
|
|||||||
if (strlen (tbuf) != 15)
|
if (strlen (tbuf) != 15)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf (stderr, "string `%s', time-t %ld, revert: `%s'\n",
|
fprintf (stderr, "string '%s', time-t %ld, revert: '%s'\n",
|
||||||
array[idx].string, (long)val, tbuf);
|
array[idx].string, (long)val, tbuf);
|
||||||
fail (idx);
|
fail (idx);
|
||||||
}
|
}
|
||||||
@ -153,21 +153,21 @@ test_string2isotime (void)
|
|||||||
{
|
{
|
||||||
fail (idx);
|
fail (idx);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf (stderr, "string `%s' expected: %d, got: %d\n",
|
fprintf (stderr, "string '%s' expected: %d, got: %d\n",
|
||||||
array[idx].string, (int)array[idx].result, (int)result);
|
array[idx].string, (int)array[idx].result, (int)result);
|
||||||
}
|
}
|
||||||
else if (result && strlen (tbuf) != 15)
|
else if (result && strlen (tbuf) != 15)
|
||||||
{
|
{
|
||||||
fail (idx);
|
fail (idx);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf (stderr, "string `%s' invalid isotime returned\n",
|
fprintf (stderr, "string '%s' invalid isotime returned\n",
|
||||||
array[idx].string);
|
array[idx].string);
|
||||||
}
|
}
|
||||||
else if (result && strcmp (array[idx].expected, tbuf))
|
else if (result && strcmp (array[idx].expected, tbuf))
|
||||||
{
|
{
|
||||||
fail (idx);
|
fail (idx);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf (stderr, "string `%s' bad isotime '%s' returned\n",
|
fprintf (stderr, "string '%s' bad isotime '%s' returned\n",
|
||||||
array[idx].string, tbuf);
|
array[idx].string, tbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,12 +53,12 @@ main (int argc, char **argv)
|
|||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Error: nothing found for `%s'\n", argc?argv[0]:"(null)");
|
"Error: nothing found for '%s'\n", argc?argv[0]:"(null)");
|
||||||
errcount++;
|
errcount++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf ("key `%s' result=`%s'\n", argc?argv[0]:"(null)", result);
|
printf ("key '%s' result='%s'\n", argc?argv[0]:"(null)", result);
|
||||||
xfree (result);
|
xfree (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,14 +120,14 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
fp = fopen (fname, "rb");
|
fp = fopen (fname, "rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s:%d: can't open `%s': %s\n",
|
fprintf (stderr, "%s:%d: can't open '%s': %s\n",
|
||||||
__FILE__, __LINE__, fname, strerror (errno));
|
__FILE__, __LINE__, fname, strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fstat (fileno(fp), &st))
|
if (fstat (fileno(fp), &st))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s:%d: can't stat `%s': %s\n",
|
fprintf (stderr, "%s:%d: can't stat '%s': %s\n",
|
||||||
__FILE__, __LINE__, fname, strerror (errno));
|
__FILE__, __LINE__, fname, strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
buf = xmalloc (buflen+1);
|
buf = xmalloc (buflen+1);
|
||||||
if (fread (buf, buflen, 1, fp) != 1)
|
if (fread (buf, buflen, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s:%d: error reading `%s': %s\n",
|
fprintf (stderr, "%s:%d: error reading '%s': %s\n",
|
||||||
__FILE__, __LINE__, fname, strerror (errno));
|
__FILE__, __LINE__, fname, strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ init_ttyfp(void)
|
|||||||
#else
|
#else
|
||||||
ttyfp = batchmode? stderr : fopen (tty_get_ttyname (), "r+");
|
ttyfp = batchmode? stderr : fopen (tty_get_ttyname (), "r+");
|
||||||
if( !ttyfp ) {
|
if( !ttyfp ) {
|
||||||
log_error("cannot open `%s': %s\n", tty_get_ttyname (),
|
log_error("cannot open '%s': %s\n", tty_get_ttyname (),
|
||||||
strerror(errno) );
|
strerror(errno) );
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ load_libiconv (void)
|
|||||||
}
|
}
|
||||||
if (!handle || !iconv_close)
|
if (!handle || !iconv_close)
|
||||||
{
|
{
|
||||||
log_info (_("error loading `%s': %s\n"),
|
log_info (_("error loading '%s': %s\n"),
|
||||||
"iconv.dll", dlerror ());
|
"iconv.dll", dlerror ());
|
||||||
log_info (_("please see %s for more information\n"),
|
log_info (_("please see %s for more information\n"),
|
||||||
"http://www.gnupg.org/download/iconv.html");
|
"http://www.gnupg.org/download/iconv.html");
|
||||||
@ -136,7 +136,7 @@ handle_iconv_error (const char *to, const char *from, int use_fallback)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!x)
|
if (!x)
|
||||||
log_info (_("conversion from `%s' to `%s' not available\n"),
|
log_info (_("conversion from '%s' to '%s' not available\n"),
|
||||||
from, to);
|
from, to);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -403,7 +403,7 @@ native_to_utf8 (const char *orig_string)
|
|||||||
static int shown;
|
static int shown;
|
||||||
|
|
||||||
if (!shown)
|
if (!shown)
|
||||||
log_info (_("conversion from `%s' to `%s' failed: %s\n"),
|
log_info (_("conversion from '%s' to '%s' failed: %s\n"),
|
||||||
active_charset_name, "utf-8", strerror (errno));
|
active_charset_name, "utf-8", strerror (errno));
|
||||||
shown = 1;
|
shown = 1;
|
||||||
/* We don't do any conversion at all but use the strings as is. */
|
/* We don't do any conversion at all but use the strings as is. */
|
||||||
@ -669,7 +669,7 @@ do_utf8_to_native (const char *string, size_t length, int delim,
|
|||||||
static int shown;
|
static int shown;
|
||||||
|
|
||||||
if (!shown)
|
if (!shown)
|
||||||
log_info (_("conversion from `%s' to `%s' failed: %s\n"),
|
log_info (_("conversion from '%s' to '%s' failed: %s\n"),
|
||||||
"utf-8", active_charset_name, strerror (errno));
|
"utf-8", active_charset_name, strerror (errno));
|
||||||
shown = 1;
|
shown = 1;
|
||||||
/* Didn't worked out. Try again but without iconv. */
|
/* Didn't worked out. Try again but without iconv. */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* inclusion into Dirmngr. By Werner Koch <wk@gnupg.org> 2003-12-12.
|
* inclusion into Dirmngr. By Werner Koch <wk@gnupg.org> 2003-12-12.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* A cdb database is a single file used to map `keys' to `values',
|
/* A cdb database is a single file used to map 'keys' to 'values',
|
||||||
having records of (key,value) pairs. File consists of 3 parts: toc
|
having records of (key,value) pairs. File consists of 3 parts: toc
|
||||||
(table of contents), data and index (hash tables).
|
(table of contents), data and index (hash tables).
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ load_certs_from_dir (const char *dirname, int are_trusted)
|
|||||||
if (!dir)
|
if (!dir)
|
||||||
{
|
{
|
||||||
if (opt.system_daemon)
|
if (opt.system_daemon)
|
||||||
log_info (_("can't access directory `%s': %s\n"),
|
log_info (_("can't access directory '%s': %s\n"),
|
||||||
dirname, strerror (errno));
|
dirname, strerror (errno));
|
||||||
return 0; /* We do not consider this a severe error. */
|
return 0; /* We do not consider this a severe error. */
|
||||||
}
|
}
|
||||||
@ -368,7 +368,7 @@ load_certs_from_dir (const char *dirname, int are_trusted)
|
|||||||
fp = es_fopen (fname, "rb");
|
fp = es_fopen (fname, "rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("can't open `%s': %s\n"),
|
log_error (_("can't open '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -387,7 +387,7 @@ load_certs_from_dir (const char *dirname, int are_trusted)
|
|||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error (_("can't parse certificate `%s': %s\n"),
|
log_error (_("can't parse certificate '%s': %s\n"),
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
ksba_cert_release (cert);
|
ksba_cert_release (cert);
|
||||||
continue;
|
continue;
|
||||||
@ -395,13 +395,13 @@ load_certs_from_dir (const char *dirname, int are_trusted)
|
|||||||
|
|
||||||
err = put_cert (cert, 1, are_trusted, NULL);
|
err = put_cert (cert, 1, are_trusted, NULL);
|
||||||
if (gpg_err_code (err) == GPG_ERR_DUP_VALUE)
|
if (gpg_err_code (err) == GPG_ERR_DUP_VALUE)
|
||||||
log_info (_("certificate `%s' already cached\n"), fname);
|
log_info (_("certificate '%s' already cached\n"), fname);
|
||||||
else if (!err)
|
else if (!err)
|
||||||
{
|
{
|
||||||
if (are_trusted)
|
if (are_trusted)
|
||||||
log_info (_("trusted certificate `%s' loaded\n"), fname);
|
log_info (_("trusted certificate '%s' loaded\n"), fname);
|
||||||
else
|
else
|
||||||
log_info (_("certificate `%s' loaded\n"), fname);
|
log_info (_("certificate '%s' loaded\n"), fname);
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
{
|
{
|
||||||
p = get_fingerprint_hexstring_colon (cert);
|
p = get_fingerprint_hexstring_colon (cert);
|
||||||
@ -413,7 +413,7 @@ load_certs_from_dir (const char *dirname, int are_trusted)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_error (_("error loading certificate `%s': %s\n"),
|
log_error (_("error loading certificate '%s': %s\n"),
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
ksba_cert_release (cert);
|
ksba_cert_release (cert);
|
||||||
}
|
}
|
||||||
@ -593,7 +593,7 @@ get_cert_byhexfpr (const char *string)
|
|||||||
}
|
}
|
||||||
if (i!=20 || *s)
|
if (i!=20 || *s)
|
||||||
{
|
{
|
||||||
log_error (_("invalid SHA1 fingerprint string `%s'\n"), string);
|
log_error (_("invalid SHA1 fingerprint string '%s'\n"), string);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,11 +211,11 @@ create_directory_if_needed (const char *name)
|
|||||||
dir = opendir (fname);
|
dir = opendir (fname);
|
||||||
if (!dir)
|
if (!dir)
|
||||||
{
|
{
|
||||||
log_info (_("creating directory `%s'\n"), fname);
|
log_info (_("creating directory '%s'\n"), fname);
|
||||||
if (mkdir (fname, S_IRUSR|S_IWUSR|S_IXUSR) )
|
if (mkdir (fname, S_IRUSR|S_IWUSR|S_IXUSR) )
|
||||||
{
|
{
|
||||||
int save_errno = errno;
|
int save_errno = errno;
|
||||||
log_error (_("error creating directory `%s': %s\n"),
|
log_error (_("error creating directory '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
gpg_err_set_errno (save_errno);
|
gpg_err_set_errno (save_errno);
|
||||||
@ -243,7 +243,7 @@ cleanup_cache_dir (int force)
|
|||||||
{ /* Very minor sanity checks. */
|
{ /* Very minor sanity checks. */
|
||||||
if (!strcmp (dname, "~/") || !strcmp (dname, "/" ))
|
if (!strcmp (dname, "~/") || !strcmp (dname, "/" ))
|
||||||
{
|
{
|
||||||
log_error (_("ignoring database dir `%s'\n"), dname);
|
log_error (_("ignoring database dir '%s'\n"), dname);
|
||||||
xfree (dname);
|
xfree (dname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ cleanup_cache_dir (int force)
|
|||||||
dir = opendir (dname);
|
dir = opendir (dname);
|
||||||
if (!dir)
|
if (!dir)
|
||||||
{
|
{
|
||||||
log_error (_("error reading directory `%s': %s\n"),
|
log_error (_("error reading directory '%s': %s\n"),
|
||||||
dname, strerror (errno));
|
dname, strerror (errno));
|
||||||
xfree (dname);
|
xfree (dname);
|
||||||
return -1;
|
return -1;
|
||||||
@ -273,16 +273,16 @@ cleanup_cache_dir (int force)
|
|||||||
|
|
||||||
if (okay)
|
if (okay)
|
||||||
{
|
{
|
||||||
log_info (_("removing cache file `%s'\n"), cdbname);
|
log_info (_("removing cache file '%s'\n"), cdbname);
|
||||||
if (gnupg_remove (cdbname))
|
if (gnupg_remove (cdbname))
|
||||||
{
|
{
|
||||||
log_error ("failed to remove `%s': %s\n",
|
log_error ("failed to remove '%s': %s\n",
|
||||||
cdbname, strerror (errno));
|
cdbname, strerror (errno));
|
||||||
problem = -1;
|
problem = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_info (_("not removing file `%s'\n"), cdbname);
|
log_info (_("not removing file '%s'\n"), cdbname);
|
||||||
xfree (cdbname);
|
xfree (cdbname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -409,7 +409,7 @@ open_dir_file (const char *fname)
|
|||||||
fp = es_fopen (fname, "r");
|
fp = es_fopen (fname, "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("failed to open cache dir file `%s': %s\n"),
|
log_error (_("failed to open cache dir file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
|
|
||||||
/* Make sure that the directory exists, try to create if otherwise. */
|
/* Make sure that the directory exists, try to create if otherwise. */
|
||||||
@ -419,31 +419,31 @@ open_dir_file (const char *fname)
|
|||||||
fp = es_fopen (fname, "w");
|
fp = es_fopen (fname, "w");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("error creating new cache dir file `%s': %s\n"),
|
log_error (_("error creating new cache dir file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
es_fprintf (fp, "v:%d:\n", DBDIRVERSION);
|
es_fprintf (fp, "v:%d:\n", DBDIRVERSION);
|
||||||
if (es_ferror (fp))
|
if (es_ferror (fp))
|
||||||
{
|
{
|
||||||
log_error (_("error writing new cache dir file `%s': %s\n"),
|
log_error (_("error writing new cache dir file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (es_fclose (fp))
|
if (es_fclose (fp))
|
||||||
{
|
{
|
||||||
log_error (_("error closing new cache dir file `%s': %s\n"),
|
log_error (_("error closing new cache dir file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info (_("new cache dir file `%s' created\n"), fname);
|
log_info (_("new cache dir file '%s' created\n"), fname);
|
||||||
|
|
||||||
fp = es_fopen (fname, "r");
|
fp = es_fopen (fname, "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("failed to re-open cache dir file `%s': %s\n"),
|
log_error (_("failed to re-open cache dir file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -471,7 +471,7 @@ check_dir_version (estream_t *fpadr, const char *fname,
|
|||||||
break;
|
break;
|
||||||
else if (*line != '#')
|
else if (*line != '#')
|
||||||
{
|
{
|
||||||
log_error (_("first record of `%s' is not the version\n"), fname);
|
log_error (_("first record of '%s' is not the version\n"), fname);
|
||||||
xfree (line);
|
xfree (line);
|
||||||
return gpg_error (GPG_ERR_CONFIGURATION);
|
return gpg_error (GPG_ERR_CONFIGURATION);
|
||||||
}
|
}
|
||||||
@ -612,14 +612,14 @@ open_dir (crl_cache_t *r_cache)
|
|||||||
default:
|
default:
|
||||||
if (*p)
|
if (*p)
|
||||||
log_info (_("extra field detected in crl record of "
|
log_info (_("extra field detected in crl record of "
|
||||||
"`%s' line %u\n"), fname, lineno);
|
"'%s' line %u\n"), fname, lineno);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry->issuer_hash)
|
if (!entry->issuer_hash)
|
||||||
{
|
{
|
||||||
log_info (_("invalid line detected in `%s' line %u\n"),
|
log_info (_("invalid line detected in '%s' line %u\n"),
|
||||||
fname, lineno);
|
fname, lineno);
|
||||||
xfree (entry);
|
xfree (entry);
|
||||||
entry = NULL;
|
entry = NULL;
|
||||||
@ -628,7 +628,7 @@ open_dir (crl_cache_t *r_cache)
|
|||||||
{
|
{
|
||||||
/* Fixme: The duplicate checking used is not very
|
/* Fixme: The duplicate checking used is not very
|
||||||
effective for large numbers of issuers. */
|
effective for large numbers of issuers. */
|
||||||
log_info (_("duplicate entry detected in `%s' line %u\n"),
|
log_info (_("duplicate entry detected in '%s' line %u\n"),
|
||||||
fname, lineno);
|
fname, lineno);
|
||||||
xfree (entry);
|
xfree (entry);
|
||||||
entry = NULL;
|
entry = NULL;
|
||||||
@ -643,7 +643,7 @@ open_dir (crl_cache_t *r_cache)
|
|||||||
else if (*line == '#')
|
else if (*line == '#')
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
log_info (_("unsupported record type in `%s' line %u skipped\n"),
|
log_info (_("unsupported record type in '%s' line %u skipped\n"),
|
||||||
fname, lineno);
|
fname, lineno);
|
||||||
|
|
||||||
if (line)
|
if (line)
|
||||||
@ -652,12 +652,12 @@ open_dir (crl_cache_t *r_cache)
|
|||||||
if (lineerr)
|
if (lineerr)
|
||||||
{
|
{
|
||||||
err = lineerr;
|
err = lineerr;
|
||||||
log_error (_("error reading `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error reading '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
if (es_ferror (fp))
|
if (es_ferror (fp))
|
||||||
{
|
{
|
||||||
log_error (_("error reading `%s': %s\n"), fname, strerror (errno));
|
log_error (_("error reading '%s': %s\n"), fname, strerror (errno));
|
||||||
err = gpg_error (GPG_ERR_CONFIGURATION);
|
err = gpg_error (GPG_ERR_CONFIGURATION);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -669,26 +669,26 @@ open_dir (crl_cache_t *r_cache)
|
|||||||
if (strlen (entry->issuer_hash) != 40)
|
if (strlen (entry->issuer_hash) != 40)
|
||||||
{
|
{
|
||||||
anyerr++;
|
anyerr++;
|
||||||
log_error (_("invalid issuer hash in `%s' line %u\n"),
|
log_error (_("invalid issuer hash in '%s' line %u\n"),
|
||||||
fname, entry->lineno);
|
fname, entry->lineno);
|
||||||
}
|
}
|
||||||
else if ( !*entry->issuer )
|
else if ( !*entry->issuer )
|
||||||
{
|
{
|
||||||
anyerr++;
|
anyerr++;
|
||||||
log_error (_("no issuer DN in `%s' line %u\n"),
|
log_error (_("no issuer DN in '%s' line %u\n"),
|
||||||
fname, entry->lineno);
|
fname, entry->lineno);
|
||||||
}
|
}
|
||||||
else if ( check_isotime (entry->this_update)
|
else if ( check_isotime (entry->this_update)
|
||||||
|| check_isotime (entry->next_update))
|
|| check_isotime (entry->next_update))
|
||||||
{
|
{
|
||||||
anyerr++;
|
anyerr++;
|
||||||
log_error (_("invalid timestamp in `%s' line %u\n"),
|
log_error (_("invalid timestamp in '%s' line %u\n"),
|
||||||
fname, entry->lineno);
|
fname, entry->lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks not leading to an immediate fail. */
|
/* Checks not leading to an immediate fail. */
|
||||||
if (strlen (entry->dbfile_hash) != 32)
|
if (strlen (entry->dbfile_hash) != 32)
|
||||||
log_info (_("WARNING: invalid cache file hash in `%s' line %u\n"),
|
log_info (_("WARNING: invalid cache file hash in '%s' line %u\n"),
|
||||||
fname, entry->lineno);
|
fname, entry->lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -791,7 +791,7 @@ update_dir (crl_cache_t cache)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("failed to open cache dir file `%s': %s\n"),
|
log_error (_("failed to open cache dir file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -823,7 +823,7 @@ update_dir (crl_cache_t cache)
|
|||||||
if (!tmpbuf)
|
if (!tmpbuf)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("failed to create temporary cache dir file `%s': %s\n"),
|
log_error (_("failed to create temporary cache dir file '%s': %s\n"),
|
||||||
tmpfname, strerror (errno));
|
tmpfname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -837,7 +837,7 @@ update_dir (crl_cache_t cache)
|
|||||||
if (!fpout)
|
if (!fpout)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("failed to create temporary cache dir file `%s': %s\n"),
|
log_error (_("failed to create temporary cache dir file '%s': %s\n"),
|
||||||
tmpfname, strerror (errno));
|
tmpfname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -911,18 +911,18 @@ update_dir (crl_cache_t cache)
|
|||||||
if (lineerr)
|
if (lineerr)
|
||||||
{
|
{
|
||||||
err = lineerr;
|
err = lineerr;
|
||||||
log_error (_("error reading `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error reading '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
if (es_ferror (fp))
|
if (es_ferror (fp))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("error reading `%s': %s\n"), fname, strerror (errno));
|
log_error (_("error reading '%s': %s\n"), fname, strerror (errno));
|
||||||
}
|
}
|
||||||
if (es_ferror (fpout))
|
if (es_ferror (fpout))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("error writing `%s': %s\n"), tmpfname, strerror (errno));
|
log_error (_("error writing '%s': %s\n"), tmpfname, strerror (errno));
|
||||||
}
|
}
|
||||||
if (err)
|
if (err)
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -933,7 +933,7 @@ update_dir (crl_cache_t cache)
|
|||||||
if (es_fclose (fpout))
|
if (es_fclose (fpout))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("error closing `%s': %s\n"), tmpfname, strerror (errno));
|
log_error (_("error closing '%s': %s\n"), tmpfname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
fpout = NULL;
|
fpout = NULL;
|
||||||
@ -945,7 +945,7 @@ update_dir (crl_cache_t cache)
|
|||||||
if (rename (tmpfname, fname))
|
if (rename (tmpfname, fname))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("error renaming `%s' to `%s': %s\n"),
|
log_error (_("error renaming '%s' to '%s': %s\n"),
|
||||||
tmpfname, fname, strerror (errno));
|
tmpfname, fname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -999,7 +999,7 @@ hash_dbfile (const char *fname, unsigned char *md5buffer)
|
|||||||
fp = buffer? es_fopen (fname, "rb") : NULL;
|
fp = buffer? es_fopen (fname, "rb") : NULL;
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("can't hash `%s': %s\n"), fname, strerror (errno));
|
log_error (_("can't hash '%s': %s\n"), fname, strerror (errno));
|
||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1023,7 +1023,7 @@ hash_dbfile (const char *fname, unsigned char *md5buffer)
|
|||||||
n = es_fread (buffer, 1, 65536, fp);
|
n = es_fread (buffer, 1, 65536, fp);
|
||||||
if (n < 65536 && es_ferror (fp))
|
if (n < 65536 && es_ferror (fp))
|
||||||
{
|
{
|
||||||
log_error (_("error hashing `%s': %s\n"), fname, strerror (errno));
|
log_error (_("error hashing '%s': %s\n"), fname, strerror (errno));
|
||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
gcry_md_close (md5);
|
gcry_md_close (md5);
|
||||||
@ -1051,7 +1051,7 @@ check_dbfile (const char *fname, const char *md5hexvalue)
|
|||||||
|
|
||||||
if (strlen (md5hexvalue) != 32)
|
if (strlen (md5hexvalue) != 32)
|
||||||
{
|
{
|
||||||
log_error (_("invalid formatted checksum for `%s'\n"), fname);
|
log_error (_("invalid formatted checksum for '%s'\n"), fname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
unhexify (buffer1, md5hexvalue);
|
unhexify (buffer1, md5hexvalue);
|
||||||
@ -1122,7 +1122,7 @@ lock_db_file (crl_cache_t cache, crl_cache_entry_t entry)
|
|||||||
|
|
||||||
fname = make_db_file_name (entry->issuer_hash);
|
fname = make_db_file_name (entry->issuer_hash);
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("opening cache file `%s'\n"), fname );
|
log_info (_("opening cache file '%s'\n"), fname );
|
||||||
|
|
||||||
if (!entry->dbfile_checked)
|
if (!entry->dbfile_checked)
|
||||||
{
|
{
|
||||||
@ -1141,7 +1141,7 @@ lock_db_file (crl_cache_t cache, crl_cache_entry_t entry)
|
|||||||
fd = open (fname, O_RDONLY);
|
fd = open (fname, O_RDONLY);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
log_error (_("error opening cache file `%s': %s\n"),
|
log_error (_("error opening cache file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
xfree (entry->cdb);
|
xfree (entry->cdb);
|
||||||
entry->cdb = NULL;
|
entry->cdb = NULL;
|
||||||
@ -1150,7 +1150,7 @@ lock_db_file (crl_cache_t cache, crl_cache_entry_t entry)
|
|||||||
}
|
}
|
||||||
if (cdb_init (entry->cdb, fd))
|
if (cdb_init (entry->cdb, fd))
|
||||||
{
|
{
|
||||||
log_error (_("error initializing cache file `%s' for reading: %s\n"),
|
log_error (_("error initializing cache file '%s' for reading: %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
xfree (entry->cdb);
|
xfree (entry->cdb);
|
||||||
entry->cdb = NULL;
|
entry->cdb = NULL;
|
||||||
@ -1536,7 +1536,7 @@ start_sig_check (ksba_crl_t crl, gcry_md_hd_t *md, int *algo)
|
|||||||
*algo = gcry_md_map_name (algoid);
|
*algo = gcry_md_map_name (algoid);
|
||||||
if (!*algo)
|
if (!*algo)
|
||||||
{
|
{
|
||||||
log_error (_("unknown hash algorithm `%s'\n"), algoid? algoid:"?");
|
log_error (_("unknown hash algorithm '%s'\n"), algoid? algoid:"?");
|
||||||
return gpg_error (GPG_ERR_DIGEST_ALGO);
|
return gpg_error (GPG_ERR_DIGEST_ALGO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2035,11 +2035,11 @@ crl_cache_insert (ctrl_t ctrl, const char *url, ksba_reader_t reader)
|
|||||||
fname = make_filename (opt.homedir_cache, DBDIR_D, tmpfname, NULL);
|
fname = make_filename (opt.homedir_cache, DBDIR_D, tmpfname, NULL);
|
||||||
xfree (tmpfname);
|
xfree (tmpfname);
|
||||||
if (!gnupg_remove (fname))
|
if (!gnupg_remove (fname))
|
||||||
log_info (_("removed stale temporary cache file `%s'\n"), fname);
|
log_info (_("removed stale temporary cache file '%s'\n"), fname);
|
||||||
else if (errno != ENOENT)
|
else if (errno != ENOENT)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("problem removing stale temporary cache file `%s': %s\n"),
|
log_error (_("problem removing stale temporary cache file '%s': %s\n"),
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -2049,7 +2049,7 @@ crl_cache_insert (ctrl_t ctrl, const char *url, ksba_reader_t reader)
|
|||||||
if (fd_cdb == -1)
|
if (fd_cdb == -1)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("error creating temporary cache file `%s': %s\n"),
|
log_error (_("error creating temporary cache file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -2069,14 +2069,14 @@ crl_cache_insert (ctrl_t ctrl, const char *url, ksba_reader_t reader)
|
|||||||
if (cdb_make_finish (&cdb))
|
if (cdb_make_finish (&cdb))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("error finishing temporary cache file `%s': %s\n"),
|
log_error (_("error finishing temporary cache file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
if (close (fd_cdb))
|
if (close (fd_cdb))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("error closing temporary cache file `%s': %s\n"),
|
log_error (_("error closing temporary cache file '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -2182,7 +2182,7 @@ crl_cache_insert (ctrl_t ctrl, const char *url, ksba_reader_t reader)
|
|||||||
/* Rename the temporary DB to the real name. */
|
/* Rename the temporary DB to the real name. */
|
||||||
newfname = make_db_file_name (entry->issuer_hash);
|
newfname = make_db_file_name (entry->issuer_hash);
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("creating cache file `%s'\n"), newfname);
|
log_info (_("creating cache file '%s'\n"), newfname);
|
||||||
|
|
||||||
/* Just in case close unused matching files. Actually we need this
|
/* Just in case close unused matching files. Actually we need this
|
||||||
only under Windows but saving file descriptors is never bad. */
|
only under Windows but saving file descriptors is never bad. */
|
||||||
@ -2214,7 +2214,7 @@ crl_cache_insert (ctrl_t ctrl, const char *url, ksba_reader_t reader)
|
|||||||
if (rename (fname, newfname))
|
if (rename (fname, newfname))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("problem renaming `%s' to `%s': %s\n"),
|
log_error (_("problem renaming '%s' to '%s': %s\n"),
|
||||||
fname, newfname, gpg_strerror (err));
|
fname, newfname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -2408,7 +2408,7 @@ crl_cache_load (ctrl_t ctrl, const char *filename)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error (_("can't open `%s': %s\n"), filename, strerror (errno));
|
log_error (_("can't open '%s': %s\n"), filename, strerror (errno));
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2488,7 +2488,7 @@ crl_cache_reload_crl (ctrl_t ctrl, ksba_cert_t cert)
|
|||||||
any_dist_point = 1;
|
any_dist_point = 1;
|
||||||
|
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info ("fetching CRL from `%s'\n", distpoint_uri);
|
log_info ("fetching CRL from '%s'\n", distpoint_uri);
|
||||||
err = crl_fetch (ctrl, distpoint_uri, &reader);
|
err = crl_fetch (ctrl, distpoint_uri, &reader);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
|
@ -242,7 +242,7 @@ crl_fetch (ctrl_t ctrl, const char *url, ksba_reader_t *reader)
|
|||||||
{
|
{
|
||||||
const char *s = http_get_header (hd, "Location");
|
const char *s = http_get_header (hd, "Location");
|
||||||
|
|
||||||
log_info (_("URL `%s' redirected to `%s' (%u)\n"),
|
log_info (_("URL '%s' redirected to '%s' (%u)\n"),
|
||||||
url, s?s:"[none]", http_get_status_code (hd));
|
url, s?s:"[none]", http_get_status_code (hd));
|
||||||
if (s && *s && redirects_left-- )
|
if (s && *s && redirects_left-- )
|
||||||
{
|
{
|
||||||
@ -267,12 +267,12 @@ crl_fetch (ctrl_t ctrl, const char *url, ksba_reader_t *reader)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 99999: /* Made up status code for error reporting. */
|
case 99999: /* Made up status code for error reporting. */
|
||||||
log_error (_("error retrieving `%s': %s\n"),
|
log_error (_("error retrieving '%s': %s\n"),
|
||||||
url, gpg_strerror (err));
|
url, gpg_strerror (err));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_error (_("error retrieving `%s': http status %u\n"),
|
log_error (_("error retrieving '%s': http status %u\n"),
|
||||||
url, http_get_status_code (hd));
|
url, http_get_status_code (hd));
|
||||||
err = gpg_error (GPG_ERR_NO_DATA);
|
err = gpg_error (GPG_ERR_NO_DATA);
|
||||||
http_close (hd, 0);
|
http_close (hd, 0);
|
||||||
|
@ -272,7 +272,7 @@ main (int argc, char **argv )
|
|||||||
{
|
{
|
||||||
err = read_certificate (*argv, &certbuf, &certbuflen);
|
err = read_certificate (*argv, &certbuf, &certbuflen);
|
||||||
if (err)
|
if (err)
|
||||||
log_error (_("error reading certificate from `%s': %s\n"),
|
log_error (_("error reading certificate from '%s': %s\n"),
|
||||||
*argv, gpg_strerror (err));
|
*argv, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -327,7 +327,7 @@ main (int argc, char **argv )
|
|||||||
err = do_loadcrl (ctx, *argv);
|
err = do_loadcrl (ctx, *argv);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error (_("loading CRL `%s' failed: %s\n"),
|
log_error (_("loading CRL '%s' failed: %s\n"),
|
||||||
*argv, gpg_strerror (err));
|
*argv, gpg_strerror (err));
|
||||||
last_err = err;
|
last_err = err;
|
||||||
}
|
}
|
||||||
@ -408,7 +408,7 @@ status_cb (void *opaque, const char *line)
|
|||||||
(void)opaque;
|
(void)opaque;
|
||||||
|
|
||||||
if (opt.verbose > 2)
|
if (opt.verbose > 2)
|
||||||
log_info (_("got status: `%s'\n"), line);
|
log_info (_("got status: '%s'\n"), line);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -791,7 +791,7 @@ inq_cert (void *opaque, const char *line)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_info (_("unsupported inquiry `%s'\n"), line);
|
log_info (_("unsupported inquiry '%s'\n"), line);
|
||||||
err = gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
|
err = gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
|
||||||
/* Note that this error will let assuan_transact terminate
|
/* Note that this error will let assuan_transact terminate
|
||||||
immediately instead of return the error to the caller. It is
|
immediately instead of return the error to the caller. It is
|
||||||
@ -884,7 +884,7 @@ do_loadcrl (assuan_context_t ctx, const char *filename)
|
|||||||
fname = canonicalize_file_name (filename);
|
fname = canonicalize_file_name (filename);
|
||||||
if (!fname)
|
if (!fname)
|
||||||
{
|
{
|
||||||
log_error ("error canonicalizing `%s': %s\n",
|
log_error ("error canonicalizing '%s': %s\n",
|
||||||
filename, strerror (errno));
|
filename, strerror (errno));
|
||||||
return gpg_error (GPG_ERR_GENERAL);
|
return gpg_error (GPG_ERR_GENERAL);
|
||||||
}
|
}
|
||||||
@ -938,7 +938,7 @@ do_lookup (assuan_context_t ctx, const char *pattern)
|
|||||||
struct b64state state;
|
struct b64state state;
|
||||||
|
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("looking up `%s'\n"), pattern);
|
log_info (_("looking up '%s'\n"), pattern);
|
||||||
|
|
||||||
err = b64enc_start (&state, stdout, NULL);
|
err = b64enc_start (&state, stdout, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -363,7 +363,7 @@ set_debug (void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("invalid debug-level `%s' given\n"), debug_level);
|
log_error (_("invalid debug-level '%s' given\n"), debug_level);
|
||||||
log_info (_("valid debug levels are: %s\n"),
|
log_info (_("valid debug levels are: %s\n"),
|
||||||
"none, basic, advanced, expert, guru");
|
"none, basic, advanced, expert, guru");
|
||||||
opt.debug = 0; /* Reset debugging, so that prior debug
|
opt.debug = 0; /* Reset debugging, so that prior debug
|
||||||
@ -736,12 +736,12 @@ main (int argc, char **argv)
|
|||||||
if (default_config)
|
if (default_config)
|
||||||
{
|
{
|
||||||
if( parse_debug )
|
if( parse_debug )
|
||||||
log_info (_("NOTE: no default option file `%s'\n"),
|
log_info (_("NOTE: no default option file '%s'\n"),
|
||||||
configname );
|
configname );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("option file `%s': %s\n"),
|
log_error (_("option file '%s': %s\n"),
|
||||||
configname, strerror(errno) );
|
configname, strerror(errno) );
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
@ -749,7 +749,7 @@ main (int argc, char **argv)
|
|||||||
configname = NULL;
|
configname = NULL;
|
||||||
}
|
}
|
||||||
if (parse_debug && configname )
|
if (parse_debug && configname )
|
||||||
log_info (_("reading options from `%s'\n"), configname );
|
log_info (_("reading options from '%s'\n"), configname );
|
||||||
default_config = 0;
|
default_config = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -854,7 +854,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
for (i=0; i < argc; i++)
|
for (i=0; i < argc; i++)
|
||||||
if (argv[i][0] == '-' && argv[i][1] == '-')
|
if (argv[i][0] == '-' && argv[i][1] == '-')
|
||||||
log_info (_("NOTE: `%s' is not considered an option\n"), argv[i]);
|
log_info (_("NOTE: '%s' is not considered an option\n"), argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!access ("/etc/dirmngr", F_OK) && !strncmp (opt.homedir, "/etc/", 5))
|
if (!access ("/etc/dirmngr", F_OK) && !strncmp (opt.homedir, "/etc/", 5))
|
||||||
@ -862,7 +862,7 @@ main (int argc, char **argv)
|
|||||||
("NOTE: DirMngr is now a proper part of GnuPG. The configuration and"
|
("NOTE: DirMngr is now a proper part of GnuPG. The configuration and"
|
||||||
" other directory names changed. Please check that no other version"
|
" other directory names changed. Please check that no other version"
|
||||||
" of dirmngr is still installed. To disable this warning, remove the"
|
" of dirmngr is still installed. To disable this warning, remove the"
|
||||||
" directory `/etc/dirmngr'.\n");
|
" directory '/etc/dirmngr'.\n");
|
||||||
|
|
||||||
if (gnupg_faked_time_p ())
|
if (gnupg_faked_time_p ())
|
||||||
{
|
{
|
||||||
@ -993,7 +993,7 @@ main (int argc, char **argv)
|
|||||||
log_error (_("error getting nonce for the socket\n"));
|
log_error (_("error getting nonce for the socket\n"));
|
||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
{
|
{
|
||||||
log_error (_("error binding socket to `%s': %s\n"),
|
log_error (_("error binding socket to '%s': %s\n"),
|
||||||
serv_addr.sun_path, gpg_strerror (gpg_error_from_errno (errno)));
|
serv_addr.sun_path, gpg_strerror (gpg_error_from_errno (errno)));
|
||||||
assuan_sock_close (fd);
|
assuan_sock_close (fd);
|
||||||
dirmngr_exit (1);
|
dirmngr_exit (1);
|
||||||
@ -1008,7 +1008,7 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("listening on socket `%s'\n"), socket_name );
|
log_info (_("listening on socket '%s'\n"), socket_name );
|
||||||
|
|
||||||
es_fflush (NULL);
|
es_fflush (NULL);
|
||||||
|
|
||||||
@ -1159,13 +1159,13 @@ main (int argc, char **argv)
|
|||||||
crl_cache_init ();
|
crl_cache_init ();
|
||||||
rc = crl_fetch (&ctrlbuf, argv[0], &reader);
|
rc = crl_fetch (&ctrlbuf, argv[0], &reader);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error (_("fetching CRL from `%s' failed: %s\n"),
|
log_error (_("fetching CRL from '%s' failed: %s\n"),
|
||||||
argv[0], gpg_strerror (rc));
|
argv[0], gpg_strerror (rc));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rc = crl_cache_insert (&ctrlbuf, argv[0], reader);
|
rc = crl_cache_insert (&ctrlbuf, argv[0], reader);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error (_("processing CRL from `%s' failed: %s\n"),
|
log_error (_("processing CRL from '%s' failed: %s\n"),
|
||||||
argv[0], gpg_strerror (rc));
|
argv[0], gpg_strerror (rc));
|
||||||
crl_close_reader (reader);
|
crl_close_reader (reader);
|
||||||
}
|
}
|
||||||
@ -1369,7 +1369,7 @@ parse_ldapserver_file (const char* filename)
|
|||||||
fp = es_fopen (filename, "r");
|
fp = es_fopen (filename, "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("error opening `%s': %s\n"), filename, strerror (errno));
|
log_error (_("error opening '%s': %s\n"), filename, strerror (errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1407,7 +1407,7 @@ parse_ldapserver_file (const char* filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (es_ferror (fp))
|
if (es_ferror (fp))
|
||||||
log_error (_("error reading `%s': %s\n"), filename, strerror (errno));
|
log_error (_("error reading '%s': %s\n"), filename, strerror (errno));
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
|
|
||||||
return serverstart;
|
return serverstart;
|
||||||
@ -1461,7 +1461,7 @@ parse_ocsp_signer (const char *string)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("can't open '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1567,7 +1567,7 @@ reread_configuration (void)
|
|||||||
fp = fopen (opt.config_filename, "r");
|
fp = fopen (opt.config_filename, "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("option file `%s': %s\n"),
|
log_error (_("option file '%s': %s\n"),
|
||||||
opt.config_filename, strerror(errno) );
|
opt.config_filename, strerror(errno) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
|
|||||||
char *attr;
|
char *attr;
|
||||||
|
|
||||||
if (myopt->verbose > 1)
|
if (myopt->verbose > 1)
|
||||||
log_info (_("scanning result for attribute `%s'\n"),
|
log_info (_("scanning result for attribute '%s'\n"),
|
||||||
want_attr? want_attr : "[all]");
|
want_attr? want_attr : "[all]");
|
||||||
|
|
||||||
if (myopt->multi)
|
if (myopt->multi)
|
||||||
@ -425,7 +425,7 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
|
|||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
if (myopt->verbose > 1)
|
if (myopt->verbose > 1)
|
||||||
log_info (_(" available attribute `%s'\n"), attr);
|
log_info (_(" available attribute '%s'\n"), attr);
|
||||||
|
|
||||||
set_timeout (myopt);
|
set_timeout (myopt);
|
||||||
|
|
||||||
@ -463,14 +463,14 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
|
|||||||
if (!values)
|
if (!values)
|
||||||
{
|
{
|
||||||
if (myopt->verbose)
|
if (myopt->verbose)
|
||||||
log_info (_("attribute `%s' not found\n"), attr);
|
log_info (_("attribute '%s' not found\n"), attr);
|
||||||
my_ldap_free_attr (attr);
|
my_ldap_free_attr (attr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myopt->verbose)
|
if (myopt->verbose)
|
||||||
{
|
{
|
||||||
log_info (_("found attribute `%s'\n"), attr);
|
log_info (_("found attribute '%s'\n"), attr);
|
||||||
if (myopt->verbose > 1)
|
if (myopt->verbose > 1)
|
||||||
for (idx=0; values[idx]; idx++)
|
for (idx=0; values[idx]; idx++)
|
||||||
log_info (" length[%d]=%d\n",
|
log_info (" length[%d]=%d\n",
|
||||||
@ -579,37 +579,37 @@ fetch_ldap (my_opt_t myopt, const char *url, const LDAPURLDesc *ludp)
|
|||||||
|
|
||||||
if (myopt->verbose)
|
if (myopt->verbose)
|
||||||
{
|
{
|
||||||
log_info (_("processing url `%s'\n"), url);
|
log_info (_("processing url '%s'\n"), url);
|
||||||
if (myopt->user)
|
if (myopt->user)
|
||||||
log_info (_(" user `%s'\n"), myopt->user);
|
log_info (_(" user '%s'\n"), myopt->user);
|
||||||
if (myopt->pass)
|
if (myopt->pass)
|
||||||
log_info (_(" pass `%s'\n"), *myopt->pass?"*****":"");
|
log_info (_(" pass '%s'\n"), *myopt->pass?"*****":"");
|
||||||
if (host)
|
if (host)
|
||||||
log_info (_(" host `%s'\n"), host);
|
log_info (_(" host '%s'\n"), host);
|
||||||
log_info (_(" port %d\n"), port);
|
log_info (_(" port %d\n"), port);
|
||||||
if (dn)
|
if (dn)
|
||||||
log_info (_(" DN `%s'\n"), dn);
|
log_info (_(" DN '%s'\n"), dn);
|
||||||
if (filter)
|
if (filter)
|
||||||
log_info (_(" filter `%s'\n"), filter);
|
log_info (_(" filter '%s'\n"), filter);
|
||||||
if (myopt->multi && !myopt->attr && ludp->lud_attrs)
|
if (myopt->multi && !myopt->attr && ludp->lud_attrs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=0; ludp->lud_attrs[i]; i++)
|
for (i=0; ludp->lud_attrs[i]; i++)
|
||||||
log_info (_(" attr `%s'\n"), ludp->lud_attrs[i]);
|
log_info (_(" attr '%s'\n"), ludp->lud_attrs[i]);
|
||||||
}
|
}
|
||||||
else if (attr)
|
else if (attr)
|
||||||
log_info (_(" attr `%s'\n"), attr);
|
log_info (_(" attr '%s'\n"), attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!host || !*host)
|
if (!host || !*host)
|
||||||
{
|
{
|
||||||
log_error (_("no host name in `%s'\n"), url);
|
log_error (_("no host name in '%s'\n"), url);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!myopt->multi && !attr)
|
if (!myopt->multi && !attr)
|
||||||
{
|
{
|
||||||
log_error (_("no attribute given for query `%s'\n"), url);
|
log_error (_("no attribute given for query '%s'\n"), url);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,7 +624,7 @@ fetch_ldap (my_opt_t myopt, const char *url, const LDAPURLDesc *ludp)
|
|||||||
npth_protect ();
|
npth_protect ();
|
||||||
if (!ld)
|
if (!ld)
|
||||||
{
|
{
|
||||||
log_error (_("LDAP init to `%s:%d' failed: %s\n"),
|
log_error (_("LDAP init to '%s:%d' failed: %s\n"),
|
||||||
host, port, strerror (errno));
|
host, port, strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -634,7 +634,7 @@ fetch_ldap (my_opt_t myopt, const char *url, const LDAPURLDesc *ludp)
|
|||||||
npth_protect ();
|
npth_protect ();
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
log_error (_("binding to `%s:%d' failed: %s\n"),
|
log_error (_("binding to '%s:%d' failed: %s\n"),
|
||||||
host, port, strerror (errno));
|
host, port, strerror (errno));
|
||||||
ldap_unbind (ld);
|
ldap_unbind (ld);
|
||||||
return -1;
|
return -1;
|
||||||
@ -659,9 +659,9 @@ fetch_ldap (my_opt_t myopt, const char *url, const LDAPURLDesc *ludp)
|
|||||||
else if (rc)
|
else if (rc)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_W32CE_SYSTEM
|
#ifdef HAVE_W32CE_SYSTEM
|
||||||
log_error ("searching `%s' failed: %d\n", url, rc);
|
log_error ("searching '%s' failed: %d\n", url, rc);
|
||||||
#else
|
#else
|
||||||
log_error (_("searching `%s' failed: %s\n"),
|
log_error (_("searching '%s' failed: %s\n"),
|
||||||
url, ldap_err2string (rc));
|
url, ldap_err2string (rc));
|
||||||
#endif
|
#endif
|
||||||
if (rc != LDAP_NO_SUCH_OBJECT)
|
if (rc != LDAP_NO_SUCH_OBJECT)
|
||||||
@ -693,13 +693,13 @@ process_url (my_opt_t myopt, const char *url)
|
|||||||
|
|
||||||
if (!ldap_is_ldap_url (url))
|
if (!ldap_is_ldap_url (url))
|
||||||
{
|
{
|
||||||
log_error (_("`%s' is not an LDAP URL\n"), url);
|
log_error (_("'%s' is not an LDAP URL\n"), url);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ldap_url_parse (url, &ludp))
|
if (ldap_url_parse (url, &ludp))
|
||||||
{
|
{
|
||||||
log_error (_("`%s' is an invalid LDAP URL\n"), url);
|
log_error (_("'%s' is an invalid LDAP URL\n"), url);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ w32_rootdir (void)
|
|||||||
*p = 0;
|
*p = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_debug ("bad filename `%s' returned for this process\n", dir);
|
log_debug ("bad filename '%s' returned for this process\n", dir);
|
||||||
*dir = 0;
|
*dir = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,11 +242,11 @@ map_host (const char *name)
|
|||||||
if ((ec=getnameinfo (ai->ai_addr, ai->ai_addrlen,
|
if ((ec=getnameinfo (ai->ai_addr, ai->ai_addrlen,
|
||||||
tmphost, sizeof tmphost,
|
tmphost, sizeof tmphost,
|
||||||
NULL, 0, NI_NAMEREQD)))
|
NULL, 0, NI_NAMEREQD)))
|
||||||
log_info ("getnameinfo failed while checking `%s': %s\n",
|
log_info ("getnameinfo failed while checking '%s': %s\n",
|
||||||
name, gai_strerror (ec));
|
name, gai_strerror (ec));
|
||||||
else if (refidx+1 >= reftblsize)
|
else if (refidx+1 >= reftblsize)
|
||||||
{
|
{
|
||||||
log_error ("getnameinfo returned for `%s': `%s'"
|
log_error ("getnameinfo returned for '%s': '%s'"
|
||||||
" [index table full - ignored]\n", name, tmphost);
|
" [index table full - ignored]\n", name, tmphost);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -254,7 +254,7 @@ map_host (const char *name)
|
|||||||
|
|
||||||
if ((tmpidx = find_hostinfo (tmphost)) != -1)
|
if ((tmpidx = find_hostinfo (tmphost)) != -1)
|
||||||
{
|
{
|
||||||
log_info ("getnameinfo returned for `%s': `%s'"
|
log_info ("getnameinfo returned for '%s': '%s'"
|
||||||
" [already known]\n", name, tmphost);
|
" [already known]\n", name, tmphost);
|
||||||
if (ai->ai_family == AF_INET)
|
if (ai->ai_family == AF_INET)
|
||||||
hosttable[tmpidx]->v4 = 1;
|
hosttable[tmpidx]->v4 = 1;
|
||||||
@ -269,12 +269,12 @@ map_host (const char *name)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_info ("getnameinfo returned for `%s': `%s'\n",
|
log_info ("getnameinfo returned for '%s': '%s'\n",
|
||||||
name, tmphost);
|
name, tmphost);
|
||||||
/* Create a new entry. */
|
/* Create a new entry. */
|
||||||
tmpidx = create_new_hostinfo (tmphost);
|
tmpidx = create_new_hostinfo (tmphost);
|
||||||
if (tmpidx == -1)
|
if (tmpidx == -1)
|
||||||
log_error ("map_host for `%s' problem: %s - `%s'"
|
log_error ("map_host for '%s' problem: %s - '%s'"
|
||||||
" [ignored]\n",
|
" [ignored]\n",
|
||||||
name, strerror (errno), tmphost);
|
name, strerror (errno), tmphost);
|
||||||
else
|
else
|
||||||
@ -326,7 +326,7 @@ map_host (const char *name)
|
|||||||
hi->poolidx = select_random_host (hi->pool);
|
hi->poolidx = select_random_host (hi->pool);
|
||||||
if (hi->poolidx == -1)
|
if (hi->poolidx == -1)
|
||||||
{
|
{
|
||||||
log_error ("no alive host found in pool `%s'\n", name);
|
log_error ("no alive host found in pool '%s'\n", name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ map_host (const char *name)
|
|||||||
|
|
||||||
if (hi->dead)
|
if (hi->dead)
|
||||||
{
|
{
|
||||||
log_error ("host `%s' marked as dead\n", hi->name);
|
log_error ("host '%s' marked as dead\n", hi->name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ mark_host_dead (const char *name)
|
|||||||
if (idx == -1)
|
if (idx == -1)
|
||||||
return;
|
return;
|
||||||
hi = hosttable[idx];
|
hi = hosttable[idx];
|
||||||
log_info ("marking host `%s' as dead%s\n", hi->name, hi->dead? " (again)":"");
|
log_info ("marking host '%s' as dead%s\n", hi->name, hi->dead? " (again)":"");
|
||||||
hi->dead = 1;
|
hi->dead = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
|
|||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
/* Fixme: After a redirection we show the old host name. */
|
/* Fixme: After a redirection we show the old host name. */
|
||||||
log_error (_("error connecting to `%s': %s\n"),
|
log_error (_("error connecting to '%s': %s\n"),
|
||||||
hostportstr, gpg_strerror (err));
|
hostportstr, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -512,7 +512,7 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
|
|||||||
err = http_wait_response (http);
|
err = http_wait_response (http);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error (_("error reading HTTP response for `%s': %s\n"),
|
log_error (_("error reading HTTP response for '%s': %s\n"),
|
||||||
hostportstr, gpg_strerror (err));
|
hostportstr, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -528,7 +528,7 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
|
|||||||
{
|
{
|
||||||
const char *s = http_get_header (http, "Location");
|
const char *s = http_get_header (http, "Location");
|
||||||
|
|
||||||
log_info (_("URL `%s' redirected to `%s' (%u)\n"),
|
log_info (_("URL '%s' redirected to '%s' (%u)\n"),
|
||||||
request, s?s:"[none]", http_get_status_code (http));
|
request, s?s:"[none]", http_get_status_code (http));
|
||||||
if (s && *s && redirects_left-- )
|
if (s && *s && redirects_left-- )
|
||||||
{
|
{
|
||||||
@ -550,7 +550,7 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
|
|||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_error (_("error accessing `%s': http status %u\n"),
|
log_error (_("error accessing '%s': http status %u\n"),
|
||||||
request, http_get_status_code (http));
|
request, http_get_status_code (http));
|
||||||
err = gpg_error (GPG_ERR_NO_DATA);
|
err = gpg_error (GPG_ERR_NO_DATA);
|
||||||
goto leave;
|
goto leave;
|
||||||
|
@ -88,7 +88,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
/* Fixme: After a redirection we show the old host name. */
|
/* Fixme: After a redirection we show the old host name. */
|
||||||
log_error (_("error connecting to `%s': %s\n"),
|
log_error (_("error connecting to '%s': %s\n"),
|
||||||
url, gpg_strerror (err));
|
url, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||||||
err = http_wait_response (http);
|
err = http_wait_response (http);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error (_("error reading HTTP response for `%s': %s\n"),
|
log_error (_("error reading HTTP response for '%s': %s\n"),
|
||||||
url, gpg_strerror (err));
|
url, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||||||
{
|
{
|
||||||
const char *s = http_get_header (http, "Location");
|
const char *s = http_get_header (http, "Location");
|
||||||
|
|
||||||
log_info (_("URL `%s' redirected to `%s' (%u)\n"),
|
log_info (_("URL '%s' redirected to '%s' (%u)\n"),
|
||||||
url, s?s:"[none]", http_get_status_code (http));
|
url, s?s:"[none]", http_get_status_code (http));
|
||||||
if (s && *s && redirects_left-- )
|
if (s && *s && redirects_left-- )
|
||||||
{
|
{
|
||||||
@ -136,7 +136,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_error (_("error accessing `%s': http status %u\n"),
|
log_error (_("error accessing '%s': http status %u\n"),
|
||||||
url, http_get_status_code (http));
|
url, http_get_status_code (http));
|
||||||
err = gpg_error (GPG_ERR_NO_DATA);
|
err = gpg_error (GPG_ERR_NO_DATA);
|
||||||
goto leave;
|
goto leave;
|
||||||
|
@ -49,7 +49,7 @@ Redistribution and use in source and binary forms, with or without
|
|||||||
modification, are permitted provided that this notice is preserved.
|
modification, are permitted provided that this notice is preserved.
|
||||||
The names of the copyright holders may not be used to endorse or
|
The names of the copyright holders may not be used to endorse or
|
||||||
promote products derived from this software without their specific
|
promote products derived from this software without their specific
|
||||||
prior written permission. This software is provided ``as is''
|
prior written permission. This software is provided `'as is''
|
||||||
without express or implied warranty.
|
without express or implied warranty.
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -62,7 +62,7 @@ provided that this notice is preserved and that due credit is given
|
|||||||
to the University of Michigan at Ann Arbor. The name of the
|
to the University of Michigan at Ann Arbor. The name of the
|
||||||
University may not be used to endorse or promote products derived
|
University may not be used to endorse or promote products derived
|
||||||
from this software without specific prior written permission. This
|
from this software without specific prior written permission. This
|
||||||
software is provided ``as is'' without express or implied warranty. */
|
software is provided `'as is'' without express or implied warranty. */
|
||||||
|
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -91,7 +91,7 @@ add_server_to_servers (const char *host, int port)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info (_("adding `%s:%d' to the ldap server list\n"), host, port);
|
log_info (_("adding '%s:%d' to the ldap server list\n"), host, port);
|
||||||
server = xtrycalloc (1, sizeof *s);
|
server = xtrycalloc (1, sizeof *s);
|
||||||
if (!server)
|
if (!server)
|
||||||
log_error (_("malloc failed: %s\n"), strerror (errno));
|
log_error (_("malloc failed: %s\n"), strerror (errno));
|
||||||
@ -599,7 +599,7 @@ start_cert_fetch_ldap (ctrl_t ctrl, cert_fetch_context_t *context,
|
|||||||
sl = parse_one_pattern (patterns->d);
|
sl = parse_one_pattern (patterns->d);
|
||||||
if (!sl)
|
if (!sl)
|
||||||
{
|
{
|
||||||
log_error (_("start_cert_fetch: invalid pattern `%s'\n"),
|
log_error (_("start_cert_fetch: invalid pattern '%s'\n"),
|
||||||
patterns->d);
|
patterns->d);
|
||||||
/* fixme: cleanup argv. */
|
/* fixme: cleanup argv. */
|
||||||
return gpg_error (GPG_ERR_INV_USER_ID);
|
return gpg_error (GPG_ERR_INV_USER_ID);
|
||||||
@ -764,28 +764,28 @@ fetch_next_cert_ldap (cert_fetch_context_t context,
|
|||||||
if (!ascii_strcasecmp (p, USERCERTIFICATE))
|
if (!ascii_strcasecmp (p, USERCERTIFICATE))
|
||||||
{
|
{
|
||||||
if (DBG_LOOKUP)
|
if (DBG_LOOKUP)
|
||||||
log_debug ("fetch_next_cert_ldap: got attribute `%s'\n",
|
log_debug ("fetch_next_cert_ldap: got attribute '%s'\n",
|
||||||
USERCERTIFICATE);
|
USERCERTIFICATE);
|
||||||
okay = 1;
|
okay = 1;
|
||||||
}
|
}
|
||||||
else if (!ascii_strcasecmp (p, CACERTIFICATE))
|
else if (!ascii_strcasecmp (p, CACERTIFICATE))
|
||||||
{
|
{
|
||||||
if (DBG_LOOKUP)
|
if (DBG_LOOKUP)
|
||||||
log_debug ("fetch_next_cert_ldap: got attribute `%s'\n",
|
log_debug ("fetch_next_cert_ldap: got attribute '%s'\n",
|
||||||
CACERTIFICATE);
|
CACERTIFICATE);
|
||||||
okay = 1;
|
okay = 1;
|
||||||
}
|
}
|
||||||
else if (!ascii_strcasecmp (p, X509CACERT))
|
else if (!ascii_strcasecmp (p, X509CACERT))
|
||||||
{
|
{
|
||||||
if (DBG_LOOKUP)
|
if (DBG_LOOKUP)
|
||||||
log_debug ("fetch_next_cert_ldap: got attribute `%s'\n",
|
log_debug ("fetch_next_cert_ldap: got attribute '%s'\n",
|
||||||
CACERTIFICATE);
|
CACERTIFICATE);
|
||||||
okay = 1;
|
okay = 1;
|
||||||
}
|
}
|
||||||
/* else if (!ascii_strcasecmp (p, USERSMIMECERTIFICATE)) */
|
/* else if (!ascii_strcasecmp (p, USERSMIMECERTIFICATE)) */
|
||||||
/* { */
|
/* { */
|
||||||
/* if (DBG_LOOKUP) */
|
/* if (DBG_LOOKUP) */
|
||||||
/* log_debug ("fetch_next_cert_ldap: got attribute `%s'\n", */
|
/* log_debug ("fetch_next_cert_ldap: got attribute '%s'\n", */
|
||||||
/* USERSMIMECERTIFICATE); */
|
/* USERSMIMECERTIFICATE); */
|
||||||
/* okay = 1; */
|
/* okay = 1; */
|
||||||
/* is_cms = 1; */
|
/* is_cms = 1; */
|
||||||
@ -793,7 +793,7 @@ fetch_next_cert_ldap (cert_fetch_context_t context,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (DBG_LOOKUP)
|
if (DBG_LOOKUP)
|
||||||
log_debug ("fetch_next_cert_ldap: got attribute `%s'"
|
log_debug ("fetch_next_cert_ldap: got attribute '%s'"
|
||||||
" - ignored\n", p);
|
" - ignored\n", p);
|
||||||
okay = 0;
|
okay = 0;
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ dump_cert (const char *text, ksba_cert_t cert)
|
|||||||
char *p;
|
char *p;
|
||||||
ksba_isotime_t t;
|
ksba_isotime_t t;
|
||||||
|
|
||||||
log_debug ("BEGIN Certificate `%s':\n", text? text:"");
|
log_debug ("BEGIN Certificate '%s':\n", text? text:"");
|
||||||
if (cert)
|
if (cert)
|
||||||
{
|
{
|
||||||
sexp = ksba_cert_get_serial (cert);
|
sexp = ksba_cert_get_serial (cert);
|
||||||
|
@ -170,7 +170,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
opt.http_proxy, NULL, NULL, NULL);
|
opt.http_proxy, NULL, NULL, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error (_("error connecting to `%s': %s\n"), url, gpg_strerror (err));
|
log_error (_("error connecting to '%s': %s\n"), url, gpg_strerror (err));
|
||||||
xfree (free_this);
|
xfree (free_this);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
if (es_fwrite (request, requestlen, 1, http_get_write_ptr (http)) != 1)
|
if (es_fwrite (request, requestlen, 1, http_get_write_ptr (http)) != 1)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_errno (errno);
|
err = gpg_error_from_errno (errno);
|
||||||
log_error ("error sending request to `%s': %s\n", url, strerror (errno));
|
log_error ("error sending request to '%s': %s\n", url, strerror (errno));
|
||||||
http_close (http, 0);
|
http_close (http, 0);
|
||||||
xfree (request);
|
xfree (request);
|
||||||
xfree (free_this);
|
xfree (free_this);
|
||||||
@ -196,7 +196,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
if (err || http_get_status_code (http) != 200)
|
if (err || http_get_status_code (http) != 200)
|
||||||
{
|
{
|
||||||
if (err)
|
if (err)
|
||||||
log_error (_("error reading HTTP response for `%s': %s\n"),
|
log_error (_("error reading HTTP response for '%s': %s\n"),
|
||||||
url, gpg_strerror (err));
|
url, gpg_strerror (err));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -207,7 +207,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
{
|
{
|
||||||
const char *s = http_get_header (http, "Location");
|
const char *s = http_get_header (http, "Location");
|
||||||
|
|
||||||
log_info (_("URL `%s' redirected to `%s' (%u)\n"),
|
log_info (_("URL '%s' redirected to '%s' (%u)\n"),
|
||||||
url, s?s:"[none]", http_get_status_code (http));
|
url, s?s:"[none]", http_get_status_code (http));
|
||||||
if (s && *s && redirects_left-- )
|
if (s && *s && redirects_left-- )
|
||||||
{
|
{
|
||||||
@ -229,7 +229,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_error (_("error accessing `%s': http status %u\n"),
|
log_error (_("error accessing '%s': http status %u\n"),
|
||||||
url, http_get_status_code (http));
|
url, http_get_status_code (http));
|
||||||
err = gpg_error (GPG_ERR_NO_DATA);
|
err = gpg_error (GPG_ERR_NO_DATA);
|
||||||
break;
|
break;
|
||||||
@ -244,7 +244,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
http_close (http, 0);
|
http_close (http, 0);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error (_("error reading HTTP response for `%s': %s\n"),
|
log_error (_("error reading HTTP response for '%s': %s\n"),
|
||||||
url, gpg_strerror (err));
|
url, gpg_strerror (err));
|
||||||
xfree (free_this);
|
xfree (free_this);
|
||||||
return err;
|
return err;
|
||||||
@ -254,7 +254,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
&response_status);
|
&response_status);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error (_("error parsing OCSP response for `%s': %s\n"),
|
log_error (_("error parsing OCSP response for '%s': %s\n"),
|
||||||
url, gpg_strerror (err));
|
url, gpg_strerror (err));
|
||||||
xfree (response);
|
xfree (response);
|
||||||
xfree (free_this);
|
xfree (free_this);
|
||||||
@ -277,17 +277,17 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||||||
if (response_status == KSBA_OCSP_RSPSTATUS_SUCCESS)
|
if (response_status == KSBA_OCSP_RSPSTATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("OCSP responder at `%s' status: %s\n"), url, t);
|
log_info (_("OCSP responder at '%s' status: %s\n"), url, t);
|
||||||
|
|
||||||
err = ksba_ocsp_hash_response (ocsp, response, responselen,
|
err = ksba_ocsp_hash_response (ocsp, response, responselen,
|
||||||
HASH_FNC, md);
|
HASH_FNC, md);
|
||||||
if (err)
|
if (err)
|
||||||
log_error (_("hashing the OCSP response for `%s' failed: %s\n"),
|
log_error (_("hashing the OCSP response for '%s' failed: %s\n"),
|
||||||
url, gpg_strerror (err));
|
url, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("OCSP responder at `%s' status: %s\n"), url, t);
|
log_error (_("OCSP responder at '%s' status: %s\n"), url, t);
|
||||||
err = gpg_error (GPG_ERR_GENERAL);
|
err = gpg_error (GPG_ERR_GENERAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,7 +481,7 @@ check_signature (ctrl_t ctrl,
|
|||||||
{
|
{
|
||||||
log_error ("responder certificate ");
|
log_error ("responder certificate ");
|
||||||
if (name)
|
if (name)
|
||||||
log_printf ("`/%s' ", name);
|
log_printf ("'/%s' ", name);
|
||||||
if (keyid)
|
if (keyid)
|
||||||
{
|
{
|
||||||
log_printf ("{");
|
log_printf ("{");
|
||||||
@ -627,12 +627,12 @@ ocsp_isvalid (ctrl_t ctrl, ksba_cert_t cert, const char *cert_fpr,
|
|||||||
url = opt.ocsp_responder;
|
url = opt.ocsp_responder;
|
||||||
default_signer = opt.ocsp_signer;
|
default_signer = opt.ocsp_signer;
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("using default OCSP responder `%s'\n"), url);
|
log_info (_("using default OCSP responder '%s'\n"), url);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("using OCSP responder `%s'\n"), url);
|
log_info (_("using OCSP responder '%s'\n"), url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ask the OCSP responder. */
|
/* Ask the OCSP responder. */
|
||||||
|
@ -1183,13 +1183,13 @@ cmd_loadcrl (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
err = crl_fetch (ctrl, line, &reader);
|
err = crl_fetch (ctrl, line, &reader);
|
||||||
if (err)
|
if (err)
|
||||||
log_error (_("fetching CRL from `%s' failed: %s\n"),
|
log_error (_("fetching CRL from '%s' failed: %s\n"),
|
||||||
line, gpg_strerror (err));
|
line, gpg_strerror (err));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = crl_cache_insert (ctrl, line, reader);
|
err = crl_cache_insert (ctrl, line, reader);
|
||||||
if (err)
|
if (err)
|
||||||
log_error (_("processing CRL from `%s' failed: %s\n"),
|
log_error (_("processing CRL from '%s' failed: %s\n"),
|
||||||
line, gpg_strerror (err));
|
line, gpg_strerror (err));
|
||||||
crl_close_reader (reader);
|
crl_close_reader (reader);
|
||||||
}
|
}
|
||||||
|
@ -879,7 +879,7 @@ check_cert_sig (ksba_cert_t issuer_cert, ksba_cert_t cert)
|
|||||||
algo = gcry_md_map_name (algoid);
|
algo = gcry_md_map_name (algoid);
|
||||||
if (!algo)
|
if (!algo)
|
||||||
{
|
{
|
||||||
log_error (_("unknown hash algorithm `%s'\n"), algoid? algoid:"?");
|
log_error (_("unknown hash algorithm '%s'\n"), algoid? algoid:"?");
|
||||||
return gpg_error (GPG_ERR_GENERAL);
|
return gpg_error (GPG_ERR_GENERAL);
|
||||||
}
|
}
|
||||||
s = gcry_md_algo_name (algo);
|
s = gcry_md_algo_name (algo);
|
||||||
|
18
doc/yat2m.c
18
doc/yat2m.c
@ -414,7 +414,7 @@ static void
|
|||||||
start_page (char *name)
|
start_page (char *name)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
inf ("starting page `%s'", name);
|
inf ("starting page '%s'", name);
|
||||||
assert (!thepage.name);
|
assert (!thepage.name);
|
||||||
thepage.name = xstrdup (name);
|
thepage.name = xstrdup (name);
|
||||||
thepage.n_sections = 0;
|
thepage.n_sections = 0;
|
||||||
@ -434,7 +434,7 @@ write_th (FILE *fp)
|
|||||||
p = strrchr (name, '.');
|
p = strrchr (name, '.');
|
||||||
if (!p || !p[1])
|
if (!p || !p[1])
|
||||||
{
|
{
|
||||||
err ("no section name in man page `%s'", thepage.name);
|
err ("no section name in man page '%s'", thepage.name);
|
||||||
free (name);
|
free (name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -591,7 +591,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
|
|||||||
ignore_args = 1; /* Parameterized macros are not yet supported. */
|
ignore_args = 1; /* Parameterized macros are not yet supported. */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
inf ("texinfo command `%s' not supported (%.*s)", command,
|
inf ("texinfo command '%s' not supported (%.*s)", command,
|
||||||
((s = memchr (rest, '\n', len)), (s? (s-rest) : len)), rest);
|
((s = memchr (rest, '\n', len)), (s? (s-rest) : len)), rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,7 +605,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
|
|||||||
i--;
|
i--;
|
||||||
if (i)
|
if (i)
|
||||||
{
|
{
|
||||||
err ("closing brace for command `%s' not found", command);
|
err ("closing brace for command '%s' not found", command);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
if (n > 2 && !ignore_args)
|
if (n > 2 && !ignore_args)
|
||||||
@ -780,13 +780,13 @@ finish_page (void)
|
|||||||
return; /* No page active. */
|
return; /* No page active. */
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
inf ("finishing page `%s'", thepage.name);
|
inf ("finishing page '%s'", thepage.name);
|
||||||
|
|
||||||
if (opt_select)
|
if (opt_select)
|
||||||
{
|
{
|
||||||
if (!strcmp (opt_select, thepage.name))
|
if (!strcmp (opt_select, thepage.name))
|
||||||
{
|
{
|
||||||
inf ("selected `%s'", thepage.name );
|
inf ("selected '%s'", thepage.name );
|
||||||
fp = stdout;
|
fp = stdout;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -798,10 +798,10 @@ finish_page (void)
|
|||||||
}
|
}
|
||||||
else if (opt_store)
|
else if (opt_store)
|
||||||
{
|
{
|
||||||
inf ("writing `%s'", thepage.name );
|
inf ("writing '%s'", thepage.name );
|
||||||
fp = fopen ( thepage.name, "w" );
|
fp = fopen ( thepage.name, "w" );
|
||||||
if (!fp)
|
if (!fp)
|
||||||
die ("failed to create `%s': %s\n", thepage.name, strerror (errno));
|
die ("failed to create '%s': %s\n", thepage.name, strerror (errno));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fp = stdout;
|
fp = stdout;
|
||||||
@ -1162,7 +1162,7 @@ parse_file (const char *fname, FILE *fp, char **section_name, int in_pause)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!incfp)
|
if (!incfp)
|
||||||
err ("can't open include file `%s':%s",
|
err ("can't open include file '%s':%s",
|
||||||
incname, strerror (errno));
|
incname, strerror (errno));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -318,7 +318,7 @@ default_inq_cb (void *opaque, const char *line)
|
|||||||
/* We do not pass errors to avoid breaking other code. */
|
/* We do not pass errors to avoid breaking other code. */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_debug ("ignoring gpg-agent inquiry `%s'\n", line);
|
log_debug ("ignoring gpg-agent inquiry '%s'\n", line);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -794,7 +794,7 @@ get_data_from_file (const char *fname, size_t maxlen, char **r_buffer)
|
|||||||
#endif
|
#endif
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
tty_printf (_("can't open `%s': %s\n"), fname, strerror (errno));
|
tty_printf (_("can't open '%s': %s\n"), fname, strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -813,7 +813,7 @@ get_data_from_file (const char *fname, size_t maxlen, char **r_buffer)
|
|||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
{
|
{
|
||||||
tty_printf (_("error reading `%s': %s\n"), fname, strerror (errno));
|
tty_printf (_("error reading '%s': %s\n"), fname, strerror (errno));
|
||||||
xfree (data);
|
xfree (data);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -840,13 +840,13 @@ put_data_to_file (const char *fname, const void *buffer, size_t length)
|
|||||||
#endif
|
#endif
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
tty_printf (_("can't create `%s': %s\n"), fname, strerror (errno));
|
tty_printf (_("can't create '%s': %s\n"), fname, strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length && es_fwrite (buffer, length, 1, fp) != 1)
|
if (length && es_fwrite (buffer, length, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
tty_printf (_("error writing `%s': %s\n"), fname, strerror (errno));
|
tty_printf (_("error writing '%s': %s\n"), fname, strerror (errno));
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1403,7 +1403,7 @@ generate_card_keys (ctrl_t ctrl)
|
|||||||
{
|
{
|
||||||
tty_printf ("\n");
|
tty_printf ("\n");
|
||||||
tty_printf (_("Please note that the factory settings of the PINs are\n"
|
tty_printf (_("Please note that the factory settings of the PINs are\n"
|
||||||
" PIN = `%s' Admin PIN = `%s'\n"
|
" PIN = '%s' Admin PIN = '%s'\n"
|
||||||
"You should change them using the command --change-pin\n"),
|
"You should change them using the command --change-pin\n"),
|
||||||
"123456", "12345678");
|
"123456", "12345678");
|
||||||
tty_printf ("\n");
|
tty_printf ("\n");
|
||||||
|
@ -57,7 +57,7 @@ dearmor_file( const char *fname )
|
|||||||
}
|
}
|
||||||
if (!inp) {
|
if (!inp) {
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s': %s\n"), fname? fname: "[stdin]",
|
log_error(_("can't open '%s': %s\n"), fname? fname: "[stdin]",
|
||||||
strerror(errno) );
|
strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ enarmor_file( const char *fname )
|
|||||||
}
|
}
|
||||||
if (!inp) {
|
if (!inp) {
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s': %s\n"), fname? fname: "[stdin]",
|
log_error(_("can't open '%s': %s\n"), fname? fname: "[stdin]",
|
||||||
strerror(errno) );
|
strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ decrypt_message (ctrl_t ctrl, const char *filename)
|
|||||||
if ( !fp )
|
if ( !fp )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"), print_fname_stdin(filename),
|
log_error (_("can't open '%s': %s\n"), print_fname_stdin(filename),
|
||||||
gpg_strerror (rc));
|
gpg_strerror (rc));
|
||||||
release_progress_context (pfx);
|
release_progress_context (pfx);
|
||||||
return rc;
|
return rc;
|
||||||
@ -126,7 +126,7 @@ decrypt_message_fd (ctrl_t ctrl, int input_fd, int output_fd)
|
|||||||
|
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
snprintf (xname, sizeof xname, "[fd %d]", input_fd);
|
snprintf (xname, sizeof xname, "[fd %d]", input_fd);
|
||||||
log_error (_("can't open `%s': %s\n"), xname, gpg_strerror (err));
|
log_error (_("can't open '%s': %s\n"), xname, gpg_strerror (err));
|
||||||
release_progress_context (pfx);
|
release_progress_context (pfx);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ decrypt_message_fd (ctrl_t ctrl, int input_fd, int output_fd)
|
|||||||
|
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
snprintf (xname, sizeof xname, "[fd %d]", output_fd);
|
snprintf (xname, sizeof xname, "[fd %d]", output_fd);
|
||||||
log_error (_("can't open `%s': %s\n"), xname, gpg_strerror (err));
|
log_error (_("can't open '%s': %s\n"), xname, gpg_strerror (err));
|
||||||
iobuf_close (fp);
|
iobuf_close (fp);
|
||||||
release_progress_context (pfx);
|
release_progress_context (pfx);
|
||||||
return err;
|
return err;
|
||||||
@ -237,7 +237,7 @@ decrypt_messages (ctrl_t ctrl, int nfiles, char *files[])
|
|||||||
}
|
}
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error(_("can't open `%s'\n"), print_fname_stdin(filename));
|
log_error(_("can't open '%s'\n"), print_fname_stdin(filename));
|
||||||
goto next_file;
|
goto next_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ encrypt_simple (const char *filename, int mode, int use_seskey)
|
|||||||
if (!inp)
|
if (!inp)
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s': %s\n"), filename? filename: "[stdin]",
|
log_error(_("can't open '%s': %s\n"), filename? filename: "[stdin]",
|
||||||
strerror(errno) );
|
strerror(errno) );
|
||||||
release_progress_context (pfx);
|
release_progress_context (pfx);
|
||||||
return rc;
|
return rc;
|
||||||
@ -260,7 +260,7 @@ encrypt_simple (const char *filename, int mode, int use_seskey)
|
|||||||
&& is_file_compressed(filename, &rc))
|
&& is_file_compressed(filename, &rc))
|
||||||
{
|
{
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info(_("`%s' already compressed\n"), filename);
|
log_info(_("'%s' already compressed\n"), filename);
|
||||||
do_compress = 0;
|
do_compress = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ encrypt_simple (const char *filename, int mode, int use_seskey)
|
|||||||
|
|
||||||
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
||||||
&& !overflow && opt.verbose)
|
&& !overflow && opt.verbose)
|
||||||
log_info(_("WARNING: `%s' is an empty file\n"), filename );
|
log_info(_("WARNING: '%s' is an empty file\n"), filename );
|
||||||
/* We can't encode the length of very large files because
|
/* We can't encode the length of very large files because
|
||||||
OpenPGP uses only 32 bit for file sizes. So if the the
|
OpenPGP uses only 32 bit for file sizes. So if the the
|
||||||
size of a file is larger than 2^32 minus some bytes for
|
size of a file is larger than 2^32 minus some bytes for
|
||||||
@ -544,13 +544,13 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
|
|||||||
strcpy (xname, "[stdin]");
|
strcpy (xname, "[stdin]");
|
||||||
else
|
else
|
||||||
*xname = 0;
|
*xname = 0;
|
||||||
log_error (_("can't open `%s': %s\n"),
|
log_error (_("can't open '%s': %s\n"),
|
||||||
*xname? xname : filename, gpg_strerror (rc) );
|
*xname? xname : filename, gpg_strerror (rc) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("reading from `%s'\n"), iobuf_get_fname_nonnull (inp));
|
log_info (_("reading from '%s'\n"), iobuf_get_fname_nonnull (inp));
|
||||||
|
|
||||||
handle_progress (pfx, inp, filename);
|
handle_progress (pfx, inp, filename);
|
||||||
|
|
||||||
@ -624,7 +624,7 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
|
|||||||
if (do_compress && cfx.dek->use_mdc && is_file_compressed(filename, &rc2))
|
if (do_compress && cfx.dek->use_mdc && is_file_compressed(filename, &rc2))
|
||||||
{
|
{
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info(_("`%s' already compressed\n"), filename);
|
log_info(_("'%s' already compressed\n"), filename);
|
||||||
do_compress = 0;
|
do_compress = 0;
|
||||||
}
|
}
|
||||||
if (rc2)
|
if (rc2)
|
||||||
@ -659,7 +659,7 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
|
|||||||
|
|
||||||
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
||||||
&& !overflow && opt.verbose)
|
&& !overflow && opt.verbose)
|
||||||
log_info(_("WARNING: `%s' is an empty file\n"), filename );
|
log_info(_("WARNING: '%s' is an empty file\n"), filename );
|
||||||
/* We can't encode the length of very large files because
|
/* We can't encode the length of very large files because
|
||||||
OpenPGP uses only 32 bit for file sizes. So if the the size
|
OpenPGP uses only 32 bit for file sizes. So if the the size
|
||||||
of a file is larger than 2^32 minus some bytes for packet
|
of a file is larger than 2^32 minus some bytes for packet
|
||||||
@ -965,7 +965,7 @@ encrypt_crypt_files (ctrl_t ctrl, int nfiles, char **files, strlist_t remusr)
|
|||||||
print_file_status(STATUS_FILE_START, line, 2);
|
print_file_status(STATUS_FILE_START, line, 2);
|
||||||
rc = encrypt_crypt (ctrl, -1, line, remusr, 0, NULL, -1);
|
rc = encrypt_crypt (ctrl, -1, line, remusr, 0, NULL, -1);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("encryption of `%s' failed: %s\n",
|
log_error ("encryption of '%s' failed: %s\n",
|
||||||
print_fname_stdin(line), g10_errstr(rc) );
|
print_fname_stdin(line), g10_errstr(rc) );
|
||||||
write_status( STATUS_FILE_DONE );
|
write_status( STATUS_FILE_DONE );
|
||||||
}
|
}
|
||||||
@ -976,7 +976,7 @@ encrypt_crypt_files (ctrl_t ctrl, int nfiles, char **files, strlist_t remusr)
|
|||||||
{
|
{
|
||||||
print_file_status(STATUS_FILE_START, *files, 2);
|
print_file_status(STATUS_FILE_START, *files, 2);
|
||||||
if ( (rc = encrypt_crypt (ctrl, -1, *files, remusr, 0, NULL, -1)) )
|
if ( (rc = encrypt_crypt (ctrl, -1, *files, remusr, 0, NULL, -1)) )
|
||||||
log_error("encryption of `%s' failed: %s\n",
|
log_error("encryption of '%s' failed: %s\n",
|
||||||
print_fname_stdin(*files), g10_errstr(rc) );
|
print_fname_stdin(*files), g10_errstr(rc) );
|
||||||
write_status( STATUS_FILE_DONE );
|
write_status( STATUS_FILE_DONE );
|
||||||
files++;
|
files++;
|
||||||
|
16
g10/exec.c
16
g10/exec.c
@ -193,7 +193,7 @@ make_tempdir(struct exec_info *info)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(mkdtemp(info->tempdir)==NULL)
|
if(mkdtemp(info->tempdir)==NULL)
|
||||||
log_error(_("can't create directory `%s': %s\n"),
|
log_error(_("can't create directory '%s': %s\n"),
|
||||||
info->tempdir,strerror(errno));
|
info->tempdir,strerror(errno));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -421,10 +421,10 @@ exec_write(struct exec_info **info,const char *program,
|
|||||||
/* If we get this far the exec failed. Clean up and return. */
|
/* If we get this far the exec failed. Clean up and return. */
|
||||||
|
|
||||||
if(args_in==NULL)
|
if(args_in==NULL)
|
||||||
log_error(_("unable to execute program `%s': %s\n"),
|
log_error(_("unable to execute program '%s': %s\n"),
|
||||||
program,strerror(errno));
|
program,strerror(errno));
|
||||||
else
|
else
|
||||||
log_error(_("unable to execute shell `%s': %s\n"),
|
log_error(_("unable to execute shell '%s': %s\n"),
|
||||||
shell,strerror(errno));
|
shell,strerror(errno));
|
||||||
|
|
||||||
/* This mimics the POSIX sh behavior - 127 means "not found"
|
/* This mimics the POSIX sh behavior - 127 means "not found"
|
||||||
@ -465,7 +465,7 @@ exec_write(struct exec_info **info,const char *program,
|
|||||||
#endif /* !EXEC_TEMPFILE_ONLY */
|
#endif /* !EXEC_TEMPFILE_ONLY */
|
||||||
|
|
||||||
if(DBG_EXTPROG)
|
if(DBG_EXTPROG)
|
||||||
log_debug("using temp file `%s'\n",(*info)->tempfile_in);
|
log_debug("using temp file '%s'\n",(*info)->tempfile_in);
|
||||||
|
|
||||||
/* It's not fork/exec/pipe, so create a temp file */
|
/* It's not fork/exec/pipe, so create a temp file */
|
||||||
if( is_secured_filename ((*info)->tempfile_in) )
|
if( is_secured_filename ((*info)->tempfile_in) )
|
||||||
@ -478,7 +478,7 @@ exec_write(struct exec_info **info,const char *program,
|
|||||||
if((*info)->tochild==NULL)
|
if((*info)->tochild==NULL)
|
||||||
{
|
{
|
||||||
ret = gpg_error_from_syserror ();
|
ret = gpg_error_from_syserror ();
|
||||||
log_error(_("can't create `%s': %s\n"),
|
log_error(_("can't create '%s': %s\n"),
|
||||||
(*info)->tempfile_in,strerror(errno));
|
(*info)->tempfile_in,strerror(errno));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -604,19 +604,19 @@ exec_finish(struct exec_info *info)
|
|||||||
if(info->tempfile_in)
|
if(info->tempfile_in)
|
||||||
{
|
{
|
||||||
if(unlink(info->tempfile_in)==-1)
|
if(unlink(info->tempfile_in)==-1)
|
||||||
log_info(_("WARNING: unable to remove tempfile (%s) `%s': %s\n"),
|
log_info(_("WARNING: unable to remove tempfile (%s) '%s': %s\n"),
|
||||||
"in",info->tempfile_in,strerror(errno));
|
"in",info->tempfile_in,strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(info->tempfile_out)
|
if(info->tempfile_out)
|
||||||
{
|
{
|
||||||
if(unlink(info->tempfile_out)==-1)
|
if(unlink(info->tempfile_out)==-1)
|
||||||
log_info(_("WARNING: unable to remove tempfile (%s) `%s': %s\n"),
|
log_info(_("WARNING: unable to remove tempfile (%s) '%s': %s\n"),
|
||||||
"out",info->tempfile_out,strerror(errno));
|
"out",info->tempfile_out,strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rmdir(info->tempdir)==-1)
|
if(rmdir(info->tempdir)==-1)
|
||||||
log_info(_("WARNING: unable to remove temp directory `%s': %s\n"),
|
log_info(_("WARNING: unable to remove temp directory '%s': %s\n"),
|
||||||
info->tempdir,strerror(errno));
|
info->tempdir,strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,7 +586,7 @@ transfer_format_to_openpgp (gcry_sexp_t s_pgp, PKT_public_key *pk)
|
|||||||
curveoidstr = gpg_curve_to_oid (curvename, NULL);
|
curveoidstr = gpg_curve_to_oid (curvename, NULL);
|
||||||
if (!curveoidstr)
|
if (!curveoidstr)
|
||||||
{
|
{
|
||||||
log_error ("no OID known for curve `%s'\n", curvename);
|
log_error ("no OID known for curve '%s'\n", curvename);
|
||||||
err = gpg_error (GPG_ERR_UNKNOWN_NAME);
|
err = gpg_error (GPG_ERR_UNKNOWN_NAME);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
@ -872,12 +872,12 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk,
|
|||||||
if (!rc)
|
if (!rc)
|
||||||
{
|
{
|
||||||
/* Key found. */
|
/* Key found. */
|
||||||
log_info (_("automatically retrieved `%s' via %s\n"),
|
log_info (_("automatically retrieved '%s' via %s\n"),
|
||||||
name, mechanism);
|
name, mechanism);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (rc != G10ERR_NO_PUBKEY || opt.verbose || no_fingerprint)
|
if (rc != G10ERR_NO_PUBKEY || opt.verbose || no_fingerprint)
|
||||||
log_info (_("error retrieving `%s' via %s: %s\n"),
|
log_info (_("error retrieving '%s' via %s: %s\n"),
|
||||||
name, mechanism,
|
name, mechanism,
|
||||||
no_fingerprint ? _("No fingerprint") : g10_errstr (rc));
|
no_fingerprint ? _("No fingerprint") : g10_errstr (rc));
|
||||||
}
|
}
|
||||||
|
72
g10/gpg.c
72
g10/gpg.c
@ -1012,7 +1012,7 @@ set_debug (const char *level)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("invalid debug-level `%s' given\n"), level);
|
log_error (_("invalid debug-level '%s' given\n"), level);
|
||||||
g10_exit (2);
|
g10_exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1127,8 +1127,8 @@ open_info_file (const char *fname, int for_write, int binary)
|
|||||||
while (fd == -1 && errno == EINTR);
|
while (fd == -1 && errno == EINTR);
|
||||||
/* } */
|
/* } */
|
||||||
if ( fd == -1)
|
if ( fd == -1)
|
||||||
log_error ( for_write? _("can't create `%s': %s\n")
|
log_error ( for_write? _("can't create '%s': %s\n")
|
||||||
: _("can't open `%s': %s\n"), fname, strerror(errno));
|
: _("can't open '%s': %s\n"), fname, strerror(errno));
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
#endif
|
#endif
|
||||||
@ -1181,7 +1181,7 @@ add_group(char *string)
|
|||||||
name=strsep(&string,"=");
|
name=strsep(&string,"=");
|
||||||
if(string==NULL)
|
if(string==NULL)
|
||||||
{
|
{
|
||||||
log_error(_("no = sign found in group definition `%s'\n"),name);
|
log_error(_("no = sign found in group definition '%s'\n"),name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1379,49 +1379,49 @@ check_permissions (const char *path, int item)
|
|||||||
{
|
{
|
||||||
if(item==0)
|
if(item==0)
|
||||||
log_info(_("WARNING: unsafe ownership on"
|
log_info(_("WARNING: unsafe ownership on"
|
||||||
" homedir `%s'\n"),tmppath);
|
" homedir '%s'\n"),tmppath);
|
||||||
else if(item==1)
|
else if(item==1)
|
||||||
log_info(_("WARNING: unsafe ownership on"
|
log_info(_("WARNING: unsafe ownership on"
|
||||||
" configuration file `%s'\n"),tmppath);
|
" configuration file '%s'\n"),tmppath);
|
||||||
else
|
else
|
||||||
log_info(_("WARNING: unsafe ownership on"
|
log_info(_("WARNING: unsafe ownership on"
|
||||||
" extension `%s'\n"),tmppath);
|
" extension '%s'\n"),tmppath);
|
||||||
}
|
}
|
||||||
if(perm)
|
if(perm)
|
||||||
{
|
{
|
||||||
if(item==0)
|
if(item==0)
|
||||||
log_info(_("WARNING: unsafe permissions on"
|
log_info(_("WARNING: unsafe permissions on"
|
||||||
" homedir `%s'\n"),tmppath);
|
" homedir '%s'\n"),tmppath);
|
||||||
else if(item==1)
|
else if(item==1)
|
||||||
log_info(_("WARNING: unsafe permissions on"
|
log_info(_("WARNING: unsafe permissions on"
|
||||||
" configuration file `%s'\n"),tmppath);
|
" configuration file '%s'\n"),tmppath);
|
||||||
else
|
else
|
||||||
log_info(_("WARNING: unsafe permissions on"
|
log_info(_("WARNING: unsafe permissions on"
|
||||||
" extension `%s'\n"),tmppath);
|
" extension '%s'\n"),tmppath);
|
||||||
}
|
}
|
||||||
if(enc_dir_own)
|
if(enc_dir_own)
|
||||||
{
|
{
|
||||||
if(item==0)
|
if(item==0)
|
||||||
log_info(_("WARNING: unsafe enclosing directory ownership on"
|
log_info(_("WARNING: unsafe enclosing directory ownership on"
|
||||||
" homedir `%s'\n"),tmppath);
|
" homedir '%s'\n"),tmppath);
|
||||||
else if(item==1)
|
else if(item==1)
|
||||||
log_info(_("WARNING: unsafe enclosing directory ownership on"
|
log_info(_("WARNING: unsafe enclosing directory ownership on"
|
||||||
" configuration file `%s'\n"),tmppath);
|
" configuration file '%s'\n"),tmppath);
|
||||||
else
|
else
|
||||||
log_info(_("WARNING: unsafe enclosing directory ownership on"
|
log_info(_("WARNING: unsafe enclosing directory ownership on"
|
||||||
" extension `%s'\n"),tmppath);
|
" extension '%s'\n"),tmppath);
|
||||||
}
|
}
|
||||||
if(enc_dir_perm)
|
if(enc_dir_perm)
|
||||||
{
|
{
|
||||||
if(item==0)
|
if(item==0)
|
||||||
log_info(_("WARNING: unsafe enclosing directory permissions on"
|
log_info(_("WARNING: unsafe enclosing directory permissions on"
|
||||||
" homedir `%s'\n"),tmppath);
|
" homedir '%s'\n"),tmppath);
|
||||||
else if(item==1)
|
else if(item==1)
|
||||||
log_info(_("WARNING: unsafe enclosing directory permissions on"
|
log_info(_("WARNING: unsafe enclosing directory permissions on"
|
||||||
" configuration file `%s'\n"),tmppath);
|
" configuration file '%s'\n"),tmppath);
|
||||||
else
|
else
|
||||||
log_info(_("WARNING: unsafe enclosing directory permissions on"
|
log_info(_("WARNING: unsafe enclosing directory permissions on"
|
||||||
" extension `%s'\n"),tmppath);
|
" extension '%s'\n"),tmppath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1603,7 +1603,7 @@ list_config(char *items)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if(!any)
|
if(!any)
|
||||||
log_error(_("unknown configuration item `%s'\n"),name);
|
log_error(_("unknown configuration item '%s'\n"),name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1805,7 +1805,7 @@ parse_trust_model(const char *model)
|
|||||||
else if(ascii_strcasecmp(model,"auto")==0)
|
else if(ascii_strcasecmp(model,"auto")==0)
|
||||||
opt.trust_model=TM_AUTO;
|
opt.trust_model=TM_AUTO;
|
||||||
else
|
else
|
||||||
log_error("unknown trust model `%s'\n",model);
|
log_error("unknown trust model '%s'\n",model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1865,7 +1865,7 @@ get_default_configname (void)
|
|||||||
/* Print a warning when both config files are present. */
|
/* Print a warning when both config files are present. */
|
||||||
char *p = make_filename (opt.homedir, "options", NULL);
|
char *p = make_filename (opt.homedir, "options", NULL);
|
||||||
if (! access (p, R_OK))
|
if (! access (p, R_OK))
|
||||||
log_info (_("NOTE: old default options file `%s' ignored\n"), p);
|
log_info (_("NOTE: old default options file '%s' ignored\n"), p);
|
||||||
xfree (p);
|
xfree (p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2123,18 +2123,18 @@ main (int argc, char **argv)
|
|||||||
if( !configfp ) {
|
if( !configfp ) {
|
||||||
if( default_config ) {
|
if( default_config ) {
|
||||||
if( parse_debug )
|
if( parse_debug )
|
||||||
log_info(_("NOTE: no default option file `%s'\n"),
|
log_info(_("NOTE: no default option file '%s'\n"),
|
||||||
configname );
|
configname );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_error(_("option file `%s': %s\n"),
|
log_error(_("option file '%s': %s\n"),
|
||||||
configname, strerror(errno) );
|
configname, strerror(errno) );
|
||||||
g10_exit(2);
|
g10_exit(2);
|
||||||
}
|
}
|
||||||
xfree(configname); configname = NULL;
|
xfree(configname); configname = NULL;
|
||||||
}
|
}
|
||||||
if( parse_debug && configname )
|
if( parse_debug && configname )
|
||||||
log_info(_("reading options from `%s'\n"), configname );
|
log_info(_("reading options from '%s'\n"), configname );
|
||||||
default_config = 0;
|
default_config = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2366,7 +2366,7 @@ main (int argc, char **argv)
|
|||||||
opt.force_ownertrust=string_to_trust_value(pargs.r.ret_str);
|
opt.force_ownertrust=string_to_trust_value(pargs.r.ret_str);
|
||||||
if(opt.force_ownertrust==-1)
|
if(opt.force_ownertrust==-1)
|
||||||
{
|
{
|
||||||
log_error("invalid ownertrust `%s'\n",pargs.r.ret_str);
|
log_error("invalid ownertrust '%s'\n",pargs.r.ret_str);
|
||||||
opt.force_ownertrust=0;
|
opt.force_ownertrust=0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2550,7 +2550,7 @@ main (int argc, char **argv)
|
|||||||
if(*pargs.r.ret_str!='\0')
|
if(*pargs.r.ret_str!='\0')
|
||||||
{
|
{
|
||||||
if(parse_expire_string(pargs.r.ret_str)==(u32)-1)
|
if(parse_expire_string(pargs.r.ret_str)==(u32)-1)
|
||||||
log_error(_("`%s' is not a valid signature expiration\n"),
|
log_error(_("'%s' is not a valid signature expiration\n"),
|
||||||
pargs.r.ret_str);
|
pargs.r.ret_str);
|
||||||
else
|
else
|
||||||
opt.def_sig_expire=pargs.r.ret_str;
|
opt.def_sig_expire=pargs.r.ret_str;
|
||||||
@ -2562,7 +2562,7 @@ main (int argc, char **argv)
|
|||||||
if(*pargs.r.ret_str!='\0')
|
if(*pargs.r.ret_str!='\0')
|
||||||
{
|
{
|
||||||
if(parse_expire_string(pargs.r.ret_str)==(u32)-1)
|
if(parse_expire_string(pargs.r.ret_str)==(u32)-1)
|
||||||
log_error(_("`%s' is not a valid signature expiration\n"),
|
log_error(_("'%s' is not a valid signature expiration\n"),
|
||||||
pargs.r.ret_str);
|
pargs.r.ret_str);
|
||||||
else
|
else
|
||||||
opt.def_cert_expire=pargs.r.ret_str;
|
opt.def_cert_expire=pargs.r.ret_str;
|
||||||
@ -2644,7 +2644,7 @@ main (int argc, char **argv)
|
|||||||
case oNoMDCWarn: opt.no_mdc_warn=1; break;
|
case oNoMDCWarn: opt.no_mdc_warn=1; break;
|
||||||
case oDisplayCharset:
|
case oDisplayCharset:
|
||||||
if( set_native_charset( pargs.r.ret_str ) )
|
if( set_native_charset( pargs.r.ret_str ) )
|
||||||
log_error(_("`%s' is not a valid character set\n"),
|
log_error(_("'%s' is not a valid character set\n"),
|
||||||
pargs.r.ret_str);
|
pargs.r.ret_str);
|
||||||
break;
|
break;
|
||||||
case oNotDashEscaped: opt.not_dash_escaped = 1; break;
|
case oNotDashEscaped: opt.not_dash_escaped = 1; break;
|
||||||
@ -2927,7 +2927,7 @@ main (int argc, char **argv)
|
|||||||
else if(ascii_strcasecmp(pargs.r.ret_str,"0xlong")==0)
|
else if(ascii_strcasecmp(pargs.r.ret_str,"0xlong")==0)
|
||||||
opt.keyid_format=KF_0xLONG;
|
opt.keyid_format=KF_0xLONG;
|
||||||
else
|
else
|
||||||
log_error("unknown keyid-format `%s'\n",pargs.r.ret_str);
|
log_error("unknown keyid-format '%s'\n",pargs.r.ret_str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case oExitOnStatusWriteError:
|
case oExitOnStatusWriteError:
|
||||||
@ -3053,7 +3053,7 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opt.verbose > 2)
|
if (opt.verbose > 2)
|
||||||
log_info ("using character set `%s'\n", get_native_charset ());
|
log_info ("using character set '%s'\n", get_native_charset ());
|
||||||
|
|
||||||
if( may_coredump && !opt.quiet )
|
if( may_coredump && !opt.quiet )
|
||||||
log_info(_("WARNING: program may create a core file!\n"));
|
log_info(_("WARNING: program may create a core file!\n"));
|
||||||
@ -3100,7 +3100,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
for (i=0; i < argc; i++)
|
for (i=0; i < argc; i++)
|
||||||
if (argv[i][0] == '-' && argv[i][1] == '-')
|
if (argv[i][0] == '-' && argv[i][1] == '-')
|
||||||
log_info (_("NOTE: `%s' is not considered an option\n"), argv[i]);
|
log_info (_("NOTE: '%s' is not considered an option\n"), argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3356,17 +3356,17 @@ main (int argc, char **argv)
|
|||||||
switch(badtype)
|
switch(badtype)
|
||||||
{
|
{
|
||||||
case PREFTYPE_SYM:
|
case PREFTYPE_SYM:
|
||||||
log_info(_("you may not use cipher algorithm `%s'"
|
log_info(_("you may not use cipher algorithm '%s'"
|
||||||
" while in %s mode\n"),
|
" while in %s mode\n"),
|
||||||
badalg,compliance_option_string());
|
badalg,compliance_option_string());
|
||||||
break;
|
break;
|
||||||
case PREFTYPE_HASH:
|
case PREFTYPE_HASH:
|
||||||
log_info(_("you may not use digest algorithm `%s'"
|
log_info(_("you may not use digest algorithm '%s'"
|
||||||
" while in %s mode\n"),
|
" while in %s mode\n"),
|
||||||
badalg,compliance_option_string());
|
badalg,compliance_option_string());
|
||||||
break;
|
break;
|
||||||
case PREFTYPE_ZIP:
|
case PREFTYPE_ZIP:
|
||||||
log_info(_("you may not use compression algorithm `%s'"
|
log_info(_("you may not use compression algorithm '%s'"
|
||||||
" while in %s mode\n"),
|
" while in %s mode\n"),
|
||||||
badalg,compliance_option_string());
|
badalg,compliance_option_string());
|
||||||
break;
|
break;
|
||||||
@ -3473,14 +3473,14 @@ main (int argc, char **argv)
|
|||||||
if( argc > 1 )
|
if( argc > 1 )
|
||||||
wrong_args(_("--store [filename]"));
|
wrong_args(_("--store [filename]"));
|
||||||
if( (rc = encrypt_store(fname)) )
|
if( (rc = encrypt_store(fname)) )
|
||||||
log_error ("storing `%s' failed: %s\n",
|
log_error ("storing '%s' failed: %s\n",
|
||||||
print_fname_stdin(fname),g10_errstr(rc) );
|
print_fname_stdin(fname),g10_errstr(rc) );
|
||||||
break;
|
break;
|
||||||
case aSym: /* encrypt the given file only with the symmetric cipher */
|
case aSym: /* encrypt the given file only with the symmetric cipher */
|
||||||
if( argc > 1 )
|
if( argc > 1 )
|
||||||
wrong_args(_("--symmetric [filename]"));
|
wrong_args(_("--symmetric [filename]"));
|
||||||
if( (rc = encrypt_symmetric(fname)) )
|
if( (rc = encrypt_symmetric(fname)) )
|
||||||
log_error (_("symmetric encryption of `%s' failed: %s\n"),
|
log_error (_("symmetric encryption of '%s' failed: %s\n"),
|
||||||
print_fname_stdin(fname),g10_errstr(rc) );
|
print_fname_stdin(fname),g10_errstr(rc) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3925,7 +3925,7 @@ main (int argc, char **argv)
|
|||||||
int algo = all_algos? 0 : gcry_md_map_name (*argv);
|
int algo = all_algos? 0 : gcry_md_map_name (*argv);
|
||||||
|
|
||||||
if( !algo && !all_algos )
|
if( !algo && !all_algos )
|
||||||
log_error(_("invalid hash algorithm `%s'\n"), *argv );
|
log_error(_("invalid hash algorithm '%s'\n"), *argv );
|
||||||
else {
|
else {
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
if( !argc )
|
if( !argc )
|
||||||
@ -4056,7 +4056,7 @@ main (int argc, char **argv)
|
|||||||
gpg_err_set_errno (EPERM);
|
gpg_err_set_errno (EPERM);
|
||||||
}
|
}
|
||||||
if( !a )
|
if( !a )
|
||||||
log_error(_("can't open `%s'\n"), print_fname_stdin(fname));
|
log_error(_("can't open '%s'\n"), print_fname_stdin(fname));
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if( !opt.no_armor ) {
|
if( !opt.no_armor ) {
|
||||||
|
@ -79,7 +79,7 @@ display_online_help( const char *keyword )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tty_printf (_("No help available for `%s'"), keyword );
|
tty_printf (_("No help available for '%s'"), keyword );
|
||||||
}
|
}
|
||||||
if (need_final_lf)
|
if (need_final_lf)
|
||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
|
14
g10/import.c
14
g10/import.c
@ -194,7 +194,7 @@ import_keys_internal (ctrl_t ctrl, iobuf_t inp, char **fnames, int nnames,
|
|||||||
gpg_err_set_errno (EPERM);
|
gpg_err_set_errno (EPERM);
|
||||||
}
|
}
|
||||||
if( !inp2 )
|
if( !inp2 )
|
||||||
log_error(_("can't open `%s': %s\n"), fname, strerror(errno) );
|
log_error(_("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rc = import (ctrl, inp2, fname, stats, fpr, fpr_len, options);
|
rc = import (ctrl, inp2, fname, stats, fpr, fpr_len, options);
|
||||||
@ -203,7 +203,7 @@ import_keys_internal (ctrl_t ctrl, iobuf_t inp, char **fnames, int nnames,
|
|||||||
iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE,
|
iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE,
|
||||||
0, (char*)fname);
|
0, (char*)fname);
|
||||||
if( rc )
|
if( rc )
|
||||||
log_error("import from `%s' failed: %s\n", fname,
|
log_error("import from '%s' failed: %s\n", fname,
|
||||||
g10_errstr(rc) );
|
g10_errstr(rc) );
|
||||||
}
|
}
|
||||||
if( !fname )
|
if( !fname )
|
||||||
@ -314,7 +314,7 @@ import (ctrl_t ctrl, IOBUF inp, const char* fname,struct stats_s *stats,
|
|||||||
if( rc == -1 )
|
if( rc == -1 )
|
||||||
rc = 0;
|
rc = 0;
|
||||||
else if( rc && rc != G10ERR_INV_KEYRING )
|
else if( rc && rc != G10ERR_INV_KEYRING )
|
||||||
log_error( _("error reading `%s': %s\n"), fname, g10_errstr(rc));
|
log_error( _("error reading '%s': %s\n"), fname, g10_errstr(rc));
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -880,11 +880,11 @@ import_one (ctrl_t ctrl,
|
|||||||
return G10ERR_GENERAL;
|
return G10ERR_GENERAL;
|
||||||
}
|
}
|
||||||
if( opt.verbose > 1 )
|
if( opt.verbose > 1 )
|
||||||
log_info (_("writing to `%s'\n"), keydb_get_resource_name (hd) );
|
log_info (_("writing to '%s'\n"), keydb_get_resource_name (hd) );
|
||||||
|
|
||||||
rc = keydb_insert_keyblock (hd, keyblock );
|
rc = keydb_insert_keyblock (hd, keyblock );
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error (_("error writing keyring `%s': %s\n"),
|
log_error (_("error writing keyring '%s': %s\n"),
|
||||||
keydb_get_resource_name (hd), g10_errstr(rc));
|
keydb_get_resource_name (hd), g10_errstr(rc));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -984,7 +984,7 @@ import_one (ctrl_t ctrl,
|
|||||||
/* keyblock_orig has been updated; write */
|
/* keyblock_orig has been updated; write */
|
||||||
rc = keydb_update_keyblock (hd, keyblock_orig);
|
rc = keydb_update_keyblock (hd, keyblock_orig);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error (_("error writing keyring `%s': %s\n"),
|
log_error (_("error writing keyring '%s': %s\n"),
|
||||||
keydb_get_resource_name (hd), g10_errstr(rc) );
|
keydb_get_resource_name (hd), g10_errstr(rc) );
|
||||||
else if(non_self)
|
else if(non_self)
|
||||||
revalidation_mark ();
|
revalidation_mark ();
|
||||||
@ -1726,7 +1726,7 @@ import_revoke_cert( const char *fname, KBNODE node, struct stats_s *stats )
|
|||||||
/* and write the keyblock back */
|
/* and write the keyblock back */
|
||||||
rc = keydb_update_keyblock (hd, keyblock );
|
rc = keydb_update_keyblock (hd, keyblock );
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error (_("error writing keyring `%s': %s\n"),
|
log_error (_("error writing keyring '%s': %s\n"),
|
||||||
keydb_get_resource_name (hd), g10_errstr(rc) );
|
keydb_get_resource_name (hd), g10_errstr(rc) );
|
||||||
keydb_release (hd); hd = NULL;
|
keydb_release (hd); hd = NULL;
|
||||||
/* we are ready */
|
/* we are ready */
|
||||||
|
16
g10/keydb.c
16
g10/keydb.c
@ -144,7 +144,7 @@ maybe_create_keyring (char *filename, int force)
|
|||||||
sense if this is the case. An empty non-writable directory
|
sense if this is the case. An empty non-writable directory
|
||||||
with no keyring is not really useful at all. */
|
with no keyring is not really useful at all. */
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info ("can't allocate lock for `%s'\n", filename );
|
log_info ("can't allocate lock for '%s'\n", filename );
|
||||||
|
|
||||||
if (!force)
|
if (!force)
|
||||||
return gpg_error (GPG_ERR_ENOENT);
|
return gpg_error (GPG_ERR_ENOENT);
|
||||||
@ -155,7 +155,7 @@ maybe_create_keyring (char *filename, int force)
|
|||||||
if ( dotlock_take (lockhd, -1) )
|
if ( dotlock_take (lockhd, -1) )
|
||||||
{
|
{
|
||||||
/* This is something bad. Probably a stale lockfile. */
|
/* This is something bad. Probably a stale lockfile. */
|
||||||
log_info ("can't lock `%s'\n", filename );
|
log_info ("can't lock '%s'\n", filename );
|
||||||
rc = G10ERR_GENERAL;
|
rc = G10ERR_GENERAL;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -180,13 +180,13 @@ maybe_create_keyring (char *filename, int force)
|
|||||||
if (!iobuf)
|
if (!iobuf)
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error ( _("error creating keyring `%s': %s\n"),
|
log_error ( _("error creating keyring '%s': %s\n"),
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!opt.quiet)
|
if (!opt.quiet)
|
||||||
log_info (_("keyring `%s' created\n"), filename);
|
log_info (_("keyring '%s' created\n"), filename);
|
||||||
|
|
||||||
iobuf_close (iobuf);
|
iobuf_close (iobuf);
|
||||||
/* Must invalidate that ugly cache */
|
/* Must invalidate that ugly cache */
|
||||||
@ -243,7 +243,7 @@ keydb_add_resource (const char *url, int flags)
|
|||||||
#if !defined(HAVE_DRIVE_LETTERS) && !defined(__riscos__)
|
#if !defined(HAVE_DRIVE_LETTERS) && !defined(__riscos__)
|
||||||
else if (strchr (resname, ':'))
|
else if (strchr (resname, ':'))
|
||||||
{
|
{
|
||||||
log_error ("invalid key resource URL `%s'\n", url );
|
log_error ("invalid key resource URL '%s'\n", url );
|
||||||
rc = gpg_error (GPG_ERR_GENERAL);
|
rc = gpg_error (GPG_ERR_GENERAL);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ keydb_add_resource (const char *url, int flags)
|
|||||||
switch (rt)
|
switch (rt)
|
||||||
{
|
{
|
||||||
case KEYDB_RESOURCE_TYPE_NONE:
|
case KEYDB_RESOURCE_TYPE_NONE:
|
||||||
log_error ("unknown type of key resource `%s'\n", url );
|
log_error ("unknown type of key resource '%s'\n", url );
|
||||||
rc = gpg_error (GPG_ERR_GENERAL);
|
rc = gpg_error (GPG_ERR_GENERAL);
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ keydb_add_resource (const char *url, int flags)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_error ("resource type of `%s' not supported\n", url);
|
log_error ("resource type of '%s' not supported\n", url);
|
||||||
rc = gpg_error (GPG_ERR_GENERAL);
|
rc = gpg_error (GPG_ERR_GENERAL);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ keydb_add_resource (const char *url, int flags)
|
|||||||
|
|
||||||
leave:
|
leave:
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error (_("keyblock resource `%s': %s\n"), filename, gpg_strerror (rc));
|
log_error (_("keyblock resource '%s': %s\n"), filename, gpg_strerror (rc));
|
||||||
else
|
else
|
||||||
any_public = 1;
|
any_public = 1;
|
||||||
xfree (filename);
|
xfree (filename);
|
||||||
|
@ -932,7 +932,7 @@ sign_uids (KBNODE keyblock, strlist_t locusr, int *ret_modified,
|
|||||||
{
|
{
|
||||||
answer = cpr_get ("sign_uid.class",
|
answer = cpr_get ("sign_uid.class",
|
||||||
_("Your selection? "
|
_("Your selection? "
|
||||||
"(enter `?' for more information): "));
|
"(enter '?' for more information): "));
|
||||||
if (answer[0] == '\0')
|
if (answer[0] == '\0')
|
||||||
class = 0x10 + opt.def_cert_level; /* Default */
|
class = 0x10 + opt.def_cert_level; /* Default */
|
||||||
else if (ascii_strcasecmp (answer, "0") == 0)
|
else if (ascii_strcasecmp (answer, "0") == 0)
|
||||||
@ -1633,9 +1633,9 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
|
|||||||
|
|
||||||
tty_printf ("\n");
|
tty_printf ("\n");
|
||||||
tty_printf
|
tty_printf
|
||||||
(_("* The `sign' command may be prefixed with an `l' for local "
|
(_("* The 'sign' command may be prefixed with an 'l' for local "
|
||||||
"signatures (lsign),\n"
|
"signatures (lsign),\n"
|
||||||
" a `t' for trust signatures (tsign), an `nr' for "
|
" a 't' for trust signatures (tsign), an 'nr' for "
|
||||||
"non-revocable signatures\n"
|
"non-revocable signatures\n"
|
||||||
" (nrsign), or any combination thereof (ltsign, "
|
" (nrsign), or any combination thereof (ltsign, "
|
||||||
"tnrsign, etc.).\n"));
|
"tnrsign, etc.).\n"));
|
||||||
@ -1717,7 +1717,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
|
|||||||
if (!parse_sign_type
|
if (!parse_sign_type
|
||||||
(answer, &localsig, &nonrevokesig, &trustsig))
|
(answer, &localsig, &nonrevokesig, &trustsig))
|
||||||
{
|
{
|
||||||
tty_printf (_("Unknown signature type `%s'\n"), answer);
|
tty_printf (_("Unknown signature type '%s'\n"), answer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1879,7 +1879,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
|
|||||||
}
|
}
|
||||||
if (!a)
|
if (!a)
|
||||||
{
|
{
|
||||||
tty_printf (_("Can't open `%s': %s\n"),
|
tty_printf (_("Can't open '%s': %s\n"),
|
||||||
fname, strerror (errno));
|
fname, strerror (errno));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1895,7 +1895,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
|
|||||||
err = G10ERR_NO_SECKEY;
|
err = G10ERR_NO_SECKEY;
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
tty_printf (_("Error reading backup key from `%s': %s\n"),
|
tty_printf (_("Error reading backup key from '%s': %s\n"),
|
||||||
fname, g10_errstr (err));
|
fname, g10_errstr (err));
|
||||||
free_packet (pkt);
|
free_packet (pkt);
|
||||||
xfree (pkt);
|
xfree (pkt);
|
||||||
@ -2256,7 +2256,7 @@ leave:
|
|||||||
free_public_key (pk);
|
free_public_key (pk);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_info ("error changing the passphrase for `%s': %s\n",
|
log_info ("error changing the passphrase for '%s': %s\n",
|
||||||
username, gpg_strerror (err));
|
username, gpg_strerror (err));
|
||||||
write_status_error ("keyedit.passwd", err);
|
write_status_error ("keyedit.passwd", err);
|
||||||
}
|
}
|
||||||
|
22
g10/keygen.c
22
g10/keygen.c
@ -272,7 +272,7 @@ set_one_pref (int val, int type, const char *item, byte *buf, int *nbuf)
|
|||||||
for (i=0; i < *nbuf; i++ )
|
for (i=0; i < *nbuf; i++ )
|
||||||
if (buf[i] == val)
|
if (buf[i] == val)
|
||||||
{
|
{
|
||||||
log_info (_("preference `%s' duplicated\n"), item);
|
log_info (_("preference '%s' duplicated\n"), item);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ keygen_set_std_prefs (const char *string,int personal)
|
|||||||
modify=0;
|
modify=0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_info (_("invalid item `%s' in preference string\n"),tok);
|
log_info (_("invalid item '%s' in preference string\n"),tok);
|
||||||
rc=-1;
|
rc=-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2387,7 +2387,7 @@ ask_user_id (int mode, KBNODE keyblock)
|
|||||||
/* print a note in case that UTF8 mapping has to be done */
|
/* print a note in case that UTF8 mapping has to be done */
|
||||||
for(p=uid; *p; p++ ) {
|
for(p=uid; *p; p++ ) {
|
||||||
if( *p & 0x80 ) {
|
if( *p & 0x80 ) {
|
||||||
tty_printf(_("You are using the `%s' character set.\n"),
|
tty_printf(_("You are using the '%s' character set.\n"),
|
||||||
get_native_charset() );
|
get_native_charset() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3091,7 +3091,7 @@ read_parameter_file( const char *fname )
|
|||||||
gpg_err_set_errno (EPERM);
|
gpg_err_set_errno (EPERM);
|
||||||
}
|
}
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
log_error (_("can't open `%s': %s\n"), fname, strerror(errno) );
|
log_error (_("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
iobuf_ioctl (fp, IOBUF_IOCTL_NO_CACHE, 1, NULL);
|
iobuf_ioctl (fp, IOBUF_IOCTL_NO_CACHE, 1, NULL);
|
||||||
@ -3156,7 +3156,7 @@ read_parameter_file( const char *fname )
|
|||||||
/* Ignore this command. */
|
/* Ignore this command. */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_info("skipping control `%s' (%s)\n", keyword, value );
|
log_info("skipping control '%s' (%s)\n", keyword, value );
|
||||||
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -3584,7 +3584,7 @@ do_generate_keypair (struct para_data_s *para,
|
|||||||
outctrl->pub.stream = iobuf_create( outctrl->pub.fname );
|
outctrl->pub.stream = iobuf_create( outctrl->pub.fname );
|
||||||
if (!outctrl->pub.stream)
|
if (!outctrl->pub.stream)
|
||||||
{
|
{
|
||||||
log_error(_("can't create `%s': %s\n"), outctrl->pub.newfname,
|
log_error(_("can't create '%s': %s\n"), outctrl->pub.newfname,
|
||||||
strerror(errno) );
|
strerror(errno) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3596,7 +3596,7 @@ do_generate_keypair (struct para_data_s *para,
|
|||||||
}
|
}
|
||||||
assert( outctrl->pub.stream );
|
assert( outctrl->pub.stream );
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("writing public key to `%s'\n"), outctrl->pub.fname );
|
log_info (_("writing public key to '%s'\n"), outctrl->pub.fname );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3732,7 +3732,7 @@ do_generate_keypair (struct para_data_s *para,
|
|||||||
|
|
||||||
if (!err && opt.verbose)
|
if (!err && opt.verbose)
|
||||||
{
|
{
|
||||||
log_info (_("writing public key to `%s'\n"),
|
log_info (_("writing public key to '%s'\n"),
|
||||||
keydb_get_resource_name (pub_hd));
|
keydb_get_resource_name (pub_hd));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3740,7 +3740,7 @@ do_generate_keypair (struct para_data_s *para,
|
|||||||
{
|
{
|
||||||
err = keydb_insert_keyblock (pub_hd, pub_root);
|
err = keydb_insert_keyblock (pub_hd, pub_root);
|
||||||
if (err)
|
if (err)
|
||||||
log_error (_("error writing public keyring `%s': %s\n"),
|
log_error (_("error writing public keyring '%s': %s\n"),
|
||||||
keydb_get_resource_name (pub_hd), g10_errstr(err));
|
keydb_get_resource_name (pub_hd), g10_errstr(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4200,7 +4200,7 @@ gen_card_key_with_backup (int algo, int keyno, int is_primary,
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't create backup file `%s': %s\n"),
|
log_error (_("can't create backup file '%s': %s\n"),
|
||||||
fname, strerror(errno) );
|
fname, strerror(errno) );
|
||||||
xfree (fname);
|
xfree (fname);
|
||||||
free_secret_key (sk_unprotected);
|
free_secret_key (sk_unprotected);
|
||||||
@ -4226,7 +4226,7 @@ gen_card_key_with_backup (int algo, int keyno, int is_primary,
|
|||||||
|
|
||||||
iobuf_close (fp);
|
iobuf_close (fp);
|
||||||
iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE, 0, (char*)fname);
|
iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE, 0, (char*)fname);
|
||||||
log_info (_("NOTE: backup of card key saved to `%s'\n"), fname);
|
log_info (_("NOTE: backup of card key saved to '%s'\n"), fname);
|
||||||
|
|
||||||
fingerprint_from_sk (sk, array, &n);
|
fingerprint_from_sk (sk, array, &n);
|
||||||
p = fprbuf = xmalloc (MAX_FINGERPRINT_LEN*2 + 1 + 1);
|
p = fprbuf = xmalloc (MAX_FINGERPRINT_LEN*2 + 1 + 1);
|
||||||
|
@ -308,7 +308,7 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
|
|||||||
if (!kr->lockhd) {
|
if (!kr->lockhd) {
|
||||||
kr->lockhd = dotlock_create (kr->fname, 0);
|
kr->lockhd = dotlock_create (kr->fname, 0);
|
||||||
if (!kr->lockhd) {
|
if (!kr->lockhd) {
|
||||||
log_info ("can't allocate lock for `%s'\n", kr->fname );
|
log_info ("can't allocate lock for '%s'\n", kr->fname );
|
||||||
rc = G10ERR_GENERAL;
|
rc = G10ERR_GENERAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,7 +323,7 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
|
|||||||
if (kr->is_locked)
|
if (kr->is_locked)
|
||||||
;
|
;
|
||||||
else if (dotlock_take (kr->lockhd, -1) ) {
|
else if (dotlock_take (kr->lockhd, -1) ) {
|
||||||
log_info ("can't lock `%s'\n", kr->fname );
|
log_info ("can't lock '%s'\n", kr->fname );
|
||||||
rc = G10ERR_GENERAL;
|
rc = G10ERR_GENERAL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -338,7 +338,7 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
|
|||||||
if (!kr->is_locked)
|
if (!kr->is_locked)
|
||||||
;
|
;
|
||||||
else if (dotlock_release (kr->lockhd))
|
else if (dotlock_release (kr->lockhd))
|
||||||
log_info ("can't unlock `%s'\n", kr->fname );
|
log_info ("can't unlock '%s'\n", kr->fname );
|
||||||
else
|
else
|
||||||
kr->is_locked = 0;
|
kr->is_locked = 0;
|
||||||
}
|
}
|
||||||
@ -376,12 +376,12 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
|
|||||||
a = iobuf_open (hd->found.kr->fname);
|
a = iobuf_open (hd->found.kr->fname);
|
||||||
if (!a)
|
if (!a)
|
||||||
{
|
{
|
||||||
log_error(_("can't open `%s'\n"), hd->found.kr->fname);
|
log_error(_("can't open '%s'\n"), hd->found.kr->fname);
|
||||||
return G10ERR_KEYRING_OPEN;
|
return G10ERR_KEYRING_OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iobuf_seek (a, hd->found.offset) ) {
|
if (iobuf_seek (a, hd->found.offset) ) {
|
||||||
log_error ("can't seek `%s'\n", hd->found.kr->fname);
|
log_error ("can't seek '%s'\n", hd->found.kr->fname);
|
||||||
iobuf_close(a);
|
iobuf_close(a);
|
||||||
return G10ERR_KEYRING_OPEN;
|
return G10ERR_KEYRING_OPEN;
|
||||||
}
|
}
|
||||||
@ -687,7 +687,7 @@ prepare_search (KEYRING_HANDLE hd)
|
|||||||
if (!hd->current.iobuf)
|
if (!hd->current.iobuf)
|
||||||
{
|
{
|
||||||
hd->current.error = gpg_error_from_syserror ();
|
hd->current.error = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s'\n"), hd->current.kr->fname );
|
log_error(_("can't open '%s'\n"), hd->current.kr->fname );
|
||||||
return hd->current.error;
|
return hd->current.error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1210,7 +1210,7 @@ create_tmp_file (const char *template,
|
|||||||
if (!*r_fp)
|
if (!*r_fp)
|
||||||
{
|
{
|
||||||
int rc = gpg_error_from_syserror ();
|
int rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't create `%s': %s\n"), tmpfname, strerror(errno) );
|
log_error(_("can't create '%s': %s\n"), tmpfname, strerror(errno) );
|
||||||
xfree (tmpfname);
|
xfree (tmpfname);
|
||||||
xfree (bakfname);
|
xfree (bakfname);
|
||||||
return rc;
|
return rc;
|
||||||
@ -1243,7 +1243,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname, const char *fname)
|
|||||||
if (rename (fname, bakfname) )
|
if (rename (fname, bakfname) )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error ("renaming `%s' to `%s' failed: %s\n",
|
log_error ("renaming '%s' to '%s' failed: %s\n",
|
||||||
fname, bakfname, strerror(errno) );
|
fname, bakfname, strerror(errno) );
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -1255,7 +1255,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname, const char *fname)
|
|||||||
if (rename (tmpfname, fname) )
|
if (rename (tmpfname, fname) )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("renaming `%s' to `%s' failed: %s\n"),
|
log_error (_("renaming '%s' to '%s' failed: %s\n"),
|
||||||
tmpfname, fname, strerror(errno) );
|
tmpfname, fname, strerror(errno) );
|
||||||
register_secured_file (fname);
|
register_secured_file (fname);
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -1272,7 +1272,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname, const char *fname)
|
|||||||
if (!stat (bakfname, &statbuf) && !chmod (fname, statbuf.st_mode))
|
if (!stat (bakfname, &statbuf) && !chmod (fname, statbuf.st_mode))
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
log_error ("WARNING: unable to restore permissions to `%s': %s",
|
log_error ("WARNING: unable to restore permissions to '%s': %s",
|
||||||
fname, strerror(errno));
|
fname, strerror(errno));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1363,7 +1363,7 @@ keyring_rebuild_cache (void *token,int noisy)
|
|||||||
if (iobuf_close (tmpfp))
|
if (iobuf_close (tmpfp))
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error ("error closing `%s': %s\n",
|
log_error ("error closing '%s': %s\n",
|
||||||
tmpfilename, strerror (errno));
|
tmpfilename, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -1379,7 +1379,7 @@ keyring_rebuild_cache (void *token,int noisy)
|
|||||||
goto leave;
|
goto leave;
|
||||||
lastresname = resname;
|
lastresname = resname;
|
||||||
if (noisy && !opt.quiet)
|
if (noisy && !opt.quiet)
|
||||||
log_info (_("caching keyring `%s'\n"), resname);
|
log_info (_("caching keyring '%s'\n"), resname);
|
||||||
rc = create_tmp_file (resname, &bakfilename, &tmpfilename, &tmpfp);
|
rc = create_tmp_file (resname, &bakfilename, &tmpfilename, &tmpfp);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -1401,7 +1401,7 @@ keyring_rebuild_cache (void *token,int noisy)
|
|||||||
keyblock->pkt->pkttype, noisy? " - deleted":"");
|
keyblock->pkt->pkttype, noisy? " - deleted":"");
|
||||||
if (noisy)
|
if (noisy)
|
||||||
continue;
|
continue;
|
||||||
log_info ("Hint: backup your keys and try running `%s'\n",
|
log_info ("Hint: backup your keys and try running '%s'\n",
|
||||||
"gpg --rebuild-keydb-caches");
|
"gpg --rebuild-keydb-caches");
|
||||||
rc = gpg_error (GPG_ERR_INV_KEYRING);
|
rc = gpg_error (GPG_ERR_INV_KEYRING);
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -1456,7 +1456,7 @@ keyring_rebuild_cache (void *token,int noisy)
|
|||||||
if (iobuf_close (tmpfp))
|
if (iobuf_close (tmpfp))
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error ("error closing `%s': %s\n",
|
log_error ("error closing '%s': %s\n",
|
||||||
tmpfilename, strerror (errno));
|
tmpfilename, strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -1518,7 +1518,7 @@ do_copy (int mode, const char *fname, KBNODE root,
|
|||||||
if( !newfp )
|
if( !newfp )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't create `%s': %s\n"), fname, strerror(errno));
|
log_error (_("can't create '%s': %s\n"), fname, strerror(errno));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
if( !opt.quiet )
|
if( !opt.quiet )
|
||||||
@ -1544,7 +1544,7 @@ do_copy (int mode, const char *fname, KBNODE root,
|
|||||||
if( !fp )
|
if( !fp )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s': %s\n"), fname, strerror(errno) );
|
log_error(_("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1559,7 +1559,7 @@ do_copy (int mode, const char *fname, KBNODE root,
|
|||||||
/* copy everything to the new file */
|
/* copy everything to the new file */
|
||||||
rc = copy_all_packets (fp, newfp);
|
rc = copy_all_packets (fp, newfp);
|
||||||
if( rc != -1 ) {
|
if( rc != -1 ) {
|
||||||
log_error("%s: copy to `%s' failed: %s\n",
|
log_error("%s: copy to '%s' failed: %s\n",
|
||||||
fname, tmpfname, g10_errstr(rc) );
|
fname, tmpfname, g10_errstr(rc) );
|
||||||
iobuf_close(fp);
|
iobuf_close(fp);
|
||||||
iobuf_cancel(newfp);
|
iobuf_cancel(newfp);
|
||||||
@ -1572,7 +1572,7 @@ do_copy (int mode, const char *fname, KBNODE root,
|
|||||||
/* copy first part to the new file */
|
/* copy first part to the new file */
|
||||||
rc = copy_some_packets( fp, newfp, start_offset );
|
rc = copy_some_packets( fp, newfp, start_offset );
|
||||||
if( rc ) { /* should never get EOF here */
|
if( rc ) { /* should never get EOF here */
|
||||||
log_error ("%s: copy to `%s' failed: %s\n",
|
log_error ("%s: copy to '%s' failed: %s\n",
|
||||||
fname, tmpfname, g10_errstr(rc) );
|
fname, tmpfname, g10_errstr(rc) );
|
||||||
iobuf_close(fp);
|
iobuf_close(fp);
|
||||||
iobuf_cancel(newfp);
|
iobuf_cancel(newfp);
|
||||||
@ -1603,7 +1603,7 @@ do_copy (int mode, const char *fname, KBNODE root,
|
|||||||
/* copy the rest */
|
/* copy the rest */
|
||||||
rc = copy_all_packets( fp, newfp );
|
rc = copy_all_packets( fp, newfp );
|
||||||
if( rc != -1 ) {
|
if( rc != -1 ) {
|
||||||
log_error("%s: copy to `%s' failed: %s\n",
|
log_error("%s: copy to '%s' failed: %s\n",
|
||||||
fname, tmpfname, g10_errstr(rc) );
|
fname, tmpfname, g10_errstr(rc) );
|
||||||
iobuf_close(fp);
|
iobuf_close(fp);
|
||||||
iobuf_cancel(newfp);
|
iobuf_cancel(newfp);
|
||||||
|
@ -173,7 +173,7 @@ parse_keyserver_options(char *options)
|
|||||||
#ifdef EXEC_TEMPFILE_ONLY
|
#ifdef EXEC_TEMPFILE_ONLY
|
||||||
if(ascii_strncasecmp(tok,"use-temp-files",14)==0 ||
|
if(ascii_strncasecmp(tok,"use-temp-files",14)==0 ||
|
||||||
ascii_strncasecmp(tok,"no-use-temp-files",17)==0)
|
ascii_strncasecmp(tok,"no-use-temp-files",17)==0)
|
||||||
log_info(_("WARNING: keyserver option `%s' is not used"
|
log_info(_("WARNING: keyserver option '%s' is not used"
|
||||||
" on this platform\n"),tok);
|
" on this platform\n"),tok);
|
||||||
#else
|
#else
|
||||||
if(ascii_strncasecmp(tok,"use-temp-files",14)==0)
|
if(ascii_strncasecmp(tok,"use-temp-files",14)==0)
|
||||||
@ -1417,13 +1417,13 @@ keyserver_search (ctrl_t ctrl, strlist_t tokens)
|
|||||||
/* switch(ret) */
|
/* switch(ret) */
|
||||||
/* { */
|
/* { */
|
||||||
/* case KEYSERVER_SCHEME_NOT_FOUND: */
|
/* case KEYSERVER_SCHEME_NOT_FOUND: */
|
||||||
/* log_error(_("no handler for keyserver scheme `%s'\n"), */
|
/* log_error(_("no handler for keyserver scheme '%s'\n"), */
|
||||||
/* opt.keyserver->scheme); */
|
/* opt.keyserver->scheme); */
|
||||||
/* break; */
|
/* break; */
|
||||||
|
|
||||||
/* case KEYSERVER_NOT_SUPPORTED: */
|
/* case KEYSERVER_NOT_SUPPORTED: */
|
||||||
/* log_error(_("action `%s' not supported with keyserver " */
|
/* log_error(_("action '%s' not supported with keyserver " */
|
||||||
/* "scheme `%s'\n"), "search", opt.keyserver->scheme); */
|
/* "scheme '%s'\n"), "search", opt.keyserver->scheme); */
|
||||||
/* break; */
|
/* break; */
|
||||||
|
|
||||||
/* case KEYSERVER_TIMEOUT: */
|
/* case KEYSERVER_TIMEOUT: */
|
||||||
@ -1655,7 +1655,7 @@ keyserver_fetch (ctrl_t ctrl, strlist_t urilist)
|
|||||||
for (sl=urilist; sl; sl=sl->next)
|
for (sl=urilist; sl; sl=sl->next)
|
||||||
{
|
{
|
||||||
if (!opt.quiet)
|
if (!opt.quiet)
|
||||||
log_info (_("requesting key from `%s'\n"), sl->d);
|
log_info (_("requesting key from '%s'\n"), sl->d);
|
||||||
|
|
||||||
err = gpg_dirmngr_ks_fetch (ctrl, sl->d, &datastream);
|
err = gpg_dirmngr_ks_fetch (ctrl, sl->d, &datastream);
|
||||||
if (!err)
|
if (!err)
|
||||||
|
@ -580,7 +580,7 @@ proc_encrypted( CTX c, PACKET *pkt )
|
|||||||
sprintf ( buf, "%d:", c->dek->algo );
|
sprintf ( buf, "%d:", c->dek->algo );
|
||||||
for(i=0; i < c->dek->keylen; i++ )
|
for(i=0; i < c->dek->keylen; i++ )
|
||||||
sprintf(buf+strlen(buf), "%02X", c->dek->key[i] );
|
sprintf(buf+strlen(buf), "%02X", c->dek->key[i] );
|
||||||
log_info( "session key: `%s'\n", buf );
|
log_info( "session key: '%s'\n", buf );
|
||||||
write_status_text ( STATUS_SESSION_KEY, buf );
|
write_status_text ( STATUS_SESSION_KEY, buf );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
g10/misc.c
14
g10/misc.c
@ -107,9 +107,9 @@ register_secured_file (const char *fname)
|
|||||||
|
|
||||||
/* Note that we stop immediatley if something goes wrong here. */
|
/* Note that we stop immediatley if something goes wrong here. */
|
||||||
if (stat (fname, &buf))
|
if (stat (fname, &buf))
|
||||||
log_fatal (_("fstat of `%s' failed in %s: %s\n"), fname,
|
log_fatal (_("fstat of '%s' failed in %s: %s\n"), fname,
|
||||||
"register_secured_file", strerror (errno));
|
"register_secured_file", strerror (errno));
|
||||||
/* log_debug ("registering `%s' i=%lu.%lu\n", fname, */
|
/* log_debug ("registering '%s' i=%lu.%lu\n", fname, */
|
||||||
/* (unsigned long)buf.st_dev, (unsigned long)buf.st_ino); */
|
/* (unsigned long)buf.st_dev, (unsigned long)buf.st_ino); */
|
||||||
for (sf=secured_files; sf; sf = sf->next)
|
for (sf=secured_files; sf; sf = sf->next)
|
||||||
{
|
{
|
||||||
@ -137,11 +137,11 @@ unregister_secured_file (const char *fname)
|
|||||||
|
|
||||||
if (stat (fname, &buf))
|
if (stat (fname, &buf))
|
||||||
{
|
{
|
||||||
log_error (_("fstat of `%s' failed in %s: %s\n"), fname,
|
log_error (_("fstat of '%s' failed in %s: %s\n"), fname,
|
||||||
"unregister_secured_file", strerror (errno));
|
"unregister_secured_file", strerror (errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* log_debug ("unregistering `%s' i=%lu.%lu\n", fname, */
|
/* log_debug ("unregistering '%s' i=%lu.%lu\n", fname, */
|
||||||
/* (unsigned long)buf.st_dev, (unsigned long)buf.st_ino); */
|
/* (unsigned long)buf.st_dev, (unsigned long)buf.st_ino); */
|
||||||
for (sfprev=NULL,sf=secured_files; sf; sfprev=sf, sf = sf->next)
|
for (sfprev=NULL,sf=secured_files; sf; sfprev=sf, sf = sf->next)
|
||||||
{
|
{
|
||||||
@ -213,7 +213,7 @@ is_secured_filename (const char *fname)
|
|||||||
{
|
{
|
||||||
if (errno == ENOENT || errno == EPERM || errno == EACCES)
|
if (errno == ENOENT || errno == EPERM || errno == EACCES)
|
||||||
return 0;
|
return 0;
|
||||||
log_error (_("fstat of `%s' failed in %s: %s\n"), fname,
|
log_error (_("fstat of '%s' failed in %s: %s\n"), fname,
|
||||||
"is_secured_filename", strerror (errno));
|
"is_secured_filename", strerror (errno));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1215,7 +1215,7 @@ parse_options(char *str,unsigned int *options,
|
|||||||
if(ascii_strncasecmp(opts[j].name,tok,toklen)==0)
|
if(ascii_strncasecmp(opts[j].name,tok,toklen)==0)
|
||||||
{
|
{
|
||||||
if(noisy)
|
if(noisy)
|
||||||
log_info(_("ambiguous option `%s'\n"),otok);
|
log_info(_("ambiguous option '%s'\n"),otok);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1240,7 +1240,7 @@ parse_options(char *str,unsigned int *options,
|
|||||||
if(!opts[i].name)
|
if(!opts[i].name)
|
||||||
{
|
{
|
||||||
if(noisy)
|
if(noisy)
|
||||||
log_info(_("unknown option `%s'\n"),otok);
|
log_info(_("unknown option '%s'\n"),otok);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ overwrite_filep( const char *fname )
|
|||||||
if (opt.answer_no || opt.batch)
|
if (opt.answer_no || opt.batch)
|
||||||
return 0; /* Do not overwrite. */
|
return 0; /* Do not overwrite. */
|
||||||
|
|
||||||
tty_printf (_("File `%s' exists. "), fname);
|
tty_printf (_("File '%s' exists. "), fname);
|
||||||
if (cpr_enabled ())
|
if (cpr_enabled ())
|
||||||
tty_printf ("\n");
|
tty_printf ("\n");
|
||||||
if (cpr_get_answer_is_yes ("openfile.overwrite.okay",
|
if (cpr_get_answer_is_yes ("openfile.overwrite.okay",
|
||||||
@ -194,12 +194,12 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
|
|||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
snprintf (xname, sizeof xname, "[fd %d]", inp_fd);
|
snprintf (xname, sizeof xname, "[fd %d]", inp_fd);
|
||||||
log_error (_("can't open `%s': %s\n"), xname, gpg_strerror (rc));
|
log_error (_("can't open '%s': %s\n"), xname, gpg_strerror (rc));
|
||||||
}
|
}
|
||||||
else if (opt.verbose)
|
else if (opt.verbose)
|
||||||
{
|
{
|
||||||
snprintf (xname, sizeof xname, "[fd %d]", inp_fd);
|
snprintf (xname, sizeof xname, "[fd %d]", inp_fd);
|
||||||
log_info (_("writing to `%s'\n"), xname);
|
log_info (_("writing to '%s'\n"), xname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (iobuf_is_pipe_filename (iname) && !opt.outfile)
|
else if (iobuf_is_pipe_filename (iname) && !opt.outfile)
|
||||||
@ -208,7 +208,7 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
|
|||||||
if ( !*a )
|
if ( !*a )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"), "[stdout]", strerror(errno) );
|
log_error (_("can't open '%s': %s\n"), "[stdout]", strerror(errno) );
|
||||||
}
|
}
|
||||||
else if ( opt.verbose )
|
else if ( opt.verbose )
|
||||||
log_info (_("writing to stdout\n"));
|
log_info (_("writing to stdout\n"));
|
||||||
@ -287,10 +287,10 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
|
|||||||
if (!*a)
|
if (!*a)
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't create `%s': %s\n"), name, strerror(errno) );
|
log_error(_("can't create '%s': %s\n"), name, strerror(errno) );
|
||||||
}
|
}
|
||||||
else if( opt.verbose )
|
else if( opt.verbose )
|
||||||
log_info (_("writing to `%s'\n"), name );
|
log_info (_("writing to '%s'\n"), name );
|
||||||
}
|
}
|
||||||
xfree(buf);
|
xfree(buf);
|
||||||
}
|
}
|
||||||
@ -328,7 +328,7 @@ open_sigfile( const char *iname, progress_filter_context_t *pfx )
|
|||||||
gpg_err_set_errno (EPERM);
|
gpg_err_set_errno (EPERM);
|
||||||
}
|
}
|
||||||
if( a && opt.verbose )
|
if( a && opt.verbose )
|
||||||
log_info(_("assuming signed data in `%s'\n"), buf );
|
log_info(_("assuming signed data in '%s'\n"), buf );
|
||||||
if (a && pfx)
|
if (a && pfx)
|
||||||
handle_progress (pfx, a, buf);
|
handle_progress (pfx, a, buf);
|
||||||
xfree(buf);
|
xfree(buf);
|
||||||
@ -365,7 +365,7 @@ copy_options_file( const char *destdir )
|
|||||||
gpg_err_set_errno (EPERM);
|
gpg_err_set_errno (EPERM);
|
||||||
}
|
}
|
||||||
if( !src ) {
|
if( !src ) {
|
||||||
log_info (_("can't open `%s': %s\n"), fname, strerror(errno) );
|
log_info (_("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||||
xfree(fname);
|
xfree(fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -380,7 +380,7 @@ copy_options_file( const char *destdir )
|
|||||||
dst = fopen( fname, "w" );
|
dst = fopen( fname, "w" );
|
||||||
umask(oldmask);
|
umask(oldmask);
|
||||||
if( !dst ) {
|
if( !dst ) {
|
||||||
log_info (_("can't create `%s': %s\n"), fname, strerror(errno) );
|
log_info (_("can't create '%s': %s\n"), fname, strerror(errno) );
|
||||||
fclose( src );
|
fclose( src );
|
||||||
xfree(fname);
|
xfree(fname);
|
||||||
return;
|
return;
|
||||||
@ -407,9 +407,9 @@ copy_options_file( const char *destdir )
|
|||||||
}
|
}
|
||||||
fclose( dst );
|
fclose( dst );
|
||||||
fclose( src );
|
fclose( src );
|
||||||
log_info(_("new configuration file `%s' created\n"), fname );
|
log_info(_("new configuration file '%s' created\n"), fname );
|
||||||
if (any_option)
|
if (any_option)
|
||||||
log_info (_("WARNING: options in `%s'"
|
log_info (_("WARNING: options in '%s'"
|
||||||
" are not yet active during this run\n"),
|
" are not yet active during this run\n"),
|
||||||
fname);
|
fname);
|
||||||
xfree(fname);
|
xfree(fname);
|
||||||
@ -441,10 +441,10 @@ try_make_homedir (const char *fname)
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (gnupg_mkdir (fname, "-rwx"))
|
if (gnupg_mkdir (fname, "-rwx"))
|
||||||
log_fatal ( _("can't create directory `%s': %s\n"),
|
log_fatal ( _("can't create directory '%s': %s\n"),
|
||||||
fname, strerror(errno) );
|
fname, strerror(errno) );
|
||||||
else if (!opt.quiet )
|
else if (!opt.quiet )
|
||||||
log_info ( _("directory `%s' created\n"), fname );
|
log_info ( _("directory '%s' created\n"), fname );
|
||||||
copy_options_file( fname );
|
copy_options_file( fname );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ generate_photo_id(PKT_public_key *pk,const char *photo_name)
|
|||||||
}
|
}
|
||||||
if(!file)
|
if(!file)
|
||||||
{
|
{
|
||||||
log_error(_("unable to open JPEG file `%s': %s\n"),
|
log_error(_("unable to open JPEG file '%s': %s\n"),
|
||||||
filename,strerror(errno));
|
filename,strerror(errno));
|
||||||
xfree(filename);
|
xfree(filename);
|
||||||
filename=NULL;
|
filename=NULL;
|
||||||
@ -143,7 +143,7 @@ generate_photo_id(PKT_public_key *pk,const char *photo_name)
|
|||||||
/* Is it a JPEG? */
|
/* Is it a JPEG? */
|
||||||
if(photo[0]!=0xFF || photo[1]!=0xD8)
|
if(photo[0]!=0xFF || photo[1]!=0xD8)
|
||||||
{
|
{
|
||||||
log_error(_("`%s' is not a JPEG file\n"),filename);
|
log_error(_("'%s' is not a JPEG file\n"),filename);
|
||||||
xfree(photo);
|
xfree(photo);
|
||||||
photo=NULL;
|
photo=NULL;
|
||||||
xfree(filename);
|
xfree(filename);
|
||||||
|
@ -414,7 +414,7 @@ do_we_trust( PKT_public_key *pk, unsigned int trustlevel )
|
|||||||
if( opt.trust_model==TM_ALWAYS )
|
if( opt.trust_model==TM_ALWAYS )
|
||||||
{
|
{
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("No trust check due to `--trust-model always' option\n");
|
log_info("No trust check due to '--trust-model always' option\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,14 +572,14 @@ check_signatures_trust( PKT_signature *sig )
|
|||||||
{
|
{
|
||||||
okay = 1;
|
okay = 1;
|
||||||
write_status_text (STATUS_PKA_TRUST_GOOD, sig->pka_info->email);
|
write_status_text (STATUS_PKA_TRUST_GOOD, sig->pka_info->email);
|
||||||
log_info (_("Note: Verified signer's address is `%s'\n"),
|
log_info (_("Note: Verified signer's address is '%s'\n"),
|
||||||
sig->pka_info->email);
|
sig->pka_info->email);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
okay = 0;
|
okay = 0;
|
||||||
write_status_text (STATUS_PKA_TRUST_BAD, sig->pka_info->email);
|
write_status_text (STATUS_PKA_TRUST_BAD, sig->pka_info->email);
|
||||||
log_info (_("Note: Signer's address `%s' "
|
log_info (_("Note: Signer's address '%s' "
|
||||||
"does not match DNS entry\n"), sig->pka_info->email);
|
"does not match DNS entry\n"), sig->pka_info->email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
if (opt.outfp && is_secured_file (es_fileno (opt.outfp)))
|
if (opt.outfp && is_secured_file (es_fileno (opt.outfp)))
|
||||||
{
|
{
|
||||||
err = gpg_error (GPG_ERR_EPERM);
|
err = gpg_error (GPG_ERR_EPERM);
|
||||||
log_error (_("error creating `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error creating '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
else if (fp || nooutput)
|
else if (fp || nooutput)
|
||||||
@ -166,13 +166,13 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
{
|
{
|
||||||
gpg_err_set_errno (EPERM);
|
gpg_err_set_errno (EPERM);
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("error creating `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error creating '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
else if (!(fp = es_fopen (fname, "wb")))
|
else if (!(fp = es_fopen (fname, "wb")))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("error creating `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error creating '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
#else /* __riscos__ */
|
#else /* __riscos__ */
|
||||||
@ -195,7 +195,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
fp = fopen (fname, "wb");
|
fp = fopen (fname, "wb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error (_("error creating `%s': %s\n"), fname, gpg_strerror (err));
|
log_error (_("error creating '%s': %s\n"), fname, gpg_strerror (err));
|
||||||
err = G10ERR_CREATE_FILE;
|
err = G10ERR_CREATE_FILE;
|
||||||
if (errno == 106)
|
if (errno == 106)
|
||||||
log_info ("Do output file and input file have the same name?\n");
|
log_info ("Do output file and input file have the same name?\n");
|
||||||
@ -245,7 +245,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
{
|
{
|
||||||
if (opt.max_output && (++count) > opt.max_output)
|
if (opt.max_output && (++count) > opt.max_output)
|
||||||
{
|
{
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, "exceeded --max-output limit\n");
|
fname, "exceeded --max-output limit\n");
|
||||||
err = gpg_error (GPG_ERR_TOO_LARGE);
|
err = gpg_error (GPG_ERR_TOO_LARGE);
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -256,7 +256,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
else
|
else
|
||||||
err = gpg_error (GPG_ERR_EOF);
|
err = gpg_error (GPG_ERR_EOF);
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
{
|
{
|
||||||
if (opt.max_output && (count += len) > opt.max_output)
|
if (opt.max_output && (count += len) > opt.max_output)
|
||||||
{
|
{
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, "exceeded --max-output limit\n");
|
fname, "exceeded --max-output limit\n");
|
||||||
err = gpg_error (GPG_ERR_TOO_LARGE);
|
err = gpg_error (GPG_ERR_TOO_LARGE);
|
||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
@ -293,7 +293,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
else if (es_fwrite (buffer, 1, len, fp) != len)
|
else if (es_fwrite (buffer, 1, len, fp) != len)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -320,7 +320,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
{
|
{
|
||||||
if (opt.max_output && (++count) > opt.max_output)
|
if (opt.max_output && (++count) > opt.max_output)
|
||||||
{
|
{
|
||||||
log_error ("Error writing to `%s': %s\n",
|
log_error ("Error writing to '%s': %s\n",
|
||||||
fname, "exceeded --max-output limit\n");
|
fname, "exceeded --max-output limit\n");
|
||||||
err = gpg_error (GPG_ERR_TOO_LARGE);
|
err = gpg_error (GPG_ERR_TOO_LARGE);
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -331,7 +331,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
else
|
else
|
||||||
err = gpg_error (GPG_ERR_EOF);
|
err = gpg_error (GPG_ERR_EOF);
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -369,7 +369,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
{
|
{
|
||||||
if (opt.max_output && (count += len) > opt.max_output)
|
if (opt.max_output && (count += len) > opt.max_output)
|
||||||
{
|
{
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, "exceeded --max-output limit\n");
|
fname, "exceeded --max-output limit\n");
|
||||||
err = gpg_error (GPG_ERR_TOO_LARGE);
|
err = gpg_error (GPG_ERR_TOO_LARGE);
|
||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
@ -378,7 +378,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
else if (es_fwrite (buffer, 1, len, fp) != len)
|
else if (es_fwrite (buffer, 1, len, fp) != len)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -399,7 +399,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
{
|
{
|
||||||
if (opt.max_output && (++count) > opt.max_output)
|
if (opt.max_output && (++count) > opt.max_output)
|
||||||
{
|
{
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, "exceeded --max-output limit\n");
|
fname, "exceeded --max-output limit\n");
|
||||||
err = gpg_error (GPG_ERR_TOO_LARGE);
|
err = gpg_error (GPG_ERR_TOO_LARGE);
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -407,7 +407,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
else if (es_putc (c, fp) == EOF)
|
else if (es_putc (c, fp) == EOF)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error writing to `%s': %s\n",
|
log_error ("error writing to '%s': %s\n",
|
||||||
fname, gpg_strerror (err));
|
fname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -452,7 +452,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
if (fp && fp != es_stdout && fp != opt.outfp && es_fclose (fp))
|
if (fp && fp != es_stdout && fp != opt.outfp && es_fclose (fp))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error closing `%s': %s\n", fname, gpg_strerror (err));
|
log_error ("error closing '%s': %s\n", fname, gpg_strerror (err));
|
||||||
fp = NULL;
|
fp = NULL;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -469,7 +469,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
|
|||||||
values is a good idea in any case. */
|
values is a good idea in any case. */
|
||||||
if (!err)
|
if (!err)
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error flushing `%s': %s\n", "[stdout]",
|
log_error ("error flushing '%s': %s\n", "[stdout]",
|
||||||
gpg_strerror (err));
|
gpg_strerror (err));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,7 +581,7 @@ ask_for_detached_datafile (gcry_md_hd_t md, gcry_md_hd_t md2,
|
|||||||
else if (!fp)
|
else if (!fp)
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"), answer,
|
log_error (_("can't open '%s': %s\n"), answer,
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -650,7 +650,7 @@ hash_datafiles (gcry_md_hd_t md, gcry_md_hd_t md2, strlist_t files,
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
int rc = gpg_error_from_syserror ();
|
int rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open signed data `%s'\n"),
|
log_error (_("can't open signed data '%s'\n"),
|
||||||
print_fname_stdin (sl->d));
|
print_fname_stdin (sl->d));
|
||||||
release_progress_context (pfx);
|
release_progress_context (pfx);
|
||||||
return rc;
|
return rc;
|
||||||
|
20
g10/sign.c
20
g10/sign.c
@ -614,7 +614,7 @@ write_plaintext_packet (IOBUF out, IOBUF inp, const char *fname, int ptmode)
|
|||||||
|
|
||||||
if( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
if( !(tmpsize = iobuf_get_filelength(inp, &overflow))
|
||||||
&& !overflow && opt.verbose)
|
&& !overflow && opt.verbose)
|
||||||
log_info (_("WARNING: `%s' is an empty file\n"), fname);
|
log_info (_("WARNING: '%s' is an empty file\n"), fname);
|
||||||
|
|
||||||
/* We can't encode the length of very large files because
|
/* We can't encode the length of very large files because
|
||||||
OpenPGP uses only 32 bit for file sizes. So if the size of
|
OpenPGP uses only 32 bit for file sizes. So if the size of
|
||||||
@ -839,7 +839,7 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
|
|||||||
if( !inp )
|
if( !inp )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"), fname? fname: "[stdin]",
|
log_error (_("can't open '%s': %s\n"), fname? fname: "[stdin]",
|
||||||
strerror(errno) );
|
strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -857,11 +857,11 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
|
|||||||
if( !out )
|
if( !out )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't create `%s': %s\n"), outfile, strerror(errno) );
|
log_error(_("can't create '%s': %s\n"), outfile, strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
else if( opt.verbose )
|
else if( opt.verbose )
|
||||||
log_info(_("writing to `%s'\n"), outfile );
|
log_info(_("writing to '%s'\n"), outfile );
|
||||||
}
|
}
|
||||||
else if( (rc = open_outfile (GNUPG_INVALID_FD, fname,
|
else if( (rc = open_outfile (GNUPG_INVALID_FD, fname,
|
||||||
opt.armor? 1: detached? 2:0, &out )))
|
opt.armor? 1: detached? 2:0, &out )))
|
||||||
@ -1039,13 +1039,13 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
|
|||||||
if( !inp )
|
if( !inp )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s': %s\n"),
|
log_error(_("can't open '%s': %s\n"),
|
||||||
sl->d,strerror(errno));
|
sl->d,strerror(errno));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
handle_progress (pfx, inp, sl->d);
|
handle_progress (pfx, inp, sl->d);
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
fprintf(stderr, " `%s'", sl->d );
|
fprintf(stderr, " '%s'", sl->d );
|
||||||
if(opt.textmode)
|
if(opt.textmode)
|
||||||
{
|
{
|
||||||
memset( &tfx, 0, sizeof tfx);
|
memset( &tfx, 0, sizeof tfx);
|
||||||
@ -1157,7 +1157,7 @@ clearsign_file( const char *fname, strlist_t locusr, const char *outfile )
|
|||||||
}
|
}
|
||||||
if( !inp ) {
|
if( !inp ) {
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"),
|
log_error (_("can't open '%s': %s\n"),
|
||||||
fname? fname: "[stdin]", strerror(errno) );
|
fname? fname: "[stdin]", strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -1173,11 +1173,11 @@ clearsign_file( const char *fname, strlist_t locusr, const char *outfile )
|
|||||||
if( !out )
|
if( !out )
|
||||||
{
|
{
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't create `%s': %s\n"), outfile, strerror(errno) );
|
log_error(_("can't create '%s': %s\n"), outfile, strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
else if( opt.verbose )
|
else if( opt.verbose )
|
||||||
log_info(_("writing to `%s'\n"), outfile );
|
log_info(_("writing to '%s'\n"), outfile );
|
||||||
}
|
}
|
||||||
else if( (rc = open_outfile (GNUPG_INVALID_FD, fname, 1, &out )) )
|
else if( (rc = open_outfile (GNUPG_INVALID_FD, fname, 1, &out )) )
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -1315,7 +1315,7 @@ sign_symencrypt_file (const char *fname, strlist_t locusr)
|
|||||||
}
|
}
|
||||||
if( !inp ) {
|
if( !inp ) {
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error (_("can't open `%s': %s\n"),
|
log_error (_("can't open '%s': %s\n"),
|
||||||
fname? fname: "[stdin]", strerror(errno) );
|
fname? fname: "[stdin]", strerror(errno) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ import_ownertrust( const char *fname )
|
|||||||
is_stdin = 1;
|
is_stdin = 1;
|
||||||
}
|
}
|
||||||
else if( !(fp = fopen( fname, "r" )) ) {
|
else if( !(fp = fopen( fname, "r" )) ) {
|
||||||
log_error ( _("can't open `%s': %s\n"), fname, strerror(errno) );
|
log_error ( _("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ import_ownertrust( const char *fname )
|
|||||||
{
|
{
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
gpg_err_set_errno (EPERM);
|
gpg_err_set_errno (EPERM);
|
||||||
log_error (_("can't open `%s': %s\n"), fname, strerror(errno) );
|
log_error (_("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ import_ownertrust( const char *fname )
|
|||||||
continue;
|
continue;
|
||||||
n = strlen(line);
|
n = strlen(line);
|
||||||
if( line[n-1] != '\n' ) {
|
if( line[n-1] != '\n' ) {
|
||||||
log_error (_("error in `%s': %s\n"), fname, _("line too long") );
|
log_error (_("error in '%s': %s\n"), fname, _("line too long") );
|
||||||
/* ... or last line does not have a LF */
|
/* ... or last line does not have a LF */
|
||||||
break; /* can't continue */
|
break; /* can't continue */
|
||||||
}
|
}
|
||||||
@ -166,17 +166,17 @@ import_ownertrust( const char *fname )
|
|||||||
if( !hexdigitp(p) )
|
if( !hexdigitp(p) )
|
||||||
break;
|
break;
|
||||||
if( *p != ':' ) {
|
if( *p != ':' ) {
|
||||||
log_error (_("error in `%s': %s\n"), fname, _("colon missing") );
|
log_error (_("error in '%s': %s\n"), fname, _("colon missing") );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fprlen = p - line;
|
fprlen = p - line;
|
||||||
if( fprlen != 32 && fprlen != 40 ) {
|
if( fprlen != 32 && fprlen != 40 ) {
|
||||||
log_error (_("error in `%s': %s\n"),
|
log_error (_("error in '%s': %s\n"),
|
||||||
fname, _("invalid fingerprint") );
|
fname, _("invalid fingerprint") );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( sscanf(p, ":%u:", &otrust ) != 1 ) {
|
if( sscanf(p, ":%u:", &otrust ) != 1 ) {
|
||||||
log_error (_("error in `%s': %s\n"),
|
log_error (_("error in '%s': %s\n"),
|
||||||
fname, _("ownertrust value missing"));
|
fname, _("ownertrust value missing"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -213,11 +213,11 @@ import_ownertrust( const char *fname )
|
|||||||
any = 1;
|
any = 1;
|
||||||
}
|
}
|
||||||
else /* error */
|
else /* error */
|
||||||
log_error (_("error finding trust record in `%s': %s\n"),
|
log_error (_("error finding trust record in '%s': %s\n"),
|
||||||
fname, g10_errstr(rc));
|
fname, g10_errstr(rc));
|
||||||
}
|
}
|
||||||
if( ferror(fp) )
|
if( ferror(fp) )
|
||||||
log_error ( _("read error in `%s': %s\n"), fname, strerror(errno) );
|
log_error ( _("read error in '%s': %s\n"), fname, strerror(errno) );
|
||||||
if( !is_stdin )
|
if( !is_stdin )
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
20
g10/tdbio.c
20
g10/tdbio.c
@ -511,7 +511,7 @@ tdbio_set_dbname( const char *new_dbname, int create )
|
|||||||
gpg_err_set_errno (EIO);
|
gpg_err_set_errno (EIO);
|
||||||
#endif /*HAVE_W32CE_SYSTEM*/
|
#endif /*HAVE_W32CE_SYSTEM*/
|
||||||
if( errno != ENOENT ) {
|
if( errno != ENOENT ) {
|
||||||
log_error( _("can't access `%s': %s\n"), fname, strerror(errno) );
|
log_error( _("can't access '%s': %s\n"), fname, strerror(errno) );
|
||||||
xfree(fname);
|
xfree(fname);
|
||||||
return G10ERR_TRUSTDB;
|
return G10ERR_TRUSTDB;
|
||||||
}
|
}
|
||||||
@ -548,9 +548,9 @@ tdbio_set_dbname( const char *new_dbname, int create )
|
|||||||
if( !lockhandle )
|
if( !lockhandle )
|
||||||
lockhandle = dotlock_create (db_name, 0);
|
lockhandle = dotlock_create (db_name, 0);
|
||||||
if( !lockhandle )
|
if( !lockhandle )
|
||||||
log_fatal( _("can't create lock for `%s'\n"), db_name );
|
log_fatal( _("can't create lock for '%s'\n"), db_name );
|
||||||
if( dotlock_make (lockhandle, -1) )
|
if( dotlock_make (lockhandle, -1) )
|
||||||
log_fatal( _("can't lock `%s'\n"), db_name );
|
log_fatal( _("can't lock '%s'\n"), db_name );
|
||||||
#endif /* __riscos__ */
|
#endif /* __riscos__ */
|
||||||
oldmask=umask(077);
|
oldmask=umask(077);
|
||||||
if (is_secured_filename (fname)) {
|
if (is_secured_filename (fname)) {
|
||||||
@ -561,17 +561,17 @@ tdbio_set_dbname( const char *new_dbname, int create )
|
|||||||
fp =fopen( fname, "wb" );
|
fp =fopen( fname, "wb" );
|
||||||
umask(oldmask);
|
umask(oldmask);
|
||||||
if( !fp )
|
if( !fp )
|
||||||
log_fatal( _("can't create `%s': %s\n"), fname, strerror(errno) );
|
log_fatal( _("can't create '%s': %s\n"), fname, strerror(errno) );
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
db_fd = open( db_name, O_RDWR | MY_O_BINARY );
|
db_fd = open( db_name, O_RDWR | MY_O_BINARY );
|
||||||
if( db_fd == -1 )
|
if( db_fd == -1 )
|
||||||
log_fatal( _("can't open `%s': %s\n"), db_name, strerror(errno) );
|
log_fatal( _("can't open '%s': %s\n"), db_name, strerror(errno) );
|
||||||
|
|
||||||
#ifndef __riscos__
|
#ifndef __riscos__
|
||||||
if( !lockhandle )
|
if( !lockhandle )
|
||||||
lockhandle = dotlock_create (db_name, 0);
|
lockhandle = dotlock_create (db_name, 0);
|
||||||
if( !lockhandle )
|
if( !lockhandle )
|
||||||
log_fatal( _("can't create lock for `%s'\n"), db_name );
|
log_fatal( _("can't create lock for '%s'\n"), db_name );
|
||||||
#endif /* !__riscos__ */
|
#endif /* !__riscos__ */
|
||||||
|
|
||||||
rc = create_version_record ();
|
rc = create_version_record ();
|
||||||
@ -612,10 +612,10 @@ open_db()
|
|||||||
if (!lockhandle )
|
if (!lockhandle )
|
||||||
lockhandle = dotlock_create (db_name, 0);
|
lockhandle = dotlock_create (db_name, 0);
|
||||||
if (!lockhandle )
|
if (!lockhandle )
|
||||||
log_fatal( _("can't create lock for `%s'\n"), db_name );
|
log_fatal( _("can't create lock for '%s'\n"), db_name );
|
||||||
#ifdef __riscos__
|
#ifdef __riscos__
|
||||||
if (dotlock_take (lockhandle, -1) )
|
if (dotlock_take (lockhandle, -1) )
|
||||||
log_fatal( _("can't lock `%s'\n"), db_name );
|
log_fatal( _("can't lock '%s'\n"), db_name );
|
||||||
#endif /* __riscos__ */
|
#endif /* __riscos__ */
|
||||||
#ifdef HAVE_W32CE_SYSTEM
|
#ifdef HAVE_W32CE_SYSTEM
|
||||||
{
|
{
|
||||||
@ -629,7 +629,7 @@ open_db()
|
|||||||
xfree (wname);
|
xfree (wname);
|
||||||
}
|
}
|
||||||
if (db_fd == -1)
|
if (db_fd == -1)
|
||||||
log_fatal ("can't open `%s': %d, %d\n", db_name,
|
log_fatal ("can't open '%s': %d, %d\n", db_name,
|
||||||
(int)prevrc, (int)GetLastError ());
|
(int)prevrc, (int)GetLastError ());
|
||||||
}
|
}
|
||||||
#else /*!HAVE_W32CE_SYSTEM*/
|
#else /*!HAVE_W32CE_SYSTEM*/
|
||||||
@ -646,7 +646,7 @@ open_db()
|
|||||||
log_info (_("NOTE: trustdb not writable\n"));
|
log_info (_("NOTE: trustdb not writable\n"));
|
||||||
}
|
}
|
||||||
if ( db_fd == -1 )
|
if ( db_fd == -1 )
|
||||||
log_fatal( _("can't open `%s': %s\n"), db_name, strerror(errno) );
|
log_fatal( _("can't open '%s': %s\n"), db_name, strerror(errno) );
|
||||||
#endif /*!HAVE_W32CE_SYSTEM*/
|
#endif /*!HAVE_W32CE_SYSTEM*/
|
||||||
register_secured_file (db_name);
|
register_secured_file (db_name);
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ register_trusted_key( const char *string )
|
|||||||
err = classify_user_id (string, &desc, 1);
|
err = classify_user_id (string, &desc, 1);
|
||||||
if (err || desc.mode != KEYDB_SEARCH_MODE_LONG_KID )
|
if (err || desc.mode != KEYDB_SEARCH_MODE_LONG_KID )
|
||||||
{
|
{
|
||||||
log_error(_("`%s' is not a valid long keyID\n"), string );
|
log_error(_("'%s' is not a valid long keyID\n"), string );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,7 +606,7 @@ check_trustdb ()
|
|||||||
validate_keys (0);
|
validate_keys (0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_info (_("no need for a trustdb check with `%s' trust model\n"),
|
log_info (_("no need for a trustdb check with '%s' trust model\n"),
|
||||||
trust_model_string());
|
trust_model_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,7 +621,7 @@ update_trustdb()
|
|||||||
if(opt.trust_model==TM_PGP || opt.trust_model==TM_CLASSIC)
|
if(opt.trust_model==TM_PGP || opt.trust_model==TM_CLASSIC)
|
||||||
validate_keys (1);
|
validate_keys (1);
|
||||||
else
|
else
|
||||||
log_info (_("no need for a trustdb update with `%s' trust model\n"),
|
log_info (_("no need for a trustdb update with '%s' trust model\n"),
|
||||||
trust_model_string());
|
trust_model_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1885,7 +1885,7 @@ check_regexp(const char *expr,const char *string)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(DBG_TRUST)
|
if(DBG_TRUST)
|
||||||
log_debug("regexp `%s' (`%s') on `%s': %s\n",
|
log_debug("regexp '%s' ('%s') on '%s': %s\n",
|
||||||
regexp,expr,string,ret==0?"YES":"NO");
|
regexp,expr,string,ret==0?"YES":"NO");
|
||||||
|
|
||||||
xfree(regexp);
|
xfree(regexp);
|
||||||
@ -2374,7 +2374,7 @@ validate_keys (int interactive)
|
|||||||
{
|
{
|
||||||
if(DBG_TRUST)
|
if(DBG_TRUST)
|
||||||
log_debug("key %08lX%08lX:"
|
log_debug("key %08lX%08lX:"
|
||||||
" overriding ownertrust `%s' with `%s'\n",
|
" overriding ownertrust '%s' with '%s'\n",
|
||||||
(ulong)k->kid[0],(ulong)k->kid[1],
|
(ulong)k->kid[0],(ulong)k->kid[1],
|
||||||
trust_value_to_string(k->ownertrust),
|
trust_value_to_string(k->ownertrust),
|
||||||
trust_value_to_string(min));
|
trust_value_to_string(min));
|
||||||
|
@ -95,7 +95,7 @@ verify_signatures (ctrl_t ctrl, int nfiles, char **files )
|
|||||||
}
|
}
|
||||||
if( !fp ) {
|
if( !fp ) {
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s': %s\n"),
|
log_error(_("can't open '%s': %s\n"),
|
||||||
print_fname_stdin(sigfile), gpg_strerror (rc));
|
print_fname_stdin(sigfile), gpg_strerror (rc));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ verify_one_file (ctrl_t ctrl, const char *name )
|
|||||||
}
|
}
|
||||||
if( !fp ) {
|
if( !fp ) {
|
||||||
rc = gpg_error_from_syserror ();
|
rc = gpg_error_from_syserror ();
|
||||||
log_error(_("can't open `%s': %s\n"),
|
log_error(_("can't open '%s': %s\n"),
|
||||||
print_fname_stdin(name), strerror (errno));
|
print_fname_stdin(name), strerror (errno));
|
||||||
print_file_status( STATUS_FILE_ERROR, name, 1 );
|
print_file_status( STATUS_FILE_ERROR, name, 1 );
|
||||||
goto leave;
|
goto leave;
|
||||||
|
@ -82,7 +82,7 @@ run_umount_helper (const char *mountpoint)
|
|||||||
|
|
||||||
err = gnupg_spawn_process_detached (pgmname, args, NULL);
|
err = gnupg_spawn_process_detached (pgmname, args, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
log_error ("failed to run `%s': %s\n",
|
log_error ("failed to run '%s': %s\n",
|
||||||
pgmname, gpg_strerror (err));
|
pgmname, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ handle_status_line (runner_t runner, const char *line,
|
|||||||
{
|
{
|
||||||
for (line +=8; *line && spacep (line); line++)
|
for (line +=8; *line && spacep (line); line++)
|
||||||
;
|
;
|
||||||
log_info ("got status `%s'\n", line);
|
log_info ("got status '%s'\n", line);
|
||||||
if (!strcmp (line, "fuse_main_start"))
|
if (!strcmp (line, "fuse_main_start"))
|
||||||
{
|
{
|
||||||
/* Send a special error code back to let the caller know
|
/* Send a special error code back to let the caller know
|
||||||
@ -114,7 +114,7 @@ handle_status_line (runner_t runner, const char *line,
|
|||||||
{
|
{
|
||||||
for (line +=8; *line && spacep (line); line++)
|
for (line +=8; *line && spacep (line); line++)
|
||||||
;
|
;
|
||||||
log_info ("got prompt `%s'\n", line);
|
log_info ("got prompt '%s'\n", line);
|
||||||
if (!strcmp (line, "create_root_dir"))
|
if (!strcmp (line, "create_root_dir"))
|
||||||
err = send_cmd (runner, cmd == ENCFS_CMD_CREATE? "y":"n");
|
err = send_cmd (runner, cmd == ENCFS_CMD_CREATE? "y":"n");
|
||||||
else if (!strcmp (line, "create_mount_point"))
|
else if (!strcmp (line, "create_mount_point"))
|
||||||
@ -270,7 +270,7 @@ run_encfs_tool (ctrl_t ctrl, enum encfs_cmds cmd,
|
|||||||
outbound[0], -1, inbound[1], &pid);
|
outbound[0], -1, inbound[1], &pid);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error ("error spawning `%s': %s\n", pgmname, gpg_strerror (err));
|
log_error ("error spawning '%s': %s\n", pgmname, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
close (outbound[0]); outbound[0] = -1;
|
close (outbound[0]); outbound[0] = -1;
|
||||||
@ -291,7 +291,7 @@ run_encfs_tool (ctrl_t ctrl, enum encfs_cmds cmd,
|
|||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
*r_id = runner_get_rid (runner);
|
*r_id = runner_get_rid (runner);
|
||||||
log_info ("running `%s' in the background\n", pgmname);
|
log_info ("running '%s' in the background\n", pgmname);
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
if (inbound[0] != -1)
|
if (inbound[0] != -1)
|
||||||
@ -418,7 +418,7 @@ be_encfs_create_container (ctrl_t ctrl, const char *fname, tupledesc_t tuples,
|
|||||||
if (!mkdtemp (mountpoint))
|
if (!mkdtemp (mountpoint))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("can't create directory `%s': %s\n"),
|
log_error (_("can't create directory '%s': %s\n"),
|
||||||
"/tmp/.#g13_XXXXXX", gpg_strerror (err));
|
"/tmp/.#g13_XXXXXX", gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -428,7 +428,7 @@ be_encfs_create_container (ctrl_t ctrl, const char *fname, tupledesc_t tuples,
|
|||||||
|
|
||||||
/* In any case remove the temporary mount point. */
|
/* In any case remove the temporary mount point. */
|
||||||
if (rmdir (mountpoint))
|
if (rmdir (mountpoint))
|
||||||
log_error ("error removing temporary mount point `%s': %s\n",
|
log_error ("error removing temporary mount point '%s': %s\n",
|
||||||
mountpoint, gpg_strerror (gpg_error_from_syserror ()));
|
mountpoint, gpg_strerror (gpg_error_from_syserror ()));
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ start_gpg (ctrl_t ctrl, int input_fd, int output_fd, assuan_context_t *r_ctx)
|
|||||||
opt.gpg_program = gnupg_module_name (GNUPG_MODULE_NAME_GPG);
|
opt.gpg_program = gnupg_module_name (GNUPG_MODULE_NAME_GPG);
|
||||||
|
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info (_("no running gpg - starting `%s'\n"), opt.gpg_program);
|
log_info (_("no running gpg - starting '%s'\n"), opt.gpg_program);
|
||||||
|
|
||||||
/* Compute argv[0]. */
|
/* Compute argv[0]. */
|
||||||
if ( !(pgmname = strrchr (opt.gpg_program, '/')))
|
if ( !(pgmname = strrchr (opt.gpg_program, '/')))
|
||||||
|
@ -135,7 +135,7 @@ write_keyblob (const char *filename,
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error creating new container `%s': %s\n",
|
log_error ("error creating new container '%s': %s\n",
|
||||||
filename, gpg_strerror (err));
|
filename, gpg_strerror (err));
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ write_keyblob (const char *filename,
|
|||||||
if (es_fclose (fp))
|
if (es_fclose (fp))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error closing `%s': %s\n",
|
log_error ("error closing '%s': %s\n",
|
||||||
filename, gpg_strerror (err));
|
filename, gpg_strerror (err));
|
||||||
remove (filename);
|
remove (filename);
|
||||||
return err;
|
return err;
|
||||||
@ -208,7 +208,7 @@ write_keyblob (const char *filename,
|
|||||||
|
|
||||||
writeerr:
|
writeerr:
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error writing header to `%s': %s\n",
|
log_error ("error writing header to '%s': %s\n",
|
||||||
filename, gpg_strerror (err));
|
filename, gpg_strerror (err));
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
remove (filename);
|
remove (filename);
|
||||||
|
12
g13/g13.c
12
g13/g13.c
@ -273,7 +273,7 @@ set_debug (void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("invalid debug-level `%s' given\n"), debug_level);
|
log_error (_("invalid debug-level '%s' given\n"), debug_level);
|
||||||
g13_exit(2);
|
g13_exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,11 +448,11 @@ main ( int argc, char **argv)
|
|||||||
if (default_config)
|
if (default_config)
|
||||||
{
|
{
|
||||||
if (parse_debug)
|
if (parse_debug)
|
||||||
log_info (_("NOTE: no default option file `%s'\n"), configname);
|
log_info (_("NOTE: no default option file '%s'\n"), configname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error (_("option file `%s': %s\n"),
|
log_error (_("option file '%s': %s\n"),
|
||||||
configname, strerror(errno));
|
configname, strerror(errno));
|
||||||
g13_exit(2);
|
g13_exit(2);
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ main ( int argc, char **argv)
|
|||||||
configname = NULL;
|
configname = NULL;
|
||||||
}
|
}
|
||||||
if (parse_debug && configname)
|
if (parse_debug && configname)
|
||||||
log_info (_("reading options from `%s'\n"), configname);
|
log_info (_("reading options from '%s'\n"), configname);
|
||||||
default_config = 0;
|
default_config = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,7 +606,7 @@ main ( int argc, char **argv)
|
|||||||
|
|
||||||
for (i=0; i < argc; i++)
|
for (i=0; i < argc; i++)
|
||||||
if (argv[i][0] == '-' && argv[i][1] == '-')
|
if (argv[i][0] == '-' && argv[i][1] == '-')
|
||||||
log_info (_("NOTE: `%s' is not considered an option\n"), argv[i]);
|
log_info (_("NOTE: '%s' is not considered an option\n"), argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -728,7 +728,7 @@ main ( int argc, char **argv)
|
|||||||
start_idle_task ();
|
start_idle_task ();
|
||||||
err = g13_mount_container (&ctrl, argv[0], argc == 2?argv[1]:NULL);
|
err = g13_mount_container (&ctrl, argv[0], argc == 2?argv[1]:NULL);
|
||||||
if (err)
|
if (err)
|
||||||
log_error ("error mounting container `%s': %s <%s>\n",
|
log_error ("error mounting container '%s': %s <%s>\n",
|
||||||
*argv, gpg_strerror (err), gpg_strsource (err));
|
*argv, gpg_strerror (err), gpg_strsource (err));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
22
g13/mount.c
22
g13/mount.c
@ -55,24 +55,24 @@ parse_header (const char *filename,
|
|||||||
if (packet[0] != (0xc0|61) || len < 26
|
if (packet[0] != (0xc0|61) || len < 26
|
||||||
|| memcmp (packet+6, "GnuPG/G13", 10))
|
|| memcmp (packet+6, "GnuPG/G13", 10))
|
||||||
{
|
{
|
||||||
log_error ("file `%s' is not valid container\n", filename);
|
log_error ("file '%s' is not valid container\n", filename);
|
||||||
return gpg_error (GPG_ERR_INV_OBJ);
|
return gpg_error (GPG_ERR_INV_OBJ);
|
||||||
}
|
}
|
||||||
if (packet[16] != 1)
|
if (packet[16] != 1)
|
||||||
{
|
{
|
||||||
log_error ("unknown version %u of container `%s'\n",
|
log_error ("unknown version %u of container '%s'\n",
|
||||||
(unsigned int)packet[16], filename);
|
(unsigned int)packet[16], filename);
|
||||||
return gpg_error (GPG_ERR_INV_OBJ);
|
return gpg_error (GPG_ERR_INV_OBJ);
|
||||||
}
|
}
|
||||||
if (packet[17] || packet[18]
|
if (packet[17] || packet[18]
|
||||||
|| packet[26] || packet[27] || packet[28] || packet[29]
|
|| packet[26] || packet[27] || packet[28] || packet[29]
|
||||||
|| packet[30] || packet[31])
|
|| packet[30] || packet[31])
|
||||||
log_info ("WARNING: unknown meta information in `%s'\n", filename);
|
log_info ("WARNING: unknown meta information in '%s'\n", filename);
|
||||||
if (packet[19])
|
if (packet[19])
|
||||||
log_info ("WARNING: OS flag is not supported in `%s'\n", filename);
|
log_info ("WARNING: OS flag is not supported in '%s'\n", filename);
|
||||||
if (packet[24] != 1 || packet[25] != 0)
|
if (packet[24] != 1 || packet[25] != 0)
|
||||||
{
|
{
|
||||||
log_error ("meta data copies in `%s' are not supported\n", filename);
|
log_error ("meta data copies in '%s' are not supported\n", filename);
|
||||||
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
|
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ parse_header (const char *filename,
|
|||||||
/* Do a basic sanity check on the length. */
|
/* Do a basic sanity check on the length. */
|
||||||
if (len < 32 || len > 1024*1024)
|
if (len < 32 || len > 1024*1024)
|
||||||
{
|
{
|
||||||
log_error ("bad length given in container `%s'\n", filename);
|
log_error ("bad length given in container '%s'\n", filename);
|
||||||
return gpg_error (GPG_ERR_INV_OBJ);
|
return gpg_error (GPG_ERR_INV_OBJ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ read_keyblob_prefix (const char *filename, estream_t *r_fp, size_t *r_headerlen)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error reading `%s': %s\n", filename, gpg_strerror (err));
|
log_error ("error reading '%s': %s\n", filename, gpg_strerror (err));
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ read_keyblob_prefix (const char *filename, estream_t *r_fp, size_t *r_headerlen)
|
|||||||
if (es_fread (packet, 32, 1, fp) != 1)
|
if (es_fread (packet, 32, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error reading the header of `%s': %s\n",
|
log_error ("error reading the header of '%s': %s\n",
|
||||||
filename, gpg_strerror (err));
|
filename, gpg_strerror (err));
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
return err;
|
return err;
|
||||||
@ -150,7 +150,7 @@ read_keyblob (const char *filename,
|
|||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
if (opt.verbose)
|
if (opt.verbose)
|
||||||
log_info ("header length of `%s' is %zu\n", filename, headerlen);
|
log_info ("header length of '%s' is %zu\n", filename, headerlen);
|
||||||
|
|
||||||
/* Read everything including the padding. We should eventually do a
|
/* Read everything including the padding. We should eventually do a
|
||||||
regular OpenPGP parsing to detect the padding packet and pass
|
regular OpenPGP parsing to detect the padding packet and pass
|
||||||
@ -173,7 +173,7 @@ read_keyblob (const char *filename,
|
|||||||
if (es_fread (msg, msglen, 1, fp) != 1)
|
if (es_fread (msg, msglen, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error ("error reading keyblob of `%s': %s\n",
|
log_error ("error reading keyblob of '%s': %s\n",
|
||||||
filename, gpg_strerror (err));
|
filename, gpg_strerror (err));
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ g13_mount_container (ctrl_t ctrl, const char *filename, const char *mountpoint)
|
|||||||
if (!mkdtemp (mountpoint_buffer))
|
if (!mkdtemp (mountpoint_buffer))
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_error (_("can't create directory `%s': %s\n"),
|
log_error (_("can't create directory '%s': %s\n"),
|
||||||
"/tmp/g13-XXXXXX", gpg_strerror (err));
|
"/tmp/g13-XXXXXX", gpg_strerror (err));
|
||||||
xfree (mountpoint_buffer);
|
xfree (mountpoint_buffer);
|
||||||
return err;
|
return err;
|
||||||
|
@ -136,7 +136,7 @@ mountinfo_del_mount (const char *container, const char *mountpoint,
|
|||||||
not have completed yet. We should add the mountpoints
|
not have completed yet. We should add the mountpoints
|
||||||
to an idle queue and retry a remove. */
|
to an idle queue and retry a remove. */
|
||||||
if (rmdir (m->mountpoint))
|
if (rmdir (m->mountpoint))
|
||||||
log_error ("error removing mount point `%s': %s\n",
|
log_error ("error removing mount point '%s': %s\n",
|
||||||
m->mountpoint,
|
m->mountpoint,
|
||||||
gpg_strerror (gpg_error_from_syserror ()));
|
gpg_strerror (gpg_error_from_syserror ()));
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ runner_thread (void *arg)
|
|||||||
gnupg_release_process (runner->pid);
|
gnupg_release_process (runner->pid);
|
||||||
runner->pid = (pid_t)(-1);
|
runner->pid = (pid_t)(-1);
|
||||||
if (err)
|
if (err)
|
||||||
log_error ("running `%s' failed (exitcode=%d): %s\n",
|
log_error ("running '%s' failed (exitcode=%d): %s\n",
|
||||||
runner->name, exitcode, gpg_strerror (err));
|
runner->name, exitcode, gpg_strerror (err));
|
||||||
log_debug ("runner thread waiting finished\n");
|
log_debug ("runner thread waiting finished\n");
|
||||||
}
|
}
|
||||||
|
10
gl/setenv.c
10
gl/setenv.c
@ -47,7 +47,7 @@ extern char **environ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if _LIBC
|
#if _LIBC
|
||||||
/* This lock protects against simultaneous modifications of `environ'. */
|
/* This lock protects against simultaneous modifications of 'environ'. */
|
||||||
# include <bits/libc-lock.h>
|
# include <bits/libc-lock.h>
|
||||||
__libc_lock_define_initialized (static, envlock)
|
__libc_lock_define_initialized (static, envlock)
|
||||||
# define LOCK __libc_lock_lock (envlock)
|
# define LOCK __libc_lock_lock (envlock)
|
||||||
@ -101,11 +101,11 @@ static void *known_values;
|
|||||||
static char **last_environ;
|
static char **last_environ;
|
||||||
|
|
||||||
|
|
||||||
/* This function is used by `setenv' and `putenv'. The difference between
|
/* This function is used by 'setenv' and 'putenv'. The difference between
|
||||||
the two functions is that for the former must create a new string which
|
the two functions is that for the former must create a new string which
|
||||||
is then placed in the environment, while the argument of `putenv'
|
is then placed in the environment, while the argument of 'putenv'
|
||||||
must be used directly. This is all complicated by the fact that we try
|
must be used directly. This is all complicated by the fact that we try
|
||||||
to reuse values once generated for a `setenv' call since we can never
|
to reuse values once generated for a 'setenv' call since we can never
|
||||||
free the strings. */
|
free the strings. */
|
||||||
int
|
int
|
||||||
__add_to_environ (const char *name, const char *value, const char *combined,
|
__add_to_environ (const char *name, const char *value, const char *combined,
|
||||||
@ -288,7 +288,7 @@ setenv (const char *name, const char *value, int replace)
|
|||||||
return __add_to_environ (name, value, NULL, replace);
|
return __add_to_environ (name, value, NULL, replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The `clearenv' was planned to be added to POSIX.1 but probably
|
/* The 'clearenv' was planned to be added to POSIX.1 but probably
|
||||||
never made it. Nevertheless the POSIX.9 standard (POSIX bindings
|
never made it. Nevertheless the POSIX.9 standard (POSIX bindings
|
||||||
for Fortran 77) requires this function. */
|
for Fortran 77) requires this function. */
|
||||||
int
|
int
|
||||||
|
@ -38,7 +38,7 @@ extern char **environ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if _LIBC
|
#if _LIBC
|
||||||
/* This lock protects against simultaneous modifications of `environ'. */
|
/* This lock protects against simultaneous modifications of 'environ'. */
|
||||||
# include <bits/libc-lock.h>
|
# include <bits/libc-lock.h>
|
||||||
__libc_lock_define_initialized (static, envlock)
|
__libc_lock_define_initialized (static, envlock)
|
||||||
# define LOCK __libc_lock_lock (envlock)
|
# define LOCK __libc_lock_lock (envlock)
|
||||||
|
@ -31,7 +31,7 @@ extern "C" {
|
|||||||
<regex.h>. */
|
<regex.h>. */
|
||||||
|
|
||||||
#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
|
#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
|
||||||
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
|
/* VMS doesn't have 'size_t' in <sys/types.h>, even though POSIX says it
|
||||||
should be there. */
|
should be there. */
|
||||||
# include <stddef.h>
|
# include <stddef.h>
|
||||||
#endif
|
#endif
|
||||||
@ -116,9 +116,9 @@ typedef unsigned long int reg_syntax_t;
|
|||||||
If not set, newline is literal. */
|
If not set, newline is literal. */
|
||||||
#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
|
#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
|
||||||
|
|
||||||
/* If this bit is set, then `{...}' defines an interval, and \{ and \}
|
/* If this bit is set, then '{...}' defines an interval, and \{ and \}
|
||||||
are literals.
|
are literals.
|
||||||
If not set, then `\{...\}' defines an interval. */
|
If not set, then '\{...\}' defines an interval. */
|
||||||
#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
|
#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
|
||||||
|
|
||||||
/* If this bit is set, (...) defines a group, and \( and \) are literals.
|
/* If this bit is set, (...) defines a group, and \( and \) are literals.
|
||||||
@ -255,7 +255,7 @@ extern reg_syntax_t re_syntax_options;
|
|||||||
#define RE_DUP_MAX (0x7fff)
|
#define RE_DUP_MAX (0x7fff)
|
||||||
|
|
||||||
|
|
||||||
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
|
/* POSIX 'cflags' bits (i.e., information for 'regcomp'). */
|
||||||
|
|
||||||
/* If this bit is set, then use extended regular expression syntax.
|
/* If this bit is set, then use extended regular expression syntax.
|
||||||
If not set, then use basic regular expression syntax. */
|
If not set, then use basic regular expression syntax. */
|
||||||
@ -275,7 +275,7 @@ extern reg_syntax_t re_syntax_options;
|
|||||||
#define REG_NOSUB (REG_NEWLINE << 1)
|
#define REG_NOSUB (REG_NEWLINE << 1)
|
||||||
|
|
||||||
|
|
||||||
/* POSIX `eflags' bits (i.e., information for regexec). */
|
/* POSIX 'eflags' bits (i.e., information for regexec). */
|
||||||
|
|
||||||
/* If this bit is set, then the beginning-of-line operator doesn't match
|
/* If this bit is set, then the beginning-of-line operator doesn't match
|
||||||
the beginning of the string (presumably because it's not the
|
the beginning of the string (presumably because it's not the
|
||||||
@ -289,7 +289,7 @@ extern reg_syntax_t re_syntax_options;
|
|||||||
|
|
||||||
|
|
||||||
/* If any error codes are removed, changed, or added, update the
|
/* If any error codes are removed, changed, or added, update the
|
||||||
`re_error_msg' table in regex.c. */
|
're_error_msg' table in regex.c. */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
#ifdef _XOPEN_SOURCE
|
#ifdef _XOPEN_SOURCE
|
||||||
@ -321,9 +321,9 @@ typedef enum
|
|||||||
} reg_errcode_t;
|
} reg_errcode_t;
|
||||||
|
|
||||||
/* This data structure represents a compiled pattern. Before calling
|
/* This data structure represents a compiled pattern. Before calling
|
||||||
the pattern compiler, the fields `buffer', `allocated', `fastmap',
|
the pattern compiler, the fields 'buffer', 'allocated', 'fastmap',
|
||||||
`translate', and `no_sub' can be set. After the pattern has been
|
'translate', and 'no_sub' can be set. After the pattern has been
|
||||||
compiled, the `re_nsub' field is available. All other fields are
|
compiled, the 're_nsub' field is available. All other fields are
|
||||||
private to the regex routines. */
|
private to the regex routines. */
|
||||||
|
|
||||||
#ifndef RE_TRANSLATE_TYPE
|
#ifndef RE_TRANSLATE_TYPE
|
||||||
@ -334,14 +334,14 @@ struct re_pattern_buffer
|
|||||||
{
|
{
|
||||||
/* [[[begin pattern_buffer]]] */
|
/* [[[begin pattern_buffer]]] */
|
||||||
/* Space that holds the compiled pattern. It is declared as
|
/* Space that holds the compiled pattern. It is declared as
|
||||||
`unsigned char *' because its elements are
|
'unsigned char *' because its elements are
|
||||||
sometimes used as array indexes. */
|
sometimes used as array indexes. */
|
||||||
unsigned char *buffer;
|
unsigned char *buffer;
|
||||||
|
|
||||||
/* Number of bytes to which `buffer' points. */
|
/* Number of bytes to which 'buffer' points. */
|
||||||
unsigned long int allocated;
|
unsigned long int allocated;
|
||||||
|
|
||||||
/* Number of bytes actually used in `buffer'. */
|
/* Number of bytes actually used in 'buffer'. */
|
||||||
unsigned long int used;
|
unsigned long int used;
|
||||||
|
|
||||||
/* Syntax setting with which the pattern was compiled. */
|
/* Syntax setting with which the pattern was compiled. */
|
||||||
@ -362,14 +362,14 @@ struct re_pattern_buffer
|
|||||||
size_t re_nsub;
|
size_t re_nsub;
|
||||||
|
|
||||||
/* Zero if this pattern cannot match the empty string, one else.
|
/* Zero if this pattern cannot match the empty string, one else.
|
||||||
Well, in truth it's used only in `re_search_2', to see
|
Well, in truth it's used only in 're_search_2', to see
|
||||||
whether or not we should use the fastmap, so we don't set
|
whether or not we should use the fastmap, so we don't set
|
||||||
this absolutely perfectly; see `re_compile_fastmap' (the
|
this absolutely perfectly; see 're_compile_fastmap' (the
|
||||||
`duplicate' case). */
|
'duplicate' case). */
|
||||||
unsigned can_be_null : 1;
|
unsigned can_be_null : 1;
|
||||||
|
|
||||||
/* If REGS_UNALLOCATED, allocate space in the `regs' structure
|
/* If REGS_UNALLOCATED, allocate space in the 'regs' structure
|
||||||
for `max (RE_NREGS, re_nsub + 1)' groups.
|
for 'max (RE_NREGS, re_nsub + 1)' groups.
|
||||||
If REGS_REALLOCATE, reallocate space if necessary.
|
If REGS_REALLOCATE, reallocate space if necessary.
|
||||||
If REGS_FIXED, use what's there. */
|
If REGS_FIXED, use what's there. */
|
||||||
#define REGS_UNALLOCATED 0
|
#define REGS_UNALLOCATED 0
|
||||||
@ -377,11 +377,11 @@ struct re_pattern_buffer
|
|||||||
#define REGS_FIXED 2
|
#define REGS_FIXED 2
|
||||||
unsigned regs_allocated : 2;
|
unsigned regs_allocated : 2;
|
||||||
|
|
||||||
/* Set to zero when `regex_compile' compiles a pattern; set to one
|
/* Set to zero when 'regex_compile' compiles a pattern; set to one
|
||||||
by `re_compile_fastmap' if it updates the fastmap. */
|
by 're_compile_fastmap' if it updates the fastmap. */
|
||||||
unsigned fastmap_accurate : 1;
|
unsigned fastmap_accurate : 1;
|
||||||
|
|
||||||
/* If set, `re_match_2' does not return information about
|
/* If set, 're_match_2' does not return information about
|
||||||
subexpressions. */
|
subexpressions. */
|
||||||
unsigned no_sub : 1;
|
unsigned no_sub : 1;
|
||||||
|
|
||||||
@ -414,16 +414,16 @@ struct re_registers
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
|
/* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
|
||||||
`re_match_2' returns information about at least this many registers
|
're_match_2' returns information about at least this many registers
|
||||||
the first time a `regs' structure is passed. */
|
the first time a 'regs' structure is passed. */
|
||||||
#ifndef RE_NREGS
|
#ifndef RE_NREGS
|
||||||
# define RE_NREGS 30
|
# define RE_NREGS 30
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* POSIX specification for registers. Aside from the different names than
|
/* POSIX specification for registers. Aside from the different names than
|
||||||
`re_registers', POSIX uses an array of structures, instead of a
|
're_registers', POSIX uses an array of structures, instead of a
|
||||||
structure of arrays. */
|
structure of arrays. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -450,11 +450,11 @@ typedef struct
|
|||||||
#endif /* not __STDC__ */
|
#endif /* not __STDC__ */
|
||||||
|
|
||||||
/* Sets the current default syntax to SYNTAX, and return the old syntax.
|
/* Sets the current default syntax to SYNTAX, and return the old syntax.
|
||||||
You can also simply assign to the `re_syntax_options' variable. */
|
You can also simply assign to the 're_syntax_options' variable. */
|
||||||
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
||||||
|
|
||||||
/* Compile the regular expression PATTERN, with length LENGTH
|
/* Compile the regular expression PATTERN, with length LENGTH
|
||||||
and syntax given by the global `re_syntax_options', into the buffer
|
and syntax given by the global 're_syntax_options', into the buffer
|
||||||
BUFFER. Return NULL if successful, and an error string if not. */
|
BUFFER. Return NULL if successful, and an error string if not. */
|
||||||
extern const char *re_compile_pattern
|
extern const char *re_compile_pattern
|
||||||
_RE_ARGS ((const char *pattern, size_t length,
|
_RE_ARGS ((const char *pattern, size_t length,
|
||||||
@ -477,7 +477,7 @@ extern int re_search
|
|||||||
int length, int start, int range, struct re_registers *regs));
|
int length, int start, int range, struct re_registers *regs));
|
||||||
|
|
||||||
|
|
||||||
/* Like `re_search', but search in the concatenation of STRING1 and
|
/* Like 're_search', but search in the concatenation of STRING1 and
|
||||||
STRING2. Also, stop searching at index START + STOP. */
|
STRING2. Also, stop searching at index START + STOP. */
|
||||||
extern int re_search_2
|
extern int re_search_2
|
||||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||||
@ -485,14 +485,14 @@ extern int re_search_2
|
|||||||
int start, int range, struct re_registers *regs, int stop));
|
int start, int range, struct re_registers *regs, int stop));
|
||||||
|
|
||||||
|
|
||||||
/* Like `re_search', but return how many characters in STRING the regexp
|
/* Like 're_search', but return how many characters in STRING the regexp
|
||||||
in BUFFER matched, starting at position START. */
|
in BUFFER matched, starting at position START. */
|
||||||
extern int re_match
|
extern int re_match
|
||||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
||||||
int length, int start, struct re_registers *regs));
|
int length, int start, struct re_registers *regs));
|
||||||
|
|
||||||
|
|
||||||
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
/* Relates to 're_match' as 're_search_2' relates to 're_search'. */
|
||||||
extern int re_match_2
|
extern int re_match_2
|
||||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||||
int length1, const char *string2, int length2,
|
int length1, const char *string2, int length2,
|
||||||
|
@ -258,7 +258,7 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
nread = fread (buf+buflen, 1, NCHUNK, fp);
|
nread = fread (buf+buflen, 1, NCHUNK, fp);
|
||||||
if (nread < NCHUNK && ferror (fp))
|
if (nread < NCHUNK && ferror (fp))
|
||||||
{
|
{
|
||||||
log_error ("error reading `[stdin]': %s\n", strerror (errno));
|
log_error ("error reading '[stdin]': %s\n", strerror (errno));
|
||||||
xfree (buf);
|
xfree (buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -275,13 +275,13 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
fp = fopen (fname, "rb");
|
fp = fopen (fname, "rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
log_error ("can't open `%s': %s\n", fname, strerror (errno));
|
log_error ("can't open '%s': %s\n", fname, strerror (errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fstat (fileno(fp), &st))
|
if (fstat (fileno(fp), &st))
|
||||||
{
|
{
|
||||||
log_error ("can't stat `%s': %s\n", fname, strerror (errno));
|
log_error ("can't stat '%s': %s\n", fname, strerror (errno));
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ read_file (const char *fname, size_t *r_length)
|
|||||||
log_fatal ("can't allocate buffer: %s\n", strerror (errno));
|
log_fatal ("can't allocate buffer: %s\n", strerror (errno));
|
||||||
if (fread (buf, buflen, 1, fp) != 1)
|
if (fread (buf, buflen, 1, fp) != 1)
|
||||||
{
|
{
|
||||||
log_error ("error reading `%s': %s\n", fname, strerror (errno));
|
log_error ("error reading '%s': %s\n", fname, strerror (errno));
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
xfree (buf);
|
xfree (buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -223,19 +223,19 @@ void _keybox_free (void *p);
|
|||||||
|
|
||||||
#define return_if_fail(expr) do { \
|
#define return_if_fail(expr) do { \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
fprintf (stderr, "%s:%d: assertion `%s' failed\n", \
|
fprintf (stderr, "%s:%d: assertion '%s' failed\n", \
|
||||||
__FILE__, __LINE__, #expr ); \
|
__FILE__, __LINE__, #expr ); \
|
||||||
return; \
|
return; \
|
||||||
} } while (0)
|
} } while (0)
|
||||||
#define return_null_if_fail(expr) do { \
|
#define return_null_if_fail(expr) do { \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
fprintf (stderr, "%s:%d: assertion `%s' failed\n", \
|
fprintf (stderr, "%s:%d: assertion '%s' failed\n", \
|
||||||
__FILE__, __LINE__, #expr ); \
|
__FILE__, __LINE__, #expr ); \
|
||||||
return NULL; \
|
return NULL; \
|
||||||
} } while (0)
|
} } while (0)
|
||||||
#define return_val_if_fail(expr,val) do { \
|
#define return_val_if_fail(expr,val) do { \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
fprintf (stderr, "%s:%d: assertion `%s' failed\n", \
|
fprintf (stderr, "%s:%d: assertion '%s' failed\n", \
|
||||||
__FILE__, __LINE__, #expr ); \
|
__FILE__, __LINE__, #expr ); \
|
||||||
return (val); \
|
return (val); \
|
||||||
} } while (0)
|
} } while (0)
|
||||||
|
@ -471,7 +471,7 @@ open_file (const char **filename, FILE *outfp)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
int save_errno = errno;
|
int save_errno = errno;
|
||||||
fprintf (outfp, "can't open `%s': %s\n", *filename, strerror(errno));
|
fprintf (outfp, "can't open '%s': %s\n", *filename, strerror(errno));
|
||||||
gpg_err_set_errno (save_errno);
|
gpg_err_set_errno (save_errno);
|
||||||
}
|
}
|
||||||
return fp;
|
return fp;
|
||||||
@ -511,7 +511,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp)
|
|||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
rc = 0;
|
rc = 0;
|
||||||
if (rc)
|
if (rc)
|
||||||
fprintf (outfp, "error reading `%s': %s\n", filename, gpg_strerror (rc));
|
fprintf (outfp, "error reading '%s': %s\n", filename, gpg_strerror (rc));
|
||||||
|
|
||||||
if (fp != stdin)
|
if (fp != stdin)
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
@ -592,7 +592,7 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp)
|
|||||||
if (!dupitems)
|
if (!dupitems)
|
||||||
{
|
{
|
||||||
gpg_error_t tmperr = gpg_error_from_syserror ();
|
gpg_error_t tmperr = gpg_error_from_syserror ();
|
||||||
fprintf (outfp, "error allocating array for `%s': %s\n",
|
fprintf (outfp, "error allocating array for '%s': %s\n",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
return tmperr;
|
return tmperr;
|
||||||
}
|
}
|
||||||
@ -603,7 +603,7 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp)
|
|||||||
unsigned char digest[20];
|
unsigned char digest[20];
|
||||||
|
|
||||||
if (hash_blob_rawdata (blob, digest))
|
if (hash_blob_rawdata (blob, digest))
|
||||||
fprintf (outfp, "error in blob %ld of `%s'\n", recno, filename);
|
fprintf (outfp, "error in blob %ld of '%s'\n", recno, filename);
|
||||||
else if (memcmp (digest, zerodigest, 20))
|
else if (memcmp (digest, zerodigest, 20))
|
||||||
{
|
{
|
||||||
if (dupitems_count >= dupitems_size)
|
if (dupitems_count >= dupitems_size)
|
||||||
@ -615,7 +615,7 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp)
|
|||||||
if (!tmp)
|
if (!tmp)
|
||||||
{
|
{
|
||||||
gpg_error_t tmperr = gpg_error_from_syserror ();
|
gpg_error_t tmperr = gpg_error_from_syserror ();
|
||||||
fprintf (outfp, "error reallocating array for `%s': %s\n",
|
fprintf (outfp, "error reallocating array for '%s': %s\n",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
free (dupitems);
|
free (dupitems);
|
||||||
return tmperr;
|
return tmperr;
|
||||||
@ -632,7 +632,7 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp)
|
|||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
rc = 0;
|
rc = 0;
|
||||||
if (rc)
|
if (rc)
|
||||||
fprintf (outfp, "error reading `%s': %s\n", filename, gpg_strerror (rc));
|
fprintf (outfp, "error reading '%s': %s\n", filename, gpg_strerror (rc));
|
||||||
if (fp != stdin)
|
if (fp != stdin)
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ _keybox_dump_cut_records (const char *filename, unsigned long from,
|
|||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
rc = 0;
|
rc = 0;
|
||||||
if (rc)
|
if (rc)
|
||||||
fprintf (stderr, "error reading `%s': %s\n", filename, gpg_strerror (rc));
|
fprintf (stderr, "error reading '%s': %s\n", filename, gpg_strerror (rc));
|
||||||
leave:
|
leave:
|
||||||
if (fp != stdin)
|
if (fp != stdin)
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
|
@ -159,7 +159,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname,
|
|||||||
/* { */
|
/* { */
|
||||||
/* if (chmod (tmpfname, S_IRUSR | S_IWUSR) ) */
|
/* if (chmod (tmpfname, S_IRUSR | S_IWUSR) ) */
|
||||||
/* { */
|
/* { */
|
||||||
/* log_debug ("chmod of `%s' failed: %s\n", */
|
/* log_debug ("chmod of '%s' failed: %s\n", */
|
||||||
/* tmpfname, strerror(errno) ); */
|
/* tmpfname, strerror(errno) ); */
|
||||||
/* return KEYBOX_Write_File; */
|
/* return KEYBOX_Write_File; */
|
||||||
/* } */
|
/* } */
|
||||||
|
@ -150,7 +150,7 @@ main(int argc,char *argv[])
|
|||||||
output=fopen(optarg,"wb");
|
output=fopen(optarg,"wb");
|
||||||
if(output==NULL)
|
if(output==NULL)
|
||||||
{
|
{
|
||||||
fprintf(console,"gpgkeys: Cannot open output file `%s': %s\n",
|
fprintf(console,"gpgkeys: Cannot open output file '%s': %s\n",
|
||||||
optarg,strerror(errno));
|
optarg,strerror(errno));
|
||||||
return KEYSERVER_INTERNAL_ERROR;
|
return KEYSERVER_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ main(int argc,char *argv[])
|
|||||||
input=fopen(argv[optind],"r");
|
input=fopen(argv[optind],"r");
|
||||||
if(input==NULL)
|
if(input==NULL)
|
||||||
{
|
{
|
||||||
fprintf(console,"gpgkeys: Cannot open input file `%s': %s\n",
|
fprintf(console,"gpgkeys: Cannot open input file '%s': %s\n",
|
||||||
argv[optind],strerror(errno));
|
argv[optind],strerror(errno));
|
||||||
return KEYSERVER_INTERNAL_ERROR;
|
return KEYSERVER_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ main(int argc,char *argv[])
|
|||||||
|
|
||||||
if(curldata->protocols[i]==NULL)
|
if(curldata->protocols[i]==NULL)
|
||||||
{
|
{
|
||||||
fprintf(console,"gpgkeys: protocol `%s' not supported\n",opt->scheme);
|
fprintf(console,"gpgkeys: protocol '%s' not supported\n",opt->scheme);
|
||||||
ret=KEYSERVER_SCHEME_NOT_FOUND;
|
ret=KEYSERVER_SCHEME_NOT_FOUND;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -79,19 +79,19 @@ connect_server (const char *server, unsigned short port)
|
|||||||
|
|
||||||
/* Win32 gethostbyname doesn't handle IP addresses internally, so we
|
/* Win32 gethostbyname doesn't handle IP addresses internally, so we
|
||||||
try inet_addr first on that platform only. */
|
try inet_addr first on that platform only. */
|
||||||
if ((l = inet_addr (server)) != INADDR_NONE)
|
if ((l = inet_addr (server)) != INADDR_NONE)
|
||||||
memcpy (&addr.sin_addr, &l, sizeof l);
|
memcpy (&addr.sin_addr, &l, sizeof l);
|
||||||
else if ((hp = gethostbyname (server)))
|
else if ((hp = gethostbyname (server)))
|
||||||
{
|
{
|
||||||
if (hp->h_addrtype != AF_INET)
|
if (hp->h_addrtype != AF_INET)
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: unknown address family for `%s'\n",
|
fprintf (console, "gpgkeys: unknown address family for '%s'\n",
|
||||||
server);
|
server);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (hp->h_length != 4)
|
if (hp->h_length != 4)
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: illegal address length for `%s'\n",
|
fprintf (console, "gpgkeys: illegal address length for '%s'\n",
|
||||||
server);
|
server);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ connect_server (const char *server, unsigned short port)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: host `%s' not found: ec=%d\n",
|
fprintf (console, "gpgkeys: host '%s' not found: ec=%d\n",
|
||||||
server, (int)WSAGetLastError ());
|
server, (int)WSAGetLastError ());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -107,14 +107,14 @@ connect_server (const char *server, unsigned short port)
|
|||||||
sock = socket (AF_INET, SOCK_STREAM, 0);
|
sock = socket (AF_INET, SOCK_STREAM, 0);
|
||||||
if (sock == INVALID_SOCKET)
|
if (sock == INVALID_SOCKET)
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: error creating socket: ec=%d\n",
|
fprintf (console, "gpgkeys: error creating socket: ec=%d\n",
|
||||||
(int)WSAGetLastError ());
|
(int)WSAGetLastError ());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connect (sock, (struct sockaddr *)&addr, sizeof addr))
|
if (connect (sock, (struct sockaddr *)&addr, sizeof addr))
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: error connecting `%s': ec=%d\n",
|
fprintf (console, "gpgkeys: error connecting '%s': ec=%d\n",
|
||||||
server, (int)WSAGetLastError ());
|
server, (int)WSAGetLastError ());
|
||||||
sock_close (sock);
|
sock_close (sock);
|
||||||
return -1;
|
return -1;
|
||||||
@ -130,30 +130,30 @@ connect_server (const char *server, unsigned short port)
|
|||||||
host = gethostbyname ((char*)server);
|
host = gethostbyname ((char*)server);
|
||||||
if (!host)
|
if (!host)
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: host `%s' not found: %s\n",
|
fprintf (console, "gpgkeys: host '%s' not found: %s\n",
|
||||||
server, strerror (errno));
|
server, strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
addr.sin_addr = *(struct in_addr*)host->h_addr;
|
addr.sin_addr = *(struct in_addr*)host->h_addr;
|
||||||
|
|
||||||
sock = socket (AF_INET, SOCK_STREAM, 0);
|
sock = socket (AF_INET, SOCK_STREAM, 0);
|
||||||
if (sock == -1)
|
if (sock == -1)
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: error creating socket: %s\n",
|
fprintf (console, "gpgkeys: error creating socket: %s\n",
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connect (sock, (struct sockaddr *)&addr, sizeof addr) == -1)
|
if (connect (sock, (struct sockaddr *)&addr, sizeof addr) == -1)
|
||||||
{
|
{
|
||||||
fprintf (console, "gpgkeys: error connecting `%s': %s\n",
|
fprintf (console, "gpgkeys: error connecting '%s': %s\n",
|
||||||
server, strerror (errno));
|
server, strerror (errno));
|
||||||
close (sock);
|
close (sock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return sock;
|
return sock;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,11 +163,11 @@ write_server (int sock, const char *data, size_t length)
|
|||||||
int nleft;
|
int nleft;
|
||||||
|
|
||||||
nleft = length;
|
nleft = length;
|
||||||
while (nleft > 0)
|
while (nleft > 0)
|
||||||
{
|
{
|
||||||
int nwritten;
|
int nwritten;
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
nwritten = send (sock, data, nleft, 0);
|
nwritten = send (sock, data, nleft, 0);
|
||||||
if ( nwritten == SOCKET_ERROR )
|
if ( nwritten == SOCKET_ERROR )
|
||||||
{
|
{
|
||||||
@ -184,7 +184,7 @@ write_server (int sock, const char *data, size_t length)
|
|||||||
if (errno == EAGAIN)
|
if (errno == EAGAIN)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 50000;
|
tv.tv_usec = 50000;
|
||||||
select(0, NULL, NULL, NULL, &tv);
|
select(0, NULL, NULL, NULL, &tv);
|
||||||
@ -197,7 +197,7 @@ write_server (int sock, const char *data, size_t length)
|
|||||||
nleft -=nwritten;
|
nleft -=nwritten;
|
||||||
data += nwritten;
|
data += nwritten;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ send_request (const char *request, int *r_sock)
|
|||||||
return KEYSERVER_GENERAL_ERROR;
|
return KEYSERVER_GENERAL_ERROR;
|
||||||
}
|
}
|
||||||
*server++ = 0;
|
*server++ = 0;
|
||||||
|
|
||||||
sock = connect_server (server, 79);
|
sock = connect_server (server, 79);
|
||||||
if (sock == -1)
|
if (sock == -1)
|
||||||
{
|
{
|
||||||
@ -272,7 +272,7 @@ get_key (char *getkey)
|
|||||||
sock_close (sock);
|
sock_close (sock);
|
||||||
return KEYSERVER_OK;
|
return KEYSERVER_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hmmm, we use iobuf here only to cope with Windows socket
|
/* Hmmm, we use iobuf here only to cope with Windows socket
|
||||||
peculiarities (we can't used fdopen). */
|
peculiarities (we can't used fdopen). */
|
||||||
fp_read = iobuf_sockopen (sock , "r");
|
fp_read = iobuf_sockopen (sock , "r");
|
||||||
@ -286,7 +286,7 @@ get_key (char *getkey)
|
|||||||
while ( iobuf_read_line ( fp_read, &line, &buflen, &maxlen))
|
while ( iobuf_read_line ( fp_read, &line, &buflen, &maxlen))
|
||||||
{
|
{
|
||||||
maxlen=1024;
|
maxlen=1024;
|
||||||
|
|
||||||
if(gotit)
|
if(gotit)
|
||||||
{
|
{
|
||||||
print_nocr(output, (const char*)line);
|
print_nocr(output, (const char*)line);
|
||||||
@ -299,7 +299,7 @@ get_key (char *getkey)
|
|||||||
gotit=1;
|
gotit=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gotit)
|
if(gotit)
|
||||||
fprintf (output,"KEY 0x%s END\n", getkey);
|
fprintf (output,"KEY 0x%s END\n", getkey);
|
||||||
else
|
else
|
||||||
@ -316,7 +316,7 @@ get_key (char *getkey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_help (FILE *fp)
|
show_help (FILE *fp)
|
||||||
{
|
{
|
||||||
fprintf (fp,"-h, --help\thelp\n");
|
fprintf (fp,"-h, --help\thelp\n");
|
||||||
@ -362,7 +362,7 @@ main(int argc,char *argv[])
|
|||||||
output=fopen(optarg,"w");
|
output=fopen(optarg,"w");
|
||||||
if(output==NULL)
|
if(output==NULL)
|
||||||
{
|
{
|
||||||
fprintf(console,"gpgkeys: Cannot open output file `%s': %s\n",
|
fprintf(console,"gpgkeys: Cannot open output file '%s': %s\n",
|
||||||
optarg,strerror(errno));
|
optarg,strerror(errno));
|
||||||
return KEYSERVER_INTERNAL_ERROR;
|
return KEYSERVER_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
@ -375,7 +375,7 @@ main(int argc,char *argv[])
|
|||||||
input=fopen(argv[optind],"r");
|
input=fopen(argv[optind],"r");
|
||||||
if(input==NULL)
|
if(input==NULL)
|
||||||
{
|
{
|
||||||
fprintf(console,"gpgkeys: Cannot open input file `%s': %s\n",
|
fprintf(console,"gpgkeys: Cannot open input file '%s': %s\n",
|
||||||
argv[optind],strerror(errno));
|
argv[optind],strerror(errno));
|
||||||
return KEYSERVER_INTERNAL_ERROR;
|
return KEYSERVER_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ send_key(int *r_eof)
|
|||||||
append_path(request,"/pks/add");
|
append_path(request,"/pks/add");
|
||||||
|
|
||||||
if(opt->verbose>2)
|
if(opt->verbose>2)
|
||||||
fprintf(console,"gpgkeys: HTTP URL is `%s'\n",request);
|
fprintf(console,"gpgkeys: HTTP URL is '%s'\n",request);
|
||||||
|
|
||||||
curl_easy_setopt(curl,CURLOPT_URL,request);
|
curl_easy_setopt(curl,CURLOPT_URL,request);
|
||||||
curl_easy_setopt(curl,CURLOPT_POST,1L);
|
curl_easy_setopt(curl,CURLOPT_POST,1L);
|
||||||
@ -289,7 +289,7 @@ get_key(char *getkey)
|
|||||||
strcat(request,offset);
|
strcat(request,offset);
|
||||||
|
|
||||||
if(opt->verbose>2)
|
if(opt->verbose>2)
|
||||||
fprintf(console,"gpgkeys: HTTP URL is `%s'\n",request);
|
fprintf(console,"gpgkeys: HTTP URL is '%s'\n",request);
|
||||||
|
|
||||||
curl_easy_setopt(curl,CURLOPT_URL,request);
|
curl_easy_setopt(curl,CURLOPT_URL,request);
|
||||||
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_writer);
|
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_writer);
|
||||||
@ -358,7 +358,7 @@ get_name(const char *getkey)
|
|||||||
fprintf(output,"NAME %s BEGIN\n",getkey);
|
fprintf(output,"NAME %s BEGIN\n",getkey);
|
||||||
|
|
||||||
if(opt->verbose>2)
|
if(opt->verbose>2)
|
||||||
fprintf(console,"gpgkeys: HTTP URL is `%s'\n",request);
|
fprintf(console,"gpgkeys: HTTP URL is '%s'\n",request);
|
||||||
|
|
||||||
curl_easy_setopt(curl,CURLOPT_URL,request);
|
curl_easy_setopt(curl,CURLOPT_URL,request);
|
||||||
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_writer);
|
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_writer);
|
||||||
@ -446,7 +446,7 @@ search_key(const char *searchkey)
|
|||||||
fprintf(output,"SEARCH %s BEGIN\n",searchkey);
|
fprintf(output,"SEARCH %s BEGIN\n",searchkey);
|
||||||
|
|
||||||
if(opt->verbose>2)
|
if(opt->verbose>2)
|
||||||
fprintf(console,"gpgkeys: HTTP URL is `%s'\n",request);
|
fprintf(console,"gpgkeys: HTTP URL is '%s'\n",request);
|
||||||
|
|
||||||
curl_easy_setopt(curl,CURLOPT_URL,request);
|
curl_easy_setopt(curl,CURLOPT_URL,request);
|
||||||
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_mrindex_writer);
|
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_mrindex_writer);
|
||||||
@ -596,7 +596,7 @@ main(int argc,char *argv[])
|
|||||||
output=fopen(optarg,"w");
|
output=fopen(optarg,"w");
|
||||||
if(output==NULL)
|
if(output==NULL)
|
||||||
{
|
{
|
||||||
fprintf(console,"gpgkeys: Cannot open output file `%s': %s\n",
|
fprintf(console,"gpgkeys: Cannot open output file '%s': %s\n",
|
||||||
optarg,strerror(errno));
|
optarg,strerror(errno));
|
||||||
return KEYSERVER_INTERNAL_ERROR;
|
return KEYSERVER_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
@ -609,7 +609,7 @@ main(int argc,char *argv[])
|
|||||||
input=fopen(argv[optind],"r");
|
input=fopen(argv[optind],"r");
|
||||||
if(input==NULL)
|
if(input==NULL)
|
||||||
{
|
{
|
||||||
fprintf(console,"gpgkeys: Cannot open input file `%s': %s\n",
|
fprintf(console,"gpgkeys: Cannot open input file '%s': %s\n",
|
||||||
argv[optind],strerror(errno));
|
argv[optind],strerror(errno));
|
||||||
return KEYSERVER_INTERNAL_ERROR;
|
return KEYSERVER_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user