/[smecontribs]/rpms/smeserver-gitweb/contribs8/smeserver-gitweb-1.0.0-checktrusted_networks.patch
ViewVC logotype

Contents of /rpms/smeserver-gitweb/contribs8/smeserver-gitweb-1.0.0-checktrusted_networks.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Jun 22 18:02:09 2016 UTC (8 years, 5 months ago) by unnilennium
Branch: MAIN
CVS Tags: smeserver-gitweb-1_0_0-20_el5_sme, smeserver-gitweb-1_0_0-22_el5_sme, HEAD
* Wed Jun 22 2016 Jean-Philipe Pialasse <tests@pialasse.com> 1.0.0-20.sme
- port to SME8 SME9 fixes
- fix 500 error after auth on remote access  [SME: 9614]
- check all trusted networks [SME: 9578]
- fix git db readable by everybody [SME: 9615]

1 diff -Nur smeserver-gitweb-1.1.0.old/root/etc/e-smith/templates/etc/gitweb.conf/60ExportAuthHook smeserver-gitweb-1.1.0/root/etc/e-smith/templates/etc/gitweb.conf/60ExportAuthHook
2 --- smeserver-gitweb-1.1.0.old/root/etc/e-smith/templates/etc/gitweb.conf/60ExportAuthHook 2016-06-22 12:52:10.450000000 -0400
3 +++ smeserver-gitweb-1.1.0/root/etc/e-smith/templates/etc/gitweb.conf/60ExportAuthHook 2016-06-22 13:05:27.508000000 -0400
4 @@ -84,15 +84,22 @@
5 my %properties = $repository->props;
6
7 # Check if the request is from a local IP address for this host
8 -
9 - # Get server private IP address and mask for access to the local network only
10 - my @network_setting = split(/[\/ ]/, $local_network_setting );
11 -
12 - # Check if the REMOTE_ADDR is within the range of the 'private' address for this server
13 - my $remote_addr = NetAddr::IP->new( $ENV\{'REMOTE_ADDR'\} );
14 - if( $remote_addr->within( new NetAddr::IP @network_setting[1], @network_setting[2] ) ) \{
15 - return 1; # EXIT LOCAL HOST -> REPOSITORY VIEW ALLOWED
16 - \}
17 + my @network_set = split(/ /, $local_network_setting );
18 +
19 + for my $cur_network (@network_set) \{
20 + $cur_network = "$cur_network/255.255.255.255" unless $cur_network =~ /[0-9.]*\/[0-9.]*/;
21 +
22 + # Get server private IP address and mask for access to the local
23 + # network only
24 + my @network_setting = split(/\//, $cur_network );
25 +
26 + # Check if the REMOTE_ADDR is within the range of the
27 + # 'private' address for this server
28 + my $remote_addr = NetAddr::IP->new( $ENV{'REMOTE_ADDR'} );
29 + if( $remote_addr->within( new NetAddr::IP @network_setting[0], @network_setting[1] ) ) \{
30 + return 1; # EXIT LOCAL HOST -> REPOSITORY VIEW ALLOWED
31 + \}
32 + \}
33
34 # See if internet access is allowed on this repository.
35 if ($properties\{'allow_access_from'\}) \{

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed