home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / libpam-runtime.postinst < prev    next >
Encoding:
Text File  |  2009-09-03  |  1.2 KB  |  50 lines

  1. #!/bin/sh -e
  2.  
  3. . /usr/share/debconf/confmodule
  4.  
  5. # pam-auth-update is introduced in 1.0.1-2ubuntu1
  6. # Between 1.0.1-2ubuntu1 and 1.0.1-9ubuntu1.1 it is possible to get empty
  7. # profiles
  8. if [ "x$2" != "x" ] ;then
  9.     if dpkg --compare-versions $2 lt 1.0.1-9ubuntu1.1 && dpkg --compare-versions $2 ge 1.0.1-2ubuntu1 ; then
  10.     db_get libpam-runtime/profiles
  11.     if [ "x$RET" = "x" ] ; then
  12.         UHOH=1
  13.     fi
  14.     fi
  15. fi
  16.  
  17. # If the user has removed the config file, respect this sign of dementia
  18. # -- only create on package install.
  19. force=
  20. if [ -z "$2" ] || dpkg --compare-versions "$2" lt 1.0.1-6
  21. then
  22.     force=--force
  23.     for configfile in common-auth common-account common-session  \
  24.         common-password
  25.     do
  26.         if [ -f /etc/pam.d/$configfile ] && \
  27.             ! fgrep -q `md5sum /etc/pam.d/$configfile` \
  28.             /usr/share/pam/$configfile.md5sums 2>/dev/null
  29.         then
  30.             force=
  31.         fi
  32.     done
  33. fi
  34.  
  35. pam-auth-update --package $force
  36.  
  37. if [ -n "$force" ]; then
  38.     rm -f /etc/pam.d/common-auth.pam-old \
  39.           /etc/pam.d/common-account.pam-old \
  40.           /etc/pam.d/common-password.pam-old \
  41.           /etc/pam.d/common-session.pam-old
  42. fi
  43.  
  44. if [ -n "$UHOH" ]; then
  45.     db_input critical libpam-runtime/you-had-no-auth || true
  46.     db_go
  47. fi
  48.  
  49.  
  50.