1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-06-21 02:44:03 +00:00
tenancy/src/Bootstrappers
Samuel Štancl e31249dd09
Prevent mkdir() race conditions in FilesystemTenancyBootstrapper (#1453)
This prevents race conditions that may occur if there are two concurrent
processes trying to create the storage path for the tenant. The
storagePath() method runs during bootstrap() which can easily happen
in two places at once. The race condition specifically occurs in between
the is_dir() check and the mkdir() call, the latter producing an
exception if the dir already exist. We simply ignore any error coming
out of mkdir() and then check for success separately.

We could omit that success check since failure is unlikely and would
only occur due to a server misconfiguration that would manifest itself
in other ways as well, but this way the simple TOC/TOU race condition
is prevented while other errors are still reported.

We apply the same change to the mkdir() in scopeSessions() as the logic
is similar.

Resolves #1452
2026-04-13 23:57:59 +02:00
..
Integrations [4.x] Resolve testing todos (#1361) 2025-08-03 23:21:03 +02:00
BroadcastChannelPrefixBootstrapper.php [4.x] General code cleanup (#1278) 2024-12-31 00:35:46 +01:00
BroadcastingConfigBootstrapper.php docblocks: change TenantConfig references to TenantConfigBootstrapper 2025-10-30 02:32:17 +01:00
CacheTagsBootstrapper.php Enable single_line_empty_body phpcsfixer rule 2024-04-02 04:31:03 +02:00
CacheTenancyBootstrapper.php Config: scope_sessions = true only with supported drivers, always throw 2025-11-05 14:53:07 +01:00
DatabaseCacheBootstrapper.php DB cache bootstrapper: setConnection() instead of purge() (#1408) 2025-11-04 15:47:15 +01:00
DatabaseSessionBootstrapper.php Cache prefixing logic rewrite, session scoping improvements, tests refactor (#43) 2024-04-09 20:40:27 +02:00
DatabaseTenancyBootstrapper.php Refactor DatabaseConfig, minor DB manager improvements, resolve todos 2025-10-13 16:01:34 +02:00
FilesystemTenancyBootstrapper.php Prevent mkdir() race conditions in FilesystemTenancyBootstrapper (#1453) 2026-04-13 23:57:59 +02:00
MailConfigBootstrapper.php docblocks: change TenantConfig references to TenantConfigBootstrapper 2025-10-30 02:32:17 +01:00
PersistentQueueTenancyBootstrapper.php [4.x] Queue logic refactor (#1289) 2025-01-14 13:49:16 +01:00
PostgresRLSBootstrapper.php Postgres RLS + permission controlled database managers (#33) 2024-04-24 22:32:49 +02:00
QueueTenancyBootstrapper.php [4.x] Queue logic refactor (#1289) 2025-01-14 13:49:16 +01:00
RedisTenancyBootstrapper.php redis bootstrapper: support clusters (#1207) 2024-04-12 01:05:46 +02:00
RootUrlBootstrapper.php [4.x] Cleanup (#1317) 2025-02-20 20:49:09 +01:00
TenantConfigBootstrapper.php Add TenantConfigBootstrapper, deprecate Feature implementation 2025-09-26 13:49:15 +02:00
UrlGeneratorBootstrapper.php [4.x] Make TenancyUrlGenerator inherit the original UrlGenerator's scheme (http or https) (#1390) 2025-10-28 13:26:50 +01:00