!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/share/rhn/up2date_client/   drwxr-xr-x
Free 3.84 GB of 27.03 GB (14.21%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     grubcfg.py (2.29 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/python
#
# Module for munging lilo.conf lilo configurations file in the case
#   of installing new or updated kernel packages
#
# Copyright (c) 1999-2002 Red Hat, Inc.  Distributed under GPL.
#
# Authors: Adrian Likins <alikins@redhat.com>
#

import os,sys
sys.path.insert(0, "/usr/share/rhn/")
sys.path.insert(1,"/usr/share/rhn/up2date_client")

import iutil
from rhpl.translate import _, N_
import time
import string
import rpmUtils
import transaction

import up2dateLog
from bootloadercfg import Error, makeInitrd


class GrubbyRuntimeError(Error):
    def __repr__(self):
        msg = _("Unable to run grubby correctly: the message was:\n") + self.errmsg
        return msg

# fire off grubby to find the default
def findDefault():
    log = up2dateLog.initLog()
    try:
        pipe = os.popen("/sbin/grubby --default-kernel")
        ret = pipe.read()
        ret = string.strip(ret)
        
        log.log_me("""Running /sbin/grubby --default-kernel""")
    except RuntimeError, command:
        raise GrubbyRuntimeError("unable to run grubby. Not running as root?")
    
    return ret

def setDefault(newImage):
    try:
        ret = iutil.execWithRedirect("/sbin/grubby", ["grubby", "--set-default", "/boot/vmlinuz-%s" % newImage])
    except RuntimeError, command:
        raise GrubbyRuntimeError("unable to run grubby. Not running as root?")

    # FIXME
    # add error checking here? grubby seems to always return 0
    return ret
    
    
def installNewImages(imageList, test=0, filename=None):

    # find out what image is
    defaultImagePath = findDefault()
    defaultType = None
    
    # open the rpmdb and look up the kernel path
    ts = transaction.initReadOnlyTransaction()
    if defaultImagePath != "":
        header = rpmUtils.findDepLocal(ts,defaultImagePath)
    else:
        header = None
        
    if header:
        # the default is the name of the
        defaultType = header["name"]
    else:
        defaultType = None

    
    # look for a kernel image matching the default in the list of
    # kernels I'm installing...
    # if we dont match anything, dont set linux to the default of any sort
    for (newimage, imageType) in imageList:
        if defaultType == imageType:
            setDefault(newimage)

    # not much testing we can do here... ;-<
    return 0        

:: 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.003 ]--