Skip to content

Instantly share code, notes, and snippets.

@berekuk
Created November 7, 2010 12:21
Show Gist options
  • Save berekuk/666100 to your computer and use it in GitHub Desktop.
Save berekuk/666100 to your computer and use it in GitHub Desktop.
use Ubic::Credentials;
my $current_cr = Ubic::Credentials->current;
my $service_cr = $service->credentials; # or maybe to avoid adding one more method to Ubic::Service interface, Ubic->credentials($service_name)
$guard = $service_cr->effective_guard; # guard
... # write status file
undef $guard;
$service_cr->activate; # there is no way back from here - you can't change real uid and then change it back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment