[p4perl] Impersonating a user (p4perl 2007.3)
tony at smee.org
Tue Jul 15 11:53:35 PDT 2008
G Barthelemy wrote:
>>> I get a "password invalid" error when running
>>> $p4->RunLogin($user_to_impersonate) even if a superuser has been
>>> specified with SetUser, so no ticket gets generated.
>> Have you got a valid ticket for the super-user? You have to prove you are the
>> super-user before you can run 'p4 login <otheruser>'. Can you run other
>> commands as that super-user?
> Sorry for the silence, but I have been sidetracked. To reply to your
> question, yes I believe I had a valid ticket for superuser and could
> execute commands as that superuser. However, I am failing to display
> the ticket expiry time. So I seem to have 2 issues with
> P4PERL/LINUX26I386/2007.3/151416 (2007.3 API) (2008/04/09).
> 1- I can't seem to output a users ticket expiry time:
> $p4->RunLogin("-s") is mute, so I have to resort to other means to
> determine if the current user (for instance the superuser) has a valid
> ticket. In the example below, I run "p4 depots" as the superuser is
> the only one with access to one of the depots.
> 2- RunLogin($user) doesn't seem to honor even though the current user
> is superuser. I get Password Invalid.
> Unless I am doing something wrong of course, so here's the script I
> used as a test (p4adm is superuser):
> In the mean time, I solved my problem by not using the API.
I think the best thing is if you can send me, the output of the script
with some debugging enabled. Let's try first with
$p4->SetDebugLevel( 2 );
Put that in before the call to Connect(), and let's see what it produces.
More information about the p4perl