[PATCH] Add support for MS Catalog files

Andreas Schneider asn at samba.org
Wed Aug 8 05:41:10 UTC 2018


On Tuesday, 7 August 2018 21:21:07 CEST Jeremy Allison wrote:
> On Tue, Aug 07, 2018 at 11:40:39AM +0200, Andreas Schneider wrote:
> > Updated patchset attached.
> > 
> > 
> > Thanks for the review!
> 
> LGTM. Really nice, clean code - thanks !
> 
> Reviewed-by: Jeremy Allison <jra at samba.org>
> 
> However, it adds a dependency on the package libtasn1-bin
> for the ans1Parser program.
> 
> You'll need to get root at sn-devel to install that,
> or change the patch to gate the compilation of this binary on
> availability of libtasn1-bin, as currently it won't
> configure without it.

First the checks for libtasn1 are if-guarded. So if it isn't found it wont 
build it. See the code below.

However gnutls-devel (>= 3.4) requires libtasn1-devel. So if I remove 
libtasn1-devel, gnutls-devel will be removed too and then you get:

Checking for gnutls >= 3.4.7                                                      
: not found                                                                            
source4/lib/tls/wscript:28: error: the configuration failed (see '/home/asn/
workspace/projects/samba/bin/config.log')

At least if you build the AD DC with a relatively recent GnuTLS version. sn-
devel still has GnuTLS 2.2.


If you configure --without-ad-dc support and remove gnutls-devel I get:

Checking for system libtasn1 (>=3.8)                                              
: not found
Checking for library gnutls                                                       
: not found
Checking for gnutls_pkcs7_get_embedded_data_oid                                   
: not found
Checking for macro gnutls_pkcs7_get_embedded_data_oid                             
: not found


It doesn't look for asn1Parser as libtasn1-devel is not installed.

make -j
'build' finished successfully (59.878s)




> > +++ b/lib/mscat/wscript
> > @@ -0,0 +1,42 @@
> > +#!/usr/bin/env python
> > +
> > +import os
> > +import Logs
> > +import sys
> > +
> > +def configure(conf):
> > +    pkg_name = 'libtasn1'
> > +    pkg_minversion = '3.8'
> > +
> > +    if conf.CHECK_BUNDLED_SYSTEM_PKG(pkg_name,
> > minversion=pkg_minversion):
> > +        if not conf.find_program('asn1Parser', var='ASN1PARSER'):
> > +            Logs.error('ERROR: You need to make sure asn1Parser is
> > available') +            sys.exit(1)

if-guarded checks for the library.

> > +    conf.CHECK_FUNCS_IN('gnutls_pkcs7_get_embedded_data_oid', 'gnutls')
> > +
> > +def build(bld):
> > +    if bld.CONFIG_SET('HAVE_LIBTASN1') and
> > bld.CONFIG_SET('HAVE_GNUTLS_PKCS7_GET_EMBEDDED_DATA_OID'): +       

Also if guarded that if one feature is not present it won't build.

> > bld.SAMBA_GENERATOR('MSCAT_PARSER',
> > +                            source='mscat.asn',
> > +                            target='mscat_asn1_tab.c',
> > +                            rule='${ASN1PARSER} --output ${TGT} ${SRC}',
> > +                            group='build_source')
> > +
> > +        bld.SAMBA_LIBRARY('mscat',
> > +                          source='''
> > +                                 mscat_asn1_tab.c
> > +                                 mscat_ctl.c
> > +                                 mscat_pkcs7.c
> > +                                 ''',
> > +                          deps='''
> > +                               talloc
> > +                               gnutls
> > +                               libtasn1
> > +                               samba-util
> > +                               ''',
> > +                          private_library=True)
> > +
> > +        bld.SAMBA_BINARY('dumpmscat',
> > +                         source='dumpmscat.c',
> > +                         deps='mscat')


-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D





More information about the samba-technical mailing list