[Asterisk-code-review] media cache: make sure generated filenames cannot conflict (asterisk[master])

Nathan Bruning asteriskteam at digium.com
Wed Feb 1 06:43:19 CST 2023


Attention is currently required from: Sean Bright.

Nathan Bruning has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19797 )

Change subject: media cache: make sure generated filenames cannot conflict
......................................................................


Patch Set 1:

(1 comment)

Patchset:

PS1: 
> Some thoughts: […]
Hi Sean,

Changing the directory layout could be an option, but potentially would break customer setups - for example, we have some pruning scripts to avoid the cache to grow indefinitely.

I agree the fix is better suited in `bucket_file_update_path`, so i can submit something like

```
int c = 0;
while(file_exists_with_any_extension("%s%i.%s", filename, c, ext)) {
   c++
}
rename(...)
```

so just append a counter to the result of `ast_bucket_file_temporary_create` until we're sure it's unique?



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19797
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: If6b5f4af9cbdf39009252594eb987b07bfb493a4
Gerrit-Change-Number: 19797
Gerrit-PatchSet: 1
Gerrit-Owner: Nathan Bruning <nathan at iperity.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Comment-Date: Wed, 01 Feb 2023 12:43:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230201/1d4700e8/attachment.html>


More information about the asterisk-code-review mailing list