Difference in the way 14.04/3.19 and 16.04/4.4 handle the system() function opening a new process in...
What's the purpose of these copper coils with resitors inside them in A Yamaha RX-V396RDS amplifier?
I am on the US no-fly list. What can I do in order to be allowed on flights which go through US airspace?
Wanted: 5.25 floppy to usb adapter
How much time does it take for a broken magnet to recover its poles?
Why is this code uniquely decodable?
How do we edit a novel that's written by several people?
Is my plan for fixing my water heater leak bad?
What does a violin mute do?
Do my Windows system binaries contain sensitive information?
How to properly claim credit for peer review?
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
Activating a Alphanet Faucet Wallet Remotely (without tezos-client)
Find the number of ways to express 1050 as sum of consecutive integers
Connecting top and bottom of adjacent circles
If all harmonics are generated by plucking, how does a guitar string produce a pure frequency sound?
What is the meaning of "pick up" in this sentence?
When does coming up with an idea constitute sufficient contribution for authorship?
How to avoid being sexist when trying to employ someone to function in a very sexist environment?
Table enclosed in curly brackets
Can I retract my name from an already published manuscript?
Does Windows 10's telemetry include sending *.doc files if Word crashed?
Meth dealer reference in Family Guy
Criticizing long fiction. How is it different from short?
F1 visa even for a three-week course?
Difference in the way 14.04/3.19 and 16.04/4.4 handle the system() function opening a new process in xterm
What is the difference between xterm and xterm(unicode)?Give permissions for packages downloaded from the internet and lock them in Ubuntu 12.04 sidebarStarting xterm windows via cronterminal won't lauch (ubuntu 16.04)What's the difference between 16.04 and 16.04.1?Gnome terminal will not startSystemd not able to switch off Wacom touch on resumewifi and wired connections do not work in dual boot ubuntu 16.04upate caused“Secure boot violation - invalid signature detected”Sudo - how not to type password in bash script? (apt-get)
I am trying to port a well tested c++ application between 14.04.1 with 3.19.0 kernel to 16.04LTS server with 4.4.0 kernel I run an executable from a 3rd party that has to run as root in a terminal. I believe that I have boiled the issue down to the call
system( "xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/factory/updateFirmware.sh' -r" );
This works on the old system, the terminal opens and the script runs, printing its progress and results. In the new system, the call returns a failure without even printing the opening log message that the script normally produces. I can run this exact command manually in a terminal window and it works, opening a second terminal and running the script.
It may be that there is some security mechanism that is stopping the terminal. Before I try another hundred things (I've tried sudo/sudoers, popen, and exec; all seem the same), does anyone know -
Is there a security policy or configuration setting that would disallow a system() call to open a terminal, even if the calling program is running as root?
Below are some further test code that I ran, with the resulting log messages produced. The first is a logger command, it prints its message in the logs and returns success. the second is whoami, which just returns success but proves that the commmand can be run by system. (TR_TRACE is a logging module that we use, these are announcing the result of each call.) The first failure is the simple command to open an xterm and run whoami. The last failure is the actual original problematic command.
result = system( "logger -t 'system() call' 'Are we doing effing anything?'" );
TR_TRACE(Usermesg, 0, "Returned from logger call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "whoami");
TR_TRACE(Usermesg, 0, "Returned from whoami call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( " xterm -j -hold -geometry 80x30+400+200 -e 'whoami'");
TR_TRACE(Usermesg, 0, "Returned from whoami call in terminal, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "sudo xterm -T 'Firmware Update' -sb -fg black -bg lightgray +132 -hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/360/updateMatroxFirmware.sh'" );
TR_TRACE(Usermesg, 0, "Returned from script to update FPGA firmware version, update result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
Logs show
Mar 4 02:06:41 tm6a system() call: Are we doing effing anything?
Mar 4 02:06:41 tm6a TSS: 808 d61ed740 0000 VR@Usermesg: Returned from logger call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 821 d61ed740 0000 VR@Usermesg: Returned from whoami call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 827 d61ed740 0000 VR@Usermesg: Returned from whoami call in terminal, result=256 WEXITSTATUS( result )=1
Mar 4 02:06:41 tm6a TSS: 839 d61ed740 0000 VR@Usermesg: Returned from script to update Matrox card FPGA firmware version, update result=256 WEXITSTATUS( result )=1
16.04 sudo c++ xterm
New contributor
add a comment |
I am trying to port a well tested c++ application between 14.04.1 with 3.19.0 kernel to 16.04LTS server with 4.4.0 kernel I run an executable from a 3rd party that has to run as root in a terminal. I believe that I have boiled the issue down to the call
system( "xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/factory/updateFirmware.sh' -r" );
This works on the old system, the terminal opens and the script runs, printing its progress and results. In the new system, the call returns a failure without even printing the opening log message that the script normally produces. I can run this exact command manually in a terminal window and it works, opening a second terminal and running the script.
It may be that there is some security mechanism that is stopping the terminal. Before I try another hundred things (I've tried sudo/sudoers, popen, and exec; all seem the same), does anyone know -
Is there a security policy or configuration setting that would disallow a system() call to open a terminal, even if the calling program is running as root?
Below are some further test code that I ran, with the resulting log messages produced. The first is a logger command, it prints its message in the logs and returns success. the second is whoami, which just returns success but proves that the commmand can be run by system. (TR_TRACE is a logging module that we use, these are announcing the result of each call.) The first failure is the simple command to open an xterm and run whoami. The last failure is the actual original problematic command.
result = system( "logger -t 'system() call' 'Are we doing effing anything?'" );
TR_TRACE(Usermesg, 0, "Returned from logger call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "whoami");
TR_TRACE(Usermesg, 0, "Returned from whoami call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( " xterm -j -hold -geometry 80x30+400+200 -e 'whoami'");
TR_TRACE(Usermesg, 0, "Returned from whoami call in terminal, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "sudo xterm -T 'Firmware Update' -sb -fg black -bg lightgray +132 -hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/360/updateMatroxFirmware.sh'" );
TR_TRACE(Usermesg, 0, "Returned from script to update FPGA firmware version, update result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
Logs show
Mar 4 02:06:41 tm6a system() call: Are we doing effing anything?
Mar 4 02:06:41 tm6a TSS: 808 d61ed740 0000 VR@Usermesg: Returned from logger call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 821 d61ed740 0000 VR@Usermesg: Returned from whoami call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 827 d61ed740 0000 VR@Usermesg: Returned from whoami call in terminal, result=256 WEXITSTATUS( result )=1
Mar 4 02:06:41 tm6a TSS: 839 d61ed740 0000 VR@Usermesg: Returned from script to update Matrox card FPGA firmware version, update result=256 WEXITSTATUS( result )=1
16.04 sudo c++ xterm
New contributor
In the title you mentioned 12.04 (LTS/ESM, which did use 3.19 kernel too with HWE or later-in-life ESM) but then 14.04 (3.19 or 4.4 kernels). I might be best to clarify or correct. I suspect the issue relates to fixes due to shellshock (later 2014) but I can't recall what changes occurred anymore (too long ago), but it may be worth you searching (as I suspect it's the reason for the change you're finding). The system() call was the shellshock entry point....
– guiverc
33 mins ago
Any program that usessystem()
is obviously not well-tested...
– fkraiem
23 mins ago
guiverc - sorry, that was a typo. I edited it to reflect 14.04.
– user239554
7 mins ago
Do the pieces execute?sudo /opt/factory/updateFirmware.sh
by itself?xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'cat /etc.issue'
?
– waltinator
23 secs ago
add a comment |
I am trying to port a well tested c++ application between 14.04.1 with 3.19.0 kernel to 16.04LTS server with 4.4.0 kernel I run an executable from a 3rd party that has to run as root in a terminal. I believe that I have boiled the issue down to the call
system( "xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/factory/updateFirmware.sh' -r" );
This works on the old system, the terminal opens and the script runs, printing its progress and results. In the new system, the call returns a failure without even printing the opening log message that the script normally produces. I can run this exact command manually in a terminal window and it works, opening a second terminal and running the script.
It may be that there is some security mechanism that is stopping the terminal. Before I try another hundred things (I've tried sudo/sudoers, popen, and exec; all seem the same), does anyone know -
Is there a security policy or configuration setting that would disallow a system() call to open a terminal, even if the calling program is running as root?
Below are some further test code that I ran, with the resulting log messages produced. The first is a logger command, it prints its message in the logs and returns success. the second is whoami, which just returns success but proves that the commmand can be run by system. (TR_TRACE is a logging module that we use, these are announcing the result of each call.) The first failure is the simple command to open an xterm and run whoami. The last failure is the actual original problematic command.
result = system( "logger -t 'system() call' 'Are we doing effing anything?'" );
TR_TRACE(Usermesg, 0, "Returned from logger call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "whoami");
TR_TRACE(Usermesg, 0, "Returned from whoami call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( " xterm -j -hold -geometry 80x30+400+200 -e 'whoami'");
TR_TRACE(Usermesg, 0, "Returned from whoami call in terminal, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "sudo xterm -T 'Firmware Update' -sb -fg black -bg lightgray +132 -hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/360/updateMatroxFirmware.sh'" );
TR_TRACE(Usermesg, 0, "Returned from script to update FPGA firmware version, update result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
Logs show
Mar 4 02:06:41 tm6a system() call: Are we doing effing anything?
Mar 4 02:06:41 tm6a TSS: 808 d61ed740 0000 VR@Usermesg: Returned from logger call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 821 d61ed740 0000 VR@Usermesg: Returned from whoami call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 827 d61ed740 0000 VR@Usermesg: Returned from whoami call in terminal, result=256 WEXITSTATUS( result )=1
Mar 4 02:06:41 tm6a TSS: 839 d61ed740 0000 VR@Usermesg: Returned from script to update Matrox card FPGA firmware version, update result=256 WEXITSTATUS( result )=1
16.04 sudo c++ xterm
New contributor
I am trying to port a well tested c++ application between 14.04.1 with 3.19.0 kernel to 16.04LTS server with 4.4.0 kernel I run an executable from a 3rd party that has to run as root in a terminal. I believe that I have boiled the issue down to the call
system( "xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/factory/updateFirmware.sh' -r" );
This works on the old system, the terminal opens and the script runs, printing its progress and results. In the new system, the call returns a failure without even printing the opening log message that the script normally produces. I can run this exact command manually in a terminal window and it works, opening a second terminal and running the script.
It may be that there is some security mechanism that is stopping the terminal. Before I try another hundred things (I've tried sudo/sudoers, popen, and exec; all seem the same), does anyone know -
Is there a security policy or configuration setting that would disallow a system() call to open a terminal, even if the calling program is running as root?
Below are some further test code that I ran, with the resulting log messages produced. The first is a logger command, it prints its message in the logs and returns success. the second is whoami, which just returns success but proves that the commmand can be run by system. (TR_TRACE is a logging module that we use, these are announcing the result of each call.) The first failure is the simple command to open an xterm and run whoami. The last failure is the actual original problematic command.
result = system( "logger -t 'system() call' 'Are we doing effing anything?'" );
TR_TRACE(Usermesg, 0, "Returned from logger call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "whoami");
TR_TRACE(Usermesg, 0, "Returned from whoami call, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( " xterm -j -hold -geometry 80x30+400+200 -e 'whoami'");
TR_TRACE(Usermesg, 0, "Returned from whoami call in terminal, result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
result = system( "sudo xterm -T 'Firmware Update' -sb -fg black -bg lightgray +132 -hold -fn 9x15bold -geometry 80x30+400+200 -e 'sudo /opt/360/updateMatroxFirmware.sh'" );
TR_TRACE(Usermesg, 0, "Returned from script to update FPGA firmware version, update result=" << result << " WEXITSTATUS( result )=" << WEXITSTATUS( result ));
Logs show
Mar 4 02:06:41 tm6a system() call: Are we doing effing anything?
Mar 4 02:06:41 tm6a TSS: 808 d61ed740 0000 VR@Usermesg: Returned from logger call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 821 d61ed740 0000 VR@Usermesg: Returned from whoami call, result=0 WEXITSTATUS( result )=0
Mar 4 02:06:41 tm6a TSS: 827 d61ed740 0000 VR@Usermesg: Returned from whoami call in terminal, result=256 WEXITSTATUS( result )=1
Mar 4 02:06:41 tm6a TSS: 839 d61ed740 0000 VR@Usermesg: Returned from script to update Matrox card FPGA firmware version, update result=256 WEXITSTATUS( result )=1
16.04 sudo c++ xterm
16.04 sudo c++ xterm
New contributor
New contributor
edited 8 mins ago
user239554
New contributor
asked 55 mins ago
user239554user239554
12
12
New contributor
New contributor
In the title you mentioned 12.04 (LTS/ESM, which did use 3.19 kernel too with HWE or later-in-life ESM) but then 14.04 (3.19 or 4.4 kernels). I might be best to clarify or correct. I suspect the issue relates to fixes due to shellshock (later 2014) but I can't recall what changes occurred anymore (too long ago), but it may be worth you searching (as I suspect it's the reason for the change you're finding). The system() call was the shellshock entry point....
– guiverc
33 mins ago
Any program that usessystem()
is obviously not well-tested...
– fkraiem
23 mins ago
guiverc - sorry, that was a typo. I edited it to reflect 14.04.
– user239554
7 mins ago
Do the pieces execute?sudo /opt/factory/updateFirmware.sh
by itself?xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'cat /etc.issue'
?
– waltinator
23 secs ago
add a comment |
In the title you mentioned 12.04 (LTS/ESM, which did use 3.19 kernel too with HWE or later-in-life ESM) but then 14.04 (3.19 or 4.4 kernels). I might be best to clarify or correct. I suspect the issue relates to fixes due to shellshock (later 2014) but I can't recall what changes occurred anymore (too long ago), but it may be worth you searching (as I suspect it's the reason for the change you're finding). The system() call was the shellshock entry point....
– guiverc
33 mins ago
Any program that usessystem()
is obviously not well-tested...
– fkraiem
23 mins ago
guiverc - sorry, that was a typo. I edited it to reflect 14.04.
– user239554
7 mins ago
Do the pieces execute?sudo /opt/factory/updateFirmware.sh
by itself?xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'cat /etc.issue'
?
– waltinator
23 secs ago
In the title you mentioned 12.04 (LTS/ESM, which did use 3.19 kernel too with HWE or later-in-life ESM) but then 14.04 (3.19 or 4.4 kernels). I might be best to clarify or correct. I suspect the issue relates to fixes due to shellshock (later 2014) but I can't recall what changes occurred anymore (too long ago), but it may be worth you searching (as I suspect it's the reason for the change you're finding). The system() call was the shellshock entry point....
– guiverc
33 mins ago
In the title you mentioned 12.04 (LTS/ESM, which did use 3.19 kernel too with HWE or later-in-life ESM) but then 14.04 (3.19 or 4.4 kernels). I might be best to clarify or correct. I suspect the issue relates to fixes due to shellshock (later 2014) but I can't recall what changes occurred anymore (too long ago), but it may be worth you searching (as I suspect it's the reason for the change you're finding). The system() call was the shellshock entry point....
– guiverc
33 mins ago
Any program that uses
system()
is obviously not well-tested...– fkraiem
23 mins ago
Any program that uses
system()
is obviously not well-tested...– fkraiem
23 mins ago
guiverc - sorry, that was a typo. I edited it to reflect 14.04.
– user239554
7 mins ago
guiverc - sorry, that was a typo. I edited it to reflect 14.04.
– user239554
7 mins ago
Do the pieces execute?
sudo /opt/factory/updateFirmware.sh
by itself? xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'cat /etc.issue'
?– waltinator
23 secs ago
Do the pieces execute?
sudo /opt/factory/updateFirmware.sh
by itself? xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'cat /etc.issue'
?– waltinator
23 secs ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
user239554 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1122854%2fdifference-in-the-way-14-04-3-19-and-16-04-4-4-handle-the-system-function-open%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
user239554 is a new contributor. Be nice, and check out our Code of Conduct.
user239554 is a new contributor. Be nice, and check out our Code of Conduct.
user239554 is a new contributor. Be nice, and check out our Code of Conduct.
user239554 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1122854%2fdifference-in-the-way-14-04-3-19-and-16-04-4-4-handle-the-system-function-open%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
In the title you mentioned 12.04 (LTS/ESM, which did use 3.19 kernel too with HWE or later-in-life ESM) but then 14.04 (3.19 or 4.4 kernels). I might be best to clarify or correct. I suspect the issue relates to fixes due to shellshock (later 2014) but I can't recall what changes occurred anymore (too long ago), but it may be worth you searching (as I suspect it's the reason for the change you're finding). The system() call was the shellshock entry point....
– guiverc
33 mins ago
Any program that uses
system()
is obviously not well-tested...– fkraiem
23 mins ago
guiverc - sorry, that was a typo. I edited it to reflect 14.04.
– user239554
7 mins ago
Do the pieces execute?
sudo /opt/factory/updateFirmware.sh
by itself?xterm -T 'Firmware Update' -j -sb -fg black -bg lightgray +132 +hold -fn 9x15bold -geometry 80x30+400+200 -e 'cat /etc.issue'
?– waltinator
23 secs ago