return TCL_ERROR; \
} \
{ \
- int tcl_ret; \
- if ((tcl_ret = get_server_handle(interp, argv[0], &server_handle)) \
+ int ltcl_ret; \
+ if ((ltcl_ret = get_server_handle(interp, argv[0], &server_handle)) \
!= TCL_OK) { \
- return tcl_ret; \
+ return ltcl_ret; \
} \
} \
argv++, argc--;
static Tcl_DString *unparse_err(kadm5_ret_t code)
{
- char *code_string, *error_string;
+ char *code_string;
+ const char *error_string;
Tcl_DString *dstring;
switch (code) {
case KRB5_CONFIG_BADFORMAT: code_string = "KRB5_CONFIG_BADFORMAT"; break;
case EINVAL: code_string = "EINVAL"; break;
case ENOENT: code_string = "ENOENT"; break;
- default: fprintf(stderr, "**** CODE %d ***\n", code); code_string = "UNKNOWN"; break;
+ default:
+ fprintf(stderr, "**** CODE %ld ***\n", (long) code);
+ code_string = "UNKNOWN"; break;
}
- error_string = (char *) error_message(code);
+ error_string = error_message(code);
if (! (dstring = (Tcl_DString *) malloc(sizeof(Tcl_DString)))) {
fprintf(stderr, "Out of memory!\n");
/* it should be initialized to 0 if I want it do be */
/* allocated automatically. */
if (mask & KADM5_PRINCIPAL) {
- if ( krb5_ret = krb5_unparse_name(context, princ->principal, &tmp)) {
+ krb5_ret = krb5_unparse_name(context, princ->principal, &tmp);
+ if (krb5_ret) {
/* XXX Do we want to return an error? Not sure. */
Tcl_DStringAppendElement(str, "[unparseable principal]");
}
tmp = 0;
if (mask & KADM5_MOD_NAME) {
- if (krb5_ret = krb5_unparse_name(context, princ->mod_name, &tmp)) {
+ if ((krb5_ret = krb5_unparse_name(context, princ->mod_name, &tmp))) {
/* XXX */
Tcl_DStringAppendElement(str, "[unparseable principal]");
}
krb5_key_data **key_data,
int n_key_data)
{
- char **argv, **argv1 = NULL;
- int i, tmp, argc, argc1, retcode;
+ char **argv;
+ int argc, retcode;
*key_data == NULL;
if (list == NULL) {
Tcl_DStringFree(tmp_dstring);
free(tmp_dstring);
- sprintf(buf, "%d", policy->pw_min_life);
+ sprintf(buf, "%ld", policy->pw_min_life);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_max_life);
+ sprintf(buf, "%ld", policy->pw_max_life);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_min_length);
+ sprintf(buf, "%ld", policy->pw_min_length);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_min_classes);
+ sprintf(buf, "%ld", policy->pw_min_classes);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_history_num);
+ sprintf(buf, "%ld", policy->pw_history_num);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->policy_refcnt);
+ sprintf(buf, "%ld", policy->policy_refcnt);
Tcl_DStringAppendElement(str, buf);
return str;
enum init_type { INIT_NONE, INIT_PASS, INIT_CREDS };
-int _tcl_kadm5_init_any(enum init_type init_type, ClientData clientData,
+static int _tcl_kadm5_init_any(enum init_type init_type, ClientData clientData,
Tcl_Interp *interp, int argc, char *argv[])
{
kadm5_ret_t ret;
- char *client_name, *pass, *service_name, *realm;
+ char *client_name, *pass, *service_name;
int tcl_ret;
krb5_ui_4 struct_version, api_version;
char *handle_var;
krb5_ccache cc;
if (pass == NULL) {
- if (ret = krb5_cc_default(context, &cc)) {
+ if ((ret = krb5_cc_default(context, &cc))) {
stash_error(interp, ret);
return TCL_ERROR;
}
} else {
- if (ret = krb5_cc_resolve(context, pass, &cc)) {
+ if ((ret = krb5_cc_resolve(context, pass, &cc))) {
stash_error(interp, ret);
return TCL_ERROR;
}
return TCL_OK;
}
-int tcl_kadm5_init(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_kadm5_init(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
{
return _tcl_kadm5_init_any(INIT_PASS, clientData, interp, argc, argv);
}
-int tcl_kadm5_init_with_creds(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_kadm5_init_with_creds(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
{
return _tcl_kadm5_init_any(INIT_CREDS, clientData, interp, argc, argv);
}
-int tcl_kadm5_destroy(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_kadm5_destroy(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
{
kadm5_ret_t ret;
int tcl_ret;
return TCL_OK;
}
-int tcl_kadm5_create_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_kadm5_create_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
int tcl_ret;
kadm5_ret_t ret;
-int tcl_kadm5_delete_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_kadm5_delete_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
krb5_principal princ;
krb5_error_code krb5_ret;
if((tcl_ret = parse_str(interp, argv[0], &name)) != TCL_OK)
return tcl_ret;
if(name != NULL) {
- if (krb5_ret = krb5_parse_name(context, name, &princ)) {
+ if ((krb5_ret = krb5_parse_name(context, name, &princ))) {
stash_error(interp, krb5_ret);
Tcl_AppendElement(interp, "while parsing principal");
return TCL_ERROR;
-int tcl_kadm5_modify_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_kadm5_modify_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
char *princ_string;
kadm5_principal_ent_t princ = 0;
return TCL_ERROR; \
} \
{ \
- int tcl_ret; \
- if ((tcl_ret = get_server_handle(interp, argv[0], &server_handle)) \
+ int htcl_ret; \
+ if ((htcl_ret = get_server_handle(interp, argv[0], &server_handle)) \
!= TCL_OK) { \
- return tcl_ret; \
+ return htcl_ret; \
} \
} \
argv++, argc--;
static Tcl_DString *unparse_err(ovsec_kadm_ret_t code)
{
- char *code_string, *error_string;
+ char *code_string;
+ const char *error_string;
Tcl_DString *dstring;
switch (code) {
case KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN: code_string = "KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN"; break;
case EINVAL: code_string = "EINVAL"; break;
case ENOENT: code_string = "ENOENT"; break;
- default: fprintf(stderr, "**** CODE %d ***\n", code); code_string = "UNKNOWN"; break;
+ default: fprintf(stderr, "**** CODE %ld ***\n", (long) code); code_string = "UNKNOWN"; break;
}
- error_string = (char *) error_message(code);
+ error_string = error_message(code);
if (! (dstring = (Tcl_DString *) malloc(sizeof(Tcl_DString)))) {
fprintf(stderr, "Out of memory!\n");
/* code for krb5_parse_name that the pointer passed into */
/* it should be initialized to 0 if I want it do be */
/* allocated automatically. */
- if (krb5_ret = krb5_unparse_name(context, princ->principal, &tmp)) {
+ krb5_ret = krb5_unparse_name(context, princ->principal, &tmp);
+ if (krb5_ret) {
/* XXX Do we want to return an error? Not sure. */
Tcl_DStringAppendElement(str, "[unparseable principal]");
}
Tcl_DStringAppendElement(str, buf);
tmp = 0;
- if (krb5_ret = krb5_unparse_name(context, princ->mod_name, &tmp)) {
+ krb5_ret = krb5_unparse_name(context, princ->mod_name, &tmp);
+ if (krb5_ret) {
/* XXX */
Tcl_DStringAppendElement(str, "[unparseable principal]");
}
Tcl_DStringFree(tmp_dstring);
free(tmp_dstring);
- sprintf(buf, "%d", policy->pw_min_life);
+ sprintf(buf, "%ld", policy->pw_min_life);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_max_life);
+ sprintf(buf, "%ld", policy->pw_max_life);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_min_length);
+ sprintf(buf, "%ld", policy->pw_min_length);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_min_classes);
+ sprintf(buf, "%ld", policy->pw_min_classes);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->pw_history_num);
+ sprintf(buf, "%ld", policy->pw_history_num);
Tcl_DStringAppendElement(str, buf);
- sprintf(buf, "%d", policy->policy_refcnt);
+ sprintf(buf, "%ld", policy->policy_refcnt);
Tcl_DStringAppendElement(str, buf);
return str;
-int tcl_ovsec_kadm_init(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_init(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
{
ovsec_kadm_ret_t ret;
char *client_name, *pass, *service_name, *realm;
-int tcl_ovsec_kadm_destroy(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_destroy(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
{
ovsec_kadm_ret_t ret;
int tcl_ret;
return TCL_OK;
}
-int tcl_ovsec_kadm_create_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_create_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
int tcl_ret;
ovsec_kadm_ret_t ret;
-int tcl_ovsec_kadm_delete_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_delete_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
krb5_principal princ;
krb5_error_code krb5_ret;
if((tcl_ret = parse_str(interp, argv[0], &name)) != TCL_OK)
return tcl_ret;
if(name != NULL) {
- if (krb5_ret = krb5_parse_name(context, name, &princ)) {
+ krb5_ret = krb5_parse_name(context, name, &princ);
+ if (krb5_ret) {
stash_error(interp, krb5_ret);
Tcl_AppendElement(interp, "while parsing principal");
return TCL_ERROR;
-int tcl_ovsec_kadm_modify_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_modify_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
char *princ_string;
ovsec_kadm_principal_ent_t princ = 0;
}
-int tcl_ovsec_kadm_rename_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_rename_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
krb5_principal source, target;
krb5_error_code krb5_ret;
GET_HANDLE(2, 0);
- if (krb5_ret = krb5_parse_name(context, argv[0], &source)) {
+ krb5_ret = krb5_parse_name(context, argv[0], &source);
+ if (krb5_ret) {
stash_error(interp, krb5_ret);
Tcl_AppendElement(interp, "while parsing source");
return TCL_ERROR;
}
- if (krb5_ret = krb5_parse_name(context, argv[1], &target)) {
+ krb5_ret = krb5_parse_name(context, argv[1], &target);
+ if (krb5_ret) {
stash_error(interp, krb5_ret);
Tcl_AppendElement(interp, "while parsing target");
krb5_free_principal(context, source);
-int tcl_ovsec_kadm_chpass_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_chpass_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
krb5_principal princ;
char *pw;
GET_HANDLE(2, 0);
- if (krb5_ret = krb5_parse_name(context, argv[0], &princ)) {
+ krb5_ret = krb5_parse_name(context, argv[0], &princ);
+ if (krb5_ret) {
stash_error(interp, krb5_ret);
Tcl_AppendElement(interp, "while parsing principal name");
return TCL_ERROR;
-int tcl_ovsec_kadm_chpass_principal_util(ClientData clientData,
- Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_chpass_principal_util(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
krb5_principal princ;
char *new_pw;
GET_HANDLE(4, 0);
- if (krb5_ret = krb5_parse_name(context, argv[0], &princ)) {
+ if ((krb5_ret = krb5_parse_name(context, argv[0], &princ))) {
stash_error(interp, krb5_ret);
Tcl_AppendElement(interp, "while parsing principal name");
return TCL_ERROR;
-int tcl_ovsec_kadm_randkey_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_randkey_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
krb5_principal princ;
krb5_keyblock *keyblock;
GET_HANDLE(2, 0);
- if (krb5_ret = krb5_parse_name(context, argv[0], &princ)) {
+ if ((krb5_ret = krb5_parse_name(context, argv[0], &princ))) {
stash_error(interp, krb5_ret);
Tcl_AppendElement(interp, "while parsing principal name");
return TCL_ERROR;
-int tcl_ovsec_kadm_get_principal(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_get_principal(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
krb5_principal princ;
ovsec_kadm_principal_ent_t ent;
if((tcl_ret = parse_str(interp, argv[0], &name)) != TCL_OK)
return tcl_ret;
if(name != NULL) {
- if (krb5_ret = krb5_parse_name(context, name, &princ)) {
+ if ((krb5_ret = krb5_parse_name(context, name, &princ))) {
stash_error(interp, ret);
Tcl_AppendElement(interp, "while parsing principal name");
return TCL_ERROR;
return retcode;
}
-int tcl_ovsec_kadm_create_policy(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_create_policy(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
int tcl_ret;
ovsec_kadm_ret_t ret;
-int tcl_ovsec_kadm_delete_policy(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_delete_policy(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
- krb5_principal princ;
- krb5_error_code krb5_ret;
ovsec_kadm_ret_t ret;
char *policy;
int tcl_ret;
-int tcl_ovsec_kadm_modify_policy(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_modify_policy(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
char *policy_string;
ovsec_kadm_policy_ent_t policy = 0;
}
-int tcl_ovsec_kadm_get_policy(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_get_policy(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
ovsec_kadm_policy_ent_t ent;
Tcl_DString *ent_dstring = 0;
-int tcl_ovsec_kadm_free_principal_ent(ClientData clientData,
- Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_free_principal_ent(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
char *ent_name;
ovsec_kadm_principal_ent_t ent;
ent = (ovsec_kadm_principal_ent_t) Tcl_GetHashValue(entry);
- if (ret = ovsec_kadm_free_principal_ent(server_handle, ent)) {
+ if ((ret = ovsec_kadm_free_principal_ent(server_handle, ent))) {
stash_error(interp, ret);
return TCL_ERROR;
}
}
-int tcl_ovsec_kadm_free_policy_ent(ClientData clientData,
- Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_free_policy_ent(ClientData clientData,
+ Tcl_Interp *interp,
+ int argc, char *argv[])
{
char *ent_name;
ovsec_kadm_policy_ent_t ent;
ent = (ovsec_kadm_policy_ent_t) Tcl_GetHashValue(entry);
- if (ret = ovsec_kadm_free_policy_ent(server_handle, ent)) {
+ if ((ret = ovsec_kadm_free_policy_ent(server_handle, ent))) {
stash_error(interp, ret);
return TCL_ERROR;
}
}
-int tcl_ovsec_kadm_get_privs(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+static int tcl_ovsec_kadm_get_privs(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
{
int tcl_ret;
char *set_ret;