diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-12-01 19:41:58 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-12-01 19:41:58 +0000 |
commit | f4f4e1f61b78d2ea01493143e4d229076c3dfc08 (patch) | |
tree | d279907ea1eeb07ee8219e667641a27d5b705a1e | |
parent | a52a5ffad03771cf7cc9ed1eaef20841529c8af3 (diff) | |
download | acf-alpine-baselayout-f4f4e1f61b78d2ea01493143e4d229076c3dfc08.tar.bz2 acf-alpine-baselayout-f4f4e1f61b78d2ea01493143e4d229076c3dfc08.tar.xz |
Modified interfaces to allow any non-space characters in interface name.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1615 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | interfaces-model.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/interfaces-model.lua b/interfaces-model.lua index b67b463..bcc3288 100644 --- a/interfaces-model.lua +++ b/interfaces-model.lua @@ -187,16 +187,15 @@ iface.unpack_interfaces = function () if string.match(line, "^#") then comment = iface.append(comment, line , "#%s*" ) elseif string.match(line, "^auto") then - local name = string.match(line, "auto%s+(%w+)") + local name = string.match(line, "auto%s+(%S+)") auto[name] = true elseif string.match(line, "^iface") then - local name, family, method = string.match(line, "%w+%s+([%w.]+)%s+(%w+)%s+(%w+)") + local name, family, method = string.match(line, "%S+%s+(%S+)%s+(%S+)%s+(%S+)") array[#array + 1] = iface.iface_type(family, method) local interface = array[#array].value interface.comment.value = comment comment = "" - -- iface <name> [inet | ipx] <method> -- we assume inet - interface.name.value = name + interface.name.value = name or "" elseif #array then -- it must be some kind of parameter local param, val = @@ -353,6 +352,9 @@ iface.validate = function (def) if #newdef.value.name.value == 0 then newdef.value.name.errtxt = "The interface must have a name" success = false + elseif string.find(newdef.value.name.value, "%s") then + newdef.value.name.errtxt = "Cannot contain spaces" + success = false end -- More validation tests go here --- -- |