grant privileges to PUBLIC cause Stado to fail restart
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Stado |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Stado -> grant all on info to public;
SQLException: ERROR: Failed to commit transaction
Though this SQL got exception, there is a new record with useried(null) inserted in Metadata database.
XDBSYS=# select * from xsystabprivs;
privid | userid | tableid | selectpriv | insertpriv | updatepriv | deletepriv | referencespriv | indexpriv | alterpriv
-------
1 | 1 | 31 | Y | Y | Y | Y | Y | Y | Y
2 | | 31 | Y | Y | Y | Y | Y | Y | Y
When trying to restart Stado, ./gs-server.sh failed due to the NullPointer caused by the null user;
Also, revoke will get exception.
Stado -> revoke update on info from public;
SQLException: ERROR: Failed to commit transaction
Related branches
Changed in stado: | |
status: | New → Fix Committed |
The cause may be:
SqlGrant.java:
granteeLis t.add(null) ;
/**
* Grammar production:
* f0 -> <PUBLIC_>
* | Identifier(prn)
*/
@Override
public Object visit(Grantee n, Object argu) {
if (n.f0.which == 0) {
}
...
}
For "public", n.f0.which==0, so null is added to granteeList.
Then,
public void prepare() throws Exception {
iGranteeList. add(granteeName == null ? null : database. getSysUser( granteeName) );
...
for (String granteeName : granteeList) {
}
...
}
null is added to iGranteeList.
When Stado starts up, Info() throws XDBServerException {
sysPermission s.put(user, aSysPermission);
user. addGranted( this); <-- this will cause exception because user is null
SysTable.java:
void readPermissions
...
...