[ace-users] ACE_Service_Config: quoting args
Johnny Willemsen
jwillemsen at remedy.nl
Tue Jun 26 07:17:43 CDT 2007
Hi,
Thanks for using the PRF form, can you rework you test to something as under
ACE_wrappers/tests or add it to an existing test, then we can add this to
the repo. I think you should only check a define whether the xml svc config
is enabled or not.
Regards,
Johnny Willemsen
Remedy IT
Postbus 101
2650 AC Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl
*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl ***
*** Commercial service and support for ACE/TAO/CIAO ***
*** See http://www.theaceorb.nl/en/support.html ***
> ACE VERSION: 5.5.8
>
> HOST MACHINE and OPERATING SYSTEM:
> Linux xxx 2.6.11-ivlsmp #1 SMP Wed Jun 29 18:06:23 EEST 2005 i686 i686
> i386 GNU/Linux
> gcc (GCC) 3.3.3 20040412 (ASPLinux 3.3.3-7)
>
> TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> COMPILER NAME AND VERSION (AND PATCHLEVEL):
>
> THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
> specific file, simply state which one]:
> #ifndef IVL_ACE_CONFIG_H
> #define IVL_ACE_CONFIG_H
>
> #if defined(DOXYGEN)
> # include <ace/config-doxygen.h>
> #elif defined(_WIN32)
> # include <ace/config-win32.h>
> #elif defined(__linux__)
> # include <ace/config-linux.h>
> #elif defined(__sun__)
> //# include <ace/config-sunos5.7.h>
> # include <ace/config-sunos5.8.h>
> //# include <ace/config-sunos5.9.h>
> //# include <ace/config-sunos5.10.h>
> #else
> # error "Unknown platform. Edit ace/config.h file to specify used
> platform."
> #endif
>
> #endif // IVL_ACE_CONFIG_H
>
> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
> use a link to a platform-specific file, simply state which one
> (unless this isn't used in this case, e.g., with Microsoft Visual
> C++)]:
> platform_linux.GNU
>
> CONTENTS OF
> $ACE_ROOT/bin/MakeProjectCreator/config/default.features
> (used by MPC when you generate your own makefiles):
> dummy_label = 0
> acexml = 1
> zlib = 1
> uses_wchar = 0
> expat = 1
> regex = 1
> png = 1
> jpeg = 1
> tiff = 1
> ssl = 1
> qos = 1
> sctp = 1
> cidl = 1
> negotiate_codesets=1
> gui = 1
> wxWindows = 1
> boost = 1
> x11 = 1
> xt = 0
> tk = 0
> fl = 0
> qt = 0
> gl = 1
> gtk = 1
> ace_qtreactor = 0
> ace_xtreactor = 0
> ace_tkreactor = 0
> ace_flreactor = 0
> tao_qtresource = 0
> tao_xtresource = 0
> tao_tkresource = 0
> tao_flresource = 0
>
> AREA/CLASS/EXAMPLE AFFECTED:
> [What example failed? What module failed to compile?]
>
> DOES THE PROBLEM AFFECT:
> COMPILATION? NO
> LINKING? NO
> EXECUTION? YES
> OTHER (please specify)?
> [Please indicate whether ACE, your application, or both are affected.]
>
> SYNOPSIS:
> Command line arguments with spaces are not properly processed.
>
> DESCRIPTION:
> Test program (see below) output:
>
> (null): line :1 col: 22 ACEXML: (6625|3084793536)
> ACEXML_SAXParseException: Internal Parser error
> ACEXML: (6625|3084793536) ACEXML_SAXParseException: Internal Parser
> error
> ACE (6625|3084793536) process_directive: Invalid argument
>
> REPEAT BY:
> // test.cpp
> #include <ace/Service_Config.h>
> #include <ace/ARGV.h>
>
> int
> ACE_TMAIN (int argc, ACE_TCHAR * argv[])
> {
> ACE_ARGV args;
> args.add(argv[0], true);
> args.add(ACE_TEXT("-S"));
> args.add(
> ACE_TEXT("'<ACE_Svc_Conf>")
> ACE_TEXT("<dynamic id=\"ACE_Logger\"")
> ACE_TEXT(" type=\"Service_Object\">")
> ACE_TEXT("<initializer path=\"ACE\"")
> ACE_TEXT(" init=\"_make_ACE_Logging_Strategy\"")
> ACE_TEXT(" params=\"-p
> ~TRACE|~DEBUG|INFO|WARNING|NOTICE|ERROR|
> CRITICAL|ALERT\"/>")
> ACE_TEXT("</dynamic>")
> ACE_TEXT("</ACE_Svc_Conf>'")
> );
>
> return ACE_Service_Config::open(args.argc(), args.argv(),
> ACE_DEFAULT_LOGGER_KEY,
> 1, 1);
> }
>
> SAMPLE FIX/WORKAROUND:
> In file ace/Service_Config.cpp in method
> ACE_Service_Config::parse_args_i(int argc, ACE_TCHAR *argv[]):
>
> superargv.add (argv[0]);
> superargv.add ( argv[getopt.opt_ind () - 1]);
> superargv.add (argv[c-1]);
>
> should be changed to
>
> superargv.add (argv[0], true);
> superargv.add ( argv[getopt.opt_ind () - 1], true);
> superargv.add (argv[c-1], true);
>
>
> --
> Pavel Zaichenko
> Chief Expert,
> IVL Equipment & Engineering, Ltd.
> Phone: +380(44)451-87-33
> mailto:zpf at ivl.ua
> mailto:zpf at ivl.kiev.ua
> http://www.ivl.ua/
>
More information about the Ace-users
mailing list