diff options
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r-- | monitor_wrap.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c index 8cc76b380..e62650342 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c | |||
@@ -1311,37 +1311,6 @@ OM_uint32 | |||
1311 | mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash) | 1311 | mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash) |
1312 | { | 1312 | { |
1313 | Buffer m; | 1313 | Buffer m; |
1314 | |||
1315 | #ifdef USE_CONSOLEKIT | ||
1316 | char * | ||
1317 | mm_consolekit_register(Session *s, const char *display) | ||
1318 | { | ||
1319 | Buffer m; | ||
1320 | char *cookie; | ||
1321 | |||
1322 | debug3("%s entering", __func__); | ||
1323 | |||
1324 | if (s->ttyfd == -1) | ||
1325 | return NULL; | ||
1326 | buffer_init(&m); | ||
1327 | buffer_put_cstring(&m, s->tty); | ||
1328 | buffer_put_cstring(&m, display != NULL ? display : ""); | ||
1329 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_CONSOLEKIT_REGISTER, &m); | ||
1330 | buffer_clear(&m); | ||
1331 | |||
1332 | mm_request_receive_expect(pmonitor->m_recvfd, | ||
1333 | MONITOR_ANS_CONSOLEKIT_REGISTER, &m); | ||
1334 | cookie = buffer_get_string(&m, NULL); | ||
1335 | buffer_free(&m); | ||
1336 | |||
1337 | /* treat empty cookie as missing cookie */ | ||
1338 | if (strlen(cookie) == 0) { | ||
1339 | xfree(cookie); | ||
1340 | cookie = NULL; | ||
1341 | } | ||
1342 | return (cookie); | ||
1343 | } | ||
1344 | #endif /* USE_CONSOLEKIT */ | ||
1345 | OM_uint32 major; | 1314 | OM_uint32 major; |
1346 | u_int len; | 1315 | u_int len; |
1347 | 1316 | ||
@@ -1545,3 +1514,34 @@ mm_jpake_check_confirm(const BIGNUM *k, | |||
1545 | return success; | 1514 | return success; |
1546 | } | 1515 | } |
1547 | #endif /* JPAKE */ | 1516 | #endif /* JPAKE */ |
1517 | |||
1518 | #ifdef USE_CONSOLEKIT | ||
1519 | char * | ||
1520 | mm_consolekit_register(Session *s, const char *display) | ||
1521 | { | ||
1522 | Buffer m; | ||
1523 | char *cookie; | ||
1524 | |||
1525 | debug3("%s entering", __func__); | ||
1526 | |||
1527 | if (s->ttyfd == -1) | ||
1528 | return NULL; | ||
1529 | buffer_init(&m); | ||
1530 | buffer_put_cstring(&m, s->tty); | ||
1531 | buffer_put_cstring(&m, display != NULL ? display : ""); | ||
1532 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_CONSOLEKIT_REGISTER, &m); | ||
1533 | buffer_clear(&m); | ||
1534 | |||
1535 | mm_request_receive_expect(pmonitor->m_recvfd, | ||
1536 | MONITOR_ANS_CONSOLEKIT_REGISTER, &m); | ||
1537 | cookie = buffer_get_string(&m, NULL); | ||
1538 | buffer_free(&m); | ||
1539 | |||
1540 | /* treat empty cookie as missing cookie */ | ||
1541 | if (strlen(cookie) == 0) { | ||
1542 | xfree(cookie); | ||
1543 | cookie = NULL; | ||
1544 | } | ||
1545 | return (cookie); | ||
1546 | } | ||
1547 | #endif /* USE_CONSOLEKIT */ | ||