From 80c4db3246839d3bf135e28101fda2bca2af069b Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 16 Jan 2009 21:24:16 +0000 Subject: 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 --- samba-model.lua | 14 +++++++------- 1 file 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]*", "") -- cgit v1.2.3