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 +- packages/freenas/www/services_rsyncd.php | 10 +-- packages/freenas/www/services_rsyncd_client.php | 6 +- 6 files changed, 107 insertions(+), 55 deletions(-) (limited to 'packages/freenas') 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 diff --git a/packages/freenas/www/services_rsyncd.php b/packages/freenas/www/services_rsyncd.php index ea85202d..a8b34b4c 100644 --- a/packages/freenas/www/services_rsyncd.php +++ b/packages/freenas/www/services_rsyncd.php @@ -42,12 +42,12 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); /* TODO: use pfSense users/groups. */ -if (!is_array($freenas_config['access']['user'])) - $freenas_config['access']['user'] = array(); +if (!is_array($freenas_config['system']['user'])) + $freenas_config['system']['user'] = array(); users_sort(); -$a_user = &$freenas_config['access']['user']; +$a_user = &$freenas_config['system']['user']; if (!is_array($freenas_config['rsync'])) { @@ -212,8 +212,8 @@ echo $pfSenseHead->getHTML(); diff --git a/packages/freenas/www/services_rsyncd_client.php b/packages/freenas/www/services_rsyncd_client.php index ab54f562..a1b1a815 100644 --- a/packages/freenas/www/services_rsyncd_client.php +++ b/packages/freenas/www/services_rsyncd_client.php @@ -42,12 +42,12 @@ require_once("freenas_guiconfig.inc"); require_once("freenas_functions.inc"); /* TODO: use pfSense users/groups. */ -if (!is_array($freenas_config['access']['user'])) - $freenas_config['access']['user'] = array(); +if (!is_array($freenas_config['system']['user'])) + $freenas_config['system']['user'] = array(); users_sort(); -$a_user = &$freenas_config['access']['user']; +$a_user = &$freenas_config['system']['user']; if (!is_array($freenas_config['rsync'])) { -- cgit v1.2.3