<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Thank You.<div>Yes, the result should be in lexical order.<br><div>Will have a look at how to get it sorted.<br><br><div>Best Regards,<div>Ulf Samuelsson.</div></div><div><br>28 feb. 2018 kl. 23:27 skrev Timothe Litt <<a href="mailto:litt@acm.org">litt@acm.org</a>>:<br><br></div><div><span></span></div><blockquote type="cite"><div>
  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  
  
    On 28-Feb-18 04:48, <a class="moz-txt-link-abbreviated" href="mailto:dhcp-users-request@lists.isc.org">dhcp-users-request@lists.isc.org</a> wrote:<br>
    <blockquote type="cite" cite="mid:mailman.1889.1519811313.3030.dhcp-users@lists.isc.org">
      <pre wrap="">Message: 1
Date: Tue, 27 Feb 2018 23:33:10 +0100
From: Ulf Samuelsson <a class="moz-txt-link-rfc2396E" href="mailto:dhcp@emagii.com"><dhcp@emagii.com></a>
To: <a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>
Subject: [RFC ] include with wildcard filenames
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:f80615ed-3ae0-e5af-a62a-799842ada91a@emagii.com"><f80615ed-3ae0-e5af-a62a-799842ada91a@emagii.com></a>
Content-Type: text/plain; charset=utf-8; format=flowed

I was trying out a dhcpd configuration, and found to my dismay
that the DHCP server did not support wildcards for include statements.
include "/etc/dhcp/pools/*.conf";
did not work.

</pre>
    </blockquote>
    <pre wrap="">[snip]</pre>
    <blockquote type="cite" cite="mid:mailman.1889.1519811313.3030.dhcp-users@lists.isc.org">
      <pre wrap="">====================================

I did a patch for dhcp-4.3.6 which is slightly limited.
It supports only wildcards on files within a single directory.
I.E: include "/etc/dhcp/pools/*.conf"; is supported
I.E: include "/etc/dhcp/*/dhcp.conf"; is not supported
The wildcard may not be in a directory.

Did a small test program which tested the functionality of wildcards,
and then patched the dhcp server, but it has not been tested yet, as 
part of dhcp
Still would like to have peoples opinion, whether this type of 
functionality is desirable.
It is certainly possible to do this without wildcards,
but wildcards seems a much cleaner solution.
====================================
</pre>
    </blockquote>
    [snip]<br>
    <blockquote type="cite" cite="mid:mailman.1889.1519811313.3030.dhcp-users@lists.isc.org">
      <pre wrap="">.
</pre>
    </blockquote>
    <br>
    Without commenting on your application, a note on your patch:<br>
    <br>
    You should be aware that readdir does not order the directory
    entries.  They are returned in<br>
    some implementation-specific order - which is generally NOT that of
    a directory listing.  Commands<br>
    such as ls sort the results for presentation.<br>
    <br>
    Users of config files in applications that have a wildcard option
    for include generally assume<br>
    that the files will be included in lexical order; e.g. foo-001.conf
    will be included before foo-002.conf.<br>
    This will not reliably be the case with your code.  The results will
    not even be deterministic on most<br>
    platforms.<br>
    <br>
    If you pursue this, you should sort the results of readdir before
    including them.<br>
    <br>
    See qsort() for a fairly portable approach.  Or look at scandir()
    (especially with versionsort()) for<br>
    a more convenient, if less portable approach to this.<br>
    <br>
    <pre class="moz-signature" cols="72">Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed. 
</pre>
  

</div></blockquote></div></div></body></html>