Package: migrationtools
Version: 47-8
Severity: important

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***

Just after installing (and modifying migrate_common.ph in
/etc/migrationtools/, but that's ininfluent), going to
/usr/share/migrationtools and running any command gives something like: 

root@stretch2:/usr/share/migrationtools# ./migrate_base.pl 
Can't locate migrate_common.ph in @INC (did you run h2ph?) (@INC
contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1
/usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24
/usr/share/perl/5.24 /usr/local/lib/site_perl
/usr/lib/x86_64-linux-gnu/perl-base) at ./migrate_base.pl line 39.

and it fail because:

require 'migrate_common.ph';

fails (the simbolic link to /etc/migrationtools/migrate_common.ph is
there).

It can be solved just doing:

ln -s /etc/migrationtools/migrate_common.ph /etc/perl/

but still the package do not work after install.

-- System Information:
Debian Release: 9.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-8-amd64 (SMP w/1 CPU core)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), 
LANGUAGE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages migrationtools depends on:
ii  ldap-utils [openldap-utils]  2.4.44+dfsg-5+deb9u2
ii  perl                         5.24.1-3+deb9u5

migrationtools recommends no packages.

Versions of packages migrationtools suggests:
ii  slapd  2.4.44+dfsg-5+deb9u2

-- Configuration Files:
/etc/migrationtools/migrate_common.ph changed:
$NETINFOBRIDGE = (-x "/usr/sbin/mkslapdconf");
if ($NETINFOBRIDGE) {
        $NAMINGCONTEXT{'aliases'}           = "cn=aliases";
        $NAMINGCONTEXT{'fstab'}             = "cn=mounts";
        $NAMINGCONTEXT{'passwd'}            = "cn=users";
        $NAMINGCONTEXT{'netgroup_byuser'}   = "cn=netgroup.byuser";
        $NAMINGCONTEXT{'netgroup_byhost'}   = "cn=netgroup.byhost";
        $NAMINGCONTEXT{'group'}             = "cn=groups";
        $NAMINGCONTEXT{'netgroup'}          = "cn=netgroup";
        $NAMINGCONTEXT{'hosts'}             = "cn=machines";
        $NAMINGCONTEXT{'networks'}          = "cn=networks";
        $NAMINGCONTEXT{'protocols'}         = "cn=protocols";
        $NAMINGCONTEXT{'rpc'}               = "cn=rpcs";
        $NAMINGCONTEXT{'services'}          = "cn=services";
} else {
        $NAMINGCONTEXT{'aliases'}           = "ou=Aliases";
        $NAMINGCONTEXT{'fstab'}             = "ou=Mounts";
        $NAMINGCONTEXT{'passwd'}            = "ou=People";
        $NAMINGCONTEXT{'netgroup_byuser'}   = "nisMapName=netgroup.byuser";
        $NAMINGCONTEXT{'netgroup_byhost'}   = "nisMapName=netgroup.byhost";
        $NAMINGCONTEXT{'group'}             = "ou=Group";
        $NAMINGCONTEXT{'netgroup'}          = "ou=Netgroup";
        $NAMINGCONTEXT{'hosts'}             = "ou=Hosts";
        $NAMINGCONTEXT{'networks'}          = "ou=Networks";
        $NAMINGCONTEXT{'protocols'}         = "ou=Protocols";
        $NAMINGCONTEXT{'rpc'}               = "ou=Rpc";
        $NAMINGCONTEXT{'services'}          = "ou=Services";
}
$DEFAULT_MAIL_DOMAIN = "truelite.it";
$DEFAULT_BASE = "dc=truelite,dc=it";
$EXTENDED_SCHEMA = 0;
$USE_UTF8 = 1;
if (defined($ENV{'LDAP_BASEDN'})) {
        $DEFAULT_BASE = $ENV{'LDAP_BASEDN'};
}
if (defined($ENV{'LDAP_DEFAULT_MAIL_DOMAIN'})) {
        $DEFAULT_MAIL_DOMAIN = $ENV{'LDAP_DEFAULT_MAIL_DOMAIN'};
}
if (defined($ENV{'LDAP_DEFAULT_MAIL_HOST'})) {
        $DEFAULT_MAIL_HOST = $ENV{'LDAP_DEFAULT_MAIL_HOST'};
}
if (defined($ENV{'LDAP_BINDDN'})) {
        $DEFAULT_OWNER = $ENV{'LDAP_BINDDN'};
}
if (defined($ENV{'LDAP_EXTENDED_SCHEMA'})) {
        $EXTENDED_SCHEMA = $ENV{'LDAP_EXTENDED_SCHEMA'};
}
if (!defined($DEFAULT_BASE)) {
        $DEFAULT_BASE = &domain_expand($DEFAULT_MAIL_DOMAIN);
        $DEFAULT_BASE =~ s/,$//o;
}
if ($EXTENDED_SCHEMA) {
        $DEFAULT_REALM = $DEFAULT_MAIL_DOMAIN;
        $DEFAULT_REALM =~ tr/a-z/A-Z/;
}
if (-x "/usr/sbin/revnetgroup") {
        $REVNETGROUP = "/usr/sbin/revnetgroup";
} elsif (-x "/usr/lib/yp/revnetgroup") {
        $REVNETGROUP = "/usr/lib/yp/revnetgroup";
}
$classmap{'o'} = 'organization';
$classmap{'dc'} = 'domain';
$classmap{'l'} = 'locality';
$classmap{'ou'} = 'organizationalUnit';
$classmap{'c'} = 'country';
$classmap{'nismapname'} = 'nisMap';
$classmap{'cn'} = 'container';
sub parse_args
{
        if ($#ARGV < 0) {
                print STDERR "Usage: $PROGRAM infile [outfile]\n";
                exit 1;
        }
        
        $INFILE = $ARGV[0];
        
        if ($#ARGV > 0) {
                $OUTFILE = $ARGV[1];
        }
}
sub open_files
{
        open(INFILE);
        if ($OUTFILE) {
                open(OUTFILE,">$OUTFILE");
                $use_stdout = 0;
        } else {
                $use_stdout = 1;
        }
}
sub domain_expand
{
        local($first) = 1;
        local($dn);
        local(@namecomponents) = split(/\./, $_[0]);
        foreach $_ (@namecomponents) {
                $first = 0;
                $dn .= "dc=$_,";
        }
        $dn .= $DEFAULT_BASE;
        return $dn;
}
sub uniq
{
        local($name) = shift(@_);
        local(@vec) = sort {uc($a) cmp uc($b)} @_;
        local(@ret);
        local($next, $last);
        foreach $next (@vec) {
                if ((uc($next) ne uc($last)) &&
                        (uc($next) ne uc($name))) {
                        push (@ret, $next);
                }
                $last = $next;
        }
        return @ret;
}
sub getsuffix
{
        local($program) = shift(@_);
        local($nc);
        $program =~ s/^migrate_(.*)\.pl$/$1/;
        $nc = $NAMINGCONTEXT{$program};
        if ($nc eq "") {
                return $DEFAULT_BASE;
        } else {
                return $nc . ',' . $DEFAULT_BASE;
        }
}
sub ldif_entry
{
        local ($HANDLE, $lhs, $rhs) = @_;
        local ($type, $val) = split(/\=/, $lhs);
        local ($dn);
        if ($rhs ne "") {
                $dn = $lhs . ',' . $rhs;
        } else {
                $dn = $lhs;
        }
        $type =~ s/\s*$//o;
        $type =~ s/^\s*//o;
        $type =~ tr/A-Z/a-z/;
        $val =~ s/\s*$//o;
        $val =~ s/^\s*//o;
        print $HANDLE "dn: $dn\n";
        print $HANDLE "$type: $val\n";
        print $HANDLE "objectClass: top\n";
        print $HANDLE "objectClass: $classmap{$type}\n";
        if ($EXTENDED_SCHEMA) {
                if ($DEFAULT_MAIL_DOMAIN) {
                        print $HANDLE "objectClass: domainRelatedObject\n";
                        print $HANDLE "associatedDomain: 
$DEFAULT_MAIL_DOMAIN\n";
                }
        }
        print $HANDLE "\n";
}
sub escape_metacharacters
{
        local($name) = @_;
        # From Table 3.1 "Characters Requiring Quoting When Contained
        # in Distinguished Names", p87 "Understanding and Deploying LDAP
        # Directory Services", Howes, Smith, & Good.
        # 1) Quote backslash
        # Note: none of these are very elegant or robust and may cause
        # more trouble than they're worth. That's why they're disabled.
        # 1.a) naive (escape all backslashes)
        # $name =~ s#\\#\\\\#og;
        #
        # 1.b) mostly naive (escape all backslashes not followed by
        # a backslash)
        # $name =~ s#\\(?!\\)#\\\\#og;
        #
        # 1.c) less naive and utterly gruesome (replace solitary
        # backslashes)
        # $name =~ s{           # Replace
        #               (?<!\\) # negative lookbehind (no preceding backslash)
        #               \\      # a single backslash
        #               (?!\\)  # negative lookahead (no following backslash)
        #       }
        #       {               # With
        #               \\\\    # a pair of backslashes
        #       }gx;
        # Ugh. Note that s#(?:[^\\])\\(?:[^\\])#////#g fails if $name
        # starts or ends with a backslash. This expression won't work
        # under perl4 because the /x flag and negative lookahead and
        # lookbehind operations aren't supported. Sorry. Also note that
        # s#(?:[^\\]*)\\(?:[^\\]*)#////#g won't work either.  Of course,
        # this is all broken if $name is already escaped before we get
        # to it. Best to throw a warning and make the user import these
        # records by hand.
        # 2) Quote leading and trailing spaces
        local($leader, $body, $trailer) = ();
        if (($leader, $body, $trailer) = ($name =~ m#^( *)(.*\S)( *)$#o)) {
                $leader =~ s# #\\ #og;
                $trailer =~ s# #\\ #og;
                $name = $leader . $body . $trailer;
        }
        # 3) Quote leading octothorpe (#)
        $name =~ s/^#/\\#/o;
        # 4) Quote comma, plus, double-quote, less-than, greater-than,
        # and semicolon
        $name =~ s#([,+"<>;])#\\$1#g;
        return $name;
}
1;


-- no debconf information

Reply via email to