static krb5_db_entry admin_def_dbent;
-static const char *admin_perm_denied_fmt = "\004ACL entry prevents %s operation by %s";
+static const char *admin_perm_denied_fmt = "\004ACL entry prevents %s operation on %s by %s";
static const char *admin_db_write_err_fmt = "\004database write failed during %s operation by %s";
static const char *admin_db_success_fmt = "\007%s operation for %s successfully issued by %s";
static const char *admin_db_read_err_fmt = "\004database read failed during %s operation by %s";
static const char *admin_add_key_text = "Add Keytype";
static const char *admin_delete_key_text = "Delete Keytype";
+static const char *admin_fentry_text = "first entry";
+
extern char *programname;
\f
/*
&client_name))) {
/* See if this client can perform this operation. */
- if (acl_op_permitted(kcontext, client, operation)) {
+ if (acl_op_permitted(kcontext, client, operation, arglist[0].data)) {
/* Parse the specified principal name */
if (!(kret = krb5_parse_name(kcontext,
else {
/* ACL check failed */
com_err(programname, 0, admin_perm_denied_fmt,
- op_msg, client_name);
+ op_msg, arglist[0].data, client_name);
retval = KRB5_ADM_NOT_AUTHORIZED;
}
&client_name))) {
/* See if this client can perform this operation. */
- if (acl_op_permitted(kcontext, client, operation)) {
+ if (acl_op_permitted(kcontext, client, operation, original)) {
/* Parse the specified principal name */
if (!(kret = krb5_parse_name(kcontext,
else {
/* ACL check failed */
com_err(programname, 0, admin_perm_denied_fmt,
- op_msg, client_name);
+ op_msg, original, client_name);
retval = KRB5_ADM_NOT_AUTHORIZED;
}
&client_name))) {
/* See if this client can perform this operation. */
- if (acl_op_permitted(kcontext, client, operation)) {
+ if (acl_op_permitted(kcontext, client, operation, arglist[0].data)) {
/* Parse the specified principal name */
if (!(kret = krb5_parse_name(kcontext,
else {
/* ACL check failed */
com_err(programname, 0, admin_perm_denied_fmt,
- op_msg, client_name);
+ op_msg, arglist[0].data, client_name);
retval = KRB5_ADM_NOT_AUTHORIZED;
}
&client_name))) {
/* See if this client can perform this operation. */
- if (acl_op_permitted(kcontext, client, ACL_INQUIRE)) {
+ if (acl_op_permitted(kcontext, client, ACL_INQUIRE, principal->data)) {
/* Parse the specified principal name */
if (!principal->length ||
else {
/* Not authorized to perform this function */
com_err(programname, 0, admin_perm_denied_fmt,
- admin_inquire_text, client_name);
+ admin_inquire_text,
+ (principal->length) ? principal->data : admin_fentry_text,
+ client_name);
retval = KRB5_ADM_NOT_AUTHORIZED;
}
&client,
&client_name))) {
- /* See if this client can perform this operation. */
- if (acl_op_permitted(kcontext, client, ACL_EXTRACT)) {
-
- realm = key_master_realm();
- if (princname = (char *) malloc((size_t) name->length + 1 +
- instance->length + 1 +
- strlen(realm) + 1)) {
+ realm = key_master_realm();
+ if (princname = (char *) malloc((size_t) name->length + 1 +
+ instance->length + 1 +
+ strlen(realm) + 1)) {
- /* Formulate the name of our target */
- sprintf(princname, "%s/%s@%s", name->data,
- instance->data, realm);
+ /* Formulate the name of our target */
+ sprintf(princname, "%s/%s@%s", name->data,
+ instance->data, realm);
- /* See if it's a valid name */
- if (!(kret = krb5_parse_name(kcontext,
- princname,
- &principal))) {
+ /* See if it's a valid name */
+ if (!(kret = krb5_parse_name(kcontext,
+ princname,
+ &principal))) {
+
+ /* See if this client can perform this operation. */
+ if (acl_op_permitted(kcontext, client, ACL_EXTRACT,
+ princname)) {
/* Get the database entry */
nentries = 1;
krb5_free_principal(kcontext, principal);
}
else {
- /* Name parse failed */
- DPRINT(DEBUG_OPERATION, debug_level,
- ("> bad principal string \"%s\"\n", princname));
- retval = KRB5_ADM_P_DOES_NOT_EXIST;
+ /* Not authorized to perform this operation */
+ com_err(programname, 0, admin_perm_denied_fmt,
+ admin_extract_key_text, princname, client_name);
+ retval = KRB5_ADM_NOT_AUTHORIZED;
}
- free(princname);
}
else {
- /* No memory. */
+ /* Name parse failed */
DPRINT(DEBUG_OPERATION, debug_level,
- ("> no memory for principal name\n"));
- retval = KRB5_ADM_SYSTEM_ERROR;
+ ("> bad principal string \"%s\"\n", princname));
+ retval = KRB5_ADM_P_DOES_NOT_EXIST;
}
+ free(princname);
}
else {
- /* Not authorized to perform this operation */
- com_err(programname, 0, admin_perm_denied_fmt,
- admin_extract_key_text, client_name);
- retval = KRB5_ADM_NOT_AUTHORIZED;
+ /* No memory. */
+ DPRINT(DEBUG_OPERATION, debug_level,
+ ("> no memory for principal name\n"));
+ retval = KRB5_ADM_SYSTEM_ERROR;
}
/* Clean up */