Lines Matching full:context

47 connect_to_master (krb5_context context, const char *master,  in connect_to_master()  argument
66 krb5_warnx(context, "Failed to get address of to %s: %s", in connect_to_master()
82 krb5_warn(context, errno, "connection failed to %s[%s]", in connect_to_master()
87 krb5_warnx(context, "connection successful " in connect_to_master()
100 get_creds(krb5_context context, const char *keytab_str, in get_creds() argument
112 ret = krb5_kt_default_name (context, keytab_buf, sizeof(keytab_buf)); in get_creds()
114 krb5_err (context, 1, ret, "krb5_kt_default_name"); in get_creds()
118 ret = krb5_kt_resolve(context, keytab_str, &keytab); in get_creds()
120 krb5_err(context, 1, ret, "%s", keytab_str); in get_creds()
123 ret = krb5_sname_to_principal (context, slave_str, IPROP_NAME, in get_creds()
125 if (ret) krb5_err(context, 1, ret, "krb5_sname_to_principal"); in get_creds()
127 ret = krb5_get_init_creds_opt_alloc(context, &init_opts); in get_creds()
128 if (ret) krb5_err(context, 1, ret, "krb5_get_init_creds_opt_alloc"); in get_creds()
132 krb5_errx (context, 1, "malloc: no memory"); in get_creds()
134 ret = krb5_get_init_creds_keytab(context, &creds, client, keytab, in get_creds()
137 krb5_get_init_creds_opt_free(context, init_opts); in get_creds()
138 if(ret) krb5_err(context, 1, ret, "krb5_get_init_creds"); in get_creds()
140 ret = krb5_kt_close(context, keytab); in get_creds()
141 if(ret) krb5_err(context, 1, ret, "krb5_kt_close"); in get_creds()
143 ret = krb5_cc_new_unique(context, krb5_cc_type_memory, NULL, cache); in get_creds()
144 if(ret) krb5_err(context, 1, ret, "krb5_cc_new_unique"); in get_creds()
146 ret = krb5_cc_initialize(context, *cache, client); in get_creds()
147 if(ret) krb5_err(context, 1, ret, "krb5_cc_initialize"); in get_creds()
149 ret = krb5_cc_store_cred(context, *cache, &creds); in get_creds()
150 if(ret) krb5_err(context, 1, ret, "krb5_cc_store_cred"); in get_creds()
152 krb5_free_cred_contents(context, &creds); in get_creds()
153 krb5_free_principal(context, client); in get_creds()
157 ihave (krb5_context context, krb5_auth_context auth_context, in ihave() argument
172 ret = krb5_write_priv_message(context, auth_context, &fd, &data); in ihave()
174 krb5_warn (context, ret, "krb5_write_message"); in ihave()
179 receive_loop (krb5_context context, in receive_loop() argument
213 krb5_errx (context, 1, "malloc: no memory"); in receive_loop()
222 krb5_err(context, 1, errno, "Failed to write log to disk"); in receive_loop()
225 krb5_err(context, 1, errno, "Failed to sync log to disk"); in receive_loop()
242 if (ret) krb5_errx(context, 1, "entry %ld: too short", (long)vers); in receive_loop()
244 if (ret) krb5_errx(context, 1, "entry %ld: too short", (long)vers); in receive_loop()
247 if (ret) krb5_errx(context, 1, "entry %ld: too short", (long)vers); in receive_loop()
249 krb5_errx(context, 1, "log is corrupted, " in receive_loop()
254 krb5_warnx (context, "replaying entry %d", (int)vers); in receive_loop()
259 const char *s = krb5_get_error_message(server_context->context, ret); in receive_loop()
260 krb5_warnx (context, in receive_loop()
264 krb5_free_error_message(context, s); in receive_loop()
274 krb5_errx(context, 1, in receive_loop()
280 krb5_errx(context, 1, "entry %ld: postamble too short", (long)vers); in receive_loop()
282 krb5_errx(context, 1, "entry %ld: postamble too short", (long)vers); in receive_loop()
285 krb5_errx(context, 1, "entry %ld: len != len2", (long)vers); in receive_loop()
287 krb5_errx(context, 1, "entry %ld: vers != vers2", (long)vers); in receive_loop()
298 receive (krb5_context context, in receive() argument
304 ret = server_context->db->hdb_open(context, in receive()
308 krb5_err (context, 1, ret, "db->open"); in receive()
310 receive_loop (context, sp, server_context); in receive()
312 ret = server_context->db->hdb_close (context, server_context->db); in receive()
314 krb5_err (context, 1, ret, "db->close"); in receive()
318 send_im_here (krb5_context context, int fd, in send_im_here() argument
327 krb5_err (context, 1, ret, "send_im_here"); in send_im_here()
331 krb5_errx (context, 1, "krb5_storage_from_data"); in send_im_here()
335 ret = krb5_write_priv_message(context, auth_context, &fd, &data); in send_im_here()
339 krb5_err (context, 1, ret, "krb5_write_priv_message"); in send_im_here()
343 receive_everything (krb5_context context, int fd, in receive_everything() argument
356 krb5_warnx(context, "receive complete database"); in receive_everything()
359 ret = hdb_create(context, &mydb, dbname); in receive_everything()
361 krb5_err(context,1, ret, "hdb_create"); in receive_everything()
364 ret = hdb_set_master_keyfile (context, in receive_everything()
367 krb5_err(context,1, ret, "hdb_set_master_keyfile"); in receive_everything()
371 ret = mydb->hdb_open(context, mydb, O_RDWR | O_CREAT | O_TRUNC, 0600); in receive_everything()
373 krb5_err (context, 1, ret, "db->open"); in receive_everything()
377 ret = krb5_read_priv_message(context, auth_context, &fd, &data); in receive_everything()
380 krb5_warn (context, ret, "krb5_read_priv_message"); in receive_everything()
386 krb5_errx (context, 1, "krb5_storage_from_data"); in receive_everything()
399 ret = hdb_value2entry (context, &fake_data, &entry.entry); in receive_everything()
401 krb5_err (context, 1, ret, "hdb_value2entry"); in receive_everything()
402 ret = mydb->hdb_store(server_context->context, in receive_everything()
406 krb5_err (context, 1, ret, "hdb_store"); in receive_everything()
408 hdb_free_entry (context, &entry); in receive_everything()
413 krb5_errx (context, 1, "strange opcode %d", opcode); in receive_everything()
417 krb5_errx (context, 1, "receive_everything: strange %d", opcode); in receive_everything()
424 krb5_err(context, 1, ret, "kadm5_log_reinit"); in receive_everything()
428 krb5_err (context, 1, ret, "kadm5_log_set_version"); in receive_everything()
432 krb5_err (context, 1, ret, "kadm5_log_nop"); in receive_everything()
434 ret = mydb->hdb_rename (context, mydb, server_context->db->hdb_name); in receive_everything()
436 krb5_err (context, 1, ret, "db->rename"); in receive_everything()
441 ret = mydb->hdb_close (context, mydb); in receive_everything()
443 krb5_err (context, 1, ret, "db->close"); in receive_everything()
445 ret = mydb->hdb_destroy (context, mydb); in receive_everything()
447 krb5_err (context, 1, ret, "db->destroy"); in receive_everything()
449 krb5_warnx(context, "receive complete database, version %ld", (long)vno); in receive_everything()
495 krb5_context context; in main() local
525 ret = krb5_init_context(&context); in main()
532 if (asprintf(&config_file, "%s/kdc.conf", hdb_db_dir(context)) == -1 in main()
539 krb5_err(context, 1, ret, "getting configuration files"); in main()
541 ret = krb5_set_config_files(context, files); in main()
544 krb5_err(context, 1, ret, "reading configuration files"); in main()
559 krb5_openlog (context, "ipropd-slave", &log_facility); in main()
560 krb5_set_warn_dest(context, log_facility); in main()
562 ret = krb5_kt_register(context, &hdb_kt_ops); in main()
564 krb5_err(context, 1, ret, "krb5_kt_register"); in main()
568 krb5_errx (context, 1, "couldn't parse time: %s", server_time_lost); in main()
575 ret = kadm5_init_with_password_ctx (context, in main()
582 krb5_err (context, 1, ret, "kadm5_init_with_password_ctx"); in main()
588 krb5_err (context, 1, ret, "kadm5_log_init"); in main()
590 get_creds(context, keytab_str, &ccache, master); in main()
592 ret = krb5_sname_to_principal (context, master, IPROP_NAME, in main()
595 krb5_err (context, 1, ret, "krb5_sname_to_principal"); in main()
600 krb5_appdefault_time(context, config_name, NULL, "reconnect-min", in main()
602 krb5_appdefault_time(context, config_name, NULL, "reconnect-max", in main()
604 krb5_appdefault_time(context, config_name, NULL, "reconnect-backoff", in main()
617 krb5_warnx(context, "sleeping %d seconds before " in main()
623 master_fd = connect_to_master (context, master, port_str); in main()
630 krb5_auth_con_free(context, auth_context); in main()
632 krb5_cc_destroy(context, ccache); in main()
633 get_creds(context, keytab_str, &ccache, master); in main()
635 ret = krb5_sendauth (context, &auth_context, &master_fd, in main()
640 krb5_warn (context, ret, "krb5_sendauth"); in main()
644 krb5_warnx(context, "ipropd-slave started at version: %ld", in main()
647 ret = ihave (context, auth_context, master_fd, in main()
663 krb5_errx (context, 1, "fd too large"); in main()
678 krb5_err (context, 1, errno, "select"); in main()
681 krb5_errx (context, 1, "server didn't send a message " in main()
684 ret = krb5_read_priv_message(context, auth_context, &master_fd, &out); in main()
686 krb5_warn (context, ret, "krb5_read_priv_message"); in main()
695 receive (context, sp, server_context); in main()
696 ret = ihave (context, auth_context, master_fd, in main()
702 ret = receive_everything (context, master_fd, server_context, in main()
708 send_im_here (context, master_fd, auth_context); in main()
715 krb5_warnx (context, "Ignoring command %d", tmp); in main()
724 krb5_warnx (context, "disconnected for server"); in main()
726 krb5_warnx (context, "got an exit signal"); in main()
739 krb5_warnx(context, "%s CPU time limit exceeded", getprogname()); in main()
742 krb5_warnx(context, "%s terminated", getprogname()); in main()
744 krb5_warnx(context, "%s unexpected exit reason: %ld", in main()