aboutsummaryrefslogtreecommitdiffstats
path: root/scd/NOTES-STATUSFD
diff options
context:
space:
mode:
authorMoritz Schulte <[email protected]>2007-08-16 12:44:17 +0000
committerMoritz Schulte <[email protected]>2007-08-16 12:44:17 +0000
commit62039d815eef5a699cb7d78a36a0a5e9eb5910c8 (patch)
tree925563c8c20b48aabd3825d26bc387d9e4631c84 /scd/NOTES-STATUSFD
parentCreating new branch for moritz' hacks (diff)
downloadgnupg-GNUPG-TRUNK-MO-HACKS.tar.gz
gnupg-GNUPG-TRUNK-MO-HACKS.zip
Implemented the STATUSFD mechanism.GNUPG-TRUNK-MO-HACKS
2007-08-16 Moritz Schulte <[email protected]> * command.c: Include "statusfd.h". (cmd_statusfd): New function. (register_commands): New entry for STATUSFD command. (update_reader_status_file): Call statusfd_event_card_inserted and statusfd_event_card_removed on events. (scd_command_handler): Pass flags=3 to assuan_init_socket_server_ext (enabling fd passing). * statusfd.c, statusfd.h: New files. * Makefile.am (scdaemon_SOURCES): Added statusfd.c, statusfd.h. * NOTES-STATUSFD: New file.
Diffstat (limited to '')
-rw-r--r--scd/NOTES-STATUSFD36
1 files changed, 36 insertions, 0 deletions
diff --git a/scd/NOTES-STATUSFD b/scd/NOTES-STATUSFD
new file mode 100644
index 000000000..543ee3d28
--- /dev/null
+++ b/scd/NOTES-STATUSFD
@@ -0,0 +1,36 @@
+Description of the statusfd mechanism:
+
+Applications can now ask scdaemon to be notified about certain events
+(card inserted/removed) on a specified file descriptor.
+
+This is how it works:
+
+Run gpg-agent in daemon mode.
+Figure out scdaemons socket:
+
+
+moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ gpg-connect-agent
+SCD GETINFO socket_name
+D /tmp/gpg-QZRVNr/S.scdaemon
+OK
+
+Connect to scdaemon and register a status file descriptor:
+
+moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ gpg-connect-agent -S /tmp/gpg-QZRVNr/S.scdaemon
+/sendfd /tmp/scd-events w
+STATUSFD
+OK
+moritz@pink:~/g10/hacks/gnupg-mo/build/scd$
+
+
+Watch the log file as you remove/insert the smartcard:
+
+moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ tail -f /tmp/scd-events
+CARD REMOVED
+CARD INSERTED
+CARD REMOVED
+CARD INSERTED
+^C
+moritz@pink:~/g10/hacks/gnupg-mo/build/scd$
+
+That's it for now.