From b452a3bf38a14c8581c9c72bd8e663e044ffbf7c Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 15 Mar 2007 21:19:52 +0000 Subject: [PATCH] Tools renaming, part 1 --- pam_usb/Makefile | 15 ++++++++------- pam_usb/doc/pusb.conf-dist | 2 +- pam_usb/src/{pusb_check.c => pamusb-check.c} | 0 pam_usb/tools/{pusb_hotplug => pamusb-agent} | 12 ++++++------ pam_usb/tools/{pusb_conf => pamusb-conf} | 0 5 files changed, 15 insertions(+), 14 deletions(-) rename pam_usb/src/{pusb_check.c => pamusb-check.c} (100%) rename pam_usb/tools/{pusb_hotplug => pamusb-agent} (94%) rename pam_usb/tools/{pusb_conf => pamusb-conf} (100%) diff --git a/pam_usb/Makefile b/pam_usb/Makefile index b28fb94..68a0685 100644 --- a/pam_usb/Makefile +++ b/pam_usb/Makefile @@ -26,15 +26,16 @@ PAM_USB := pam_usb.so PAM_USB_LDFLAGS := -shared PAM_USB_DEST := $(DESTDIR)/lib/security -# pusb_check -PUSB_CHECK_SRCS := src/pusb_check.c +# pamusb-check +PUSB_CHECK_SRCS := src/pamusb-check.c PUSB_CHECK_OBJS := $(PUSB_CHECK_SRCS:.c=.o) -PUSB_CHECK := pusb_check +PUSB_CHECK := pamusb-check # Tools -PUSB_CONF := tools/pusb_conf -PUSB_HOTPLUG := tools/pusb_hotplug +PUSB_CONF := pusb_conf +PUSB_AGENT := pamusb-agent TOOLS_DEST := $(DESTDIR)/usr/bin +TOOLS_SRC := tools # Conf CONFS := doc/pusb.conf-dist @@ -74,13 +75,13 @@ clean : install : all $(MKDIR) -p $(CONFS_DEST) $(DOCS_DEST) $(INSTALL) -m755 $(PAM_USB) $(PAM_USB_DEST) - $(INSTALL) -m755 $(PUSB_CHECK) $(PUSB_CONF) $(PUSB_HOTPLUG) $(TOOLS_DEST) + $(INSTALL) -m755 $(PUSB_CHECK) $(TOOLS_SRC)/$(PUSB_CONF) $(TOOLS_SRC)/$(PUSB_AGENT) $(TOOLS_DEST) $(INSTALL) -m644 $(CONFS) $(CONFS_DEST) $(INSTALL) -m644 $(DOCS) $(DOCS_DEST) $(INSTALL) -m644 $(MANS) $(MANS_DEST) deinstall : $(RM) -f $(PAM_USB_DEST)/$(PAM_USB) - $(RM) -f $(TOOLS_DEST)/$(PUSB_CHECK) $(TOOLS_DEST)/$(PUSB_CONF) $(TOOLS_DEST)/$(PUSB_HOTPLUG) + $(RM) -f $(TOOLS_DEST)/$(PUSB_CHECK) $(TOOLS_DEST)/$(PUSB_CONF) $(TOOLS_DEST)/$(PUSB_AGENT) $(RM) -rf $(DOCS_DEST) $(RM) -f $(MANS_DEST)/pusb_* diff --git a/pam_usb/doc/pusb.conf-dist b/pam_usb/doc/pusb.conf-dist index 710b92b..b153461 100644 --- a/pam_usb/doc/pusb.conf-dist +++ b/pam_usb/doc/pusb.conf-dist @@ -43,7 +43,7 @@ See http://www.pamusb.org/doc/configuring - + diff --git a/pam_usb/src/pusb_check.c b/pam_usb/src/pamusb-check.c similarity index 100% rename from pam_usb/src/pusb_check.c rename to pam_usb/src/pamusb-check.c diff --git a/pam_usb/tools/pusb_hotplug b/pam_usb/tools/pamusb-agent similarity index 94% rename from pam_usb/tools/pusb_hotplug rename to pam_usb/tools/pamusb-agent index 0f11d2b..cc9863d 100755 --- a/pam_usb/tools/pusb_hotplug +++ b/pam_usb/tools/pamusb-agent @@ -89,7 +89,7 @@ class HotPlugDevice: class Log: def __init__(self): - syslog.openlog('pusb_hotplug', syslog.LOG_PID | syslog.LOG_PERROR, + syslog.openlog('pamusb-agent', syslog.LOG_PID | syslog.LOG_PERROR, syslog.LOG_AUTH) def info(self, message): @@ -102,7 +102,7 @@ class Log: syslog.syslog(priority, message) def usage(): - print 'Usage: %s [--config file] [--daemon] [--path pusb_check_path]' % \ + print 'Usage: %s [--config file] [--daemon] [--path pamusb-check\'s path]' % \ os.path.basename(__file__) sys.exit(1) @@ -116,7 +116,7 @@ except getopt.GetoptError: options = {'configFile' : '/etc/pusb/pusb.conf', 'daemon' : False, - 'path' : '/usr/bin/pusb_check'} + 'path' : '/usr/bin/pamusb-check'} if len(args) != 0: usage() @@ -134,7 +134,7 @@ for o, a in opts: if not os.path.exists(options['path']): print '%s not found.' % options['path'] - print "You might specify manually pusb_check's location using --path." + print "You might specify manually pamusb-check's location using --path." usage() username = pwd.getpwuid(os.getuid())[0] @@ -182,7 +182,7 @@ def authChangeCallback(event): logger.info('Device "%s" has been inserted. ' \ 'Performing verification...' % deviceName) - cmdLine = "%s -q -c %s -u %s -s pusb_hotplug -a" % (options['path'], + cmdLine = "%s -q -c %s -u %s -s pamusb-agent -a" % (options['path'], options['configFile'], username) logger.info('Executing "%s"' % cmdLine) @@ -204,7 +204,7 @@ hpDev.addCallback(authChangeCallback) if options['daemon'] and os.fork(): sys.exit(0) -logger.info('pusb_hotplug up and running.') +logger.info('pamusb-agent up and running.') logger.info('Watching device "%s" for user "%s"' % (deviceName, username)) try: diff --git a/pam_usb/tools/pusb_conf b/pam_usb/tools/pamusb-conf similarity index 100% rename from pam_usb/tools/pusb_conf rename to pam_usb/tools/pamusb-conf