[ python-Bugs-1521375 ] ctypes test overwrites /dev/null

SourceForge.net noreply at sourceforge.net
Wed Jul 12 20:53:43 CEST 2006


Bugs item #1521375, was opened at 2006-07-12 20:22
Message generated for change (Comment added) made by theller
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1521375&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Scot Doyle (scotdoyle)
>Assigned to: Thomas Heller (theller)
Summary: ctypes test overwrites /dev/null

Initial Comment:
Steps to reproduce on Debian Sarge:
1. ls -l /dev/null
2. wget
http://www.python.org/ftp/python/2.5/Python-2.5b2.tgz
3. tar xvzf Pyth*
4. cd Pyth*
5. ./configure
6. make
7. su
8. make test
9. ls -l /dev/null

/dev/null goes from being a special character device to
a normal file of length zero.

The following command can be used instead of step 8
above to delete /dev/null
./python -c 'import ctypes.test.test_find'


To recreate /dev/null:
1. su
2. rm /dev/null
3. mknod -m 666 /dev/null c 1 3
4. chown root:root /dev/null

----------------------------------------------------------------------

>Comment By: Thomas Heller (theller)
Date: 2006-07-12 20:53

Message:
Logged In: YES 
user_id=11105

Now, that is an 'interesting' bug.  ctypes.util.find_library
does execute shell commands that happen to have '/dev/null'
in them, but it is completely unclear to me how one can
overwrite /dev/null (even if root).  Can you see anything
that's wrong there (That code is not from me, and I'm not at
all an expert in linux programming)?

BTW, I cannot reproduce this on ubuntu with 'sudo ./python
-c "import ctypes.test.test_find"'.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1521375&group_id=5470


More information about the Python-bugs-list mailing list