diff options
author | Eduardo Chappa <chappa@washington.edu> | 2014-05-17 18:18:43 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2014-05-17 18:18:43 -0600 |
commit | d8f387ef722cfb9e694d25c1ab182d01501f1b9d (patch) | |
tree | 98bb7cefb694ad2cfc53ac43a55a3dd71d2a0943 /pith/smime.c | |
parent | 0b9aa5eb03014bb55211186ba0ce60b2a8986ba0 (diff) | |
download | alpine-d8f387ef722cfb9e694d25c1ab182d01501f1b9d.tar.xz |
* Fix bug in new code that determines the name of the container if
none is specified.
Diffstat (limited to 'pith/smime.c')
-rw-r--r-- | pith/smime.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pith/smime.c b/pith/smime.c index 6c49fdcc..5a86f318 100644 --- a/pith/smime.c +++ b/pith/smime.c @@ -1400,7 +1400,7 @@ endadd: int copy_dir_to_container(WhichCerts which, char *contents) { - int ret = 0; + int ret = 0, container = 0; BIO *bio_out = NULL, *bio_in = NULL; char srcpath[MAXPATH+1], dstpath[MAXPATH+1], emailaddr[MAXPATH], file[MAXPATH], line[4096]; char *tempfile = NULL, fpath[MAXPATH+1]; @@ -1439,6 +1439,7 @@ copy_dir_to_container(WhichCerts which, char *contents) configcontainer = cpystr(DF_CA_CONTAINER); filesuffix = ".crt"; } + container = SMHOLDERTYPE(which) == Container; if(!(configdir && configdir[0])){ q_status_message(SM_ORDER, 3, 3, _("Directory not defined")); @@ -1607,7 +1608,11 @@ copy_dir_to_container(WhichCerts which, char *contents) BIO_free(bio_out); if(!ret){ - if(ret_dir){ + if(container && configpath && *configpath){ + strncpy(fpath, configpath, sizeof(fpath)); + fpath[sizeof(fpath) - 1] = '\0'; + } + else if(ret_dir){ if(strlen(dstpath) + strlen(configcontainer) - strlen(ret_dir) + 1 < sizeof(dstpath)) snprintf(fpath, sizeof(fpath), "%s%c%s", dstpath, tempfile[strlen(ret_dir)], configcontainer); |