- Timestamp:
- 2008-02-17T01:39:39Z (16 years ago)
- Branches:
- master
- Children:
- 82e8fe8
- Parents:
- fd9fa52
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
otr.c
rfd9fa52 rba5add7 112 112 113 113 /* main function for the forked keygen slave */ 114 void keygen_child_main( OtrlUserState us, int infd, int outfd);114 void keygen_child_main(const char *nick, int infd, int outfd); 115 115 116 116 /* mainloop handler for when a keygen finishes */ … … 1527 1527 /* child process */ 1528 1528 signal(SIGTERM, exit); 1529 keygen_child_main(irc-> otr->us, to[0], from[1]);1529 keygen_child_main(irc->nick, to[0], from[1]); 1530 1530 exit(0); 1531 1531 } … … 1548 1548 kg=&((*kg)->next); 1549 1549 *kg = g_new0(kg_t, 1); 1550 (*kg)->accountname = handle;1551 (*kg)->protocol = protocol;1550 (*kg)->accountname = g_strdup(handle); 1551 (*kg)->protocol = g_strdup(protocol); 1552 1552 } else { 1553 1553 /* send our job over and remember it */ … … 1555 1555 fprintf(irc->otr->to, "%s\n%s\n", handle, protocol); 1556 1556 fflush(irc->otr->to); 1557 irc->otr->sent_accountname = handle; 1558 irc->otr->sent_protocol = protocol; 1559 } 1560 } 1561 1562 void keygen_child_main(OtrlUserState us, int infd, int outfd) 1563 { 1557 irc->otr->sent_accountname = g_strdup(handle); 1558 irc->otr->sent_protocol = g_strdup(protocol); 1559 } 1560 } 1561 1562 void keygen_child_main(const char *nick, int infd, int outfd) 1563 { 1564 OtrlUserState us; 1565 char *kf; 1564 1566 FILE *input, *output; 1565 1567 char filename[128], accountname[512], protocol[512]; 1566 1568 gcry_error_t e; 1567 1569 int tempfd; 1570 1571 us = otrl_userstate_create(); 1572 kf = g_strdup_printf("%s%s.otr_keys", global.conf->configdir, nick); 1573 otrl_privkey_read(us, kf); 1574 g_free(kf); 1568 1575 1569 1576 input = fdopen(infd, "r"); … … 1620 1627 1621 1628 /* forget this job */ 1629 g_free(irc->otr->sent_accountname); 1630 g_free(irc->otr->sent_protocol); 1622 1631 irc->otr->sent_accountname = NULL; 1623 1632 irc->otr->sent_protocol = NULL;
Note: See TracChangeset
for help on using the changeset viewer.