diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-01-13 16:01:06 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-01-13 16:01:06 +0000 |
commit | 5ec7a43c6f0a6cd1369da101fa0e3f1f12d99973 (patch) | |
tree | 89b5c319d2f14352e25260d5fbf3ec67f85ca636 /password-model.lua | |
parent | 9dfc491513676fa005f68cc764c4db37f0b3094f (diff) | |
download | acf-alpine-baselayout-5ec7a43c6f0a6cd1369da101fa0e3f1f12d99973.tar.bz2 acf-alpine-baselayout-5ec7a43c6f0a6cd1369da101fa0e3f1f12d99973.tar.xz |
Modified fs.lua to survive nil parameters. Added create_directory and used within create_file and write_file. Reviewed each read_file call to make sure handles nil return value.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1677 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'password-model.lua')
-rw-r--r-- | password-model.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/password-model.lua b/password-model.lua index ba74e45..7dd9cd6 100644 --- a/password-model.lua +++ b/password-model.lua @@ -18,7 +18,7 @@ update_password = function (pw) pw.value.password.errtxt = "Invalid or non matching password" success = false end - local filecontent = "\n"..fs.read_file("/etc/shadow") + local filecontent = "\n"..(fs.read_file("/etc/shadow") or "") if pw.value.user.value == "" or not string.find(filecontent, "\n"..pw.value.user.value..":") then pw.value.user.errtxt = "Unknown user" success = false |