summaryrefslogtreecommitdiff
path: root/tools/extract-openssl.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-03 10:03:40 +0100
committerStef Walter <stefw@gnome.org>2013-03-03 10:07:18 +0100
commit6c55425a7de23a71d0abc3137f0015e878188bae (patch)
treee5183f130ea90cce0a11637afb9e40d09556aac3 /tools/extract-openssl.c
parent3acf285916968a05ea42b3ef0f9654a33e308da7 (diff)
Windows doesn't support symlinks, chmod, or atomic renames
* Don't create symlinks on windows * No atomic renames, so delete and then rename * Make sure to close files before unlinking on windows * No chmod permissions on windows
Diffstat (limited to 'tools/extract-openssl.c')
-rw-r--r--tools/extract-openssl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/extract-openssl.c b/tools/extract-openssl.c
index ae1bc27..c2cdeab 100644
--- a/tools/extract-openssl.c
+++ b/tools/extract-openssl.c
@@ -506,6 +506,8 @@ p11_openssl_canon_name_der (p11_dict *asn1_defs,
return !failed;
}
+#ifdef OS_UNIX
+
static char *
symlink_for_subject_hash (p11_extract_info *ex)
{
@@ -564,6 +566,8 @@ symlink_for_subject_old_hash (p11_extract_info *ex)
return linkname;
}
+#endif /* OS_UNIX */
+
bool
p11_extract_openssl_directory (P11KitIter *iter,
p11_extract_info *ex)
@@ -573,12 +577,15 @@ p11_extract_openssl_directory (P11KitIter *iter,
p11_save_dir *dir;
p11_buffer buf;
bool ret = true;
- char *linkname;
char *name;
size_t length;
char *pem;
CK_RV rv;
+#ifdef OS_UNIX
+ char *linkname;
+#endif
+
dir = p11_save_open_directory (ex->destination, ex->flags);
if (dir == NULL)
return false;
@@ -611,9 +618,13 @@ p11_extract_openssl_directory (P11KitIter *iter,
*
* The trailing number is incremented p11_save_symlink_in() if it
* conflicts with something we've already written out.
+ *
+ * On Windows no symlinks.
*/
ret = true;
+
+#ifdef OS_UNIX
linkname = symlink_for_subject_hash (ex);
if (file && linkname) {
ret = p11_save_symlink_in (dir, linkname, ".0", filename);
@@ -625,6 +636,7 @@ p11_extract_openssl_directory (P11KitIter *iter,
ret = p11_save_symlink_in (dir, linkname, ".0", filename);
free (linkname);
}
+#endif /* OS_UNIX */
if (ret)
ret = p11_save_write_and_finish (file, pem, length);