Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Christopher Ng
OpenLDAP
Commits
469baeb3
Commit
469baeb3
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Forgot the most important part of unsolicited notifications... exop!
parent
e9c28954
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/extended.c
+112
-0
112 additions, 0 deletions
servers/slapd/extended.c
with
112 additions
and
0 deletions
servers/slapd/extended.c
0 → 100644
+
112
−
0
View file @
469baeb3
/*
* Copyright 1999 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted only
* as authorized by the OpenLDAP Public License. A copy of this
* license is available at http://www.OpenLDAP.org/license.html or
* in file LICENSE in the top-level directory of the distribution.
*/
/*
* LDAPv3 Extended Operation Request
* ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
* requestName [0] LDAPOID,
* requestValue [1] OCTET STRING OPTIONAL
* }
*
* LDAPv3 Extended Operation Response
* ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
* COMPONENTS OF LDAPResult,
* responseName [10] LDAPOID OPTIONAL,
* response [11] OCTET STRING OPTIONAL
* }
*
*/
#include
"portable.h"
#include
<stdio.h>
#include
<ac/socket.h>
#include
"slap.h"
char
*
supportedExtensions
[]
=
{
NULL
};
int
do_extended
(
Connection
*
conn
,
Operation
*
op
)
{
int
rc
=
LDAP_SUCCESS
;
char
*
reqoid
;
struct
berval
reqdata
;
ber_tag_t
tag
;
ber_len_t
len
;
Debug
(
LDAP_DEBUG_TRACE
,
"do_extended
\n
"
,
0
,
0
,
0
);
reqoid
=
NULL
;
reqdata
.
bv_val
=
NULL
;
if
(
op
->
o_protocol
<
LDAP_VERSION3
)
{
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: protocol version (%d) too low
\n
"
,
op
->
o_protocol
,
0
,
0
);
send_ldap_disconnect
(
conn
,
op
,
LDAP_PROTOCOL_ERROR
,
"requires LDAPv3"
);
rc
=
-
1
;
goto
done
;
}
if
(
ber_scanf
(
op
->
o_ber
,
"a"
,
&
reqoid
)
==
LBER_ERROR
)
{
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: ber_scanf failed
\n
"
,
0
,
0
,
0
);
send_ldap_disconnect
(
conn
,
op
,
LDAP_PROTOCOL_ERROR
,
"decoding error"
);
rc
=
-
1
;
goto
done
;
}
if
(
!
charray_inlist
(
supportedExtensions
,
reqoid
)
)
{
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: unsupported operation
\"
%s
\"\n
"
,
reqoid
,
0
,
0
);
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_PROTOCOL_ERROR
,
NULL
,
"unsuppored operation"
);
goto
done
;
}
tag
=
ber_peek_tag
(
op
->
o_ber
,
&
len
);
if
(
ber_peek_tag
(
op
->
o_ber
,
&
len
)
==
LDAP_TAG_EXOP_REQ_VALUE
)
{
if
(
ber_scanf
(
op
->
o_ber
,
"o"
,
&
reqdata
)
!=
LBER_ERROR
)
{
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: ber_scanf failed
\n
"
,
0
,
0
,
0
);
send_ldap_disconnect
(
conn
,
op
,
LDAP_PROTOCOL_ERROR
,
"decoding error"
);
rc
=
-
1
;
goto
done
;
}
}
if
(
(
rc
=
get_ctrls
(
conn
,
op
,
1
))
!=
LDAP_SUCCESS
)
{
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: get_ctrls failed
\n
"
,
0
,
0
,
0
);
return
rc
;
}
Debug
(
LDAP_DEBUG_ARGS
,
"do_extended: oid
\"
%s
\"\n
"
,
reqoid
,
0
,
0
);
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_PROTOCOL_ERROR
,
NULL
,
"unsupported extended operation"
);
done:
if
(
reqoid
!=
NULL
)
{
free
(
reqoid
);
}
if
(
reqdata
.
bv_val
!=
NULL
)
{
free
(
reqdata
.
bv_val
);
}
return
rc
;
}
\ No newline at end of file
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