Add "Wide links" and "Unix extension" settings to samba.cgi.
authorArne Fitzenreiter <arne_f@ipfire.org>
Mon, 8 Feb 2010 22:06:01 +0000 (23:06 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 8 Feb 2010 22:06:01 +0000 (23:06 +0100)
both options are enabled by default and this is security hole.

html/cgi-bin/samba.cgi
lfs/samba

index b8e5731..4438a8b 100644 (file)
@@ -100,6 +100,8 @@ $sambasettings{'DOSCHARSET'} = 'CP850';
 $sambasettings{'UNIXCHARSET'} = 'UTF8';
 $sambasettings{'DISPLAYCHARSET'} = 'CP850';
 $sambasettings{'SOCKETOPTIONS'} = 'TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 SO_KEEPALIVE';
+$sambasettings{'WIDELINKS'} = 'on';
+$sambasettings{'UNIXEXTENSION'} = 'off';
 ### Values that have to be initialized
 $sambasettings{'ACTION'} = '';
 ### Samba CUPS Variablen
@@ -123,6 +125,9 @@ my $PDCOPTIONS = `cat ${General::swroot}/samba/pdc`;
 
 sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";&Header::closebox();}
 
+if (($sambasettings{'WIDELINKS'} eq 'on') & ($sambasettings{'UNIXEXTENSION'} eq 'on'))
+  {$errormessage="Don't enable 'Wide links' and 'Unix extension' at the same time"; }
+
 &Header::openpage('Samba', 1, '');
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
@@ -171,6 +176,8 @@ if ($sambasettings{'ACTION'} eq 'globalresetyes')
        $sambasettings{'PRINTCAPNAME'} = 'cups';
        $sambasettings{'PRINTERNAME'} = 'Printer';
 ### Values that have to be initialized
+       $sambasettings{'WIDELINKS'} = 'on';
+       $sambasettings{'UNIXEXTENSION'} = 'off';
        $sambasettings{'ACTION'} = '';
        $sambasettings{'LOCALMASTER'} = 'off';
        $sambasettings{'DOMAINMASTER'} = 'off';
@@ -249,6 +256,8 @@ if ($sambasettings{'LOCALMASTER'} eq 'on'){ $sambasettings{'LOCALMASTER'} = "tru
 if ($sambasettings{'DOMAINMASTER'} eq 'on'){ $sambasettings{'DOMAINMASTER'} = "true";} else { $sambasettings{'DOMAINMASTER'} = "false";}
 if ($sambasettings{'PREFERREDMASTER'} eq 'on'){ $sambasettings{'PREFERREDMASTER'} = "true";} else { $sambasettings{'PREFERREDMASTER'} = "false";}
 if ($sambasettings{'SYSLOGONLY'} eq 'on'){ $sambasettings{'SYSLOGONLY'} = "yes";} else { $sambasettings{'SYSLOGONLY'} = "no";}
+if ($sambasettings{'WIDELINKS'} eq 'on'){ $sambasettings{'WIDELINKS'} = "yes";} else { $sambasettings{'WIDELINKS'} = "no";}
+if ($sambasettings{'UNIXEXTENSION'} eq 'on'){ $sambasettings{'UNIXEXTENSION'} = "yes";} else { $sambasettings{'UNIXEXTENSION'} = "no";}
 
 ############################################################################################################################
 ############################################# Schreiben der Samba globals ##################################################
@@ -264,6 +273,9 @@ netbios name = $sambasettings{'NETBIOSNAME'}
 server string = $sambasettings{'SRVSTRING'}
 workgroup = $sambasettings{'WORKGRP'}
 
+wide links = $sambasettings{'WIDELINKS'}
+unix extensions = $sambasettings{'UNIXEXTENSION'}
+
 keep alive = 30
 os level = $sambasettings{'OSLEVEL'}
 fstype = NTFS
@@ -381,6 +393,12 @@ $checked{'DOMAINMASTER'}{$sambasettings{'DOMAINMASTER'}} = "checked='checked'";
 $checked{'PREFERREDMASTER'}{'off'} = '';
 $checked{'PREFERREDMASTER'}{'on'} = '';
 $checked{'PREFERREDMASTER'}{$sambasettings{'PREFERREDMASTER'}} = "checked='checked'";
+$checked{'WIDELINKS'}{'off'} = '';
+$checked{'WIDELINKS'}{'on'} = '';
+$checked{'WIDELINKS'}{$sambasettings{'WIDELINKS'}} = "checked='checked'";
+$checked{'UNIXEXTENSION'}{'off'} = '';
+$checked{'UNIXEXTENSION'}{'on'} = '';
+$checked{'UNIXEXTENSION'}{$sambasettings{'UNIXEXTENSION'}} = "checked='checked'";
 $checked{'GREEN'}{'off'} = '';
 $checked{'GREEN'}{'on'} = '';
 $checked{'GREEN'}{$sambasettings{'GREEN'}} = "checked='checked'";
@@ -481,6 +499,11 @@ END
 print <<END
 <tr><td align='center' width='40%'>$Lang::tr{'more'}</td><td align='left'><input type='text' name='OTHERINTERFACES' value='$sambasettings{'OTHERINTERFACES'}' size="30" /></td></tr>
 <tr><td align='left'><br /></td><td></td></tr>
+<tr><td align='left' width='40%'>Wide links</td><td align='left'>on <input type='radio' name='WIDELINKS' value='on' $checked{'WIDELINKS'}{'on'} />/
+                                                                                                                                                                                       <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'><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">
                                                                                                                                                                <option value='share' $selected{'SECURITY'}{'share'}>Share</option>
index 2e00b59..4dbb90f 100644 (file)
--- a/lfs/samba
+++ b/lfs/samba
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = samba
-PAK_VER    = 23
+PAK_VER    = 24
 
 DEPS       = "cups"