Univention Bugzilla – Attachment 3269 Details for
Bug 22517
Potentielles blockieren durch zu große Ausgabe von UCS Script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix pipe deadlock
22517_ucr_deadlock.diff (text/plain), 1.17 KB, created by
Philipp Hahn
on 2011-05-13 14:08:38 CEST
(
hide
)
Description:
Fix pipe deadlock
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2011-05-13 14:08:38 CEST
Size:
1.17 KB
patch
obsolete
>Bug #22517: Fix deadlock by pipe overflow >--- python/univention/config_registry.py (Revision 24122) >+++ python/univention/config_registry.py (Arbeitskopie) >@@ -379,17 +405,18 @@ > return template > > def runScript(script, arg, changes): >- >- s = '' >+ """ >+ Execute script with command line arguments using a shell and pass changes on STDIN. >+ For each changed variable a line with the 'name of the variable', the 'old value', and the 'new value' are passed seperated by '@%@'. >+ """ >+ diff = [] > for key, value in changes.items(): > if value and len(value) > 1 and value[0] and value[1]: >- s += '%s@%%@%s@%%@%s\n' % (key, value[0], value[1]) >+ diff.append('%s@%%@%s@%%@%s\n' % (key, value[0], value[1])) > >- p = subprocess.Popen(script+" "+arg, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) >- p_out, p_in = p.stdin, p.stdout >- p_out.write(s) >- p_out.close() >- p_in.close() >+ with open(os.path.devnull, 'w') as null: >+ p = subprocess.Popen(script + " " + arg, shell=True, stdin=subprocess.PIPE, stdout=null, close_fds=True) >+ p.communicate(''.join(diff)) > > def runModule(modpath, arg, ucr, changes): > arg2meth = { 'generate': lambda obj: getattr(obj, 'handler'),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22517
: 3269 |
3270