Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Installing OVALdi under Solaris

Help
Igor Prata
2011-01-05
2013-06-12
  • Igor Prata
    Igor Prata
    2011-01-05

    Hello,

    I am trying to install OVALDI under a Solaris SO (many of them, Open Solaris, Oracle Solaris 11 Express, Open Indiana…).

    In my Virtual Machines I receive the following configure error from Xerces Lib:

    # ./configure -prefix=/usr/local/xerces
    (…)
    checking whether the compiler has the CPUID intrinsic… no
    checking whether the compiler has the _get_cpuid intrinsic… no
    checking whether the compiler has the SSE2 intrinsic… no
    configure: creating ./config.status
    ./config.status: line 531: syntax error at line 534: `<<' unmatched

    And the following in the Xalan compilation:

    # make
    make -C src/xalanc all
    make: Entering directory `/root/xml-xalan/c/src/xalanc'
    Makefile:126: /version.incl: No such file or directory
    make: *** No rule to make target `/version.incl'.  Stop.
    make: Leaving directory `/root/xml-xalan/c/src/xalanc'
    make: ***  Error 2

    Any one succeeds installing Ovaldi on Solaris?

    Best Regards,

    Igor Prata

    www.modulo.com
    www.modsic.org

     
  • I've built xerces and xalan on solaris (9 and 10) several times.  I peeked into config.status, and it looked like the complaint is coming from a heredoc.  It's always worked for me, so I can't readily explain why the heredoc is causing a problem.  One thing that I noticed is that you aren't building the libraries in the intended way.  There are instructions at http://xerces.apache.org/xerces-c/build-winunix-2.html#UNIX and http://xml.apache.org/xalan-c/build_instruct.html#unix you might read through and see if it helps.  E.g. you aren't supposed to run configure directly; there is a runConfigure script they want you to use.  There are some environment variables you're supposed to set up before building.  I think the xalan build error is probably due to an incorrect environment.

    Try following their instructions for building and see if it helps.

     
  • Juan Castro
    Juan Castro
    2011-01-06

    Hello, I'm working with Igor in this project.

    Xerces 3.1.1 doesn't have a runConfigure script like the one described in the instructions you linked. Instead, its HTML instructions (found inside the .tar.gz) say to run… ./configure. Moreover, its recommended options don't include a Solaris/gcc combination, only Solaris/Sun cc.

    I'm going to try with Xerces 2.8 instead.

     
  • Juan Castro
    Juan Castro
    2011-01-06

    Now Xerces and Xalan compile and install OK. But when compiling OVALdi, I get the error below. Looks like a Gcrypt compatibility issue. (I'm using the one that came with Solaris 11.)

    g++  -Wall -O -DBSD_COMP -DSUNOS -I/usr/local/include -I/usr/include -I/usr/include/pcre -I/usr/local/xerces/include -I/usr/local/xalan/include -I../../src/solaris -I../../src -I../../src/probes/unix -I../../src/probes/solaris -I../../src/probes/independent  -c -o ../../src/Digest.o ../../src/Digest.cpp
    ../../src/Digest.cpp:64: error: `GcryMDHd' does not name a type
    ../../src/Digest.cpp: In member function `void Digest::initDigest(void**, Digest::DigestType)':
    ../../src/Digest.cpp:113: error: `GcryMDHd' undeclared (first use this function)
    ../../src/Digest.cpp:113: error: (Each undeclared identifier is reported only once for each function it appears in.)
    ../../src/Digest.cpp:113: error: expected `;' before "hd"
    ../../src/Digest.cpp:117: error: `hd' undeclared (first use this function)
    ../../src/Digest.cpp:117: error: invalid conversion from `int' to `gcry_md_handle**'
    /usr/include/gcrypt.h:1109: error: too few arguments to function `gcry_error_t gcry_md_open(gcry_md_handle**, int, unsigned int)'
    ../../src/Digest.cpp:117: error: at this point in file
    ../../src/Digest.cpp:129: error: 'struct <unnamed>::DigestContext' has no member named 'hd'
    ../../src/Digest.cpp: In member function `void Digest::updateDigest(void*, void*, size_t)':
    ../../src/Digest.cpp:137: error: 'struct <unnamed>::DigestContext' has no member named 'hd'
    ../../src/Digest.cpp: In member function `std::string Digest::getDigestResults(void*)':
    ../../src/Digest.cpp:145: error: 'struct <unnamed>::DigestContext' has no member named 'hd'
    ../../src/Digest.cpp: In member function `void Digest::freeDigest(void*)':
    ../../src/Digest.cpp:155: error: 'struct <unnamed>::DigestContext' has no member named 'hd'
    make: ***  Error 1

     
  • Juan Castro
    Juan Castro
    2011-01-06

    …and installing the latest libgcrypt from GNU and putting -I/usr/local/gcrypt/include and -L/usr/local/gcrypt/lib in front within the makefile doesn't help - same error.

     
  • Ah ok.  The version of ovaldi we distribute does not support Xerces 3.x.  It requires 2.x.

    I have not tried to build ovaldi on Solaris 11.  Solaris 10 had an old version of libgcrypt which required some special hacks to work.  Maybe a newer version of libgcrypt is bundled with Solaris 11 and no longer requires the hacks.  If you want to edit the source, you might try editing Digest.cpp and look for the '#if defined SUNOS' parts and remove those hacks.  But Solaris 11 is not officially supported, and it sounds like ovaldi just doesn't build on that platform as-is.

     
  • Juan Castro
    Juan Castro
    2011-01-06

    Thanks Michael! That did the trick. I have OVALdi running on Solaris 11 now!

     
  • Juan Castro
    Juan Castro
    2011-01-07

    HOW TO INSTALL OVALDI ON SOLARIS 11:

    Tested on Solaris 11 Express, gcc/g++ compiler. This may work for other versions of Solaris 11 (e.g. OpenIndiana), but you may have to install pcre and/or libgcrypt by hand. In my system, pcre came without the include files, so I had to grab "headers-pcre" from the package manager.

    - Download Xalan 1.10.0 sources from http://www.apache.org/dyn/closer.cgi/xml/xalan-c
    - Download Xerces 2.8.0 (NOT the 3.x version!) from http://xerces.apache.org/xerces-c/download.cgi
    - Download OVALdi 5.8.2 from http://sourceforge.net/projects/ovaldi/files/ovaldi/5.8%20Build%202/

    - Installing Xerces:

      su -
      cd /usr/src
      gzcat <download-path>/xerces-c-src_2_8_0.tar.gz | tar xvf -
      export XERCESCROOT=/usr/src/xerces-c-src_2_8_0
      cd $XERCESCROOT
      cd src/xercesc
      sh runConfigure -p solaris -c gcc -x g++ -P /usr/local
      make && make install
    

    - Installing Xalan

      su -
      cd /usr/src
      gzcat <download-path>/Xalan-C_1_10_0-src.tar.gz | tar xvf -
      export XERCESCROOT=/usr/local
      export XALANCROOT=/usr/src/xml-xalan/c
      cd $XALANCROOT
      sh runConfigure -p solaris -c gcc -x g++ -P /usr/local
      make && make install
    

    - Building OVALdi

      su -
      cd /usr/src
      bzcat <download-path>/ovaldi-5.8.2-src.tar.bz2 | tar xvf -
      cd ovaldi-5.8.2-src
    

      Edit src/Digest.cpp, replace all instances of "#if defined SUNOS" with "#if defined WAYOLDSUNOS"

      cd project/solaris
    

      Edit Makefile and include -I/usr/include/pcre in the INCDIRS list

      make
    

    - You now have a working ovaldi executable in /usr/src/ovaldi-5.8.2-src/project/solaris/Release. To run it, the LD_LIBRARY_PATH variable must contain the path /usr/local/lib. The safest way to run it is with

      LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH <path-to-executable>/ovaldi
    
     
  • Juan Castro
    Juan Castro
    2011-01-10

    Please add the following at the end (after the LD_LIBRARY_PATH stuff). Or, alternatively, how do I get edit access to the wiki?

    Or, better yet, add /usr/local/lib permanently to the system library search path with the following command:

    crle -l /usr/local/lib -u
    

    WARNING: If you forget the -u switch above your system will become UNUSABLE!

     
  • Juan Castro
    Juan Castro
    2011-01-12

    Trying to compile under Solaris 10 now. Got gcc and all the development stuff from sunfreeware.com. With or without the SUNOS hack, I get errors.

    With hack:

    g++  -Wall -O -DBSD_COMP -DSUNOS -I/usr/local/include -I/usr/include -I../../src/solaris -I../../src -I../../src/probes/unix -I../../src/probes/solaris -I../../src/probes/independent  -c -o ../../src/Digest.o ../../src/Digest.cpp
    ../../src/Digest.cpp:64: warning: `GcryMDHd' is deprecated (declared at /usr/local/include/gcrypt.h:1196)
    ../../src/Digest.cpp: In member function `void Digest::initDigest(void**, Digest::DigestType)':
    ../../src/Digest.cpp:113: warning: `GcryMDHd' is deprecated (declared at /usr/local/include/gcrypt.h:1196)
    ../../src/Digest.cpp:117: error: invalid conversion from `int' to `gcry_md_handle**'
    /usr/local/include/gcrypt.h:1202: error: too few arguments to function `gcry_error_t gcry_md_open(gcry_md_handle**, int, unsigned int)'
    ../../src/Digest.cpp:117: error: at this point in file
    ../../src/Digest.cpp:117: error: invalid conversion from `gcry_error_t' to `gcry_md_handle*'
    make: ** [../../src/Digest.o] Erro 1
    

    Without hack:

    g++  -Wall -O -DBSD_COMP -DSUNOS -I/usr/local/include -I/usr/include -I../../src/solaris -I../../src -I../../src/probes/unix -I../../src/probes/solaris -I../../src/probes/independent  -c -o ../../src/Digest.o ../../src/Digest.cpp
    ../../src/Digest.cpp: In member function `int Digest::getDigest(Digest::DigestType)':
    ../../src/Digest.cpp:171: error: `GCRY_MD_SHA224' was not declared in this scope
    ../../src/Digest.cpp:171: warning: unused variable 'GCRY_MD_SHA224'
    make: ** [../../src/Digest.o] Erro 1
    
     
  • Juan Castro
    Juan Castro
    2011-01-12

    No, scratch that. I shouldn't have installed libgcrypt from sunfreeware. Removed it and now (with hack) it works. Although I get a strange warning when linking:

    ld: warning: global symbol `_END_' has non-global binding:
            (file /usr/local/lib/libpcre.so value=LOCL);
    ld: warning: global symbol `_START_' has non-global binding:
            (file /usr/local/lib/libpcre.so value=LOCL);
    
     
  • Juan Castro
    Juan Castro
    2011-01-31

    Another problem: we are in need of running OVALdi 5.6 on Solaris 10. It doesn`t even have a makefile for solaris, only for WIndows and Linux. Trying to use the Linux makefile gives me this. (After adding the include and lib dirs for OpenSSL and PCRE.)

    Has anybody ever built OVALdi 5.6.x on Solaris 10?

    [b]g++ -c -Wall -O -DSUNOS  -I/usr/include/pcre -I/usr/local/ssl/include -I/usr/local/include -I/usr/include -I../../src/linux -I../../src -I../../src/probes/unix -I../../src/probes/linux -I../../src/probes/independent -o ./Release/obj/Main.obj ../../src/Main.cpp[/b]
    In file included from ../../src/linux/ProbeFactory.h:69,
                     from ../../src/linux/ObjectCollector.h:36,
                     from ../../src/linux/DataCollector.h:35,
                     from ../../src/Main.h:63,
                     from ../../src/Main.cpp:31:
    ../../src/probes/independent/LDAPProbe.h:86: error: ISO C++ forbids declaration of `LDAP' with no type
    ../../src/probes/independent/LDAPProbe.h:86: error: expected `;' before '*' token
    ../../src/probes/independent/LDAPProbe.h:92: error: `LDAP' has not been declared
    ../../src/probes/independent/LDAPProbe.h:92: error: ISO C++ forbids declaration of `ldap' with no type
    ../../src/probes/independent/LDAPProbe.h:228: error: `ULONG' has not been declared
    ../../src/probes/independent/LDAPProbe.h:228: error: ISO C++ forbids declaration of `error' with no type
    ../../src/probes/independent/LDAPProbe.h:289: error: ISO C++ forbids declaration of `LDAP' with no type
    ../../src/probes/independent/LDAPProbe.h:289: error: expected `;' before '*' token
    In file included from ../../src/linux/SystemInfo.h:58,
                     from ../../src/linux/DataCollector.h:36,
                     from ../../src/Main.h:63,
                     from ../../src/Main.cpp:31:
    /usr/include/net/if.h:99: error: template argument required for `struct map'
    ../../src/Main.cpp: In function `int main(int, char**)':
    ../../src/Main.cpp:200: error: `STRNICMP' was not declared in this scope
    
     
  • Danny Haynes
    Danny Haynes
    2011-02-01

    The Solaris and Mac OSX ports were not introduced until ovaldi-5.7.2.  Some of the errors have to do with not having the header file (ldap.h) from the OpenLDAP library and others were addressed when we ported the OVAL Interpreter to Solaris.  Is there a specific reason why you need to use ovaldi-5.6.x rather than ovaldi-5.8.2?  There have been a lot of changes and additions made to the OVAL Interpreter since then.

     
  • Juan Castro
    Juan Castro
    2011-02-01

    Can I use the 5.8 executable with the schemas that came with 5.6?

     
  • Danny Haynes
    Danny Haynes
    2011-02-02

    The OVAL Language maintains backwards compatibility across minor releases.  This means OVAL 5.6 content should be valid against the OVAL 5.8 schemas except where backwards compatibility had to be broken to fix critical defects under the Exceptions clause of the OVAL Language Versioning Methodology (http://oval.mitre.org/language/about/versioning.html) and where constructs were removed under the OVAL Language Deprecation Policy (http://oval.mitre.org/language/about/deprecation.html).  What I would recommend here is that you write your content for OVAL 5.6 and run it using ovaldi-5.8.2 assuming that the content you are writing does not include constructs that have been modified in later versions of the language.  Otherwise, if you need to target OVAL 5.6, trying to build ovaldi-5.6.x on Solaris is probably your best option.

     
  • Modys
    Modys
    2012-02-02

    you may have to install gmake, pcre 8.12  , libgpgerror1.8   and/or libgcrypt 1.4.6 from sunfreeware first in this sequence. working great on T5XXXX amd M5000 SUN HW.