Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration error "Can't use 'defined(@array)'" starting OpenCA. #4

Open
kmorwath opened this issue Jan 11, 2017 · 2 comments
Open

Comments

@kmorwath
Copy link

Running init.d/openca start, for a new clean installation, I get:

Configuration error: The loading of the command /opt/openca/lib/openca/cmds/ldapCreateCSR failed. Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at (eval 154) line 60, chunk 1.

OS: Ubuntu 16 LTS

Perl version: This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux-gnu-thread-multi
(with 58 registered patches, see perl -V for more detail)

@kmorwath
Copy link
Author

Simply removing defined looks to work.

@redbrain17
Copy link

redbrain17 commented Jan 10, 2018

Run into the same issue on this lines:

+++ /opt/openca-1.3/lib/openca/cmds/ldapCreateCSR       2018-01-10 13:24:25.120866506 +0100
@@ -57,7 +57,7 @@
                          DN        => $dn,
                          ATTRIBUTE => $elements [$i-1]);
         generalError ($ldap->errno, $ldap->errval)
-            if (not defined @values and $ldap->errno);
+            if (not @values and $ldap->errno);

         foreach my $value (@values)
         {
             ## RFC2253: / must not be escaped
@@ -88,7 +88,7 @@
                          DN        => $dn,
                          ATTRIBUTE => $subjectalt_attr[$i-1]);
         generalError ($ldap->errno, $ldap->errval)
-            if (not defined @values and $ldap->errno);
+            if (not @values and $ldap->errno);
         foreach my $value (@values)
         {
             push (@san, $subjectalt_attr[$i-1].":".$value);
@@ -109,7 +109,7 @@
                          DN        => $dn,
                          ATTRIBUTE => $attr);
         generalError ($ldap->errno, $ldap->errval)
-           if (not defined @values and $ldap->errno);
+           if (not @values and $ldap->errno);
         if (scalar @values)
         {
             foreach my $value (@values)
@@ -130,7 +130,7 @@
                          DN        => $dn,
                          ATTRIBUTE => "role");
     generalError ($ldap->errno, $ldap->errval)
-        if (not defined @roles and $ldap->errno);
+        if (not @roles and $ldap->errno);

     $role = $roles[0] if (scalar @roles);

     ## build CSR header

After this fix openca is running somehow

ps -auxw | grep openca
www-data 24230  0.0  3.4 145236 71688 pts/0    S    13:02   0:00 /usr/bin/perl /opt/openca-1.3/etc/openca/openca_start
www-data 26647  0.0  3.4 145580 71924 pts/0    S    13:16   0:00 /usr/bin/perl /opt/openca-1.3/etc/openca/openca_start

But still can't access web fronted (possible another issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants