Due to implementation of the new "level2 oplocks" parameter and removal of
the "share modes" samba parameter, changes to select samba fragments needs
to be made to Samba 2.2.2 installs. Following are suggested changes to the
current array of SME/e-smith smb.conf fragments. Please also note the
addition of a delete user script fragment. This fragment automates the
process of removing a machine from a domain (e.g. when a machine leaves and
rejoins a domain). machine-account-delete perl code listed at the end of
this document.
# [12deleteuserscript]
# Remove Windows Machine Account
delete user script = /etc/e-smith/events/actions/machine-account-delete
%u
# [50homes]
#============================ Share Definitions
==============================
[homes]
comment = Home directory
browseable = no
guest ok = no
read only = no
writable = yes
printable = no
create mode = 0660
force create mode = 0660
directory mode = 0770
force directory mode = 0770
level2 oplocks = no
path = /home/e-smith/files/users/%S/home
# [50printers]
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
level2 oplocks = no
# [60primary]
[Primary]
comment = Primary site
path = /home/e-smith/files/primary
read only = no
writable = yes
printable = no
create mode = 0640
directory mode = 02750
force create mode = 0640
force directory mode = 02750
level2 oplocks = no
# [61netlogonshare]
{
my $domainMaster = $SambaDomainMaster || 'no';
if ($domainMaster eq 'yes')
{
$OUT .= "[netlogon]\n";
$OUT .= " comment = Network Logon Service\n";
$OUT .= " path = /home/netlogon\n";
$OUT .= " guest ok = yes\n";
$OUT .= " writable = yes\n";
$OUT .= " browseable = no\n";
$OUT .= " level2 oplocks = no\n";
}
}
# [61printerdriversshare]
# added to support printer drivers download
[print$]
path = /home/e-smith/files/samba/printers
guest ok = yes
browsable = yes
read only = yes
; since this share is configured as read only, then we need
; a 'write-list'. Check the file system permissions to make
; sure this account can copy files to the share. If this
; is setup to a non-root account, then it should also exist
; as a 'printer admin'
write list = @admin root admin Administrator
level2 oplocks = no
# [61Profilesshare]
# This is the WinNT/W2K Profiles share
# WinNT/W2K profiles are stored in /home/e-smith/files/samba/profiles/~user
# Win9x profiles are stored in ~user/.profiles
[Profiles]
path = /home/e-smith/files/samba/profiles
writeable = yes
browseable = no
create mask = 0600
directory mask = 0700
level2 oplocks = no
# [90ibays]
{
# process all information-bay directories
my %accounts;
tie %accounts, 'esmith::config', '/home/e-smith/accounts';
my $key;
my $value;
my $result = "";
while (($key,$value) = each %accounts)
{
my ($type, %properties) = split (/\|/, $value, -1);
if ($type eq 'ibay')
{
$result .= "\n";
$result .= "[$key]\n";
$result .= " comment = $properties{'Name'}\n";
#---------------------------------------
# If no public access, have the share go directly to the files
# subdirectory (for easier drive mappings)
# Otherwise, have the share mapping show all three subfolders
#---------------------------------------
if ($properties{'PublicAccess'} eq 'none')
{
$result .= " path = /home/e-smith/files/ibays/$key/files\n";
}
else
{
$result .= " path = /home/e-smith/files/ibays/$key\n";
}
$result .= " read only = no\n";
$result .= " writable = yes\n";
$result .= " printable = no\n";
$result .= " level2 oplocks = no\n";
# Make the defaults really stupid
my $fmode = "0000";
if ($properties{'UserAccess'})
{
#----------------------------------------
# e-smith 4.0
#----------------------------------------
if ($properties{'UserAccess'} eq 'wr-admin-rd-group')
{
$fmode = "0640";
}
elsif ($properties{'UserAccess'} eq 'wr-group-rd-group')
{
$fmode = "0660";
}
elsif ($properties{'UserAccess'} eq 'wr-group-rd-everyone')
{
$fmode = "0664";
}
$result .= " inherit permissions = yes\n";
}
else
{
#----------------------------------------
# e-smith 3.0
#----------------------------------------
my $dmode;
if ($properties{'WriteAccess'} eq 'admin')
{
$fmode = "0640";
$dmode = "0750";
}
else
{
$fmode = "0660";
$dmode = "0770";
}
$result .= " directory mode = $dmode\n";
}
$result .= " create mode = $fmode\n";
}
}
$result;
}
########### END FRAGMENTS ###################
########### MACHINE-ACCOUNT-DELETE APPLET ######
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# copyright (C) 2001 e-smith, inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Technical support for this program is available from e-smith, inc.
# Please visit our web site www.e-smith.com for details.
#----------------------------------------------------------------------
##Load modules
use strict;
##Assign command line arguments to lexical variable
my $machineName = (RemoveWhiteSpace($ARGV[0]))[0];
## Verfy that an argument was passed to this script
die "machinename argument missing" unless defined ($machineName);
##Create e-smith machine account
open (DELETEESMITH, "/sbin/e-smith/db accounts delete $machineName |") ||
die "Failed to create e-smith account $machineName\n";
close (DELETEESMITH);
##Delete smbpasswd entry
#open (DELETEMACHINE, "/usr/bin/smbpasswd -x $machineName |") || die
"Problem deleting smbpassd entry!! \n";
#close (DELETEMACHINE);
##reset machine passwd
open (DELETEMACHINE, "/usr/bin/passwd -d $machineName |") || die "Problem
resetting machine password!! \n";
close (DELETEMACHINE);
##delete unix password entry
open (DELETEMACHINE, "/usr/sbin/userdel -r $machineName |") || die "Problem
deleting unix account!! \n ";
close (DELETEMACHINE);
exit;
#---------------------------------------------------------------------------
-----------------------------------------------------------------------
# Clean White Spaces from Data
#---------------------------------------------------------------------------
-----------------------------------------------------------------------
sub RemoveWhiteSpace {
#Set local varables to lexical scope
my ($arrayElement,@processingArray, $arraySize);
#dump parameter array to a temporary, processing array
@processingArray = @_;
$arraySize = @processingArray;
#cycle through array and remove white space
foreach $arrayElement (0..($arraySize-1)) {
$processingArray[$arrayElement] =~ s/^\s+//; #remove leading spaces
$processingArray[$arrayElement] =~ s/\s+$//; #remove trailing spaces
}
#return array of processed elements to calling routine
return (@processingArray);
}
--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org