do not hardcode filenames, use SQ_KEYS_DB ENGINE-524
authorClaudio Luck <claudio.luck@pep.foundation>
Thu, 30 May 2019 02:16:16 +0200
branchENGINE-524
changeset 3838c2941a9d7f2b
parent 3837 28c820987e41
child 3839 f264464b1cfa
do not hardcode filenames, use SQ_KEYS_DB
src/pgp_sequoia.c
src/platform_unix.c
     1.1 --- a/src/pgp_sequoia.c	Sat May 25 01:52:40 2019 +0200
     1.2 +++ b/src/pgp_sequoia.c	Thu May 30 02:16:16 2019 +0200
     1.3 @@ -182,7 +182,7 @@
     1.4      PEP_STATUS status = PEP_STATUS_OK;
     1.5      const char * path_keys_db;
     1.6  
     1.7 -    status = unix_user_file_path(session, "keys.db", &path_keys_db);
     1.8 +    status = unix_user_file_path(session, SQ_KEYS_DB, &path_keys_db);
     1.9      if (status != PEP_STATUS_OK)
    1.10          ERROR_OUT(NULL, status,
    1.11                    "could not determine path to keys DB");
     2.1 --- a/src/platform_unix.c	Sat May 25 01:52:40 2019 +0200
     2.2 +++ b/src/platform_unix.c	Thu May 30 02:16:16 2019 +0200
     2.3 @@ -200,7 +200,7 @@
     2.4                  return PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
     2.5              }
     2.6  
     2.7 -            while (*(p-1) == '/' && (p-1) > buffer)   /* drop trailing slashes, note '>' on decremented p */
     2.8 +            while (*(p-1) == '/' && (p-1) > buffer)   /* strip trailing slashes */
     2.9                  p--;
    2.10              p = stpncpy (p, confsdir[cf_i], len);
    2.11              if (automkdir[cf_i]) {