Package: lbdb
Version: 0.51.1-1
Severity: normal
X-Debbugs-Cc: d...@darkboxed.org

Hi Roland,

I'm trying to use lbdb for Debian work, but I found some of my queries are
not returning results.

In particular uid queries work and I belive I tested with those when
writing my config eons ago. However having since found myself also needing
to lookup people by name I was always frustrated by the no results problem,
but usually too focused to look into it.

Now I have and it seems the smelly eval in the middle of lbdbq is to blame.

Looking into the history I find your

commit a5d53a802c5cc3fe288a3ae7640d9cccf0b5b762

Hopefully the quoting of $@ now works...

1 file changed, 1 insertion(+), 1 deletion(-)
lbdbq.sh.in | 2 +-

modified   lbdbq.sh.in
@@ -55,7 +55,7 @@ for method in $METHODS ; do
 done
 
 for method in $METHODS ; do
-  eval ${method}_query "$@" >> $collection || true
+  eval ${method}_query \""$@"\" >> $collection || true
 done


Regrettably I must inform you that this did not seem to make the quoting
work :-).

Instead I submit to you the idea to
just-not-use-eval-at-all-ever-as-it's-rarely-really-actually-needed^TM:

-   eval ${method}_query \""$@"\" >> "$collection" || true
+   ${method}_query "$@" >> "$collection" || true

This seems to fix my problem at least, but I'm not sure passing the $@ args
individually is the behaviour you intended?

--Daniel

PS: Thanks for lbdb.
I really like the whole concept of it if it would only work <3

-- System Information:
Debian Release: 12.10
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-18-amd64 (SMP w/32 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lbdb depends on:
ii  libc6        2.36-9+deb12u10
ii  libvformat0  1.13-12
ii  perl         5.36.0-7+deb12u1

lbdb recommends no packages.

Versions of packages lbdb suggests:
pn  abook                <none>
ii  elpa-lbdb            0.51.1-1
ii  finger               0.17-17
pn  goobook              <none>
pn  khard                <none>
ii  libauthen-sasl-perl  2.1600-3
ii  libnet-ldap-perl     1:0.6800+dfsg-1
pn  libpalm-perl         <none>
pn  maildir-utils        <none>
ii  mutt                 2.2.12-0.1~deb12u1
pn  procmail             <none>

-- Configuration Files:
/etc/lbdb.rc changed:
METHODS="m_gpg m_ldap"
LDAP_NICKS="debian"

/etc/lbdb_ldap.rc changed:
%ldap_server_db = (
    'debian' => [
        'ldaps://db.debian.org',
        'ou=users,dc=debian,dc=org',
        'uid cn sn ircnick',
        'uid cn sn ircnick',
        '${uid}@debian.org',
        '${cn} ${sn}', '${ircnick}'
    ],
);
$ldap_server = 'ldaps://db.debian.org';
$search_base = 'ou=users,dc=debian,dc=org';
$ldap_search_fields = 'uid cn sn ircnick';
$ldap_expected_answers = 'uid cn sn ircnick';
$ldap_result_email = '${uid}@debian.org';
$ldap_result_realname = '${cn} ${sn}';
$ldap_result_comment = '(${ircnick})';
$ignorant = 0;
$ldap_bind_dn = '';
$ldap_bind_password = '';
$ldap_tls = 0; # Note: setting this to 1 breaks with ldaps urls
$ldap_sasl_mech = '';
1;


-- no debconf information

Attachment: signature.asc
Description: PGP signature

Reply via email to