Project

General

Profile

Bug #12277

/proc/<PID>/fdinfo should resolve paths relative to current process

Added by Andy Fiddaman 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Following 12046, pfiles is returning the wrong information for the pathname of files open by a process in an NGZ.


Related issues

Related to illumos gate - Feature #12046: Provide /proc/<PID>/fdinfo/Closed

Actions

History

#1

Updated by Andy Fiddaman 9 months ago

Review at: https://code.illumos.org/c/illumos-gate/+/363

Before

bloody# pfiles 1224 | grep log/syslog
      /var/log/syslog
bloody# zlogin pkgsrc pfiles 1224 | grep log/syslog
      /var/log/syslog

After

bloody# pfiles 101219 | grep log/syslog
      /zones/pkgsrc/root/var/log/syslog
bloody# zlogin pkgsrc pfiles 101219 | grep log/syslog
      /var/log/syslog

This should have been caught with the testing I did for 12046 but my test program didn't iterate past system processes and therefore didn't descend into zones properly.

I'm now using this much simpler test:

#!/bin/ksh

compare() {
        pid=$1

        old=/tmp/old.$$
        new=/tmp/new.$$

        pfiles $pid > $new
        ./pfiles $pid > $old
        echo "***********************  $pid   ****************************" 
        gdiff -u $old $new
        rm -f $old $new
}

for pid in /proc/*; do
        compare $pid
done

where ./pfiles is the pre-12046 pfiles.

#2

Updated by Dan McDonald 9 months ago

#3

Updated by Electric Monk 9 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 19ee9cd1f5161e227951200cab5ecbff45fd5d71

commit  19ee9cd1f5161e227951200cab5ecbff45fd5d71
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2020-02-08T23:13:39.000Z

    12277 /proc/<PID>/fdinfo should resolve paths relative to current process
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Jason King <jason.king@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF