summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorAdam Mitz <mitza@objectcomputing.com>2022-09-22 17:58:28 -0500
committerGitHub <noreply@github.com>2022-09-22 17:58:28 -0500
commit0b7e12778ae92315cbd51c901cb8402d6bd646a7 (patch)
tree030bc773180b5c9ffecef6f2659ae29179f9db0e /TAO
parentf980f161749eac82843c44943e6fec229920ba9f (diff)
parent64b5a4fecb5806522f220d63b0744ffa40bb6bcc (diff)
downloadATCD-0b7e12778ae92315cbd51c901cb8402d6bd646a7.tar.gz
Merge pull request #1907 from lukem/format-security
Fix -Wformat-security issues
Diffstat (limited to 'TAO')
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp8
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp6
-rw-r--r--TAO/orbsvcs/tests/HTIOP/test_config.h10
3 files changed, 12 insertions, 12 deletions
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp
index eaad5ff3dc1..cced9d94274 100644
--- a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp
@@ -101,7 +101,8 @@ CORBA::Object_ptr EventChannelFactory_i::create_process (
const int ENV_BUF_LEN = 512;
ACE_TCHAR buf[ENV_BUF_LEN];
server_addr.addr_to_string(buf,ENV_BUF_LEN,0);
- options.setenv(ACE_TEXT("EventChannelFactoryAddr"), buf);
+ options.setenv(ACE_TEXT("EventChannelFactoryAddr"),
+ ACE_TEXT("%") ACE_TEXT_PRIs, buf);
// extract the object ID from the criteria
for (CORBA::ULong i = 0; i < the_criteria.length(); ++i)
@@ -112,7 +113,8 @@ CORBA::Object_ptr EventChannelFactory_i::create_process (
const char* id_str = name[0].id.in();
the_criteria[i].val >>= val;
if (id_str[0] != '-') // environment variable
- options.setenv(ACE_TEXT_CHAR_TO_TCHAR(id_str), ACE_TEXT("%s"), val);
+ options.setenv(ACE_TEXT_CHAR_TO_TCHAR(id_str),
+ ACE_TEXT("%") ACE_TEXT_PRIs, val);
else {// command line option
ACE_OS::sprintf(buf, ACE_TEXT(" %s %s"), id_str, val);
str += buf;
@@ -122,7 +124,7 @@ CORBA::Object_ptr EventChannelFactory_i::create_process (
ORBSVCS_DEBUG((LM_DEBUG, "Command Line : %s\n", str.c_str()));
- options.command_line(str.c_str());
+ options.command_line(ACE_TEXT("%") ACE_TEXT_PRIs, str.c_str());
// Try to create a new process running date.
ACE_Process new_process;
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp
index 18e34e05ea4..4b281396eb3 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp
@@ -537,7 +537,7 @@ ImR_Activator_i::start_server(const char* name,
1,
cmdline_buf_len + 1,
this->env_buf_len_, this->max_env_vars_);
- proc_opts.command_line (ACE_TEXT_CHAR_TO_TCHAR(cmdline));
+ proc_opts.command_line (ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR(cmdline));
proc_opts.working_directory (dir);
// Win32 does not support the CLOSE_ON_EXEC semantics for sockets
// the way unix does, so in order to avoid having the child process
@@ -564,13 +564,13 @@ ImR_Activator_i::start_server(const char* name,
{
CORBA::String_var ior = orb_->object_to_string (locator_.in ());
proc_opts.setenv (ACE_TEXT ("ImplRepoServiceIOR"),
- ACE_TEXT_CHAR_TO_TCHAR (ior.in ()));
+ ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR (ior.in ()));
}
for (CORBA::ULong i = 0; i < env.length (); ++i)
{
proc_opts.setenv (ACE_TEXT_CHAR_TO_TCHAR (env[i].name.in ()),
- ACE_TEXT_CHAR_TO_TCHAR (env[i].value.in ()));
+ ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR (env[i].value.in ()));
}
pid = this->process_mgr_.spawn (proc_opts, this);
diff --git a/TAO/orbsvcs/tests/HTIOP/test_config.h b/TAO/orbsvcs/tests/HTIOP/test_config.h
index 010fff62047..6a0904281cf 100644
--- a/TAO/orbsvcs/tests/HTIOP/test_config.h
+++ b/TAO/orbsvcs/tests/HTIOP/test_config.h
@@ -126,14 +126,12 @@ size_t const ACE_MAX_THREADS = 4;
}
#else /* ! VXWORKS */
-# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
-# define ACE_INIT_LOG_FMT ACE_TEXT ("%ls%ls%ls")
-# else
-# define ACE_INIT_LOG_FMT ACE_TEXT ("%s%s%s")
-# endif /* !ACE_WIN32 && ACE_USES_WCHAR */
#define ACE_INIT_LOG(NAME) \
ACE_TCHAR temp[MAXPATHLEN]; \
- ACE_OS::sprintf (temp, ACE_INIT_LOG_FMT, \
+ ACE_OS::sprintf (temp, \
+ ACE_TEXT ("%") ACE_TEXT_PRIs \
+ ACE_TEXT ("%") ACE_TEXT_PRIs \
+ ACE_TEXT ("%") ACE_TEXT_PRIs, \
ACE_LOG_DIRECTORY, \
ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \
ACE_LOG_FILE_EXT_NAME); \