Skip to content

Add resolving of $PROGRAM_NAME from /dev/fd/number #23358

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

michal-josef-spacek
Copy link

There are situations when $PROGRAM_NAME is something /dev/fd/number

  1. example like sudo /usr/local/bin/<tool> with checksum verification - Issue with $PROGRAM_NAME (sudo + checksum verification) #23351
    → Resolves to the tool path
  2. example with pipe: perl <( echo '#!perl -DA'; echo 'print "$0\n"');
    → Stay with /dev/fd/number
  • This set of changes requires a perldelta entry, and I need help writing it.

@jkeenan jkeenan changed the title Add resoving of $PROGRAM_NAME from /dev/fd/number Add resolving of $PROGRAM_NAME from /dev/fd/number Jun 5, 2025
@michal-josef-spacek michal-josef-spacek force-pushed the fix_program_name_in_sudo branch 2 times, most recently from 085c026 to 99313c1 Compare June 5, 2025 15:24
Copy link
Contributor

@jkeenan jkeenan left a comment

Choose a reason for hiding this comment

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

These changes need to be exercised by our test suite. Such a test will have to take into account the quirks of different operating systems.

@jkeenan jkeenan added defer-next-dev This PR should not be merged yet, but await the next development cycle type-core labels Jun 5, 2025
@michal-josef-spacek michal-josef-spacek force-pushed the fix_program_name_in_sudo branch from 99313c1 to 6241f02 Compare June 5, 2025 16:32
There are situations when $PROGRAM_NAME is something /dev/fd/<number>
1) example like sudo /usr/local/bin/<tool> with checksum verification
(GH#23351)
2) example with pipe: perl <( echo '#!perl -DA'; echo 'print "$0\n"');
@michal-josef-spacek
Copy link
Author

There were issues in the build on Windows, I updated PR.

@michal-josef-spacek
Copy link
Author

hm, issue on Windows perl.obj : error LNK2019: unresolved external symbol readlink referenced in function S_open_script

@Leont
Copy link
Contributor

Leont commented Jun 6, 2025

This code should probably be feature guarded.

That means Configure should check if "/proc/self/fd/%d" actually works on that platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defer-next-dev This PR should not be merged yet, but await the next development cycle type-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants