Skip to content

Commit

Permalink
exmdb: ignore softdeleted folders when validating new folder name
Browse files Browse the repository at this point in the history
Two folders must not have the same path. This limitation was
overeagerly enforced even for softdeleted folders, even though they
are not visible, which led to the inability in Gromox to delete and
recreate folders in public stores while the same is doable in
EXC2019.

References: GXL-454, DESK-1210
  • Loading branch information
jengelh committed Oct 11, 2023
1 parent 90f2ee7 commit 9281085
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exch/exmdb_provider/common_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ BOOL common_util_get_folder_by_name(
char sql_string[128];

snprintf(sql_string, std::size(sql_string), "SELECT folder_id "
"FROM folders WHERE parent_id=%llu", LLU{parent_id});
"FROM folders WHERE parent_id=%llu AND is_deleted=0", LLU{parent_id});
auto pstmt = gx_sql_prep(psqlite, sql_string);
if (pstmt == nullptr)
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion exch/exmdb_provider/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ BOOL exmdb_server::create_folder_by_properties(const char *dir, cpid_t cpid,
}
auto qstr = "SELECT 1 FROM folders AS f INNER JOIN folder_properties AS fp "
"ON f.folder_id=fp.folder_id AND fp.proptag=? "
"WHERE f.parent_id=? and fp.propval=? COLLATE NOCASE";
"WHERE f.parent_id=? AND f.is_deleted=0 AND fp.propval=? COLLATE NOCASE";
auto pstmt = gx_sql_prep(pdb->psqlite, qstr);
if (pstmt == nullptr)
return FALSE;
Expand Down

0 comments on commit 9281085

Please sign in to comment.