<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Sat, 6 Oct 2018, 01:34 Alan Coopersmith, <<a href="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">v2: check for lstat() failing<br>
<br>
Fixes: 04bdbbcab3c "xmlconfig: read more config files from drirc.d/"<br>
Signed-off-by: Alan Coopersmith <<a href="mailto:alan.coopersmith@oracle.com" target="_blank" rel="noreferrer">alan.coopersmith@oracle.com</a>><br>
Reviewed-by: Roland Mainz <<a href="mailto:roland.mainz@nrubsig.org" target="_blank" rel="noreferrer">roland.mainz@nrubsig.org</a>><br>
Reviewed-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com" target="_blank" rel="noreferrer">ian.d.romanick@intel.com</a>><br>
---<br>
src/util/xmlconfig.c | 8 ++++++++<br>
1 file changed, 8 insertions(+)<br>
<br>
diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c<br>
index 5264f2598b..5907c68012 100644<br>
--- a/src/util/xmlconfig.c<br>
+++ b/src/util/xmlconfig.c<br>
@@ -938,8 +938,16 @@ parseOneConfigFile(struct OptConfData *data, const char *filename)<br>
static int<br>
scandir_filter(const struct dirent *ent)<br>
{<br>
+#ifndef DT_REG /* systems without d_type in dirent results */<br>
+ struct stat st;<br>
+<br>
+ if ((lstat(ent->d_name, &st) != 0) ||<br>
+ (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)))<br>
+ return 0;<br>
+#else<br>
if (ent->d_type != DT_REG && ent->d_type != DT_LNK)<br>
return 0;<br>
+#endif<br>
<br>
if (fnmatch("*.conf", ent->d_name, 0))<br>
return 0;<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Reviewed by <a href="mailto:roland.mainz@nrubsig.org">roland.mainz@nrubsig.org</a> </div><div dir="auto"><br></div><div dir="auto">----</div><div dir="auto"><br></div><div dir="auto">Bye,</div><div dir="auto">Roland </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>