Ejemplo n.º 1
0
int main(){
  Ledger *ledger = NULL;
 
  printf("TEST 1 RET = %d\n", edit_entry(ledger, "hi", 1, 2, 0));
  
  get_ledger(&ledger, F, NULL, NULL);
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 2 RET = %d\n", edit_entry(ledger, "hi", 1, 0, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 3 RET = %d\n", edit_entry(ledger, "0.5", 1, 0, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);
  
  printf("TEST 3A RET = %d\n", edit_entry(ledger, "0.5", 1, 3, 1));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);
  
  printf("TEST 3B RET = %d\n", edit_entry(ledger, "0.5", 2, 4, 2));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);
  
  printf("TEST 3C RET = %d\n", edit_entry(ledger, "0.5", 1, 3, -1));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 4 RET = %d\n", edit_entry(ledger, "hi", 1, 1, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 5 RET = %d\n", edit_entry(ledger, "hi\thi", 1, 2, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 6 RET = %d\n", edit_entry(ledger, "hi\thi", -1, 2, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 7 RET = %d\n", edit_entry(ledger, "hi\thi", 1, -2, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 8 RET = %d\n", edit_entry(ledger, "hi\thi", 1000, 2, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  printf("TEST 9 RET = %d\n", edit_entry(ledger, "hi\thi", 1, 2000, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);
  free_ledger(&ledger);
  
  get_ledger(&ledger, "../data/ledgers/empty.txt", NULL, NULL);
  printf("TEST 10 RET = %d\n", edit_entry(ledger, "1000", 0, 0, 0));
  print_ledger_to_stream(ledger, stdout);  
  print_summary_to_stream(ledger, stdout, 1);

  free_ledger(&ledger);
  return 0;
}
Ejemplo n.º 2
0
Archivo: mod.c Proyecto: InvLim/heimdal
static int
do_mod_entry(krb5_principal principal, void *data)
{
    krb5_error_code ret;
    kadm5_principal_ent_rec princ;
    int mask = 0;
    struct modify_options *e = data;

    memset (&princ, 0, sizeof(princ));
    ret = kadm5_get_principal(kadm_handle, principal, &princ,
			      KADM5_PRINCIPAL | KADM5_ATTRIBUTES |
			      KADM5_MAX_LIFE | KADM5_MAX_RLIFE |
			      KADM5_PRINC_EXPIRE_TIME |
			      KADM5_PW_EXPIRATION);
    if(ret)
	return ret;

    if(e->max_ticket_life_string ||
       e->max_renewable_life_string ||
       e->expiration_time_string ||
       e->pw_expiration_time_string ||
       e->attributes_string ||
       e->policy_string ||
       e->kvno_integer != -1 ||
       e->constrained_delegation_strings.num_strings ||
       e->alias_strings.num_strings ||
       e->pkinit_acl_strings.num_strings ||
       e->hist_kvno_diff_clnt_integer != -1 ||
       e->hist_kvno_diff_svc_integer != -1) {
	ret = set_entry(context, &princ, &mask,
			e->max_ticket_life_string,
			e->max_renewable_life_string,
			e->expiration_time_string,
			e->pw_expiration_time_string,
			e->attributes_string,
			e->policy_string);
	if(e->kvno_integer != -1) {
	    princ.kvno = e->kvno_integer;
	    mask |= KADM5_KVNO;
	}
	if (e->constrained_delegation_strings.num_strings) {
	    add_constrained_delegation(context, &princ,
				       &e->constrained_delegation_strings);
	    mask |= KADM5_TL_DATA;
	}
	if (e->alias_strings.num_strings) {
	    add_aliases(context, &princ, &e->alias_strings);
	    mask |= KADM5_TL_DATA;
	}
	if (e->pkinit_acl_strings.num_strings) {
	    add_pkinit_acl(context, &princ, &e->pkinit_acl_strings);
	    mask |= KADM5_TL_DATA;
	}
	if (e->hist_kvno_diff_clnt_integer != -1) {
	    add_kvno_diff(context, &princ, 0, e->hist_kvno_diff_clnt_integer);
	    mask |= KADM5_TL_DATA;
	}
	if (e->hist_kvno_diff_svc_integer != -1) {
	    add_kvno_diff(context, &princ, 1, e->hist_kvno_diff_clnt_integer);
	    mask |= KADM5_TL_DATA;
	}
    } else
	ret = edit_entry(&princ, &mask, NULL, 0);
    if(ret == 0) {
	ret = kadm5_modify_principal(kadm_handle, &princ, mask);
	if(ret)
	    krb5_warn(context, ret, "kadm5_modify_principal");
    }

    kadm5_free_principal_ent(kadm_handle, &princ);
    return ret;
}
Ejemplo n.º 3
0
static krb5_error_code
add_one_principal (const char *name,
		   int rand_key,
		   int rand_password,
		   int use_defaults,
		   char *password,
		   krb5_key_data *key_data,
		   const char *max_ticket_life,
		   const char *max_renewable_life,
		   const char *attributes,
		   const char *expiration,
		   const char *pw_expiration)
{
    krb5_error_code ret;
    kadm5_principal_ent_rec princ, defrec;
    kadm5_principal_ent_rec *default_ent = NULL;
    krb5_principal princ_ent = NULL;
    int mask = 0;
    int default_mask = 0;
    char pwbuf[1024];

    memset(&princ, 0, sizeof(princ));
    ret = krb5_parse_name(context, name, &princ_ent);
    if (ret) {
	krb5_warn(context, ret, "krb5_parse_name");
	return ret;
    }
    princ.principal = princ_ent;
    mask |= KADM5_PRINCIPAL;

    ret = set_entry(context, &princ, &mask,
		    max_ticket_life, max_renewable_life,
		    expiration, pw_expiration, attributes);
    if (ret)
	goto out;

    default_ent = &defrec;
    ret = get_default (kadm_handle, princ_ent, default_ent);
    if (ret) {
	default_ent  = NULL;
	default_mask = 0;
    } else {
	default_mask = KADM5_ATTRIBUTES | KADM5_MAX_LIFE | KADM5_MAX_RLIFE |
	    KADM5_PRINC_EXPIRE_TIME | KADM5_PW_EXPIRATION;
    }

    if(use_defaults)
	set_defaults(&princ, &mask, default_ent, default_mask);
    else
	if(edit_entry(&princ, &mask, default_ent, default_mask))
	    goto out;
    if(rand_key || key_data) {
	princ.attributes |= KRB5_KDB_DISALLOW_ALL_TIX;
	mask |= KADM5_ATTRIBUTES;
	random_password (pwbuf, sizeof(pwbuf));
	password = pwbuf;
    } else if (rand_password) {
	random_password (pwbuf, sizeof(pwbuf));
	password = pwbuf;
    } else if(password == NULL) {
	char *princ_name;
	char *prompt;

	krb5_unparse_name(context, princ_ent, &princ_name);
	asprintf (&prompt, "%s's Password: "******"failed to verify password");
	    goto out;
	}
	password = pwbuf;
    }

    ret = kadm5_create_principal(kadm_handle, &princ, mask, password);
    if(ret) {
	krb5_warn(context, ret, "kadm5_create_principal");
	goto out;
    }
    if(rand_key) {
	krb5_keyblock *new_keys;
	int n_keys, i;
	ret = kadm5_randkey_principal(kadm_handle, princ_ent,
				      &new_keys, &n_keys);
	if(ret){
	    krb5_warn(context, ret, "kadm5_randkey_principal");
	    n_keys = 0;
	}
	for(i = 0; i < n_keys; i++)
	    krb5_free_keyblock_contents(context, &new_keys[i]);
	if (n_keys > 0)
	    free(new_keys);
	kadm5_get_principal(kadm_handle, princ_ent, &princ,
			    KADM5_PRINCIPAL | KADM5_KVNO | KADM5_ATTRIBUTES);
	princ.attributes &= (~KRB5_KDB_DISALLOW_ALL_TIX);
	princ.kvno = 1;
	kadm5_modify_principal(kadm_handle, &princ,
			       KADM5_ATTRIBUTES | KADM5_KVNO);
	kadm5_free_principal_ent(kadm_handle, &princ);
    } else if (key_data) {
	ret = kadm5_chpass_principal_with_key (kadm_handle, princ_ent,
					       3, key_data);
	if (ret) {
	    krb5_warn(context, ret, "kadm5_chpass_principal_with_key");
	}
	kadm5_get_principal(kadm_handle, princ_ent, &princ,
			    KADM5_PRINCIPAL | KADM5_ATTRIBUTES);
	princ.attributes &= (~KRB5_KDB_DISALLOW_ALL_TIX);
	kadm5_modify_principal(kadm_handle, &princ, KADM5_ATTRIBUTES);
	kadm5_free_principal_ent(kadm_handle, &princ);
    } else if (rand_password) {
	char *princ_name;

	krb5_unparse_name(context, princ_ent, &princ_name);
	printf ("added %s with password \"%s\"\n", princ_name, password);
	free (princ_name);
    }
out:
    if (princ_ent)
	krb5_free_principal (context, princ_ent);
    if(default_ent)
	kadm5_free_principal_ent (kadm_handle, default_ent);
    if (password != NULL)
	memset (password, 0, strlen(password));
    return ret;
}
Ejemplo n.º 4
0
int
main (int argc, char *argv[])
{
  vc_component *v = NULL;
  fpos_t *fpos = NULL;
  long pos = 0;
  FILE *fp = NULL;
  ITEM *it = NULL;
  int entry_number = 0;

  bool done = FALSE;
  int win_state = WINDOW_INDEX;
  int command = 0;

  set_defaults ();
  process_command_line_args (argc, argv);
  /*
   * process_environment_variables(); 
   * process_configuration_file(); 
   */

  signal (SIGINT, finish);      /* catch interrupt for exiting */
  signal (SIGWINCH, resize);    /* catch interrupt for resizing */
  initscr ();

  keypad (stdscr, TRUE);        /* enable keypad for use of arrow keys */
  nonl ();                      /* tell curses not to do NL->CR/NL on output */
  cbreak ();                    /* take input chars immediately */
  noecho ();

  init_index (data_path);
  set_index_help_fcn (show_index_help);
  init_view ();
  set_view_help_fcn (show_view_help);
  init_edit ();
  set_edit_help_fcn (show_edit_help);
  init_help ();

  while (!done)
    {
      switch (win_state)
        {
        case WINDOW_INDEX:

      /*-------------------
         display the index
        -------------------*/

          display_index ();
          command = process_index_commands ();

          switch (command)
            {
            case INDEX_COMMAND_VIEW:
              win_state = WINDOW_VIEW;
              break;
            case INDEX_COMMAND_RAW_VIEW:
              win_state = WINDOW_RAW_VIEW;
              break;
            case INDEX_COMMAND_EDIT:
              win_state = WINDOW_EDIT;
              break;
            case INDEX_COMMAND_ADD:
              win_state = WINDOW_ADD;
              break;
            case INDEX_COMMAND_DELETE:
              win_state = WINDOW_DELETE;
              break;
            case INDEX_COMMAND_QUIT:
              done = TRUE;
              break;
            default:
              break;
            }

          break;

        case WINDOW_RAW_VIEW:

      /*-------------------------------------------------
         view the currently selected item with the pager
        -------------------------------------------------*/

          it = get_current_item ();

          /* only display if there is an item that is selected */
          if (NULL == it)
            {
              v = NULL;
            }
          else
            {
              fpos = (fpos_t *) item_userptr (it);

              fp = fopen (data_path, "r");
              fsetpos (fp, fpos);
              v = parse_vcard_file (fp);
              fclose (fp);
            }

          if (v != NULL)
            {
              raw_view (v);
              vc_delete_deep (v);
              v = NULL;
            }

          win_state = WINDOW_INDEX;

          break;

        case WINDOW_VIEW:

      /*----------------------------------
         view the currently selected item
        ----------------------------------*/

          it = get_current_item ();

          /* only display if there is an item that is selected */
          if (NULL == it)
            {
              v = NULL;
            }
          else
            {
              fpos = (fpos_t *) item_userptr (it);

              fp = fopen (data_path, "r");
              fsetpos (fp, fpos);
              v = parse_vcard_file (fp);
              fclose (fp);
            }

          if (v != NULL)
            {
              entry_number = get_entry_number (it);
              view_vcard (entry_number, v);
              command = process_view_commands ();

              switch (command)
                {
                case VIEW_COMMAND_EDIT:
                  win_state = WINDOW_EDIT;
                  break;
                case VIEW_COMMAND_INDEX:
                  win_state = WINDOW_INDEX;
                  break;
                case VIEW_COMMAND_PREVIOUS:
                  select_previous_item ();
                  win_state = WINDOW_VIEW;
                  break;
                case VIEW_COMMAND_NEXT:
                  select_next_item ();
                  win_state = WINDOW_VIEW;
                  break;
                default:
                  break;
                }
            }
          else
            {
              win_state = WINDOW_INDEX;
            }

          vc_delete_deep (v);
          v = NULL;

          break;

        case WINDOW_EDIT:

      /*--------------
         edit a vcard
        --------------*/

          it = get_current_item ();

          /* only display if there is an item that is selected */
          if (NULL != it)
            {
              fpos = (fpos_t *) item_userptr (it);

              fp = fopen (data_path, "r");
              fsetpos (fp, fpos);
              pos = ftell (fp);
              fclose (fp);
              fp = NULL;

              if (EDIT_SUCCESSFUL == edit_entry (data_path, pos))
                {
                  refresh_index ();
                }
            }

          win_state = WINDOW_INDEX;
          break;

        case WINDOW_ADD:
          if (ADD_SUCCESSFUL == add_entry (data_path))
            {
              refresh_index ();
            }

          win_state = WINDOW_INDEX;
          break;
        case WINDOW_DELETE:

          it = get_current_item ();

          /* only delete if there is an item that is selected */
          if (NULL != it)
            {
              fpos = (fpos_t *) item_userptr (it);

              fp = fopen (data_path, "r");
              fsetpos (fp, fpos);
              pos = ftell (fp);
              fclose (fp);
              fp = NULL;

              if (DELETE_SUCCESSFUL == delete_entry (data_path, pos))
                {
                  refresh_index ();
                }
            }

          win_state = WINDOW_INDEX;
          break;
        default:
          break;
        }
    }

  finish (0);
  exit (EXIT_SUCCESS);
  return (0);
}
Ejemplo n.º 5
0
int main()
{
  int           i, gsiproxylimit_i = 1, delegation = 0;
  char         *cmd, *dir_uri, *file, *dir_path, *admin_file, *dn = NULL,
               *help_uri, *p, *content_type, *request_uri, *button, 
               *grst_auri_i, *grst_valid_i, *gsiproxylimit, buf[12];
  GRSTgaclCred *cred;
  GRSTgaclUser *user = NULL;
  GRSTgaclAcl  *acl;
  GRSTgaclPerm  perm = GRST_PERM_NONE;

  help_uri      = getenv("REDIRECT_GRST_HELP_URI"); /* can be NULL */
  admin_file    = getenv("REDIRECT_GRST_ADMIN_FILE");
  dir_path      = getenv("REDIRECT_GRST_DIR_PATH");
  request_uri   = getenv("REQUEST_URI");
  
  if ((dir_path == NULL) || (admin_file == NULL) || (request_uri == NULL))
    {
      puts("Status: 500 Internal Server Error\nContent-type: text/plain\n\n"
           "REDIRECT_GRST_DIR_PATH or REDIRECT_GRST_ADMIN_FILE "
           "or REQUEST_URI missing");
      return -1;
    }

  GRSTgaclInit();

  gsiproxylimit = getenv("REDIRECT_GRST_GSIPROXY_LIMIT");
  if (gsiproxylimit != NULL) sscanf(gsiproxylimit, "%d", &gsiproxylimit_i);

  grst_auri_i  = getenv("GRST_CRED_AURI_0");
  grst_valid_i = getenv("GRST_CRED_VALID_0");
  
  if ((grst_auri_i != NULL) && (strncmp(grst_auri_i, "dn:", 3) == 0))  
    {
      dn = &grst_auri_i[3];
    
      sscanf(grst_valid_i, 
         "notbefore=%*ld notafter=%*ld delegation=%d nist-loa=%*d",
         &delegation);
      
      if (delegation <= gsiproxylimit_i)
        {    
          cred = GRSTgaclCredCreate(grst_auri_i, NULL);
          user = GRSTgaclUserNew(cred);

          /* User has a cert so check for VOMS attributes etc */
          for (i=1; ; i++)
             {
               sprintf (buf, "GRST_CRED_%d", i);

  	       grst_auri_i = getenv(buf);
	       if (grst_auri_i == NULL) break;
 	       
               cred = GRSTgaclCredCreate(grst_auri_i, NULL);
               GRSTgaclUserAddCred(user, cred);
             }

          /* no more VOMS attributes etc found */
        }
    }
  else if ((dn = getenv("SSL_CLIENT_S_DN")) != NULL)
    {
      cred = GRSTgaclCredCreate("dn:", GRSThttpUrlMildencode(dn));
      user = GRSTgaclUserNew(cred);
    }

  if (GRSTgaclUserHasAURI(user, getenv("REDIRECT_GRST_ADMIN_LIST")))
    perm = GRST_PERM_ALL;
  else
    {
      p = getenv("REMOTE_HOST");
      if (p != NULL)
        {
          cred = GRSTgaclCredCreate("dns:", p);
  
          if (user == NULL) user = GRSTgaclUserNew(cred);
          else              GRSTgaclUserAddCred(user, cred);
        }

      acl = GRSTgaclAclLoadforFile(dir_path);
      if (acl != NULL) perm = GRSTgaclAclTestUser(acl, user);
    }
    
  /* we're relying on being a CGI with all this un-free()ed strdup()ing */

  dir_uri  = strdup(request_uri);
  p = rindex(dir_uri, '?');
  if (p != NULL) *p = '\0';
  p = rindex(dir_uri, '/');
  if (p != NULL) p[1] = '\0';

  content_type = getenv("CONTENT_TYPE");

  if ((content_type != NULL) &&
      (GRSTstrCmpShort(content_type, "multipart/form-data; boundary=") == 0))
    {
      uploadfile(dn, perm, help_uri, dir_path, dir_uri, admin_file);
      return 0;
    }
  
  cmd    = GRSThttpGetCGI("cmd");
  button = GRSThttpGetCGI("button");

  file   = GRSThttpGetCGI("file");
  
  if ((index(file, '/') != NULL) ||
      (index(file, '<') != NULL) ||
      (index(file, '>') != NULL) ||
      (index(file, '&') != NULL) ||
      (index(file, '"') != NULL)) file[0] = '\0';

  /* file and directory functions in grst_admin_file.c */

  if (strcmp(cmd, "header") == 0) 
      justheader(dn, perm, help_uri, dir_path, dir_uri, admin_file);
  else if (strcmp(cmd, "footer") == 0) 
      justfooter(dn, perm, help_uri, dir_path, dir_uri, admin_file);
  else if (strcmp(cmd, "managedir") == 0) 
      managedir(dn, perm, help_uri, dir_path, dir_uri, admin_file);
  else if (strcmp(cmd, "print") == 0) 
      printfile(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "history") == 0) 
      filehistory(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "managednlists") == 0) 
      managednlists(user, dn, perm, help_uri, dir_path, dir_uri, admin_file);
  else if (strcmp(cmd, "editdnlist") == 0) 
      editdnlistform(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "edit") == 0)
    { 
      if ((strcasecmp(button, "new directory") == 0) ||
          (strcasecmp(button, "Create") == 0))
       newdirectory(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
      else
       editfileform(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
    }
  else if (strcmp(cmd, "editaction") == 0) 
      editfileaction(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "editdnlistaction") == 0) 
      editdnlistaction(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "delete") == 0) 
      deletefileform(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "deleteaction") == 0) 
     deletefileaction(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "rename") == 0) 
     renameform(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "renameaction") == 0) 
     renameaction(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "ziplist") == 0) 
     ziplist(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "unzipfile") == 0) 
     unzipfile(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "create_acl") == 0) 
     create_acl(dn, perm, help_uri, dir_path, file, dir_uri, admin_file);

  /* GACL functions in grst_admin_gacl.c */

  else if (strcmp(cmd, "show_acl") == 0)
     show_acl(0, user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "admin_acl") == 0)
     show_acl(1, user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "acl_history") == 0)
     show_acl(2, user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd, "revert_acl") == 0)
    revert_acl(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
    //show_acl(2, user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"new_entry_form")==0)
     new_entry_form(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"new_entry")==0)
     new_entry(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"del_entry_sure")==0)
     del_entry_sure(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"del_entry")==0)
     del_entry(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"edit_entry_form")==0)
     edit_entry_form(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"edit_entry")==0)
     edit_entry(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"add_cred_form")==0)
     add_cred_form(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"add_cred")==0)
     add_cred(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"del_cred_sure")==0)
     del_cred_sure(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);
  else if (strcmp(cmd,"del_cred")==0)
     del_cred(user, dn, perm, help_uri, dir_path, file, dir_uri, admin_file);

  /* you what? */

  else GRSThttpError("500 Internal Server Error");
}