chiark / gitweb /
Avoid accessing backup, auto-save files, etc, with include-lookup. debian_version_0_65_0
authorian <ian>
Sat, 9 Oct 1999 16:12:53 +0000 (16:12 +0000)
committerian <ian>
Sat, 9 Oct 1999 16:12:53 +0000 (16:12 +0000)
debian/changelog
parser.c
spec.sgml

index 42b97754e590cfa1fa6d88fea5ad83f2ff57d8e9..0ee5efebe765077d15735aea46552ffd438f0f83 100644 (file)
@@ -1,3 +1,10 @@
+userv (0.65.0) unstable; urgency=high
+
+  * Avoid accessing backup, auto-save files, etc, with include-lookup.
+    Everything except a-z 0-9 - _ must now be prefixed by a colon.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Sat,  9 Oct 1999 17:09:24 +0100
+
 userv (0.64.1) unstable; urgency=low
 
   * New "shutdown" builtin service for terminating uservd.
index 5f6ebadc7da07b2f2efe6d09bbd7a1b1039b6c23..01b770e0bab9d15fa51a76642a7f5806ab9a1fe4 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1089,8 +1089,14 @@ int df_includelookup(int dtoken) {
       } else {
        if (*p=='.') *q++= ':';
        while ((c= *p++)) {
-         if (c=='/') { *q++= ':'; c='-'; }
-         else if (c==':') { *q++= ':'; }
+         if (c=='/') {
+           *q++= ':';
+           c= '-';
+         } else if (!((c >= '0' && c <= '9') ||
+                      (c >= 'a' && c <= 'z') ||
+                      c == '-' || c == '_')) {
+           *q++= ':';
+         }
          *q++= c;
        }
        *q++= 0;
index 8328bf350eea39af42c250d5c4fa7c36f0534b0b..57329a46255a4327a112c98d6e3385f51a85c905 100644 (file)
--- a/spec.sgml
+++ b/spec.sgml
@@ -641,11 +641,12 @@ the directory cannot be accessed.
 
 <p>
 A translation will be applied to values before they are used to
-construct a filename, so that the lookup cannot access dotfiles or
-files in other directories: values starting with full stops will have
-a colon prepended (making <tt/:./), colons will be doubled, and each
-slash will be replaced with a colon followed by a hyphen <tt>:-</>.  A
-parameter value which is the empty string will be replaced with
+construct a filename, so that the lookup cannot access dotfiles,
+backup files, files in other directories and the like: each slash will
+be replaced with a colon followed by a hyphen <tt>:-</>, and all
+characters which are not lowercase alphanumerics, hyphens or
+underscores will have a colon prepended (so that colons are doubled).
+A parameter value which is the empty string will be replaced with
 <tt/:empty/ (note that this is different from a parameter not having
 any values).