Ticket #555 (reopened bug)

Opened 5 years ago

Last modified 5 years ago

perldoc detection fails if build runs as root

Reported by: heidnes Owned by:
Priority: normal Milestone:
Component: configure Version: 1.0.0
Severity: medium Keywords:
Cc: Language:
Patch status: applied Platform: netbsd

Description

If you build parrot as root, the detection of perldoc will always fail. The reason is that perldoc for security reasons runs as either 'nobody', 'nouser' or uid -2. Therefore, it cannot write to a file given as the argument to perldoc's -d option, when that file is created by File::Temp, since it's owned by root and has mode 0600.

It also appears to me that the first part of the perldoc test is ... a little sketchy in how it should behave? capture_output doesn't collect STDERR output, it captures STDOUT output.

I know, using > instead of perldoc's -d option is possibly port unfriendly to non-Unix systems, so a better way of testing should probably be found. In my case, I do this for only Unix-y systems, so permit myself some leeway here.

Patch to be attached.

Regards,

- Håvard

Attachments

patch-ad Download (1.1 KB) - added by heidnes 5 years ago.
Patch to change perldoc detection and use to use > instead of -d
patch-ae Download (461 bytes) - added by heidnes 5 years ago.
Another perldoc -d usage replaced with >

Change History

Changed 5 years ago by heidnes

Patch to change perldoc detection and use to use > instead of -d

Changed 5 years ago by heidnes

Another perldoc -d usage replaced with >

Changed 5 years ago by Infinoid

  • status changed from new to closed
  • resolution set to fixed
  • patch changed from new to applied

Thanks, patches applied as r38214.

I know, using > instead of perldoc's -d option is possibly port unfriendly to non-Unix systems, so a better way of testing should probably be found.

It's portable to all of the platforms we currently support. The root Makefile already uses this syntax in several places, so I think it's ok for now.

Changed 5 years ago by fperrad

  • status changed from closed to reopened
  • resolution fixed deleted

since r38214, the perldoc detection is broken on Windows XP with Strawberry Perl 5.10.0

auto::perldoc - Is perldoc installed.................................no.

reverted in r38239.

Changed 5 years ago by jkeenan

I asked for a consultation with the Strawberry Perl doctor -- David Golden -- who wrote:

Looking at r38214, the old logic is || undef, whereas the new logic allows $stderr to be the empty string. (At least, tracing capture_output and _slurp and slurp_file it looks like the empty string is the default return value.) I suspect that might be related.

However, all this seems like reinventing the wheel if what you want to know is whether 'perldoc' is available and executable:

  use IPC::Cmd 'can_run';
  my $full_path = can_run('perldoc');

(On windows that gets you the path to 'perldoc.bat' which is correct.)

And IPC::Cmd is core in 5.10, so it's pretty much expected to work everywhere.

Unfortunately, Parrot is constrained to require only Perl 5.8.?.

Changed 5 years ago by whiteknight

  • milestone 1.3 deleted
Note: See TracTickets for help on using tickets.