diff options
author | OBATA Akio <obache@wizdas.com> | 2020-08-09 17:34:23 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-08-26 18:11:02 +0200 |
commit | ac8c8ca54aaed1466255161a3d727dcfade4a7d9 (patch) | |
tree | a16f3955e178f3dca2daf98bf0ade9750aa13f6f /kded | |
parent | 56c5973b6b33df77a7491b07411cbd772c0d5d79 (diff) | |
download | tdelibs-ac8c8ca54aaed1466255161a3d727dcfade4a7d9.tar.gz tdelibs-ac8c8ca54aaed1466255161a3d727dcfade4a7d9.zip |
Add a knob to use fixed path `iceauth` tool
`system()` and `popen()` may unsafe unless using absolute command path.
Rely on PATH environment variable set by users may result in unwanted tool.
Signed-off-by: OBATA Akio <obache@wizdas.com>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kded')
-rw-r--r-- | kded/khostname.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kded/khostname.cpp b/kded/khostname.cpp index c78152b97..fb7d965bc 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -16,6 +16,8 @@ * Boston, MA 02110-1301, USA. **/ +#include <config.h> + #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> @@ -236,7 +238,7 @@ void KHostName::changeDcop() ::symlink(fname.data(), compatLink.data()); // Compatibility link // Update .ICEauthority - TQString cmd = "iceauth list "+TDEProcess::quote("netid="+oldNetId); + TQString cmd = ICEAUTH_COMMAND " list "+TDEProcess::quote("netid="+oldNetId); FILE *iceFile = popen(TQFile::encodeName(cmd), "r"); if (!iceFile) { @@ -271,7 +273,7 @@ void KHostName::changeDcop() if (netId != oldNetId) continue; - cmd = "iceauth add "; + cmd = ICEAUTH_COMMAND " add "; cmd += TDEProcess::quote(protName); cmd += " '' "; cmd += TDEProcess::quote(newNetId); @@ -288,7 +290,7 @@ void KHostName::changeDcop() char* xauthlocalhostname = getenv("XAUTHLOCALHOSTNAME"); if (!xauthlocalhostname || !oldNetId.contains(xauthlocalhostname)) { - TQString cmd = "iceauth remove "+TDEProcess::quote("netid="+oldNetId); + TQString cmd = ICEAUTH_COMMAND " remove "+TDEProcess::quote("netid="+oldNetId); system(TQFile::encodeName(cmd)); unlink(origFName.data()); origFName = DCOPClient::dcopServerFileOld(oldName); // Compatibility link |