Bug 1252037 - Horde bad shutdown Horde::Util
Summary: Horde bad shutdown Horde::Util
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: horde
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jason Tibbitts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-10 14:16 UTC by la_antorcha_guia
Modified: 2016-07-19 17:27 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-19 17:27:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description la_antorcha_guia 2015-08-10 14:16:06 UTC
Description of problem:
Horde::Util , public static function shutdown() tries to erase twice the same file.

Version-Release number of selected component (if applicable):


How reproducible:
Use horde libs

Steps to Reproduce:
1. Include horde libs
2. Call exit
3. Horde::Util is trying to erase twice tmp files

Actual results:
Errors

Expected results:
Clean exit

Additional info:

The code of function + temp solution.

{
  $ptr = &self::$_shutdowndata;

// $ptr contains files and dirs.
// Dirs and contains are erased in the first pass.
// But $ptr continues containing files already erased.
// In this case "is_file()" over non existent file return false, and tries to // iterate a non existent  dir. An error is printed.

        foreach (array_keys($ptr['paths']) as $val) {

 /* Temp Solution  */
if (!file_exists($val)) continue;
/* */

            if (@is_file($val)) {
                self::_secureDelete($val);
                continue;
            }

            try {
                $it = new RecursiveIteratorIterator(
                    new RecursiveDirectoryIterator($val),
                    RecursiveIteratorIterator::CHILD_FIRST
                );
            } catch (UnexpectedValueException $e) {
                continue;
            }

            while ($it->valid()) {
                if (!$it->isDot()) {
                    if ($it->isDir()) {
                        @rmdir($it->key());
                    } elseif ($it->isFile()) {
                        self::_secureDelete($it->key());
                    } else {
                        @unlink($it->key());
                    }
                }
                $it->next();
            }

            @rmdir($val);
        }
}

Comment 1 Fedora End Of Life 2016-07-19 17:27:32 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.