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

GH-118447: Fix handling of unreadable symlinks inos.path.realpath()#118489

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
barneygale merged 8 commits intopython:mainfrombarneygale:secret-symlinks
May 18, 2024

Conversation

barneygale
Copy link
Contributor

@barneygalebarneygale commentedMay 1, 2024
edited by bedevere-appbot
Loading

@bedevere-appbedevere-appbot added the testsTests in the Lib/test dir labelMay 1, 2024
@barneygalebarneygale changed the titleGH-118447: Handle unreadable symlinks inos.path.realpath()GH-118447: Fix handling of unreadable symlinks inos.path.realpath()May 1, 2024
@barneygalebarneygale removed the testsTests in the Lib/test dir labelMay 1, 2024
@barneygalebarneygale marked this pull request as ready for reviewMay 1, 2024 22:06
nineteendo

This comment was marked as resolved.

@barneygale
Copy link
ContributorAuthor

If not resolving unreadable symlinks is acceptable, you still need to raise an error forlink/...

realpath() shouldn't raiseOSError in non-strict mode.

nineteendo reacted with thumbs up emoji

Copy link
Contributor

@nineteendonineteendo left a comment

Choose a reason for hiding this comment

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

OK, you're right, it shouldn't raise an error. That's whatstrict is for.

@serhiy-storchaka
Copy link
Member

I think that it is reasonable to expect thatrealpath('dir/badlink/rest') returns the same result whenbadlink does not exist, is a file, is in non-readable directory or is non-readable itself, for anyrest. It's error prone, but that's how it was defined.

nineteendo reacted with thumbs up emoji

Copy link
Contributor

@nineteendonineteendo left a comment

Choose a reason for hiding this comment

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

Barney, would you like to continue working on this? You have my approval if it means anything.

barneygale reacted with thumbs up emoji
@barneygalebarneygale added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes labelsMay 18, 2024
@barneygalebarneygaleenabled auto-merge (squash)May 18, 2024 22:26
@barneygale
Copy link
ContributorAuthor

Thanks for the reviews and suggestions, both!

@barneygalebarneygale merged commitcaf6064 intopython:mainMay 18, 2024
@miss-islington-app
Copy link

Thanks@barneygale for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 18, 2024
…path()` (pythonGH-118489)(cherry picked from commitcaf6064)Co-authored-by: Barney Gale <barney.gale@gmail.com>Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
@miss-islington-app
Copy link

Sorry,@barneygale, I could not cleanly backport this to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker caf6064a1bc15ac344afd78b780188e60b9c628e 3.12

@bedevere-app
Copy link

GH-119163 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelMay 18, 2024
barneygale added a commit to barneygale/cpython that referenced this pull requestMay 18, 2024
…path()` (python#118489)Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>(cherry picked from commitcaf6064)
barneygale added a commit to barneygale/cpython that referenced this pull requestMay 18, 2024
…th.realpath()` (pythonGH-118489)Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>.(cherry picked from commitcaf6064)Co-authored-by: Barney Gale <barney.gale@gmail.com>
@barneygale
Copy link
ContributorAuthor

If no one objects, I'll skip backporting to 3.12 as this is a fairly minor bug and I can't be bothered to fix the conflicts :)

hugovk reacted with thumbs up emoji

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 FreeBSD 3.x has failed when building commitcaf6064.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1223/builds/3134) and take a look at the build logs.
  4. Check if the failure is related to this commit (caf6064) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1223/builds/3134

Failed tests:

  • test_posixpath

Failed subtests:

  • test_realpath_unreadable_symlink - test.test_posixpath.PosixPathTest.test_realpath_unreadable_symlink

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/buildbot/buildarea/3.x.ware-freebsd/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/bui[19 chars].ware-freebsd/build/build/test_python_57143æ/@test_57143_tmpæ1' != '/bui[19 chars].ware-freebsd/build/build/test_python_57143æ/@test_57143_tmpæ'- /buildbot/buildarea/3.x.ware-freebsd/build/build/test_python_57143æ/@test_57143_tmpæ1?                                                                                     -+ /buildbot/buildarea/3.x.ware-freebsd/build/build/test_python_57143æ/@test_57143_tmpæTraceback (most recent call last):  File"/buildbot/buildarea/3.x.ware-freebsd/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/bui[19 chars].ware-freebsd/build/build/test_python_66351æ/@test_66351_tmpæ1' != '/bui[19 chars].ware-freebsd/build/build/test_python_66351æ/@test_66351_tmpæ'- /buildbot/buildarea/3.x.ware-freebsd/build/build/test_python_66351æ/@test_66351_tmpæ1?                                                                                     -+ /buildbot/buildarea/3.x.ware-freebsd/build/build/test_python_66351æ/@test_66351_tmpæ

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 FreeBSD14 3.x has failed when building commitcaf6064.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1232/builds/2352) and take a look at the build logs.
  4. Check if the failure is related to this commit (caf6064) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1232/builds/2352

Failed tests:

  • test_posixpath

Failed subtests:

  • test_realpath_unreadable_symlink - test.test_posixpath.PosixPathTest.test_realpath_unreadable_symlink

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/hom[24 chars].opsec-fbsd14/build/build/test_python_79925æ/@test_79925_tmpæ1' != '/hom[24 chars].opsec-fbsd14/build/build/test_python_79925æ/@test_79925_tmpæ'- /home/buildbot/buildarea/3.x.opsec-fbsd14/build/build/test_python_79925æ/@test_79925_tmpæ1?                                                                                          -+ /home/buildbot/buildarea/3.x.opsec-fbsd14/build/build/test_python_79925æ/@test_79925_tmpæTraceback (most recent call last):  File"/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/hom[24 chars].opsec-fbsd14/build/build/test_python_75684æ/@test_75684_tmpæ1' != '/hom[24 chars].opsec-fbsd14/build/build/test_python_75684æ/@test_75684_tmpæ'- /home/buildbot/buildarea/3.x.opsec-fbsd14/build/build/test_python_75684æ/@test_75684_tmpæ1?                                                                                          -+ /home/buildbot/buildarea/3.x.opsec-fbsd14/build/build/test_python_75684æ/@test_75684_tmpæ

barneygale added a commit that referenced this pull requestMay 18, 2024
…lpath()` (GH-118489) (#119163)(cherry picked from commitcaf6064)Co-authored-by: Barney Gale <barney.gale@gmail.com>Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 FreeBSD 3.13 has failed when building commit7407267.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1491/builds/46) and take a look at the build logs.
  4. Check if the failure is related to this commit (7407267) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1491/builds/46

Failed tests:

  • test_posixpath

Failed subtests:

  • test_realpath_unreadable_symlink - test.test_posixpath.PosixPathTest.test_realpath_unreadable_symlink

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/buildbot/buildarea/3.13.ware-freebsd/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/bui[20 chars].ware-freebsd/build/build/test_python_84680æ/@test_84680_tmpæ1' != '/bui[20 chars].ware-freebsd/build/build/test_python_84680æ/@test_84680_tmpæ'- /buildbot/buildarea/3.13.ware-freebsd/build/build/test_python_84680æ/@test_84680_tmpæ1?                                                                                      -+ /buildbot/buildarea/3.13.ware-freebsd/build/build/test_python_84680æ/@test_84680_tmpæTraceback (most recent call last):  File"/buildbot/buildarea/3.13.ware-freebsd/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/bui[20 chars].ware-freebsd/build/build/test_python_77930æ/@test_77930_tmpæ1' != '/bui[20 chars].ware-freebsd/build/build/test_python_77930æ/@test_77930_tmpæ'- /buildbot/buildarea/3.13.ware-freebsd/build/build/test_python_77930æ/@test_77930_tmpæ1?                                                                                      -+ /buildbot/buildarea/3.13.ware-freebsd/build/build/test_python_77930æ/@test_77930_tmpæ

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 FreeBSD14 3.13 has failed when building commit7407267.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1481/builds/45) and take a look at the build logs.
  4. Check if the failure is related to this commit (7407267) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1481/builds/45

Failed tests:

  • test_posixpath

Failed subtests:

  • test_realpath_unreadable_symlink - test.test_posixpath.PosixPathTest.test_realpath_unreadable_symlink

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/hom[25 chars].opsec-fbsd14/build/build/test_python_95351æ/@test_95351_tmpæ1' != '/hom[25 chars].opsec-fbsd14/build/build/test_python_95351æ/@test_95351_tmpæ'- /home/buildbot/buildarea/3.13.opsec-fbsd14/build/build/test_python_95351æ/@test_95351_tmpæ1?                                                                                           -+ /home/buildbot/buildarea/3.13.opsec-fbsd14/build/build/test_python_95351æ/@test_95351_tmpæTraceback (most recent call last):  File"/home/buildbot/buildarea/3.13.opsec-fbsd14/build/Lib/test/test_posixpath.py", line670, intest_realpath_unreadable_symlinkself.assertEqual(realpath(ABSTFN),ABSTFN)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'/hom[25 chars].opsec-fbsd14/build/build/test_python_94029æ/@test_94029_tmpæ1' != '/hom[25 chars].opsec-fbsd14/build/build/test_python_94029æ/@test_94029_tmpæ'- /home/buildbot/buildarea/3.13.opsec-fbsd14/build/build/test_python_94029æ/@test_94029_tmpæ1?                                                                                           -+ /home/buildbot/buildarea/3.13.opsec-fbsd14/build/build/test_python_94029æ/@test_94029_tmpæ

estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
…path()` (python#118489)Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
@hugovkhugovk removed the needs backport to 3.12only security fixes labelFeb 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@nineteendonineteendonineteendo approved these changes

Assignees

@barneygalebarneygale

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@barneygale@serhiy-storchaka@bedevere-bot@nineteendo@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp