[rt-users] Having an issue trying to grant rights to back to root

Lori Welch lwelch at holycross.com
Mon Oct 10 13:41:41 EDT 2016


Ran into an issue, where I was trying to modify permissions on a user, and it changed root.
Now my root is not a super user.
I ran this command: perl -I /opt/rt4/lib -MRT -e' RT::LoadConfig(); RT::Init(); my $u = RT::User->new($RT::Systemuser); $u->Load("root"); print $u->PrincipalObj->GrantRight(Object => $RT::System, Right => "SuperUser");'
And I got this response:
[3228] [Mon Oct 10 17:16:18 2016] [debug]: Using internal Perl HTML -> text conversion (/opt/rt4/lib/RT/Interface/Email.pm:1454)
[3228] [Mon Oct 10 17:16:18 2016] [debug]: The RTAddressRegexp option is not set in the config. Not setting this option results in additional SQL queries to check whether each address belongs to RT or not. It is especially important to set this option if RT receives emails on addresses that are not in the database or config. (/opt/rt4/lib/RT/Config.pm:531)
[3228] [Mon Oct 10 17:16:18 2016] [critical]: Can't call method "HasRight" on an undefined value at /opt/rt4/lib/RT/ACE.pm line 237, <DATA> line 747. (/opt/rt4/lib/RT.pm:390)
Can't call method "HasRight" on an undefined value at /opt/rt4/lib/RT/ACE.pm line 237, <DATA> line 747.

Root still does not have super user rights.

I tried to change a user that does not have super user rights and never has and I got this response instead:

perl -I /opt/rt4/lib -MRT -e' RT::LoadConfig(); RT::Init(); my $u = RT::User->new($RT::Systemuser); $u->Load("user at domain.com"); print $u->PrincipalObj->GrantRight(Object => $RT::System, Right => "SuperUser");'
[3231] [Mon Oct 10 17:17:01 2016] [debug]: Using internal Perl HTML -> text conversion (/opt/rt4/lib/RT/Interface/Email.pm:1454)
[3231] [Mon Oct 10 17:17:01 2016] [debug]: The RTAddressRegexp option is not set in the config. Not setting this option results in additional SQL queries to check whether each address belongs to RT or not. It is especially important to set this option if RT receives emails on addresses that are not in the database or config. (/opt/rt4/lib/RT/Config.pm:531)
[3231] [Mon Oct 10 17:17:01 2016] [error]: Couldn't get principal for an empty user (/opt/rt4/lib/RT/User.pm:1282)
[3231] [Mon Oct 10 17:17:01 2016] [critical]: Can't call method "GrantRight" on an undefined value at -e line 1, <DATA> line 747. (/opt/rt4/lib/RT.pm:390)
Can't call method "GrantRight" on an undefined value at -e line 1, <DATA> line 747.

I got this script from RT Esentials, which was written for RT3, any chance someone can help me with an RT4 version?

Thanks

Lori
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20161010/48fe5a8f/attachment.htm>


More information about the rt-users mailing list