Browse Source

Tools renaming, part 1

master
Andrea Luzzardi 17 years ago
parent
commit
b452a3bf38
5 changed files with 15 additions and 14 deletions
  1. +8
    -7
      pam_usb/Makefile
  2. +1
    -1
      pam_usb/doc/pusb.conf-dist
  3. +0
    -0
      pam_usb/src/pamusb-check.c
  4. +6
    -6
      pam_usb/tools/pamusb-agent
  5. +0
    -0
      pam_usb/tools/pamusb-conf

+ 8
- 7
pam_usb/Makefile View File

@ -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_*

+ 1
- 1
pam_usb/doc/pusb.conf-dist View File

@ -43,7 +43,7 @@ See http://www.pamusb.org/doc/configuring
<!-- Services settings (e.g. gdm, su, sudo...) -->
<services>
<!-- Example: Speed up hotplugging by disabling one time pads -->
<service id="pusb_hotplug">
<service id="pamusb-agent">
<option name="one_time_pad">false</option>
</service>
</services>


pam_usb/src/pusb_check.c → pam_usb/src/pamusb-check.c View File


pam_usb/tools/pusb_hotplug → pam_usb/tools/pamusb-agent View File

@ -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:

pam_usb/tools/pusb_conf → pam_usb/tools/pamusb-conf View File


Loading…
Cancel
Save