ALT Linux Bugzilla
– Attachment 8980 Details for
Bug 38998
/usr/bin/xsltproc runtime error
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
fix possible race causing mkdir() on existent directory
0001-fix-race-check-mkdir.patch (text/plain), 1004 bytes, created by
Andrew Vasilyev
on 2020-09-25 23:49:52 MSK
(
hide
)
Description:
fix possible race causing mkdir() on existent directory
Filename:
MIME Type:
Creator:
Andrew Vasilyev
Created:
2020-09-25 23:49:52 MSK
Size:
1004 bytes
patch
obsolete
>From 158bc33fb3d9df36a8f0e969bb9040252b66c6b7 Mon Sep 17 00:00:00 2001 >From: "Andrew A. Vasilyev" <andy@altlinux.org> >Date: Fri, 25 Sep 2020 23:11:32 +0300 >Subject: [PATCH] fix possible race between checking and creating a directory > >--- > libxslt/security.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git libxslt/security.c libxslt/security.c >index 550dc4e2..927d55b3 100644 >--- libxslt/security.c >+++ libxslt/security.c >@@ -18,6 +18,10 @@ > #include <sys/stat.h> > #endif > >+#ifdef HAVE_ERRNO_H >+#include <errno.h> >+#endif >+ > #ifdef HAVE_MATH_H > #include <math.h> > #endif >@@ -342,8 +346,16 @@ xsltCheckWritePath(xsltSecurityPrefsPtr sec, > } > } > ret = xsltCheckWritePath(sec, ctxt, directory); >- if (ret == 1) >+ if (ret == 1) { >+#ifdef HAVE_ERRNO_H >+ errno = 0; >+#endif > ret = mkdir(directory, 0755); >+#ifdef HAVE_ERRNO_H >+ if (ret < 0 && errno == EEXIST) >+ ret = 0; >+#endif >+ } > } > xmlFree(directory); > if (ret < 0) >-- >2.25.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38998
: 8980