|
79 | 79 | nice=4,
|
80 | 80 | num_threads=5,
|
81 | 81 | status=6,
|
82 |
| - ttynr=7) |
| 82 | + ttynr=7, |
| 83 | + uid=8, |
| 84 | + euid=9, |
| 85 | + gid=10, |
| 86 | + egid=11) |
83 | 87 |
|
84 | 88 |
|
85 | 89 | # =====================================================================
|
@@ -394,7 +398,10 @@ def _proc_basic_info(self):
|
394 | 398 |
|
395 | 399 | @memoize_when_activated
|
396 | 400 | def _proc_cred(self):
|
397 |
| - return cext.proc_cred(self.pid, self._procfs_path) |
| 401 | + @wrap_exceptions |
| 402 | + def proc_cred(self): |
| 403 | + return cext.proc_cred(self.pid, self._procfs_path) |
| 404 | + return proc_cred(self) |
398 | 405 |
|
399 | 406 | @wrap_exceptions
|
400 | 407 | def name(self):
|
@@ -454,12 +461,22 @@ def ppid(self):
|
454 | 461 |
|
455 | 462 | @wrap_exceptions
|
456 | 463 | def uids(self):
|
457 |
| - real, effective, saved, _, _, _ = self._proc_cred() |
| 464 | + try: |
| 465 | + real, effective, saved, _, _, _ = self._proc_cred() |
| 466 | + except AccessDenied: |
| 467 | + real = self._proc_basic_info()[proc_info_map['uid']] |
| 468 | + effective = self._proc_basic_info()[proc_info_map['euid']] |
| 469 | + saved = None |
458 | 470 | return _common.puids(real, effective, saved)
|
459 | 471 |
|
460 | 472 | @wrap_exceptions
|
461 | 473 | def gids(self):
|
462 |
| - _, _, _, real, effective, saved = self._proc_cred() |
| 474 | + try: |
| 475 | + _, _, _, real, effective, saved = self._proc_cred() |
| 476 | + except AccessDenied: |
| 477 | + real = self._proc_basic_info()[proc_info_map['gid']] |
| 478 | + effective = self._proc_basic_info()[proc_info_map['egid']] |
| 479 | + saved = None |
463 | 480 | return _common.puids(real, effective, saved)
|
464 | 481 |
|
465 | 482 | @wrap_exceptions
|
|
0 commit comments