From 4e8d7b7fb310a668ae8653bc06036c94249b2b2a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 6 Jun 2006 17:55:41 +0000 Subject: [PATCH] r16063: Make is clearer when we can't write to the smb.conf Find more possible posix group names for the 'domain users' group, as the existing options don't exist in OSX. Andrew Bartlett --- source/scripting/libjs/provision.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/scripting/libjs/provision.js b/source/scripting/libjs/provision.js index 73e3b6f4e4f..64485efa03d 100644 --- a/source/scripting/libjs/provision.js +++ b/source/scripting/libjs/provision.js @@ -238,7 +238,7 @@ function setup_ldb(ldif, info, dbname) /* setup a file in the private dir */ -function setup_file(template, fname, subobj) +function setup_file(template, message, fname, subobj) { var lp = loadparm_init(); var f = fname; @@ -250,7 +250,10 @@ function setup_file(template, fname, subobj) data = substitute_var(data, subobj); ok = sys.file_save(f, data); - assert(ok); + if (!ok) { + message("failed to create file: " + f + "\n"); + assert(ok); + } } function provision_default_paths(subobj) @@ -355,7 +358,7 @@ function provision(subobj, message, blank, paths, session_info, credentials) var st = sys.stat(paths.smbconf); if (st == undefined) { message("Setting up smb.conf\n"); - setup_file("provision.smb.conf", paths.smbconf, subobj); + setup_file("provision.smb.conf", info.message, paths.smbconf, subobj); lp.reload(); } message("Setting up secrets.ldb\n"); @@ -412,7 +415,7 @@ function provision_dns(subobj, message, paths, session_info, credentials) assert(subobj.HOSTGUID != undefined); setup_file("provision.zone", - paths.dns, + message, paths.dns, subobj); message("Please install the zone located in " + paths.dns + " into your DNS server\n"); @@ -456,7 +459,7 @@ function provision_guess() subobj.NOGROUP = findnss(nss.getgrnam, "nogroup", "nobody"); subobj.WHEEL = findnss(nss.getgrnam, "wheel", "root", "staff"); subobj.BACKUP = findnss(nss.getgrnam, "backup", "wheel", "root", "staff"); - subobj.USERS = findnss(nss.getgrnam, "users", "guest", "other"); + subobj.USERS = findnss(nss.getgrnam, "users", "guest", "other", "unknown"); subobj.DNSDOMAIN = strlower(subobj.REALM); subobj.DNSNAME = sprintf("%s.%s", strlower(subobj.HOSTNAME),