summaryrefslogtreecommitdiffstats
path: root/lib/authenticator-plaintext.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-08-18 14:06:07 +0000
committerTed Trask <ttrask01@yahoo.com>2008-08-18 14:06:07 +0000
commit3a741f2afb19131acaff8f26d6e863cf72a25be3 (patch)
tree156e16d8fb4654faede6dc9c4a5d36a04a71fa25 /lib/authenticator-plaintext.lua
parent29de360eb486521a4e65d6e1452a8c623201c945 (diff)
downloadacf-core-3a741f2afb19131acaff8f26d6e863cf72a25be3.tar.bz2
acf-core-3a741f2afb19131acaff8f26d6e863cf72a25be3.tar.xz
Modified roles to use authenticator rather than directly access roles file. This will facilitate moving roles and passwd to a database. Had to allow roles file to use : instead of =
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1384 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/authenticator-plaintext.lua')
-rw-r--r--lib/authenticator-plaintext.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/authenticator-plaintext.lua b/lib/authenticator-plaintext.lua
index e90520d..73438e3 100644
--- a/lib/authenticator-plaintext.lua
+++ b/lib/authenticator-plaintext.lua
@@ -39,7 +39,7 @@ read_field = function(self, tabl, field)
for l in string.gmatch(m, "([^\n]+)\n?") do
local a = {}
- a.id, a.entry = string.match(l, "^([^:]*):(.*)")
+ a.id, a.entry = string.match(l, "^([^:=]*)[:=](.*)")
table.insert(row, a)
end
return row
@@ -81,8 +81,8 @@ read_entry = function(self, tabl, field, id)
local passwdfilecontent = fs.read_file_as_array(passwd_path) or {}
local entry
for k,v in pairs(passwdfilecontent) do
- if string.match(v, "^".. id .. ":") then
- return string.match(v, "^"..id..":(.*)")
+ if string.match(v, "^".. id .. "[:=]") then
+ return string.match(v, "^"..id.."[:=](.*)")
end
end
return nil
@@ -98,7 +98,7 @@ delete_entry = function (self, tabl, field, id)
local passwdfilecontent = fs.read_file_as_array(passwd_path) or {}
local output = {}
for k,v in pairs(passwdfilecontent) do
- if not ( string.match(v, "^".. id .. ":") ) and not string.match(v, "^%s*$") then
+ if not ( string.match(v, "^".. id .. "[:=]") ) and not string.match(v, "^%s*$") then
table.insert(output, v)
else
result = true