!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/bin/X11/./../../share/rhn/up2date_client/   drwxr-xr-x
Free 5.47 GB of 27.03 GB (20.23%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     urlMirrors.py (3.48 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/python

import os
import sys
import string

import config
import up2dateUtils
from repoBackends import urlUtils

def getMirrors(source, defaultMirrorUrl=None):
    cfg = config.initUp2dateConfig()
    mirrorPath = "/etc/sysconfig/rhn/mirrors/"

    mirrorType = ""
    if cfg.has_key("mirrorLocation"):
        mirrorType = cfg['mirrorLocation']
    
    if mirrorType != "":
        mirrorFile = "%s/%s.%s" % (mirrorPath, source['label'], mirrorType)
    else:
        mirrorFile = "%s/%s" % (mirrorPath, source['label'])

#   print "source: %s" % source
    mirrors = []
    arch = up2dateUtils.getUnameArch()
#   print "mf1: %s" % mirrorFile
    if os.access(mirrorFile, os.R_OK):
#       print "mirrorFile: %s" % mirrorFile
        f = open(mirrorFile, "r")
        for line in f.readlines():
            if line[0] == "#":
                continue
            line = string.strip(line)
            # just in case we want to add more info, like weight, etc
            tmp = []
            tmp = string.split(line, ' ')
            # sub in arch so we can use one mirror list for all arches
            url = string.replace(tmp[0], "$ARCH", arch)

            mirrors.append(url)

   # if there were user defined mirrors, use them
    if mirrors:
#        print "mirrors from /etc: %s" % mirrors
        return mirrors

#    print "gh2"
    #otherwise look for the dymanic ones in /var/spool/up2date
    mirrorPath = cfg['storageDir']
    mirrorFile = "%s/%s" % (mirrorPath, source['label'])
    mirrors = []

# we should cache these and do If-Modified fetches like we
# do for the package list info

##    if os.access(mirrorFile, os.R_OK):
###        print "mirrorFile: %s" % mirrorFile
##        f = open(mirrorFile, "r")
##        for line in f.readlines():
##            line = string.strip(line)
##            # just in case we want to add more info, like weight, etc
##            tmp = []
##            tmp = string.split(line, ' ')

##            mirrors.append(tmp[0])

   # if there were user defined mirrors, use them
    if mirrors:
        return mirrors

#    print "gh3"
    # download and save the latest mirror list

    # use the hardcode url for the moment, till we can
    # expect mirror lists to be in the base of the repo, hopefully
    # soon
    if defaultMirrorUrl == None:
        return []
    
    # we could try something heirarch here, aka, mirrors.us.es first, then mirrors.us, then mirrors
    if mirrorType != "":
        mirrorUrl = "%s.%s" % (defaultMirrorUrl,mirrorType)
    else:
        mirrorUrl = "%s" % (defaultMirrorUrl)

    print mirrorUrl
    try:
    
        readfd = urlUtils.open_resource(mirrorUrl, agent="Up2date/%s" % up2dateUtils.version())
    except IOError:
#        print "gh5"
        return []
#    print "DDDmirrorFile: %s" % mirrorFile
    fd = open(mirrorFile, "w")
    fd.write(readfd.read())
    readfd.close()
    fd.close()

    arch = up2dateUtils.getUnameArch()
    if os.access(mirrorFile, os.R_OK):
#        print "mirrorFile2: %s" % mirrorFile
        f = open(mirrorFile, "r")
        for line in f.readlines():
            line = string.strip(line)
            # blank line
            if len(line) == 0:
                continue
            if line[0] == "#":
                continue
            # just in case we want to add more info, like weight, etc
            tmp = []
            tmp = string.split(line, ' ')

            url = string.replace(tmp[0], "$ARCH", arch)
            mirrors.append(url)
    

#    print "mirrors: %s" % mirrors
    return mirrors

    

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0042 ]--