public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Privilege(s) needed to run top command
Date: Mon, 11 Mar 2019 21:28:00 -0000	[thread overview]
Message-ID: <20190311212845.GE3785@calimero.vinschen.de> (raw)
In-Reply-To: <87r2bd4003.fsf@Rainer.invalid>

[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-03-11 21:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 16:56 jwang
2019-03-11 20:29 ` L A Walsh
2019-03-11 20:41 ` Achim Gratz
2019-03-11 21:28   ` Corinna Vinschen [this message]
2019-03-11 21:40     ` Achim Gratz
2019-03-12  0:20       ` Andrey Repin
2019-03-12  8:58       ` Corinna Vinschen
2019-03-12  9:48   ` jwang
2019-03-12 11:14     ` Corinna Vinschen
2019-03-12 12:01       ` jwang
2019-03-12 12:39         ` Houder
2019-03-12 15:51           ` jwang
2019-03-12 16:47             ` Corinna Vinschen
2019-03-12 17:06               ` jwang
2019-03-12 17:13                 ` Corinna Vinschen
2019-03-12 17:19                   ` jwang
2019-03-12 17:40                     ` Corinna Vinschen
2019-03-12 17:39                   ` Corinna Vinschen
2019-03-12 20:28                     ` Corinna Vinschen
2019-03-12 20:50                       ` Andrey Repin
2019-03-12 20:59                         ` Corinna Vinschen
2019-03-12 21:50                           ` Andrey Repin
2019-03-12 18:10                   ` Houder
2019-03-12 19:27                 ` Achim Gratz
2019-03-13  9:17                   ` jwang
2019-03-15 10:20                     ` jwang
2019-03-15 11:28                       ` Corinna Vinschen
2019-03-15 12:34                         ` jwang
2019-03-15 13:38                           ` Corinna Vinschen
2019-03-15 13:50                             ` jwang
2019-03-15 14:11                             ` jwang
2019-03-15 14:53                               ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311212845.GE3785@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).