• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/Unix/H09-Oct-2014-15955

t/H09-Oct-2014-10060

ChangesH A D09-Oct-2014175 115

LICENSEH A D09-Oct-201417.9 KiB380292

MANIFESTH A D09-Oct-2014264 1615

META.jsonH A D09-Oct-201413.6 KiB406404

META.ymlH A D09-Oct-20148.8 KiB295294

Makefile.PLH A D09-Oct-20141.1 KiB5740

READMEH A D09-Oct-20142.2 KiB7557

dist.iniH A D09-Oct-2014142 138

weaver.iniH A D09-Oct-201421 21

README

1NAME
2    Unix::setuid - Get/set real/effective UID/username via (localizeable)
3    variable
4
5VERSION
6    This document describes version 0.02 of Unix::setuid (from Perl
7    distribution Unix-setuid), released on 2014-10-09.
8
9SYNOPSIS
10     use Unix::setuid; # exports $RUID, $EUID, $RUSER, $EUSER
11     say "Real      UID : $RUID";
12     say "Effective UID : $EUID";
13     say "Real username : $RUSER";
14     say "Effective user: $EUSER";
15     {
16         # become UID 1000 temporarily
17         local $EUID = 1000;
18         # same thing
19         #local $EUSER = "jajang"; # or 1000
20     }
21     # we're back to previous UID/user
22
23DESCRIPTION
24    This module is inspired by File::chdir and File::umask, using a tied
25    scalar variable to get/set stuffs. One benefit of this is being able to
26    use Perl's "local" with it, effectively setting something locally.
27
28EXPORTS
29  $RUID (real UID)
30    This will get/set $<.
31
32  $EUID (effective UID)
33    This will get/set $>.
34
35  $RUSER (real user)
36    Same as $RUID except you will get username and you can set using
37    UID/username. Will return numeric UID if no user exists with that ID.
38    Will die if setting to non-existing username.
39
40  $EUSER (effective user)
41    Same as $EUID except you will get username and you can set using
42    UID/username. Will return numeric UID if no user exists with that ID.
43    Will die if setting to non-existing username.
44
45SEE ALSO
46    Perl's $< and $>.
47
48    Other modules with the same concept: File::chdir, File::umask,
49    Locale::Tie.
50
51HOMEPAGE
52    Please visit the project's homepage at
53    <https://metacpan.org/release/Unix-setuid>.
54
55SOURCE
56    Source repository is at
57    <https://github.com/perlancar/perl-System-setuid>.
58
59BUGS
60    Please report any bugs or feature requests on the bugtracker website
61    <https://rt.cpan.org/Public/Dist/Display.html?Name=Unix-setuid>
62
63    When submitting a bug or request, please include a test-file or a patch
64    to an existing test-file that illustrates the bug or desired feature.
65
66AUTHOR
67    perlancar <perlancar@cpan.org>
68
69COPYRIGHT AND LICENSE
70    This software is copyright (c) 2014 by perlancar@cpan.org.
71
72    This is free software; you can redistribute it and/or modify it under
73    the same terms as the Perl 5 programming language system itself.
74
75