Privilege(s) needed to run top command
Corinna Vinschen
corinna-cygwin@cygwin.com
Mon Mar 11 21:28:00 GMT 2019
On Mar 11 21:41, Achim Gratz wrote:
> jwang writes:
> > This is used to work for a ordinary login.
> >
> > After re-install, top does not show the true load et al. Nor processes
> > owned by SYSTEM.
> >
> > Please shed some light.
>> Cygwin is a user-space layer. It can't show you information that the
> underlying OS determines to be off-limits for you.
And I just checked, even under Cygwin 2.11.2, procps and top were
not showing foreign processes if you're running under a non-admin
user account or a non-elevated shell, so this is nothing new.
In fact, `procps' at least tries to access /proc/<PID>/stat. This
doesn't return valid information because it has to be able to open a
process with PROCESS_QUERY_LIMITED_INFORMATION and PROCESS_VM_READ
permissions. No ordinary user has these permissions on processes she
doesn't own.(*)
However, Cygwin's `ps -e' was supposed to show all processes, but
it didn't anymore since I created helper objects in the NT namespace
with insufficient privileges for everyone. I pushed a patch and
uploaded new developer snapshots to https://cywin.com/snapshots/
for testing.
Thanks,
Corinna
(*) That doesn't mean it's not possible. In theory all Cygwin
processes could be opened to allow everyone
PROCESS_QUERY_LIMITED_INFORMATION access, which would at least
fill most of /proc/<PID>/stat for foreign processes.
However, we never did that, so it can't have worked yet.
--
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20190311/2e0f95aa/attachment.sig>
More information about the Cygwin
mailing list