Skip to content
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

skip shadow call when euid > 0 on linux #16

Closed
wants to merge 1 commit into from

Conversation

atoomic
Copy link
Member

@atoomic atoomic commented Jul 16, 2018

maybe linux is not restrictive enough
and we could consider using a hint sh file
to enable it only on some specific distro?

@karenetheridge
Copy link
Member

@atoomic you have push access to blead now, so I will leave this to you to apply to the proper location :)

@atoomic
Copy link
Member Author

atoomic commented Jul 10, 2019

#16637

This was referenced Oct 18, 2019
Resolves Perl#16637

maybe __linux__ is not restrictive enough
and we could consider using a hint sh file
to enable it only on some specific distro?
@Leont
Copy link
Contributor

Leont commented Oct 20, 2019

The commit should summarize why we need this

@Leont
Copy link
Contributor

Leont commented Oct 20, 2019

And AFAICT, it's not quite the right check anyway: administrator privileges are split in Linux (see man 7 capabilities)

@tonycoz
Copy link
Contributor

tonycoz commented Oct 27, 2019

Also, at least on debian, group shadow has read access.

@Leont
Copy link
Contributor

Leont commented Oct 27, 2019

Yeah, I think the only reliable way of doing this is just to let the OS figure out what is and is not allowed.

@xsawyerx
Copy link
Member

My concern with this is not how much more complicated it is. It's just one small if condition. (Though I would want the code to explain why it's doing it.)

I'm worried about accuracy, as Leon noted.

@atoomic
Copy link
Member Author

atoomic commented Oct 31, 2019

The goal was to get rid of one syscall, which is not necessary in most linux,
but regarding the controversy I think we should abort the idea and close the case.

Thanks for your feedbacks.

@atoomic atoomic closed this Oct 31, 2019
@xsawyerx
Copy link
Member

xsawyerx commented Nov 1, 2019

The goal was to get rid of one syscall, which is not necessary in most linux,
but regarding the controversy I think we should abort the idea and close the case.

I wouldn't call it a controversy. :) I suggest keeping this topic open. Skipping calls when they are not necessary is a sound idea.

What I'm wondering is:

  • When is this assumption true? When is it not?
  • Will it ever stop being true? (Maybe in such a scenario, using the hints is better?)
  • Is there a way to make the code a bit more readable? Maybe using a macro?

atoomic added a commit to atoomic/perl5 that referenced this pull request Jul 20, 2022
From ChangeLog:

  2.202 27 June 2022

      * Z_NULL should be 'UV' rather than 'PV'
        pmqs/Compress-Raw-Zlib#17
        Sun Jun 26 22:02:04 2022 +0100
        de28f0335d3d605d696b19d43fc48de42272455c

  2.201 25 June 2022

      * 2.021
        Sat Jun 25 08:42:46 2022 +0100
        85416cab509c18c5fa3f923de7b45b6c7c0f7a6f

      * 2.201
        Sat Jun 25 08:39:26 2022 +0100
        b3d63862b2ff4ac9d28e23be500c0d32ad69dd11

      * More zlib-ng updates
        Thu Jun 23 22:42:13 2022 +0100
        313f626425181702b5fc80af2b6ea7eed41d5a9d

      * Fix test count regression in t/07bufsize.t (Perl#16)
        Wed Jun 22 09:45:11 2022 +0100
        98dc5b4a2b30c26752b6f686462b06b8db72a5e4

  2.200 21 June 2022

      * Added zlib-ng support
        pmqs/Compress-Raw-Zlib#9

      * Only set Z_SOLO when building zlib sources
      * pmqs/Compress-Raw-Zlib#12
        Tue Jun 7 10:13:00 2022 +0100
        c44e0b732e214b7f77d42a3af6ae64ef944cee90

  2.105 14 April 2022

      * Add Compress::Raw::Zlib::VERSION to output
        Sat May 14 15:16:57 2022 +0100
        3e22c93169a67986017f64d9a2e5085c417d8624

      * Dump version info when running test harness
        Sat May 14 15:10:17 2022 +0100
        ca9f33ba0323d0abc91a83800636f180b2b44162

      * Fix use of ZLIB_INCLUDE/LIB
        Sat May 14 09:01:38 2022 +0100
        8a7d4a97d7441b61a8a888342766419044fa5a33

      * More fixes for BUILD_ZLIB off
        Sat May 14 08:54:04 2022 +0100
        2d9650094dab90858ef58bfbda62f3bc60e159e4

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:31:54 2022 +0100
        b61b92fc9d06bf04f1adec337357ffbd39535901

      * Merge branch 'master' of
      * https://github.com/pmqs/Compress-Raw-Zlib
        Sat May 14 08:27:14 2022 +0100
        3ac7d0d3d45ae263402fab1ebb3835e2ae16c5a6

      * Fix for BUILD_ZLIB disabled
        Sat May 14 08:25:34 2022 +0100
        b0f04e37fb58a34ef01767ad16a8f63ca868eec6

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:22:56 2022 +0100
        aa8f5ff981c7305c995d4e2f798ae0d7d45866a5

  2.104 13 April 2022

      * Merge pull request #11 from monkburger/symbol_fix_2
        Fri May 13 07:17:19 2022 +0100
        64aea2d3f78946d7df4096eadfa0d7267f4439a5

      * perl_crz -> Perl_crz
        Tue May 3 18:19:24 2022 +0000
        20502e6c2eba8ddcad80b20574e840457c0cb369

      * This is a slightly different way to fix
      * pmqs/Compress-Raw-Zlib#8
        Tue May 3 18:06:48 2022 +0000
        d9cd27fb212da7455b6ba44729ca11bb441f3950

      * add tests for crc32/adler32_combine
        Mon May 2 16:18:13 2022 +0100
        dcfe9ef439790f1a4fae81cf3eac38cfeb848294
atoomic added a commit that referenced this pull request Jul 20, 2022
From ChangeLog:

  2.202 27 June 2022

      * Z_NULL should be 'UV' rather than 'PV'
        pmqs/Compress-Raw-Zlib#17
        Sun Jun 26 22:02:04 2022 +0100
        de28f0335d3d605d696b19d43fc48de42272455c

  2.201 25 June 2022

      * 2.021
        Sat Jun 25 08:42:46 2022 +0100
        85416cab509c18c5fa3f923de7b45b6c7c0f7a6f

      * 2.201
        Sat Jun 25 08:39:26 2022 +0100
        b3d63862b2ff4ac9d28e23be500c0d32ad69dd11

      * More zlib-ng updates
        Thu Jun 23 22:42:13 2022 +0100
        313f626425181702b5fc80af2b6ea7eed41d5a9d

      * Fix test count regression in t/07bufsize.t (#16)
        Wed Jun 22 09:45:11 2022 +0100
        98dc5b4a2b30c26752b6f686462b06b8db72a5e4

  2.200 21 June 2022

      * Added zlib-ng support
        pmqs/Compress-Raw-Zlib#9

      * Only set Z_SOLO when building zlib sources
      * pmqs/Compress-Raw-Zlib#12
        Tue Jun 7 10:13:00 2022 +0100
        c44e0b732e214b7f77d42a3af6ae64ef944cee90

  2.105 14 April 2022

      * Add Compress::Raw::Zlib::VERSION to output
        Sat May 14 15:16:57 2022 +0100
        3e22c93169a67986017f64d9a2e5085c417d8624

      * Dump version info when running test harness
        Sat May 14 15:10:17 2022 +0100
        ca9f33ba0323d0abc91a83800636f180b2b44162

      * Fix use of ZLIB_INCLUDE/LIB
        Sat May 14 09:01:38 2022 +0100
        8a7d4a97d7441b61a8a888342766419044fa5a33

      * More fixes for BUILD_ZLIB off
        Sat May 14 08:54:04 2022 +0100
        2d9650094dab90858ef58bfbda62f3bc60e159e4

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:31:54 2022 +0100
        b61b92fc9d06bf04f1adec337357ffbd39535901

      * Merge branch 'master' of
      * https://github.com/pmqs/Compress-Raw-Zlib
        Sat May 14 08:27:14 2022 +0100
        3ac7d0d3d45ae263402fab1ebb3835e2ae16c5a6

      * Fix for BUILD_ZLIB disabled
        Sat May 14 08:25:34 2022 +0100
        b0f04e37fb58a34ef01767ad16a8f63ca868eec6

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:22:56 2022 +0100
        aa8f5ff981c7305c995d4e2f798ae0d7d45866a5

  2.104 13 April 2022

      * Merge pull request #11 from monkburger/symbol_fix_2
        Fri May 13 07:17:19 2022 +0100
        64aea2d3f78946d7df4096eadfa0d7267f4439a5

      * perl_crz -> Perl_crz
        Tue May 3 18:19:24 2022 +0000
        20502e6c2eba8ddcad80b20574e840457c0cb369

      * This is a slightly different way to fix
      * pmqs/Compress-Raw-Zlib#8
        Tue May 3 18:06:48 2022 +0000
        d9cd27fb212da7455b6ba44729ca11bb441f3950

      * add tests for crc32/adler32_combine
        Mon May 2 16:18:13 2022 +0100
        dcfe9ef439790f1a4fae81cf3eac38cfeb848294
scottchiefbaker pushed a commit to scottchiefbaker/perl5 that referenced this pull request Nov 3, 2022
From ChangeLog:

  2.202 27 June 2022

      * Z_NULL should be 'UV' rather than 'PV'
        pmqs/Compress-Raw-Zlib#17
        Sun Jun 26 22:02:04 2022 +0100
        de28f0335d3d605d696b19d43fc48de42272455c

  2.201 25 June 2022

      * 2.021
        Sat Jun 25 08:42:46 2022 +0100
        85416cab509c18c5fa3f923de7b45b6c7c0f7a6f

      * 2.201
        Sat Jun 25 08:39:26 2022 +0100
        b3d63862b2ff4ac9d28e23be500c0d32ad69dd11

      * More zlib-ng updates
        Thu Jun 23 22:42:13 2022 +0100
        313f626425181702b5fc80af2b6ea7eed41d5a9d

      * Fix test count regression in t/07bufsize.t (Perl#16)
        Wed Jun 22 09:45:11 2022 +0100
        98dc5b4a2b30c26752b6f686462b06b8db72a5e4

  2.200 21 June 2022

      * Added zlib-ng support
        pmqs/Compress-Raw-Zlib#9

      * Only set Z_SOLO when building zlib sources
      * pmqs/Compress-Raw-Zlib#12
        Tue Jun 7 10:13:00 2022 +0100
        c44e0b732e214b7f77d42a3af6ae64ef944cee90

  2.105 14 April 2022

      * Add Compress::Raw::Zlib::VERSION to output
        Sat May 14 15:16:57 2022 +0100
        3e22c93169a67986017f64d9a2e5085c417d8624

      * Dump version info when running test harness
        Sat May 14 15:10:17 2022 +0100
        ca9f33ba0323d0abc91a83800636f180b2b44162

      * Fix use of ZLIB_INCLUDE/LIB
        Sat May 14 09:01:38 2022 +0100
        8a7d4a97d7441b61a8a888342766419044fa5a33

      * More fixes for BUILD_ZLIB off
        Sat May 14 08:54:04 2022 +0100
        2d9650094dab90858ef58bfbda62f3bc60e159e4

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:31:54 2022 +0100
        b61b92fc9d06bf04f1adec337357ffbd39535901

      * Merge branch 'master' of
      * https://github.com/pmqs/Compress-Raw-Zlib
        Sat May 14 08:27:14 2022 +0100
        3ac7d0d3d45ae263402fab1ebb3835e2ae16c5a6

      * Fix for BUILD_ZLIB disabled
        Sat May 14 08:25:34 2022 +0100
        b0f04e37fb58a34ef01767ad16a8f63ca868eec6

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:22:56 2022 +0100
        aa8f5ff981c7305c995d4e2f798ae0d7d45866a5

  2.104 13 April 2022

      * Merge pull request Perl#11 from monkburger/symbol_fix_2
        Fri May 13 07:17:19 2022 +0100
        64aea2d3f78946d7df4096eadfa0d7267f4439a5

      * perl_crz -> Perl_crz
        Tue May 3 18:19:24 2022 +0000
        20502e6c2eba8ddcad80b20574e840457c0cb369

      * This is a slightly different way to fix
      * pmqs/Compress-Raw-Zlib#8
        Tue May 3 18:06:48 2022 +0000
        d9cd27fb212da7455b6ba44729ca11bb441f3950

      * add tests for crc32/adler32_combine
        Mon May 2 16:18:13 2022 +0100
        dcfe9ef439790f1a4fae81cf3eac38cfeb848294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants