2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
22
#include <axis2_defines.h>
23
#include <axutil_error.h>
24
#include <axutil_env.h>
25
#include <axutil_utils.h>
26
#include <rampart_callback.h>
27
#include <axutil_string.h>
28
#include <axis2_svc_skeleton.h>
29
#include <axutil_string.h>
31
axis2_status_t AXIS2_CALL
32
my_free_function(rampart_callback_t *rcb,
33
const axutil_env_t *env)
35
AXIS2_FREE(env->allocator, rcb->ops);
36
AXIS2_FREE(env->allocator, rcb);
40
axis2_char_t* AXIS2_CALL get_sample_password(rampart_callback_t *rcb, const axutil_env_t *env, const axis2_char_t *username, void *param) {
41
/*First set pf password are for sample usernames*/
42
axis2_char_t * pw = NULL;
48
euca_home = getenv("EUCALYPTUS");
50
snprintf(pwFile, 1024, "/var/eucalyptus/keys/pw");
52
snprintf(pwFile, 1024, "%s/var/eucalyptus/keys/pw", euca_home);
55
if (0 == axutil_strcmp(username, "CLUSTER") || 0 == axutil_strcmp(username, "CLOUD") || 0 == axutil_strcmp(username, "eucalyptus")) {
56
FH = fopen(pwFile, "r");
58
if (fgets(pass, 1024, FH)) {
59
pw = malloc(sizeof(axis2_char_t) * strlen(pass) + 32);
72
* Following block distinguish the exposed part of the dll.
75
axis2_get_instance(rampart_callback_t **inst,
76
const axutil_env_t *env)
78
rampart_callback_t* rcb = NULL;
80
rcb = AXIS2_MALLOC(env->allocator,
81
sizeof(rampart_callback_t));
83
rcb->ops = AXIS2_MALLOC(
84
env->allocator, sizeof(rampart_callback_ops_t));
86
/*assign function pointers*/
88
rcb->ops->callback_password = get_sample_password;
89
rcb->ops->free = my_free_function;
95
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart][pwcb_sample] Cannot initialize the PWCB module");
103
axis2_remove_instance(rampart_callback_t *inst,
104
const axutil_env_t *env)
106
axis2_status_t status = AXIS2_FAILURE;
109
status = my_free_function(inst, env);