diff --git a/Makefile b/Makefile index b28fb94..68a0685 100644 --- a/Makefile +++ b/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/doc/pusb.conf-dist b/doc/pusb.conf-dist index 710b92b..b153461 100644 --- a/doc/pusb.conf-dist +++ b/doc/pusb.conf-dist @@ -43,7 +43,7 @@ See http://www.pamusb.org/doc/configuring - + diff --git a/src/pusb_check.c b/src/pamusb-check.c similarity index 100% rename from src/pusb_check.c rename to src/pamusb-check.c diff --git a/tools/pusb_hotplug b/tools/pamusb-agent similarity index 94% rename from tools/pusb_hotplug rename to tools/pamusb-agent index 0f11d2b..cc9863d 100755 --- a/tools/pusb_hotplug +++ b/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/tools/pusb_conf b/tools/pamusb-conf similarity index 100% rename from tools/pusb_conf rename to tools/pamusb-conf