Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Session] limiting :key for GET_LOCK to 64 chars#27250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:2.7fromoleg-andreyev:limiting-get-lock-to-64
May 15, 2018

Conversation

@oleg-andreyev
Copy link
Contributor

@oleg-andreyevoleg-andreyev commentedMay 13, 2018
edited
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT

MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced.

Cases:

  • session_id is set by developers manually
  • session.sid_length is configured

Ref.:

Other issues:

@oleg-andreyevoleg-andreyev changed the titlelimiting :key for GET_LOCK to 64 chars[Session] limiting :key for GET_LOCK to 64 charsMay 13, 2018
switch ($this->driver) {
case'mysql':
// MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced.
$lockId =\substr($sessionId,0,64);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd recommend to hash the session id instead (or doing something similar) as keeping just the first 64 chars could lead to conflicts depending on how the session id is generated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The session id is just a random string. So hashing that does not reduce the likeliness of collisions compared to just using the first 64 bytes.

oleg-andreyev reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@fabian,@Tobion is right, session_id is just a random string, which is result ofhttp://php.net/manual/en/session.configuration.php#ini.session.hash-function and by default it's md5

* Returns a merge/upsert (i.e. insert or update) statement when supported by the database for writing session data.
*/
privatefunctiongetMergeStatement(string$sessionId,string$data,int$maxlifetime): ?\PDOStatement
privatefunctiongetMergeStatement(string$sessionId,string$data,int$maxlifetime): ?\PDOStatement
Copy link
Contributor

@TobionTobionMay 14, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This has already been fixed in4f3afd5 and will be merge upwards in later branches automatically. So please remove this change.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Will rebase branch

@Tobion
Copy link
Contributor

To me this is a bugfix and should be opened against 2.7 branch.

@oleg-andreyev
Copy link
ContributorAuthor

@Tobion agree, let's rebase on 2.7

oleg-andreyev added a commit to oleg-andreyev/symfony that referenced this pull requestMay 14, 2018
oleg-andreyev added a commit to oleg-andreyev/symfony that referenced this pull requestMay 14, 2018
@oleg-andreyevoleg-andreyev changed the base branch frommaster to2.7May 14, 2018 17:27
@fabpot
Copy link
Member

Thank you@oleg-andreyev.

@fabpotfabpot merged commit9cda96b intosymfony:2.7May 15, 2018
fabpot added a commit that referenced this pull requestMay 15, 2018
…reyev)This PR was merged into the 2.7 branch.Discussion----------[Session] limiting :key for GET_LOCK to 64 chars| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT> MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced.Cases:- `session_id` is set by developers manually- `session.sid_length` is configuredRef.:-https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock-http://php.net/manual/en/session.configuration.php#ini.session.sid-lengthOther issues:-go-sql-driver/mysql#385-stefangabos/Zebra_Session#16Commits-------9cda96b#27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later
nicolas-grekas added a commit that referenced this pull requestMay 15, 2018
* 2.7:  [Security] Fix logout#27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later  [Profiler] Remove propel & event_listener_loading category identifiers  [Filesystem] Fix usages of error_get_last()  [Debug] Fix populating error_get_last() for handled silent errors  Suppress warnings when open_basedir is non-empty
nicolas-grekas added a commit that referenced this pull requestMay 16, 2018
* 2.8:  [Security] Fix logout#27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later  [Profiler] Remove propel & event_listener_loading category identifiers  [Filesystem] Fix usages of error_get_last()  [Debug] Fix populating error_get_last() for handled silent errors  Suppress warnings when open_basedir is non-empty
nicolas-grekas added a commit that referenced this pull requestMay 16, 2018
* 3.4:  fix merge  [Security] Fix logout  Cleanup 2 tests for the HttpException classes#27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later  [Config] Fix tests when path contains UTF chars  [DI] Shared services should not be inlined in non-shared ones  [Profiler] Remove propel & event_listener_loading category identifiers  [Filesystem] Fix usages of error_get_last()  [Cache][Lock] Fix usages of error_get_last()  [Debug] Fix populating error_get_last() for handled silent errors  [DI] Display previous error messages when throwing unused bindings  Suppress warnings when open_basedir is non-empty
nicolas-grekas added a commit that referenced this pull requestMay 16, 2018
* 4.0: (21 commits)  [PropertyInfo] fix resolving parent|self type hints  fixed CS  fix merge  [Security] Fix logout  Cleanup 2 tests for the HttpException classes#27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later  [Config] Fix tests when path contains UTF chars  [DI] Shared services should not be inlined in non-shared ones  [Profiler] Remove propel & event_listener_loading category identifiers  [Filesystem] Fix usages of error_get_last()  [Cache][Lock] Fix usages of error_get_last()  [Debug] Fix populating error_get_last() for handled silent errors  fixed CS  fixed CS  fixed CS  [FrameworkBundle] Fix cache:clear on vagrant  [HttpKernel] Handle NoConfigurationException "onKernelException()"  Fix misses calculation when calling getItems  [DI] Display previous error messages when throwing unused bindings  Fixed return type  ...
nicolas-grekas added a commit that referenced this pull requestMay 16, 2018
* 4.1: (22 commits)  Fix CS  [PropertyInfo] fix resolving parent|self type hints  fixed CS  fix merge  [Security] Fix logout  Cleanup 2 tests for the HttpException classes#27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later  [Config] Fix tests when path contains UTF chars  [DI] Shared services should not be inlined in non-shared ones  [Profiler] Remove propel & event_listener_loading category identifiers  [Filesystem] Fix usages of error_get_last()  [Cache][Lock] Fix usages of error_get_last()  [Debug] Fix populating error_get_last() for handled silent errors  fixed CS  fixed CS  fixed CS  [FrameworkBundle] Fix cache:clear on vagrant  [HttpKernel] Handle NoConfigurationException "onKernelException()"  Fix misses calculation when calling getItems  [DI] Display previous error messages when throwing unused bindings  ...
This was referencedMay 21, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@oleg-andreyev@Tobion@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp