Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 6 Jun 2013 15:31:25 +0200
From: "Jason A. Donenfeld" <>
To: oss-security <>
Subject: Re: chroots & uid sharing

Alright that one-liner killed kittens. Sorry. Here we go:

frisell zx2c4 # cat
#!/usr/bin/env python2

import os

chroots = { }

for pid in os.listdir("/proc/"):
        if not pid.isdigit():
                uid = os.stat("/proc/" + pid).st_uid
                root = os.readlink("/proc/" + pid + "/root")
        if uid not in chroots:
                chroots[uid] = [root]
        elif root not in chroots[uid]:

for uid in chroots:
        if len(chroots[uid]) > 1:
                print "UID: %d" % uid
                for root in chroots[uid]:
                        print "\t%s" % root

frisell zx2c4 # ./
UID: 25

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.