diff options
| author | Greg Beaver <cellog@php.net> | 2008-05-12 20:42:07 +0000 |
|---|---|---|
| committer | Greg Beaver <cellog@php.net> | 2008-05-12 20:42:07 +0000 |
| commit | 82dc03941a315c24faaecefa95d3c2add47115a5 (patch) | |
| tree | 8caee7b3fc15bd18e93a696e6e2ed39f143352df /ext/phar/util.c | |
| parent | ac8ea81588b5d8c53b97ee3d9ceae0f49ee1ce94 (diff) | |
| download | php-git-82dc03941a315c24faaecefa95d3c2add47115a5.tar.gz | |
fix weird alias issues, add tests to check for new-found problems
Diffstat (limited to 'ext/phar/util.c')
| -rw-r--r-- | ext/phar/util.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/phar/util.c b/ext/phar/util.c index 5bdd018fdf..77e83098a4 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -1032,6 +1032,12 @@ int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, ch *archive = *fd_ptr; fd = *fd_ptr; if (alias && alias_len) { + if (!fd->is_temporary_alias && (alias_len != fd->alias_len || memcmp(fd->alias, alias, alias_len))) { + if (error) { + spprintf(error, 0, "alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"", alias, (*fd_ptr)->fname, fname); + } + return FAILURE; + } if (fd->alias_len && SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_alias_map), fd->alias, fd->alias_len, (void**)&fd_ptr)) { zend_hash_del(&(PHAR_GLOBALS->phar_alias_map), fd->alias, fd->alias_len); } |
