==================================================================
  Please DO NOT REPLY to this mail or send email to the developers
  about this bug. Please follow-up to Bugzilla using this link:
    https://bugs.contribs.org/show_bug.cgi?id=9578

  Have you checked the Frequently Asked Questions (FAQ)?
    http://wiki.contribs.org/SME_Server:Documentation:FAQ

  Please also take the time to read the following useful guide:
    http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
==================================================================

            Bug ID: 9578
           Summary: test for local and trusted network
    Classification: Contribs
           Product: SME Contribs
           Version: 9.0
          Hardware: ---
                OS: ---
            Status: CONFIRMED
          Severity: normal
          Priority: P3
         Component: smeserver-gitweb
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

currently the test only work for local network

i suggest this :

my @network_set = split(/ /, $local_network_setting );

for my $cur_network (@network_set) {
    $cur_network = "$cur_network/255.255.255.255" unless $cur_network =~
/[0-9.]*\/[0-9.]*/;

    # Get server private IP address and mask for access to the local network 
only
    my @network_setting = split(/\//, $cur_network );

    # Check if the REMOTE_ADDR is within the range of the 'private' address 
for this server
    my $remote_addr = NetAddr::IP->new( $ENV{'REMOTE_ADDR'} );
    if( $remote_addr->within( new NetAddr::IP @network_setting[0],  
@network_setting[1] ) ) {
                      return 1; # EXIT LOCAL HOST -> REPOSITORY VIEW ALLOWED
    }
}


this is also needed for SME8

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mail for each SME Contribs bug report
To unsubscribe, e-mail [email protected]
Searchable archive at https://lists.contribs.org/mailman/public/contribteam/

Reply via email to