diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-08-20 22:11:38 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-08-20 22:11:38 +0200 |
commit | 92221ed7cbf0323919fc2ae379be2322a3e20558 (patch) | |
tree | 648c7c27dbf8bf449d7f9172dd8953c5965e0174 /src/journal/journal-qrcode.c | |
parent | journalctl: output FSS key as QR code on generating (diff) | |
download | systemd-92221ed7cbf0323919fc2ae379be2322a3e20558.tar.xz systemd-92221ed7cbf0323919fc2ae379be2322a3e20558.zip |
journal: include machine ID in QR code
Diffstat (limited to 'src/journal/journal-qrcode.c')
-rw-r--r-- | src/journal/journal-qrcode.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/journal/journal-qrcode.c b/src/journal/journal-qrcode.c index b4dab8e86a..10a14e4def 100644 --- a/src/journal/journal-qrcode.c +++ b/src/journal/journal-qrcode.c @@ -46,7 +46,15 @@ static void print_border(FILE *output, unsigned width) { } } -int print_qr_code(FILE *output, const void *seed, size_t seed_size, uint64_t start, uint64_t interval, const char *hn, sd_id128_t mahcine) { +int print_qr_code( + FILE *output, + const void *seed, + size_t seed_size, + uint64_t start, + uint64_t interval, + const char *hn, + sd_id128_t machine) { + FILE *f; char *url = NULL; size_t url_size = 0, i; @@ -68,10 +76,13 @@ int print_qr_code(FILE *output, const void *seed, size_t seed_size, uint64_t sta fprintf(f, "%02x", ((uint8_t*) seed)[i]); } - fprintf(f, "/%llx-%llx\n", (unsigned long long) start, (unsigned long long) interval); + fprintf(f, "/%llx-%llx?machine=" SD_ID128_FORMAT_STR, + (unsigned long long) start, + (unsigned long long) interval, + SD_ID128_FORMAT_VAL(machine)); if (hn) - fprintf(f, "?hostname=%s", hn); + fprintf(f, ";hostname=%s", hn); if (ferror(f)) { fclose(f); |