View Issue Details

IDProjectCategoryView StatusLast Update
0015572mantisbtattachmentspublic2014-02-07 18:24
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Product Version1.2.14 
Target Version1.2.16Fixed in Version1.2.16 
Summary0015572: diskfile_is_name_unique() can return non-unique filename
Description

There are cases where the diskfile_is_name_unique() API function can return true, even if a file exists because it does not perform a check against the file system.

Furthermore, it only checks mantis_bug_file_table, which means that when dealing with project files there is in fact no uniqueness check at all.

TagsNo tags attached.

Relationships

has duplicate 0007176 closeddregad Move Attachments to Disk: data loss due to filename overwrite 

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master 360ffc0f

2013-03-05 23:19

dregad


Details Diff
Modify file_is_name_unique() API to work for project files also

Previously this function would only work for bug attachments, and
another API function project_file_is_name_unique() would take care of
projects. The latter was removed as it was not used, and this one
amended in case it's ever required to check for uniqueness of a project
file.

It also makes sense to regroup file-related functions in file_api.php.

Issue 0015572
Affected Issues
0015572
mod - core/file_api.php Diff File

MantisBT: master-1.2.x 67bbf86b

2013-03-05 23:19

dregad


Details Diff
Modify file_is_name_unique() API to work for project files also

Previously this function would only work for bug attachments, and
another API function project_file_is_name_unique() would take care of
projects. The latter was removed as it was not used, and this one
amended in case it's ever required to check for uniqueness of a project
file.

It also makes sense to regroup file-related functions in file_api.php.

Issue 0015572
Affected Issues
0015572
mod - core/file_api.php Diff File

MantisBT: master 65c4ce7b

2013-03-06 00:50

dregad


Details Diff
Revise and improve diskfile_is_name_unique()

Prior to this, the API would only check for a file's uniqueness by
looking up the bug_file table, and did not actually checking the file
system for an existing file.

This causes 2 potential issues:

- we could have a duplicate in the file system and therefore unwittingly
overwrite it with a new file
- it was not possible to use the function for for project docs

Fixes 0015572
Affected Issues
0015572
mod - core/file_api.php Diff File

MantisBT: master-1.2.x f6b8f7e9

2013-03-06 00:50

dregad


Details Diff
Revise and improve diskfile_is_name_unique()

Prior to this, the API would only check for a file's uniqueness by
looking up the bug_file table, and did not actually checking the file
system for an existing file.

This causes 2 potential issues:

- we could have a duplicate in the file system and therefore unwittingly
overwrite it with a new file
- it was not possible to use the function for for project docs

Fixes 0015572
Affected Issues
0015572
mod - core/file_api.php Diff File