Re: user id validation

2008-07-02 Thread Randal L. Schwartz
$< is a uid getpwuid($<) looks up the info on that. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ f

Re: user id validation

2008-07-02 Thread Richard Lee
Rajnikant wrote: Hey Richard, I think $< returns user id. Correct me if I'm wrong ;-). yes, you are correct. I was reading the perldoc .. on this and I was bit confused at first, on $uid = getpwnam ($name); $name = getpwuid

RE: user id validation

2008-07-01 Thread Rajnikant
delivery - www.persistentsys.com -Original Message- From: Richard Lee [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 11:50 AM To: Randal L. Schwartz Cc: Rajnikant; beginners@perl.org Subject: Re: user id validation Randal L. Schwartz wrote: >>>>>> "Rajnikant&q

Re: user id validation

2008-07-01 Thread John W. Krahn
Randal L. Schwartz wrote: ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "Rajnikant"> I think Work around for this is, "Rajnikant"> My $usr = $ENV { USER }; "Rajnikant"> If ($usr eq "userA") "Rajnikant">Go get it "Rajnikant"> Else "Rajnikant">Access restricted. No, you want

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> "Richard" == Richard Lee <[EMAIL PROTECTED]> writes: Richard> But I guess there is no way to get user id.. ? Did you miss my other answer? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Smalltalk/Perl/U

Re: user id validation

2008-07-01 Thread Richard Lee
Randal L. Schwartz wrote: "Rajnikant" == Rajnikant <[EMAIL PROTECTED]> writes: Rajnikant> Is there any such way to get home directory of user? Is there any such way that this might be, perhaps, oh, a FAQ? Oh, yes, let's see. $ perldoc -q tilde Found in /usr/libdata/pe

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> "Rajnikant" == Rajnikant <[EMAIL PROTECTED]> writes: Rajnikant> Is there any such way to get home directory of user? Is there any such way that this might be, perhaps, oh, a FAQ? Oh, yes, let's see. $ perldoc -q tilde Found in /usr/libdata/perl5/pod/perlfaq5.pod How can I

RE: user id validation

2008-07-01 Thread Rajnikant
-Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 11:12 AM To: beginners@perl.org Subject: Re: user id validation >>>>> ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "

RE: user id validation

2008-07-01 Thread Rajnikant
Cell: +91 9822204088 | Tel: +91 (20) 3023 2479 Persistent Systems - Innovations in software product design,development and delivery - www.persistentsys.com -Original Message- From: Amit Saxena [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 10:55 AM To: Rajnikant Cc: Richard Lee;

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "Rajnikant"> I think Work around for this is, "Rajnikant"> My $usr = $ENV { USER }; "Rajnikant"> If ($usr eq "userA") "Rajnikant">Go get it "Rajnikant"> Else "Rajnikant">Access restricted. No, you want scalar getpwwuid ($<).

Re: user id validation

2008-07-01 Thread Amit Saxena
What if before running this perl code, I modify the 'USER' environment variable ? I have not tried like that but I feel it can be done because the environment variables are not restricted. Assuming that works, then any user can just reset the environment variable to any one among the allowed ones

RE: user id validation

2008-07-01 Thread Rajnikant
I think Work around for this is, My $usr = $ENV { USER }; If ($usr eq "userA") Go get it Else Access restricted. Rajnikant Jachak | Software Engg | Persistent Systems Limited [EMAIL PROTECTED] | Cell: +91 9822204088 | Tel: +91 (20) 3023 2479 Persistent Systems - Innovations in software