Debian Bug report logs - #96111
Mailman is writing to /usr in cron

Package: python; Maintainer for python is Matthias Klose <doko@debian.org>; Source for python is src:python-defaults.

Reported by: Shane Wegner <shane@debian.org>

Date: Wed, 2 May 2001 22:03:01 UTC

Severity: wishlist

Tags: upstream

Merged with 522248

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#96111; Package mailman. Full text and rfc822 format available.

Acknowledgement sent to Shane Wegner <shane@debian.org>:
New Bug report received and forwarded. Copy sent to Tollef Fog Heen <tfheen@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Shane Wegner <shane@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Mailman is writing to /usr in cron
Date: Wed, 02 May 2001 13:54:31 -0700
Package: mailman
Version: 2.0.4-1
Severity: normal

I am getting the following messages from my lids enabled kernel.

LIDS: python (9 2 inode 198132) pid 25338 user (38/38) on NULL tty: Try to
open /usr/lib/mailman/cron/paths.pyc for writing,flag=578

If at all possible, cron shouldn't write to /usr as it is often mounted
readonly for security purposes.  I don't know much about python but every
file has a py and a pyc extention except for paths.pyc.

Shane

-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux continuum 2.2.19 #1 SMP Wed May 2 02:23:39 PDT 2001 i686

Versions of packages mailman depends on:
ii  apache             1.3.19-1              Versatile, high-performance HTTP s
ii  apache [httpd]     1.3.19-1              Versatile, high-performance HTTP s
ii  cron               3.0pl1-66             management of regular background p
ii  libc6              2.2.2-4               GNU C Library: Shared libraries an
ii  logrotate          3.5.4-1               Log rotation utility              
ii  python-base        1.5.2-16              An interactive object-oriented scr
hi  sendmail           8.11.3+8.12.0.Beta7-6 A powerful mail transport agent.  
hi  sendmail [mail-tra 8.11.3+8.12.0.Beta7-6 A powerful mail transport agent.  




Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#96111; Package mailman. Full text and rfc822 format available.

Acknowledgement sent to Tollef Fog Heen <tollef@add.no>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. Full text and rfc822 format available.

Message #10 received at 96111@bugs.debian.org (full text, mbox):

From: Tollef Fog Heen <tollef@add.no>
To: Shane Wegner <shane@debian.org>, 96111@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#96111: Mailman is writing to /usr in cron
Date: 03 May 2001 08:53:50 +0200
reassign 96111 python-base
severity 96111 wishlist
thanks

* Shane Wegner 

| If at all possible, cron shouldn't write to /usr as it is often mounted
| readonly for security purposes.  I don't know much about python but every
| file has a py and a pyc extention except for paths.pyc.

This is not cron trying to write to /usr.  It is the python compiler
which compiles .py files into bytecode files.  If anything, this would
be a wishlist bug against python, I guess.

AFAIK, there is no way I can control whether python compiles the files
or not, and if it should check whether it can write there, I think
that functionality should be in python itself, not in all of the
scripts.

-- 

Tollef Fog Heen
Unix _IS_ user friendly... It's just selective about who its friends are.



Bug reassigned from package `mailman' to `python-base'. Request was from Tollef Fog Heen <tollef@add.no> to control@bugs.debian.org. Full text and rfc822 format available.

Severity set to `wishlist'. Request was from Tollef Fog Heen <tollef@add.no> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Gregor Hoffleit <flight@debian.org>:
Bug#96111; Package python-base. Full text and rfc822 format available.

Acknowledgement sent to gregor@hoffleit.de:
Extra info received and forwarded to list. Copy sent to Gregor Hoffleit <flight@debian.org>. Full text and rfc822 format available.

Message #19 received at 96111@bugs.debian.org (full text, mbox):

From: Gregor Hoffleit <gregor@mediasupervision.de>
To: Tollef Fog Heen <tollef@add.no>, 96111@bugs.debian.org
Cc: Shane Wegner <shane@debian.org>, control@bugs.debian.org
Subject: Re: Bug#96111: Mailman is writing to /usr in cron
Date: Thu, 3 May 2001 11:43:56 +0200
reassign 96111 mailman

On Thu, May 03, 2001 at 08:53:50AM +0200, Tollef Fog Heen wrote:
> reassign 96111 python-base
> severity 96111 wishlist
> thanks
> 
> * Shane Wegner 
> 
> | If at all possible, cron shouldn't write to /usr as it is often mounted
> | readonly for security purposes.  I don't know much about python but every
> | file has a py and a pyc extention except for paths.pyc.
> 
> This is not cron trying to write to /usr.  It is the python compiler
> which compiles .py files into bytecode files.  If anything, this would
> be a wishlist bug against python, I guess.
> 
> AFAIK, there is no way I can control whether python compiles the files
> or not, and if it should check whether it can write there, I think
> that functionality should be in python itself, not in all of the
> scripts.

I'd suggest byte-compiling all .py files in mailman either at packaging time
or in the postinst script. Look at /usr/lib/python1.5/compileall.py and at
/usr/share/doc/python/sample.{postinst,prerm}.

This should definitely enhance the performance also (since mailman doesn't
need to byte-compile the source files every time the libraries are
imported by the interpreter). Drawback is either a increase of the package
size or a delay and an added complication at installation time.

I reassign this bug to mailman. If you don't agree with this, feel free to
send it back to python-base.

    Gregor
    



Information forwarded to debian-bugs-dist@lists.debian.org, Gregor Hoffleit <flight@debian.org>:
Bug#96111; Package python-base. Full text and rfc822 format available.

Acknowledgement sent to Shane Wegner <shane@debian.org>:
Extra info received and forwarded to list. Copy sent to Gregor Hoffleit <flight@debian.org>. Full text and rfc822 format available.

Message #24 received at 96111@bugs.debian.org (full text, mbox):

From: Shane Wegner <shane@debian.org>
To: gregor@hoffleit.de
Cc: Tollef Fog Heen <tollef@add.no>, 96111@bugs.debian.org, Shane Wegner <shane@debian.org>, control@bugs.debian.org
Subject: Re: Bug#96111: Mailman is writing to /usr in cron
Date: Thu, 3 May 2001 02:52:29 -0700
On Thu, May 03, 2001 at 11:43:56AM +0200, Gregor Hoffleit wrote:
> On Thu, May 03, 2001 at 08:53:50AM +0200, Tollef Fog Heen wrote:
> > * Shane Wegner 
> > 
> > | If at all possible, cron shouldn't write to /usr as it is often mounted
> > | readonly for security purposes.  I don't know much about python but every
> > | file has a py and a pyc extention except for paths.pyc.
> > 
> > This is not cron trying to write to /usr.  It is the python compiler
> > which compiles .py files into bytecode files.  If anything, this would
> > be a wishlist bug against python, I guess.
> > 
> > AFAIK, there is no way I can control whether python compiles the files
> > or not, and if it should check whether it can write there, I think
> > that functionality should be in python itself, not in all of the
> > scripts.
> 
> I'd suggest byte-compiling all .py files in mailman either at packaging time
> or in the postinst script. Look at /usr/lib/python1.5/compileall.py and at
> /usr/share/doc/python/sample.{postinst,prerm}.

This would work and I think pieces of mailman are already
compiled.  paths.py is the only one I noticed that isn't.

> I reassign this bug to mailman. If you don't agree with this, feel free to
> send it back to python-base.

Correct me if I'm wrong as I've never written a line of
python code but if it works similar to other interpretted
languages then:
python myscript.py
should work even when myscript.py is on a readonly FS such
as NFS or a CDROM.  If python is going to do any compiling
to temperary bytecode, shouldn't it use $TMPDIR or /tmp?

REgards,
Shane

-- 
Shane Wegner: shane@cm.nu
              http://www.cm.nu/~shane/
PGP:          1024D/FFE3035D
              A0ED DAC4 77EC D674 5487
              5B5C 4F89 9A4E FFE3 035D



Bug reassigned from package `python-base' to `mailman'. Request was from Gregor Hoffleit <gregor@mediasupervision.de> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#96111; Package mailman. Full text and rfc822 format available.

Acknowledgement sent to gregor@hoffleit.de:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. Full text and rfc822 format available.

Message #31 received at 96111@bugs.debian.org (full text, mbox):

From: Gregor Hoffleit <gregor@mediasupervision.de>
To: Shane Wegner <shane@debian.org>
Cc: Tollef Fog Heen <tollef@add.no>, 96111@bugs.debian.org
Subject: Re: Bug#96111: Mailman is writing to /usr in cron
Date: Thu, 3 May 2001 12:33:45 +0200
On Thu, May 03, 2001 at 02:52:29AM -0700, Shane Wegner wrote:
> Correct me if I'm wrong as I've never written a line of
> python code but if it works similar to other interpretted
> languages then:
> python myscript.py
> should work even when myscript.py is on a readonly FS such
> as NFS or a CDROM.  If python is going to do any compiling
> to temperary bytecode, shouldn't it use $TMPDIR or /tmp?

Whenever python tries to import (that's different from reading a script like
in your example) a .py file, it looks if there's a up-to-date byte-compiled
.pyc version available in the same directory. If the .pyc is found, it will
load the bytecode; if no .pyc is found, or if it not up-to-date (i.e. the
timestamp of the source is more recent), it will load the python source, and
the interpreter will byte-compile the source into bytecode. Then, it tries
to save this bytecode as .pyc into the same directory where the source was
found. Saving may fail silently, though, e.g. if the interpreter doesn't
have the necessary permissions. That's no problem, it just means that the
next time the interpreter is started, it will have to rebuild the bytecode
once again.

Consequence is that nothing serious will happen as long as the .py files
reside in a read-only directory. It just pulls down the startup performance
of the interpreter a little bit.

Nothing will happen if you startup the Python interpreter as normal user,
and if you don't have write permission to the .pyc file.

If Python is run as root, though, and the .py file sits in a writable
directory, then it may happen that Python writes a new .pyc file.

    Gregor
    



Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#96111; Package mailman. Full text and rfc822 format available.

Acknowledgement sent to Tollef Fog Heen <tollef@add.no>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. Full text and rfc822 format available.

Message #36 received at 96111@bugs.debian.org (full text, mbox):

From: Tollef Fog Heen <tollef@add.no>
To: gregor@hoffleit.de
Cc: 96111@bugs.debian.org, Shane Wegner <shane@debian.org>, control@bugs.debian.org
Subject: Re: Bug#96111: Mailman is writing to /usr in cron
Date: 03 May 2001 16:08:16 +0200
reassign 96111 python-base
thanks

* Gregor Hoffleit 

| I'd suggest byte-compiling all .py files in mailman either at packaging time
| or in the postinst script. Look at /usr/lib/python1.5/compileall.py and at
| /usr/share/doc/python/sample.{postinst,prerm}.

I am already.  The only one I forgot was a single file.  (Which is
fixed now.)  Anyhow, it would be nice if python didn't try to write to
a ro media.  Which is why I reassigned it, and made it a wishlist
request.

If you don't think python should do such tests, feel free to close the
report, as I have already fixed the bug in mailman.  If you'd call it
a bug.  (I wouldn't.)

-- 

Tollef Fog Heen
Unix _IS_ user friendly... It's just selective about who its friends are.



Bug reassigned from package `mailman' to `python-base'. Request was from Tollef Fog Heen <tollef@add.no> to control@bugs.debian.org. Full text and rfc822 format available.

Bug reassigned from package `python-base' to `python'. Request was from Matthias Klose <doko@cs.tu-berlin.de> to control@bugs.debian.org. Full text and rfc822 format available.

Tags added: upstream Request was from Matthias Klose <doko@cs.tu-berlin.de> to control@bugs.debian.org. Full text and rfc822 format available.

Merged 96111 522248. Request was from Sven Joachim <svenjoac@gmx.de> to control@bugs.debian.org. (Thu, 02 Apr 2009 20:30:07 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 17:13:58 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.