Skip to content
Snippets Groups Projects
Commit ad23f852 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Update back-shell to use void* o_private and pid_t forkandexec().

parent b06e0f16
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ Changes included in OpenLDAP 1.2
Fixed -lldap/ldap_init()
Updated ldap_open(3) man page to note ldap_init() is preferred.
Updated internal thread library
Updated slapd/back-shell to use void* private and pid_t
Build environment
Fixed --without-threads building
Fixed mkdep to handle multiple dependent files on one line
......
......@@ -21,7 +21,7 @@ shell_back_abandon(
{
struct shellinfo *si = (struct shellinfo *) be->be_private;
FILE *rfp, *wfp;
int pid;
pid_t pid;
Operation *o;
/* no abandon command defined - just kill the process handling it */
......@@ -30,7 +30,7 @@ shell_back_abandon(
pid = -1;
for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
if ( o->o_msgid == msgid ) {
pid = o->o_private;
pid = (pid_t) o->o_private;
break;
}
}
......
......@@ -28,7 +28,7 @@ shell_back_add(
return( -1 );
}
if ( (op->o_private = forkandexec( si->si_add, &rfp, &wfp )) == -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_add, &rfp, &wfp )) == (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
......
......@@ -33,8 +33,8 @@ shell_back_bind(
return( -1 );
}
if ( (op->o_private = forkandexec( si->si_bind, &rfp, &wfp ))
== -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_bind, &rfp, &wfp ))
== (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
......
......@@ -28,8 +28,8 @@ shell_back_compare(
return( -1 );
}
if ( (op->o_private = forkandexec( si->si_compare, &rfp, &wfp ))
== -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_compare, &rfp, &wfp ))
== (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
......
......@@ -27,8 +27,8 @@ shell_back_delete(
return( -1 );
}
if ( (op->o_private = forkandexec( si->si_delete, &rfp, &wfp ))
== -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_delete, &rfp, &wfp ))
== (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
......
......@@ -11,7 +11,7 @@
#include "slap.h"
#include "shell.h"
int
pid_t
forkandexec(
char **args,
FILE **rfp,
......@@ -19,7 +19,7 @@ forkandexec(
)
{
int p2c[2], c2p[2];
int pid;
pid_t pid;
if ( pipe( p2c ) != 0 || pipe( c2p ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "pipe failed\n", 0, 0, 0 );
......
......@@ -29,8 +29,8 @@ shell_back_modify(
return( -1 );
}
if ( (op->o_private = forkandexec( si->si_modify, &rfp, &wfp ))
== -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_modify, &rfp, &wfp ))
== (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
......
......@@ -29,8 +29,8 @@ shell_back_modrdn(
return( -1 );
}
if ( (op->o_private = forkandexec( si->si_modrdn, &rfp, &wfp ))
== -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_modrdn, &rfp, &wfp ))
== (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
......
......@@ -38,8 +38,8 @@ shell_back_search(
return( -1 );
}
if ( (op->o_private = forkandexec( si->si_search, &rfp, &wfp ))
== -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_search, &rfp, &wfp ))
== (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return( -1 );
......
......@@ -26,8 +26,8 @@ shell_back_unbind(
return;
}
if ( (op->o_private = forkandexec( si->si_unbind, &rfp, &wfp ))
== -1 ) {
if ( (op->o_private = (void *) forkandexec( si->si_unbind, &rfp, &wfp ))
== (void *) -1 ) {
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL,
"could not fork/exec" );
return;
......
......@@ -286,7 +286,7 @@ typedef struct slap_op {
int o_abandon; /* signals op has been abandoned */
ldap_pvt_thread_mutex_t o_abandonmutex; /* signals op has been abandoned */
int o_private; /* anything the backend needs */
void *o_private; /* anything the backend needs */
} Operation;
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment