]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/samba.cgi
Forward Firewall: fixed 12 Bugs from forum.
[people/teissler/ipfire-2.x.git] / html / cgi-bin / samba.cgi
index 2e8ea8aee902ee5d16ae32609d0f3bf76e32d2c4..74f10bd3437d515b71f1aee198d0b408fddb39a2 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2005-2010  IPTifre Team                                       #
+# Copyright (C) 2005-2013  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
@@ -77,7 +77,7 @@ my %servicenames = ('SMB Daemon' => 'smbd','NetBIOS Nameserver' => 'nmbd');
 
 $sambasettings{'WORKGRP'} = 'homeip.net';
 $sambasettings{'NETBIOSNAME'} = 'IPFire';
-$sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.7';
+$sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.x';
 $sambasettings{'INTERFACES'} = '';
 $sambasettings{'SECURITY'} = 'share';
 $sambasettings{'OSLEVEL'} = '33';
@@ -92,16 +92,17 @@ $sambasettings{'REMOTESYNC'} = '';
 $sambasettings{'PASSWORDSYNC'} = 'off';
 $sambasettings{'OTHERINTERFACES'} = '127.0.0.1';
 $sambasettings{'GUESTACCOUNT'} = 'samba';
-$sambasettings{'MAPTOGUEST'} = 'Never';
+$sambasettings{'MAPTOGUEST'} = 'Bad User';
 $sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:5 winbind:2';
 $sambasettings{'SYSLOGLEVEL'} = '1';
 $sambasettings{'SYSLOGONLY'} = 'on';
 $sambasettings{'DOSCHARSET'} = 'CP850';
 $sambasettings{'UNIXCHARSET'} = 'UTF8';
 $sambasettings{'DISPLAYCHARSET'} = 'CP850';
-$sambasettings{'SOCKETOPTIONS'} = 'TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 SO_KEEPALIVE';
+$sambasettings{'SOCKETOPTIONS'} = 'TCP_NODELAY SO_RCVBUF=819200 SO_SNDBUF=819200 SO_KEEPALIVE';
 $sambasettings{'WIDELINKS'} = 'on';
 $sambasettings{'UNIXEXTENSION'} = 'off';
+$sambasettings{'SMB2'} = 'off';
 ### Values that have to be initialized
 $sambasettings{'ACTION'} = '';
 ### Samba CUPS Variablen
@@ -148,7 +149,7 @@ if ($sambasettings{'ACTION'} eq 'globalresetyes')
        system("/usr/local/bin/sambactrl smbglobalreset");
        $sambasettings{'WORKGRP'} = 'homeip.net';
        $sambasettings{'NETBIOSNAME'} = 'IPFire';
-       $sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.0';
+       $sambasettings{'SRVSTRING'} = 'Samba running on IPFire 2.x';
        $sambasettings{'INTERFACES'} = '';
        $sambasettings{'SECURITY'} = 'share';
        $sambasettings{'OSLEVEL'} = '65';
@@ -163,7 +164,7 @@ if ($sambasettings{'ACTION'} eq 'globalresetyes')
        $sambasettings{'PASSWORDSYNC'} = 'off';
        $sambasettings{'OTHERINTERFACES'} = '127.0.0.1';
        $sambasettings{'GUESTACCOUNT'} = 'samba';
-       $sambasettings{'MAPTOGUEST'} = 'Never';
+       $sambasettings{'MAPTOGUEST'} = 'Bad User';
        $sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:5 winbind:2';
        $sambasettings{'SYSLOGLEVEL'} = '1';
        $sambasettings{'SYSLOGONLY'} = 'on';
@@ -182,7 +183,10 @@ if ($sambasettings{'ACTION'} eq 'globalresetyes')
        $sambasettings{'LOCALMASTER'} = 'off';
        $sambasettings{'DOMAINMASTER'} = 'off';
        $sambasettings{'PREFERREDMASTER'} = 'off';
-       $sambasettings{'SOCKETOPTIONS'} = 'TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 SO_KEEPALIVE';
+       $sambasettings{'SOCKETOPTIONS'} = 'TCP_NODELAY SO_RCVBUF=819200 SO_SNDBUF=819200 SO_KEEPALIVE';
+       $sambasettings{'WIDELINKS'} = 'on';
+       $sambasettings{'UNIXEXTENSION'} = 'off';
+       $sambasettings{'SMB2'} = 'off';
        $PDCOPTIONS = `cat ${General::swroot}/samba/pdc`;
        system("/usr/local/bin/sambactrl smbreload");
        refreshpage();
@@ -276,7 +280,14 @@ passdb backend = smbpasswd
 
 wide links = $sambasettings{'WIDELINKS'}
 unix extensions = $sambasettings{'UNIXEXTENSION'}
+END
+;
 
+if ($sambasettings{'SMB2'} eq 'on'){
+       print FILE "max protocol = smb2\n";
+}
+
+print FILE <<END
 keep alive = 30
 os level = $sambasettings{'OSLEVEL'}
 fstype = NTFS
@@ -400,6 +411,9 @@ $checked{'WIDELINKS'}{$sambasettings{'WIDELINKS'}} = "checked='checked'";
 $checked{'UNIXEXTENSION'}{'off'} = '';
 $checked{'UNIXEXTENSION'}{'on'} = '';
 $checked{'UNIXEXTENSION'}{$sambasettings{'UNIXEXTENSION'}} = "checked='checked'";
+$checked{'SMB2'}{'off'} = '';
+$checked{'SMB2'}{'on'} = '';
+$checked{'SMB2'}{$sambasettings{'SMB2'}} = "checked='checked'";
 $checked{'GREEN'}{'off'} = '';
 $checked{'GREEN'}{'on'} = '';
 $checked{'GREEN'}{$sambasettings{'GREEN'}} = "checked='checked'";
@@ -413,6 +427,9 @@ $checked{'VPN'}{'off'} = '';
 $checked{'VPN'}{'on'} = '';
 $checked{'VPN'}{$sambasettings{'VPN'}} = "checked='checked'";
 
+if ( $sambasettings{'MAPTOGUEST'} eq "Never" ) {
+       $sambasettings{'MAPTOGUEST'}="Bad User";
+}
 $selected{'MAPTOGUEST'}{$sambasettings{'MAPTOGUEST'}} = "selected='selected'";
 $selected{'SECURITY'}{$sambasettings{'SECURITY'}} = "selected='selected'";
 
@@ -504,6 +521,8 @@ print <<END
                                                                                                                                                                                        <input type='radio' name='WIDELINKS' value='off' $checked{'WIDELINKS'}{'off'} /> off</td></tr>
 <tr><td align='left' width='40%'>Unix extension</td><td align='left'>on <input type='radio' name='UNIXEXTENSION' value='on' $checked{'UNIXEXTENSION'}{'on'} />/
                                                                                                                                                                                        <input type='radio' name='UNIXEXTENSION' value='off' $checked{'UNIXEXTENSION'}{'off'} /> off</td></tr>
+<tr><td align='left' width='40%'>SMB2 $Lang::tr{'protocol'}</td><td align='left'>on <input type='radio' name='SMB2' value='on' $checked{'SMB2'}{'on'} />/
+                                                                                                                                                                                       <input type='radio' name='SMB2' value='off' $checked{'SMB2'}{'off'} /> off</td></tr>
 <tr><td align='left'><br /></td><td></td></tr>
 <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'security options'}</b></td></tr>
 <tr><td align='left' width='40%'>$Lang::tr{'security'}</td><td align='left'><select name='SECURITY' style="width: 165px">
@@ -514,7 +533,6 @@ print <<END
                                                                                                                                                                <option value='server' $selected{'SECURITY'}{'server'}>Server</option>
                                                                                                                                                                </select></td></tr>
 <tr><td align='left' width='40%'>$Lang::tr{'map to guest'}</td><td align='left'><select name='MAPTOGUEST' style="width: 165px">
-                                                                                                                                                                               <option value='Never' $selected{'MAPTOGUEST'}{'Never'}>Never</option>
                                                                                                                                                                                <option value='Bad User' $selected{'MAPTOGUEST'}{'Bad User'}>Bad User</option>
                                                                                                                                                                                <option value='Bad Password' $selected{'MAPTOGUEST'}{'Bad Password'}>Bad Password</option>
                                                                                                                                                                                </select></td></tr>