403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/apport/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/apport/fileutils.pyc
ó
˜¤óYc@s|dZddlZddlZddlZddlZddlZy ddlmZmZm	Z	Wn-e
k
r‘ddlmZmZm	Z	nXddlmZddl
mZejjddƒZdZd	Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!dd„Z#d„Z$dde%d„Z&de&_'dS(s0Functions to manage apport problem report files.iÿÿÿÿN(tConfigParsert
NoOptionErrortNoSectionError(t
ProblemReport(timpltAPPORT_REPORT_DIRs
/var/crashs~/.config/apport/settingss/etc/default/whoopsiec	CstdddtdtdtƒS(s)Check whether crash reporting is enabled.tGeneraltreport_crashestdefaulttpathtbool(t
get_configtTruet_whoopsie_config_file(((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytallowed_to_reportscCsV|dkrdSd}x9tj|ƒD](}|jdƒr&|rEdS|}q&q&W|S(s›Return a package's .desktop file.

    If given package is installed and has a single .desktop file, return the
    path to it, otherwise return None.
    s.desktopN(tNonet	packagingt	get_filestendswith(tpackagetdesktopfiletline((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytfind_package_desktopfile#s
cCsrddddddddg}t}x'|D]}|j|ƒr+t}Pq+q+W|oq|jd	ƒoq|jd
ƒS(s2Check whether the given file is likely to belong to a package.

    This is semi-decidable: A return value of False is definitive, a True value
    is only a guess which needs to be checked with find_file_package().
    However, this function is very fast and does not access the package
    database.
    s/bin/s/boots/etc/s/initrds/libs/sbin/s/usr/s/vars/usr/local/s	/var/lib/(tFalset
startswithR(tfilet
pkg_whitelisttwhitelist_matchti((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytlikely_packaged7s
cCsqtjj|ƒ\}}tjj|ƒ}tjj|ƒrTtjj||ƒ}nt|ƒsddStj	|ƒS(s[Return the package that ships the given file.

    Return None if no package ships it.
    N(
tosR	tsplittrealpathtisdirtjoinRRRtget_file_package(Rtdirtnametresolved_dir((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytfind_file_packageJscCs.tj|ƒ}|j|jkp-|jdkS(sACheck whether the report file has already been processed earlier.i(Rtstattst_atimetst_mtimetst_size(treporttst((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytseen_reportZscCsµd|jddƒd}d|jddƒd}tjj|ƒr›tjj|ƒr›tj|ƒ}tj|ƒ}|j|jkr›tj|ƒq›nt|dƒWdQXdS(Ns	%s.uploadt.iis%s.uploadedta(trsplitRR	texistsR(R*tunlinktopen(R,tuploadtuploadedt	report_stt	upload_st((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytmark_report_upload`s$cCsõtj|ƒ}y$tj||j|jdfƒWn»tk
rðd}xˆ|dkrÓt|ƒ}|jdƒ|jƒytj|ƒ}Wntk
r¢dSX|j|jkr¹Pnt	j
dƒ|d8}qLW|dkrñt|ƒqñnXdS(sMark given report file as seen.iiiNgš™™™™™¹?(RR(tutimeR*tOSErrorR4treadtcloseR)ttimetsleept
delete_report(R,R-ttimeouttf((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytmark_report_seenls&$




cCsˆg}x{tjtjjtdƒƒD][}yAtjj|ƒdkrktj|tjƒrk|j|ƒnWq%t	k
rq%Xq%W|S(sCReturn a list with all report files accessible to the calling user.s*.crashi(
tglobRR	R"t
report_dirtgetsizetaccesstR_OKtappendR;(treportstr((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytget_all_reportsŠs%-
cCsRg}xEtƒD]:}y t|ƒs5|j|ƒnWqtk
rIqXqW|S(sGet new reports for calling user.

    Return a list with all report files which have not yet been processed
    and are accessible to the calling user.
    (RLR.RIR;(RJRK((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytget_new_reports˜s
cCs‹g}x~tjtjjtdƒƒD]^}yDtjj|ƒdkrntj|ƒjdkrn|j|ƒnWq%t	k
r‚q%Xq%W|S(s‹Get all system reports.

    Return a list with all report files which belong to a system user (i. e.
    uid < 500 according to LSB).
    s*.crashiiô(
RDRR	R"RERFR(tst_uidRIR;(RJRK((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytget_all_system_reports©s%0
cCs&gtƒD]}t|ƒs
|^q
S(s«Get new system reports.

    Return a list with all report files which have not yet been processed
    and belong to a system user (i. e. uid < 500 according to LSB).
    (ROR.(RK((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytget_new_system_reportsºscCs?ytj|ƒWn'tk
r:t|dƒjdƒnXdS(sÁDelete the given report file.

    If unlinking the file fails due to a permission error (if report_dir is not
    writable to normal users), the file will be truncated to 0 bytes instead.
    twiN(RR3R;R4ttruncate(R,((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pyR@Âs
cCs•tƒ}|j|tƒy]t|dƒ}tjtj|dƒƒ}tjtjƒƒ}||dkrqdS|SWntt	fk
rdSXdS(sºReturn the number of recent crashes for the given report file.

    Return the number of recent crashes (currently, crashes which happened more
    than 24 hours ago are discarded).
    tCrashCountertDateiiiNi€Q(
RtloadRtintR>tmktimetstrptimet	localtimet
ValueErrortKeyError(R,tprtcounttreport_timetcur_time((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytget_recent_crashesÍs	cCsÄd|kr%|djddƒ}n5d|krN|djddƒd}ntdƒ‚|sotjƒ}ntjjtd|t	|ƒfƒ}tj
tj|tjtj
BtjBd	ƒd
ƒS(s,Construct a canonical pathname for a report and open it for writing

    If uid is not given, it defaults to the uid of the current process.
    The report file must not exist already, to prevent losing previous reports
    or symlink attacks.

    Return an open file object for binary writing.
    tExecutablePatht/t_tPackageiis7report has neither ExecutablePath nor Package attributes%s.%s.crashi twbN(treplaceRRRZRtgetuidR	R"REtstrtfdopenR4tO_WRONLYtO_CREATtO_EXCL(R,tuidtsubjectR	((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytmake_report_fileàs	%cCsÍtjj|ƒst‚tjdd|gdtjdtjdtdddiƒ}|jƒd	j	ƒ}|j
d	kr}gSg}xC|jƒD]5}|jd
ƒr|j
|jddƒd	ƒqqW|S(
s”Check file integrity against md5 sum file.

    sumfile must be md5sum(1) format (relative to /).

    Return a list of files that don't match.
    s/usr/bin/md5sums-ctstdouttstderrt	close_fdstcwdRbtenvitFAILEDt:i(RR	R2tAssertionErrort
subprocesstPopentPIPERtcommunicatetdecodet
returncodet
splitlinesRRIR1(tsumfiletmtoutt
mismatchestl((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pytcheck_files_md5ös$cCsœtjsMtƒt_|r.tjj|ƒqMtjjtjjtƒƒny0|ritjj||ƒStjj	||ƒSWnt
tfk
r—|SXdS(s¤Return a setting from user configuration.

    This is read from ~/.config/apport/settings or path. If bool is True, the
    value is interpreted as a boolean.
    N(RtconfigRR<RR	t
expandusert_config_filet
getbooleantgetRR(tsectiontsettingRR	R
((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pyRs	((t__doc__RRDRxtos.pathR>tconfigparserRRRtImportErrortproblem_reportRtapport.packaging_implRRtenvironR‰RER‡R
RRRR'R.R9RCRLRMRORPR@R`RRoR„RRR…(((s4/usr/lib/python2.7/dist-packages/apport/fileutils.pyt<module>s6< 
 														

Youez - 2016 - github.com/yon3zu
LinuXploit