From 3a741f2afb19131acaff8f26d6e863cf72a25be3 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 18 Aug 2008 14:06:07 +0000 Subject: 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 --- lib/authenticator-plaintext.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/authenticator-plaintext.lua') 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 -- cgit v1.2.3