From d4b90b2e1d58ebdb09235232449e0563ce2f22de Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Mon, 21 Aug 2006 01:09:53 +0000 Subject: samba and unix user/group bug fixing --- packages/freenas/pkg/freenas_guiconfig.inc | 6 +- packages/freenas/pkg/freenas_services.inc | 22 ++++-- packages/freenas/pkg/freenas_system.inc | 114 ++++++++++++++++++++--------- packages/freenas/pkg/rc.freenas | 4 +- 4 files changed, 99 insertions(+), 47 deletions(-) (limited to 'packages/freenas/pkg') diff --git a/packages/freenas/pkg/freenas_guiconfig.inc b/packages/freenas/pkg/freenas_guiconfig.inc index f46cf8df..8acd5ff4 100644 --- a/packages/freenas/pkg/freenas_guiconfig.inc +++ b/packages/freenas/pkg/freenas_guiconfig.inc @@ -7,7 +7,7 @@ All rights reserved. Modified for FreeNAS (http://freenas.org) by Olivier Cochard - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -88,7 +88,7 @@ function users_sort() { return strcmp($a['login'], $b['login']); } - usort($config['access']['user'], "userscmp"); + usort($config['system']['user'], "userscmp"); } /* TODO: This needs to be changed */ @@ -99,6 +99,6 @@ function groups_sort() { return strcmp($a['name'], $b['name']); } - usort($config['access']['group'], "groupscmp"); + usort($config['system']['group'], "groupscmp"); } ?> \ No newline at end of file diff --git a/packages/freenas/pkg/freenas_services.inc b/packages/freenas/pkg/freenas_services.inc index add418ed..748a9e65 100644 --- a/packages/freenas/pkg/freenas_services.inc +++ b/packages/freenas/pkg/freenas_services.inc @@ -51,6 +51,12 @@ function services_samba_configure() { if ($g['booting']) echo "Starting Samba... "; + /* make sure any of the required dirs exist */ + if (! file_exists("{$g['varetc_path']}/private")) + mkdir("{$g['varetc_path']}/private"); + if (! file_exists("{$g['varlog_path']}/samba")) + mkdir("{$g['varlog_path']}/samba"); + /* generate smb.conf */ $fd = fopen("{$g['varetc_path']}/smb.conf", "w"); if (!$fd) { @@ -499,7 +505,7 @@ dir_message = .message logfile = /var/log/wzdftpd/wzd.log xferlog = /var/log/wzdftpd/xferlog logdir = /var/log/wzdftpd -max_threads = 32 +max_threads = {$freenas_config['ftp']['numberclients']} backend = /usr/local/share/wzdftpd/backends/libwzd{$freenas_config['ftp']['authentication_backend']}.so @@ -649,16 +655,16 @@ site_who = !/usr/local/etc/wzdftpd/file_who.txt EOD; - if (isset($freenas_config['ftp']['banner'])) { + if (isset($freenas_config['ftp']['banner'])) { $ftpconf .= "200 = {$freenas_config['ftp']['banner']}"; } - fwrite($fd, $ftpconf); - fclose($fd); - chmod("/usr/local/etc/wzdftpd/wzd.cfg", 0400); + fwrite($fd, $ftpconf); + fclose($fd); + chmod("/usr/local/etc/wzdftpd/wzd.cfg", 0400); - /* now generate the plaintext userfail (if applicable) */ - if ($freenas_config['ftp']['authentication_backend'] == "plaintext") { + /* now generate the plaintext users file (if applicable) */ + if ($freenas_config['ftp']['authentication_backend'] == FTP_BACKEND_PLAINTEXT) { $ftpusers = "[GROUPS]\n"; $a_group =& $config['system']['group']; $a_user =& $config['system']['user']; @@ -1645,7 +1651,7 @@ _ftp._tcp local. EOD; } - if (isset($freenas_config['samba']['enable'])) { + if (isset($freenas_config['samba']['enable'])) { $mDNSResponder .= << \ No newline at end of file -- cgit v1.2.3