Changeset c9047b1 for remit/mit


Ignore:
Timestamp:
May 24, 2011, 4:31:12 PM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, client
Children:
3b03cc6
Parents:
a5ef930
git-author:
Alex Dehnert <adehnert@…> (05/24/11 16:16:21)
git-committer:
Alex Dehnert <adehnert@…> (05/24/11 16:31:12)
Message:

Properly escape the zwrite command line

Thanks to Anders for bringing this issue to my attention.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remit/mit/__init__.py

    r213c1e0 rc9047b1  
     1import subprocess
     2
    13from django.contrib.auth.middleware import RemoteUserMiddleware
    24from django.contrib.auth.backends import RemoteUserBackend
     
    57
    68def zephyr(msg, clas='remit', instance='log', rcpt='adehnert',):
    7     import os
    8     os.system("zwrite -d -c '%s' -i '%s' '%s' -m '%s'" % (clas, instance, rcpt, msg, ))
     9    proc = subprocess.Popen(
     10        ['zwrite', '-d', '-n', '-c', clas, '-i', instance, rcpt, ],
     11        stdin=subprocess.PIPE, stdout=subprocess.PIPE
     12    )
     13    proc.communicate(msg)
    914
    1015class ScriptsRemoteUserMiddleware(RemoteUserMiddleware):
Note: See TracChangeset for help on using the changeset viewer.