Riddle me on this one

D. Hugh Redelmeier hugh-pmF8o41NoarQT0dZR+AlfA at public.gmane.org
Sun Jan 22 04:46:08 UTC 2012


| From: Christopher Browne <cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>

| Something like that.  I imagine that some "rooty" process could turn
| an inode reference back into a file.  By downloading the sources to
| logrotate, I think I've done my system call investigations for the
| day; I'll leave that exercise to someone else :-).

I think logrotate expects that /etc/logrotate.conf will specify the
hammer with which to hit the offendor over the head.

An inode (in this case) IS a file.  Perhaps you mean a pathname.
There may not be a normal one -- all the hard links gone.  But there
is always (yuck) /proc/PID/fd/N.

For each process PID, and file descriptor N open in process PID,
/proc/PID/fd/N is a sort of symbolic link to that file.  I say "sort
of" because it works even if the file has no pathname.  A real symlink
cannot do that.  At least I think it works.

    [hugh at redclaw ~]$ ls -l /proc/$$/fd
    total 0
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 0 -> /dev/pts/2
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 1 -> /dev/pts/2
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 2 -> /dev/pts/2
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 255 -> /dev/pts/2
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 3 -> /home/hugh/.pine-debug1
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 4 -> /tmp/.303.174c31
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 5 -> /var/spool/mail/hugh
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 6 -> /tmp/.305.4f6ce
    lrwx------ 1 hugh hugh 64 Jan 21 23:35 7 -> /home/hugh/mail/1tlug
    lr-x------ 1 hugh hugh 64 Jan 21 23:35 8 -> /home/hugh/.addressbook

This was run in a shell window of the editor that I'm running to
compose this message under ALPINE.

I would say that it shows an ALPINE bug -- file descriptors 3-8 have
leaked from ALPINE into the subeditor and this is a very bad idea.
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list