Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
59a35e0b
Commit
59a35e0b
authored
24 years ago
by
Honza Petrous
Browse files
Options
Downloads
Patches
Plain Diff
ldap->search now knows about default filter (from LDAP URL)
Rev: lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1.18
parent
a23b7658
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Protocols.pmod/LDAP.pmod/client.pike
+14
-5
14 additions, 5 deletions
lib/modules/Protocols.pmod/LDAP.pmod/client.pike
with
14 additions
and
5 deletions
lib/modules/Protocols.pmod/LDAP.pmod/client.pike
+
14
−
5
View file @
59a35e0b
// LDAP client protocol implementation for Pike.
// LDAP client protocol implementation for Pike.
//
//
// $Id: client.pike,v 1.1
7
2000/07/2
0 15:00
:1
2
hop Exp $
// $Id: client.pike,v 1.1
8
2000/07/2
5 09:59
:1
9
hop Exp $
//
//
// Honza Petrous, hop@unibase.cz
// Honza Petrous, hop@unibase.cz
//
//
...
@@ -50,6 +50,8 @@
...
@@ -50,6 +50,8 @@
//
//
// newer versions - see CVS at roxen.com (hop)
// newer versions - see CVS at roxen.com (hop)
//
//
// - corrected deUTF8 values in result
// -
//
//
// Specifications:
// Specifications:
//
//
...
@@ -257,20 +259,25 @@
...
@@ -257,20 +259,25 @@
{
{
if(!server || !sizeof(server))
if(!server || !sizeof(server))
server =
(string)
LDAP_DEFAULT_
HOST
;
server = LDAP_DEFAULT_
URL
;
lauth = parse_url(server);
lauth = parse_url(server);
if(!stringp(lauth->scheme) || (lauth->scheme != "ldap")) {
if(!stringp(lauth->scheme) || (lauth->scheme != "ldap")) {
THROW(({"Unknown scheme in server URL.\n",backtrace()}));
THROW(({"Unknown scheme in server URL.\n",backtrace()}));
}
}
if(!lauth->host)
lauth += ([ "host" : parse_url(LDAP_DEFAULT_URL)->host ]);
if(!lauth->port)
lauth += ([ "port" : parse_url(LDAP_DEFAULT_URL)->port ]);
::create(lauth->host
||LDAP_DEFAULT_HOST, lauth->port||LDAP_DEFAULT_PORT
);
::create(lauth->host
, lauth->port
);
if(!::connected) {
if(!::connected) {
THROW(({"Failed to connect to LDAP server.\n",backtrace()}));
THROW(({"Failed to connect to LDAP server.\n",backtrace()}));
}
}
DWRITE(sprintf("client.create: remote = %s\n", query_address()));
DWRITE(sprintf("client.create: remote = %s\n", query_address()));
DWRITE_HI("client.OPEN: " + lauth->host
||LDAP_DEFAULT_HOST
+ (string)(lauth->port
||LDAP_DEFAULT_PORT
) + " - OK\n");
DWRITE_HI("client.OPEN: " + lauth->host
+ ":"
+ (string)(lauth->port) + " - OK\n");
binded = 0;
binded = 0;
...
@@ -736,6 +743,8 @@
...
@@ -736,6 +743,8 @@
array(string) rawarr = ({});
array(string) rawarr = ({});
mixed rv;
mixed rv;
filter=filter||lauth->filter; // default from LDAP URI
DWRITE_HI("client.SEARCH: " + (string)filter + "\n");
DWRITE_HI("client.SEARCH: " + (string)filter + "\n");
if (chk_ver())
if (chk_ver())
return(-ldap_errno);
return(-ldap_errno);
...
@@ -978,7 +987,7 @@
...
@@ -978,7 +987,7 @@
res += ([ "host" : (s / ":")[0] ]);
res += ([ "host" : (s / ":")[0] ]);
if(sizeof(s / ":") > 1)
if(sizeof(s / ":") > 1)
res += ([ "port" : (s / ":")[1] ]);
res += ([ "port" :
(int)(
(s / ":")[1]
)
]);
ar = url / "?";
ar = url / "?";
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment