File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1414 identity = System .Security .Principal .WindowsIdentity .GetCurrent();
1515 principal = System .Security .Principal .WindowsPrincipal(identity );
1616 y = principal .IsInRole(System .Security .Principal .WindowsBuiltInRole .Administrator );
17- else
17+ elseif stdlib .has_java()
1818 y = com .sun .security .auth .module .UnixSystem().getUid() == 0 ;
19+ else
20+ [s , r ] = system(' id -u' );
21+ y = s == 0 && strip(r ) == " 0" ;
1922end
2023
2124end
Original file line number Diff line number Diff line change @@ -61,9 +61,7 @@ function test_get_pid(tc)
6161
6262
6363function test_is_admin(tc )
64- tc .assumeTrue(ispc() || stdlib .has_java() || stdlib .is_mex_fun(" stdlib.is_admin" ))
65-
66- tc .verifyClass(stdlib .is_admin(), " logical" )
64+ tc .verifyClass(stdlib .is_admin(), " logical" )
6765end
6866
6967
You can’t perform that action at this time.
0 commit comments