Sunday, September 4, 2011

My name in Mac OS X Lion?

I asked myself the question: how many times is my name present in a standard Mac OS X Lion installation?

Command line: pcscd

$ pcscd -v
PCSC Framework version 1.4.0.
Copyright (C) 1999-2002 by David Corcoran <corcoran@linuxnet.com>.
Copyright (C) 2001-2005 by Ludovic Rousseau <ludovic.rousseau@free.fr>.
Copyright (C) 2003-2004 by Damien Sauveron <sauveron@labri.fr>.
Portions Copyright (C) 2000-2007 by Apple Inc.
Report bugs to <sclinux@linuxnet.com>.

Manpage: pcscd

$ man pcscd
[...]
AUTHORS
       David Corcoran <corcoran@identityalliance.com> and Ludovic Rousseau
       <ludovic.rousseau@free.fr>

Configuration file: CCID driver Info.plist

$ grep -A 1 ifdManufacturerString /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
	<key>ifdManufacturerString</key>
	<string>Ludovic Rousseau (ludovic.rousseau@free.fr)</string>

Header files: PCSC framework

A standard Lion installation does not contain the header files used to develop PC/SC applications. You need to install the Xcode package for that.

After installing Xcode (available for free from the App Store) you get:
$ cd /System/Library/Frameworks/PCSC.framework/Headers
$ grep rousseau *
pcsclite.h: *  Ludovic Rousseau <ludovic.rousseau@free.fr>
pcsclite.h: * $Id: pcsclite.h 123 2010-03-27 10:50:42Z ludovic.rousseau@gmail.com $
winscard.h: *  Ludovic Rousseau <ludovic.rousseau@free.fr>
winscard.h: * $Id: winscard.h 123 2010-03-27 10:50:42Z ludovic.rousseau@gmail.com $
wintypes.h: * $Id: wintypes.h 123 2010-03-27 10:50:42Z ludovic.rousseau@gmail.com $

My name is in 3 files: pcsclite.h, winscard.h and wintypes.h. The lines with $Id: ... $ are automatically changed by subversion when a new commit is made. If someone make a new commit to these files my name will be replace. But as I wrote in Mac OS X Lion and smart cards status I am nearly the only one to work on pcsc-lite on Mac OS X.

Ask nicely: CCID driver

My name is also present in the binary of the CCID driver.
$ cd /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/MacOS
$ strings libccid.dylib | grep Rousseau
Ludovic Rousseau

This is because the CCID driver implements the SCARD_ATTR_VENDOR_NAME attribute for SCardGetAttrib(). You can extract the information using a simple getAttrib.py Python program:
#! /usr/bin/env python

from smartcard.System import readers
from smartcard.scard import SCARD_ATTR_VENDOR_NAME

card_connection = readers()[0].createConnection()
card_connection.connect()

name = card_connection.getAttrib(SCARD_ATTR_VENDOR_NAME)
print ''.join([chr(char) for char in name])

The execution gives:
$ ./getAttrib.py 
Ludovic Rousseau

You need to use at least revision 541 of the pyscard project. This version is not yet available in a stable pyscard release.

Other sources

My name is famous in France. Wikipedia lists 50 different Rousseau and I am not (yet) in the list.

Mac OS X provides a dictionary. Using the French Academy Dictionary we have:

From the Oxford Dictionary of English we have:

Conclusion

My full name is present 4 times in a default Mac OS X Lion installation. The number goes up to 9 on a developer system. What about your name?

Yes, this article is useless. Maybe it is a sign I am mad? Ha ha ha!