Skip to content

list v. scalar assignment to E?UID, E?GID #22018

@hvds

Description

@hvds

I notice by code inspection that when assigning to $< in mg.c:Perl_magic_set it uses the first available of setruid, setreuid, setresuid or (with more caveats) setuid. However it only goes through that path if it's a scalar assignment: list assignments have PL_delaymagic set, and end up instead going through the code in pp_hot.c:S_aassign_uid, which uses the first available of setresuid, setreuid, setruid, setuid - a different order.

Is this a bug? I haven't checked, but I assume the same will apply to $>, $( and $) if so.

My guess is that the order doesn't matter: any of the first three that are defined will do what is needed (and if one is buggy it should be undef'd in configuration), so it's just a matter of finding one that's available on this platform. But it would be good to know for sure, and perhaps record it in a comment.

Metadata

Metadata

Assignees

Labels

Closable?We might be able to close this ticket, but we need to check with the reporter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions