Results 1 to 5 of 5

Thread: ldapscripts awk errors in 12.04LTS

  1. #1
    Join Date
    Apr 2006
    Location
    Silicon Valley
    Beans
    19

    ldapscripts awk errors in 12.04LTS

    I had ldap setup and ldapscripts working in 10.04LTS. After upgrading to 12.04LTS, ldapscripts (all commands) bork out with these errors:

    Code:
    sudo ldapaddgroup testgroup
    awk: cmd. line:1: /^[ \t]*host/ sub(/^[ \t]*host[ \t]*/
    awk: cmd. line:1:                                      ^ unexpected newline or end of string
    awk: /^[ \t]*host/ ""); sub(/[ \t]*(#.*)?$/
    awk:                 ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: cmd. line:1: /^[ \t]*host/ ""); sub(/[ \t]*(#.*)?$/
    awk: cmd. line:1:                                       ^ unexpected newline or end of string
    awk: /^[ \t]*host/  ""); print $0
    awk:                  ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: /^[ \t]*host/  ""); print $0
    awk:                     ^ syntax error
    awk: cmd. line:1: /^[ \t]*uri/ sub(/^[ \t]*uri[ \t]*/
    awk: cmd. line:1:                                    ^ unexpected newline or end of string
    awk: /^[ \t]*uri/ ""); sub(/[ \t]*(#.*)?$/
    awk:                ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: cmd. line:1: /^[ \t]*uri/ ""); sub(/[ \t]*(#.*)?$/
    awk: cmd. line:1:                                      ^ unexpected newline or end of string
    awk: /^[ \t]*uri/  ""); print $0
    awk:                 ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: /^[ \t]*uri/  ""); print $0
    awk:                    ^ syntax error
    awk: cmd. line:1: /^[ \t]*rootbinddn/ sub(/^[ \t]*rootbinddn[ \t]*/
    awk: cmd. line:1:                                                  ^ unexpected newline or end of string
    awk: /^[ \t]*rootbinddn/ ""); sub(/[ \t]*(#.*)?$/
    awk:                       ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: cmd. line:1: /^[ \t]*rootbinddn/ ""); sub(/[ \t]*(#.*)?$/
    awk: cmd. line:1:                                             ^ unexpected newline or end of string
    awk: /^[ \t]*rootbinddn/  ""); print $0
    awk:                        ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: /^[ \t]*rootbinddn/  ""); print $0
    awk:                           ^ syntax error
    awk: cmd. line:1: /^[ \t]*base/ sub(/^[ \t]*base[ \t]*/
    awk: cmd. line:1:                                      ^ unexpected newline or end of string
    awk: /^[ \t]*base/ ""); sub(/[ \t]*(#.*)?$/
    awk:                 ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: cmd. line:1: /^[ \t]*base/ ""); sub(/[ \t]*(#.*)?$/
    awk: cmd. line:1:                                       ^ unexpected newline or end of string
    awk: /^[ \t]*base/  ""); print $0
    awk:                  ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: /^[ \t]*base/  ""); print $0
    awk:                     ^ syntax error
    awk: cmd. line:1: /^[ \t]*nss_base_group/ sub(/^[ \t]*nss_base_group[ \t]*/
    awk: cmd. line:1:                                                          ^ unexpected newline or end of string
    awk: /^[ \t]*nss_base_group/ ""); sub(/[ \t]*(#.*)?$/
    awk:                           ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: cmd. line:1: /^[ \t]*nss_base_group/ ""); sub(/[ \t]*(#.*)?$/
    awk: cmd. line:1:                                                 ^ unexpected newline or end of string
    awk: /^[ \t]*nss_base_group/  ""); print $0
    awk:                            ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: /^[ \t]*nss_base_group/  ""); print $0
    awk:                               ^ syntax error
    awk: cmd. line:1: /^[ \t]*nss_base_passwd/ sub(/^[ \t]*nss_base_passwd[ \t]*/
    awk: cmd. line:1:                                                            ^ unexpected newline or end of string
    awk: /^[ \t]*nss_base_passwd/ ""); sub(/[ \t]*(#.*)?$/
    awk:                            ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: cmd. line:1: /^[ \t]*nss_base_passwd/ ""); sub(/[ \t]*(#.*)?$/
    awk: cmd. line:1:                                                  ^ unexpected newline or end of string
    awk: /^[ \t]*nss_base_passwd/  ""); print $0
    awk:                             ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: /^[ \t]*nss_base_passwd/  ""); print $0
    awk:                                ^ syntax error
    awk: cmd. line:1: /^[ \t]*nss_base_hosts/ sub(/^[ \t]*nss_base_hosts[ \t]*/
    awk: cmd. line:1:                                                          ^ unexpected newline or end of string
    awk: /^[ \t]*nss_base_hosts/ ""); sub(/[ \t]*(#.*)?$/
    awk:                           ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: cmd. line:1: /^[ \t]*nss_base_hosts/ ""); sub(/[ \t]*(#.*)?$/
    awk: cmd. line:1:                                                 ^ unexpected newline or end of string
    awk: /^[ \t]*nss_base_hosts/  ""); print $0
    awk:                            ^ syntax error
    awk: each rule must have a pattern or an action part
    awk: /^[ \t]*nss_base_hosts/  ""); print $0
    awk:                               ^ syntax error
    Error adding group testgroup to LDAP
    After that I purged ldapscripts, reinstalled/reconfigured from scratch, checked and rechecked everything, but awk errors remain and ldapscripts don't work.

    Any thoughts?
    Last edited by iva2k; September 13th, 2013 at 06:18 AM.

  2. #2
    Join Date
    Apr 2006
    Location
    Silicon Valley
    Beans
    19

    Re: ldapscripts awk errors in 12.04LTS

    Digging further, I removed gawk package to fall back on mawk, and errors changed to:
    Code:
    $ sudo ldapaddgroup testgroup
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: syntax error at or near print
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: syntax error at or near print
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: syntax error at or near print
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: syntax error at or near print
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: syntax error at or near print
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: syntax error at or near print
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: missing ) near end of line
    awk: line 1: extra ')'
    awk: line 1: syntax error at or near print
    Error adding group testgroup to LDAP
    I can't believe that ldapscripts package could be broken and nobody noticed - there must be something else in the setup that triggers the error.

  3. #3
    Join Date
    Apr 2006
    Location
    Silicon Valley
    Beans
    19

    Re: ldapscripts awk errors in 12.04LTS

    There appears to be a bug in Ubuntu/debian patch to ldapscripts that borks trying to load configuration from /etc/ldap.conf.

    Help thyself:

    Code:
    sudo cp /usr/share/ldapscripts/runtime.debian /usr/share/ldapscripts/runtime.debian.orig
    sudo -b gedit /usr/share/ldapscripts/runtime.debian
    Find the line in getfield function:
    Code:
    	local value="$(awk "/^[ \t]*$field/ {sub(/^[ \t]*$field[ \t]*/,\"\"); sub(/[ \t]*(#.*)?\$/, \"\"); print \$0}" "$conffile")"
    And change it to:
    Code:
    	local value=$(awk "/^[ \t]*$field/ {sub(/^[ \t]*$field[ \t]*/,\"\"); sub(/[ \t]*(#.*)?\$/, \"\"); print \$0}" "$conffile")
    The change is simply to remove quotes around $(...). I wonder how it was tested and passed?

  4. #4
    Join Date
    Apr 2006
    Location
    Silicon Valley
    Beans
    19

    Re: ldapscripts awk errors in 12.04LTS


  5. #5
    Join Date
    Apr 2006
    Location
    Silicon Valley
    Beans
    19

    Re: ldapscripts awk errors in 12.04LTS

    [removed]

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •