GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Unix::setuid(3) User Contributed Perl Documentation Unix::setuid(3)

Unix::setuid - Get/set real/effective UID/username via (localizeable) variable

This document describes version 0.02 of Unix::setuid (from Perl distribution Unix-setuid), released on 2014-10-09.

 use Unix::setuid; # exports $RUID, $EUID, $RUSER, $EUSER
 say "Real      UID : $RUID";
 say "Effective UID : $EUID";
 say "Real username : $RUSER";
 say "Effective user: $EUSER";
 {
     # become UID 1000 temporarily
     local $EUID = 1000;
     # same thing
     #local $EUSER = "jajang"; # or 1000
 }
 # we're back to previous UID/user

This module is inspired by File::chdir and File::umask, using a tied scalar variable to get/set stuffs. One benefit of this is being able to use Perl's "local" with it, effectively setting something locally.

This will get/set $<.

This will get/set $>.

Same as $RUID except you will get username and you can set using UID/username. Will return numeric UID if no user exists with that ID. Will die if setting to non-existing username.

Same as $EUID except you will get username and you can set using UID/username. Will return numeric UID if no user exists with that ID. Will die if setting to non-existing username.

Perl's $< and $>.

Other modules with the same concept: File::chdir, File::umask, Locale::Tie.

Please visit the project's homepage at <https://metacpan.org/release/Unix-setuid>.

Source repository is at <https://github.com/perlancar/perl-System-setuid>.

Please report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=Unix-setuid>

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

perlancar <perlancar@cpan.org>

This software is copyright (c) 2014 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2014-10-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.