/[smecontribs]/rpms/smeserver-gitweb/contribs10/smeserver-gitweb-1.1.0-checktrusted_networks.patch
ViewVC logotype

Annotation of /rpms/smeserver-gitweb/contribs10/smeserver-gitweb-1.1.0-checktrusted_networks.patch

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


Revision 1.1 - (hide annotations) (download)
Sun Dec 20 15:41:50 2020 UTC (3 years, 10 months ago) by brianr
Branch: MAIN
CVS Tags: smeserver-gitweb-1_1_0-14_el7_sme, smeserver-gitweb-1_1_0-13_el7_sme, HEAD
Initial import

1 brianr 1.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