09-22-2003
ldap search filter
Hi,
I am trying to do an ldapsearch with a filter that checks the uid and the userpassword:
$filter= "(&(uid=$user) (userpassword=$password)";
$objs = $ldap->search( base => $basedn, filter => "($filter)");
i based it on this example i found on CPAN:
$mesg = $ldap->search(
base => $base_dn,
scope => 'sub',
filter => '(|(objectclass=rfc822mailgroup)(sn=jones))'
);
My filter does not work and i cannot understand why.. if anyone has any ideas, please reply!
Tine
10 More Discussions You Might Find Interesting
1. Programming
hi all
i m writin a c program to search ldap db for values.
i used the following code after search result return a value >0
if (result==1)
{
entry=ldap_first_entry(ld,msg);
for(....;....;...)
{
// code to store the data values
}
}
i m gettin an error at... (1 Reply)
Discussion started by: mridula
1 Replies
2. UNIX for Dummies Questions & Answers
I would like to do an ldap search which looks for entries which do not actually have a certain attribute. Not that the attribute is Null, but where the attribute does not exist.
Is this possible using ldapsearch? (3 Replies)
Discussion started by: dopple
3 Replies
3. UNIX for Advanced & Expert Users
How can I do a ldapsearch to find a DN for a user when I know the exact cn for that user out of active directory.
I have tried several different commands (hundreds) but need the -b with the full dn to perform the search using ldapsearch from AIX. I am trying to find the OU for a user and the... (1 Reply)
Discussion started by: cchart3
1 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I have two files in this form that consist of three columns, a name (L*contig*), the length (length=**) and the sequence
LT_file.txt
LTcontig1 length=13 acccatgctttta
LTcontig5 length=8 ggattacc
LTcontig8 length=20 ccattgaccgtacctgatcg
LTcontig23 length=5 accta
and... (5 Replies)
Discussion started by: FelipeAd
5 Replies
5. Shell Programming and Scripting
Hello all,
searching on a text file (log file) is quite simple:
grep -i texttosearch filename | grep somethingWhat I'm trying to do is filter the result by TAG and remove the double entries.
Like if the log file contains the following text (fields are separated by commas):
... (18 Replies)
Discussion started by: Lord Spectre
18 Replies
6. UNIX for Dummies Questions & Answers
I am posting in this section because in this regard I am a Dummy. I know very little about ldap.
We have a couple of ldap registries running on an AIX box. I can connect into those registries using an openldap browser.
But I am trying to run some queries against the registry on the server itself,... (1 Reply)
Discussion started by: fwellers
1 Replies
7. UNIX for Dummies Questions & Answers
i want run query to identify witch groups that user A belong,
CN=name,CN=Users,DC=mydomain ?? (1 Reply)
Discussion started by: prpkrk
1 Replies
8. Shell Programming and Scripting
Hi All,
I have a existing Ldap query which take a HOME as variable and gives the result where i grep for a particular line.
ldapsearch -h server_domain_name -p 389 -D "uid=user,ou=appadm,o=ent" -w PaB -b "ou=roles,o=ent" "cidx=$HOME" | grep -w "ent: xyz"
Now i have 330K Homes in a... (1 Reply)
Discussion started by: posner
1 Replies
9. Solaris
Hi all,
I have 2 users. One of them shows "gecos" attribute during ldapsearch but the other one is not showing the attribute.
bash-3.00# ldapsearch -h 10.26.73.2 -D "cn=directory manager" -w xxxx -b "uid=user01,ou=people,dc=xx,dc=xx,dc=xx,dc=com,dc=xx" objectclass=*
version: 1
dn:... (1 Reply)
Discussion started by: Yohanna Flores
1 Replies
10. Solaris
I have very limited knowledge on LDAP configuration and have been trying fix one issue, but unsuccessful.
The server, I am working on, is Solaris-10 zone. sudoers is configured on LDAP (its not on local server). I have access to login directly on server with root, but somehow sudo is not working... (9 Replies)
Discussion started by: solaris_1977
9 Replies
LEARN ABOUT MOJAVE
uri::ldap5.18
URI::ldap(3) User Contributed Perl Documentation URI::ldap(3)
NAME
URI::ldap - LDAP Uniform Resource Locators
SYNOPSIS
use URI;
$uri = URI->new("ldap:$uri_string");
$dn = $uri->dn;
$filter = $uri->filter;
@attr = $uri->attributes;
$scope = $uri->scope;
%extn = $uri->extensions;
$uri = URI->new("ldap:"); # start empty
$uri->host("ldap.itd.umich.edu");
$uri->dn("o=University of Michigan,c=US");
$uri->attributes(qw(postalAddress));
$uri->scope('sub');
$uri->filter('(cn=Babs Jensen)');
print $uri->as_string,"
";
DESCRIPTION
"URI::ldap" provides an interface to parse an LDAP URI into its constituent parts and also to build a URI as described in RFC 2255.
METHODS
"URI::ldap" supports all the generic and server methods defined by URI, plus the following.
Each of the following methods can be used to set or get the value in the URI. The values are passed in unescaped form. None of these
return undefined values, but elements without a default can be empty. If arguments are given, then a new value is set for the given part
of the URI.
$uri->dn( [$new_dn] )
Sets or gets the Distinguished Name part of the URI. The DN identifies the base object of the LDAP search.
$uri->attributes( [@new_attrs] )
Sets or gets the list of attribute names which are returned by the search.
$uri->scope( [$new_scope] )
Sets or gets the scope to be used by the search. The value can be one of "base", "one" or "sub". If none is given in the URI then the
return value defaults to "base".
$uri->_scope( [$new_scope] )
Same as scope(), but does not default to anything.
$uri->filter( [$new_filter] )
Sets or gets the filter to be used by the search. If none is given in the URI then the return value defaults to "(objectClass=*)".
$uri->_filter( [$new_filter] )
Same as filter(), but does not default to anything.
$uri->extensions( [$etype => $evalue,...] )
Sets or gets the extensions used for the search. The list passed should be in the form etype1 => evalue1, etype2 => evalue2,... This is
also the form of list that is returned.
SEE ALSO
<http://tools.ietf.org/html/rfc2255>
AUTHOR
Graham Barr <gbarr@pobox.com>
Slightly modified by Gisle Aas to fit into the URI distribution.
COPYRIGHT
Copyright (c) 1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
perl v5.18.2 2012-02-11 URI::ldap(3)