mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-10 21:13:49 +01:00
Fix python 2.6 SyntaxError
Multiple context expressions are only supported since version 2.7. It was introduced in commit f6f879d ("Fix potential shell injection when running rpm2cpio").
This commit is contained in:
parent
b7d3ae992c
commit
a884b58313
@ -6697,13 +6697,15 @@ def unpack_srcrpm(srpm, dir, *files):
|
|||||||
if os.path.isdir(dir):
|
if os.path.isdir(dir):
|
||||||
os.chdir(dir)
|
os.chdir(dir)
|
||||||
ret = -1
|
ret = -1
|
||||||
with open(srpm, 'r') as fsrpm, open(os.devnull, 'w') as devnull:
|
with open(srpm, 'r') as fsrpm:
|
||||||
|
with open(os.devnull, 'w') as devnull:
|
||||||
rpm2cpio_proc = subprocess.Popen(['rpm2cpio'], stdin=fsrpm,
|
rpm2cpio_proc = subprocess.Popen(['rpm2cpio'], stdin=fsrpm,
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
# XXX: shell injection is possible via the files parameter, but the
|
# XXX: shell injection is possible via the files parameter, but the
|
||||||
# current osc code does not use the files parameter.
|
# current osc code does not use the files parameter.
|
||||||
cpio_proc = subprocess.Popen(['cpio', '-i'] + list(files),
|
cpio_proc = subprocess.Popen(['cpio', '-i'] + list(files),
|
||||||
stdin=rpm2cpio_proc.stdout, stderr=devnull)
|
stdin=rpm2cpio_proc.stdout,
|
||||||
|
stderr=devnull)
|
||||||
rpm2cpio_proc.stdout.close()
|
rpm2cpio_proc.stdout.close()
|
||||||
cpio_proc.communicate()
|
cpio_proc.communicate()
|
||||||
rpm2cpio_proc.wait()
|
rpm2cpio_proc.wait()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user