Regression : Incorrect use of subprocess module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP's Framework R&D | ||
5.0 |
Fix Released
|
Medium
|
Jay Vora (Serpent Consulting Services) |
Bug Description
I'm using OpenERP 5.0.15
In tools/misc.py: exec_pg_
The executable argument specifies the program to execute. It is very seldom needed: Usually, the program to execute is defined by the args argument. If shell=True, the executable argument specifies which shell to use. On Unix, the default shell is /bin/sh.
The above two functions have been working up to now only by accident. The subprocess module will spawn the /bin/sh shell and try to execute the first element in the argument list tuple. The first element is the command name (without the full path), but since the command is usually in the shell's path it will succeed. However if , for example, the pg_* commands were not in the shell's path (for example in /usr/lib/pgsql/bin) then it would fail.
Patch is attached.
summary: |
- Incorrect use of subprocess module + Regression : Incorrect use of subprocess module |
Update: Please disregard my analysis for why the two functions appear to be functioning up to now. It is wrong since the first element in the argument list is *not* the command name. The bug is real none the less and should be fixed.