summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-06-10 15:34:19 -0400
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-06-10 15:34:19 -0400
commitcd01310f5f0ef8626e745956d93e3ef5b6becb3d (patch)
tree473dfe49e93d95de61dbe9e17a5ec79faea381ab /src
parentd3e13a3d5315fc79637bca98ba2e9b9be6e98c8c (diff)
downloadslapi-nis-cd01310f5f0ef8626e745956d93e3ef5b6becb3d.tar.gz
slapi-nis-cd01310f5f0ef8626e745956d93e3ef5b6becb3d.tar.xz
slapi-nis-cd01310f5f0ef8626e745956d93e3ef5b6becb3d.zip
- fail to provide the order for secure maps to not-secure clients
Diffstat (limited to 'src')
-rw-r--r--src/dummymap.c3
-rw-r--r--src/map.c3
-rw-r--r--src/map.h2
-rw-r--r--src/nis.c8
4 files changed, 10 insertions, 6 deletions
diff --git a/src/dummymap.c b/src/dummymap.c
index b6a336a..d03fe09 100644
--- a/src/dummymap.c
+++ b/src/dummymap.c
@@ -158,10 +158,11 @@ map_supports_map(struct plugin_state *state,
bool_t
map_order(struct plugin_state *state,
- const char *domain, const char *map,
+ const char *domain, const char *map, bool_t *secure,
unsigned int *order)
{
*order = 1;
+ *secure = FALSE;
return TRUE;
}
diff --git a/src/map.c b/src/map.c
index ad4c5df..77cdd49 100644
--- a/src/map.c
+++ b/src/map.c
@@ -346,13 +346,14 @@ map_master_name(struct plugin_state *state, const char **master)
* decrease. */
bool_t
map_order(struct plugin_state *state,
- const char *domain_name, const char *map_name,
+ const char *domain_name, const char *map_name, bool_t *map_secure,
unsigned int *order)
{
struct map *map;
map = map_data_find_map(state, domain_name, map_name);
if (map != NULL) {
*order = map->last_changed & 0xffffffff;
+ *map_secure = map->secure;
return TRUE;
} else {
return FALSE;
diff --git a/src/map.h b/src/map.h
index e5aeda1..a013b88 100644
--- a/src/map.h
+++ b/src/map.h
@@ -49,7 +49,7 @@ bool_t map_next(struct plugin_state *state,
unsigned int *next_key_len, char **next_key,
unsigned int *next_value_len, char **next_value);
bool_t map_order(struct plugin_state *state,
- const char *domain, const char *map,
+ const char *domain, const char *map, bool_t *map_secure,
unsigned int *order);
/* Functions to push data into maps. */
void map_data_clear_map(struct plugin_state *state,
diff --git a/src/nis.c b/src/nis.c
index b7e3ec6..237bd5e 100644
--- a/src/nis.c
+++ b/src/nis.c
@@ -272,18 +272,20 @@ nis_order(struct plugin_state *state,
dispatch_reply_fragment *reply_fragment_fn,
dispatch_reply *reply_fn,
struct dispatch_client_data *cdata,
- XDR *request_xdrs,
+ XDR *request_xdrs, bool_t client_secure,
struct rpc_msg *reply, XDR *reply_xdrs,
struct ypresp_order *reply_order)
{
struct ypreq_nokey req_nokey;
+ bool_t map_secure;
memset(&req_nokey, 0, sizeof(req_nokey));
memset(reply_order, 0, sizeof(*reply_order));
if (xdr_ypreq_nokey(request_xdrs, &req_nokey)) {
map_rdlock();
reply_order->status = YP_TRUE;
if (map_order(state, req_nokey.domain, req_nokey.map,
- &reply_order->ordernum)) {
+ &map_secure, &reply_order->ordernum) &&
+ (map_secure ? client_secure : TRUE)) {
reply_order->status = YP_TRUE;
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
@@ -1037,7 +1039,7 @@ nis_process_request(struct plugin_state *state,
accepted->ar_results.proc = (xdrproc_t) xdr_ypresp_order;
/* Call the real function. */
nis_order(state, reply_fragment_fn, reply_fn, cdata,
- &request_xdrs,
+ &request_xdrs, client_secure,
&reply, &reply_xdrs, &reply_order);
goto sent_reply;
break;