summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-01-16 21:24:16 +0000
committerTed Trask <ttrask01@yahoo.com>2009-01-16 21:24:16 +0000
commit80c4db3246839d3bf135e28101fda2bca2af069b (patch)
tree041f55c54bbce73e99a0b05bb6054c7425c2d666
parentc57c6b16c74f7f570c6460be8131da62ea36e237 (diff)
downloadacf-samba-80c4db3246839d3bf135e28101fda2bca2af069b.tar.bz2
acf-samba-80c4db3246839d3bf135e28101fda2bca2af069b.tar.xz
Tested by removing expected packages, files, and directories. Fixed resulting bugs.
git-svn-id: svn://svn.alpinelinux.org/acf/samba/trunk@1683 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--samba-model.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/samba-model.lua b/samba-model.lua
index 4483461..402d4d7 100644
--- a/samba-model.lua
+++ b/samba-model.lua
@@ -126,7 +126,7 @@ function get_join()
connect.password = cfe({ label="Domain Controller password" })
configcontent = configcontent or fs.read_file(configfile) or ""
- config = config or format.parse_ini_file(configcontent)
+ config = config or format.parse_ini_file(configcontent) or {}
if config and config.global and config.global.workgroup then
connect.domain.value = config.global.workgroup
end
@@ -162,7 +162,7 @@ function set_join(connect)
-- the conf.d file doesn't automatically include winbindd
local content = fs.read_file(confdfile) or ""
- local list = format.parse_ini_file(content, "", "daemon_list")
+ local list = format.parse_ini_file(content, "", "daemon_list") or '""'
if not string.find(list, "winbind") then
content = format.update_ini_file(content, "", "daemon_list", string.gsub(list, '"$', ' winbind"'))
fs.write_file(confdfile, content)
@@ -174,7 +174,7 @@ end
function list_shares()
local shares = {}
configcontent = configcontent or fs.read_file(configfile) or ""
- config = config or format.parse_ini_file(configcontent)
+ config = config or format.parse_ini_file(configcontent) or {}
for name,section in pairs(config or {}) do
if not specialsection[name] then
@@ -191,7 +191,7 @@ end
function read_share(name)
local share = {}
configcontent = configcontent or fs.read_file(configfile) or ""
- config = config or format.parse_ini_file(configcontent)
+ config = config or format.parse_ini_file(configcontent) or {}
name = name or ""
local sharecfg = config[name] or {}
@@ -233,7 +233,7 @@ function update_share(share)
local success, share = validate_share(share)
configcontent = configcontent or fs.read_file(configfile) or ""
- config = config or format.parse_ini_file(configcontent)
+ config = config or format.parse_ini_file(configcontent) or {}
if not config[share.value.name.value] then
share.value.name.errtxt = "Share not found"
success = false
@@ -252,7 +252,7 @@ function create_share(share)
local success, share = validate_share(share)
configcontent = configcontent or fs.read_file(configfile) or ""
- config = config or format.parse_ini_file(configcontent)
+ config = config or format.parse_ini_file(configcontent) or {}
if config[share.value.name.value] then
share.value.name.errtxt = "Share already exists"
success = false
@@ -274,7 +274,7 @@ function delete_share(name)
retval.errtxt = "Share not found"
else
configcontent = configcontent or fs.read_file(configfile) or ""
- config = config or format.parse_ini_file(configcontent)
+ config = config or format.parse_ini_file(configcontent) or {}
if config[name] then
configcontent = format.set_ini_section(configcontent, name, "")
configcontent = string.gsub(configcontent, "\n%s*%[%s*"..format.escapemagiccharacters(name).."%s*%][^\n]*", "")