Ignore:
Timestamp:
02/12/2012 03:58:59 AM (12 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
f42ffb8a
Parents:
b17ac78
Message:

Update ca-cert scripts.

Account for changed upstream format.
Ensure date command works for all systems.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@9380 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/security/cacerts.xml

    rb17ac78 rfe54f243  
    8989# Authors: DJ Lucas
    9090#          Bruce Dubbs
     91#
     92# Version 20120211
    9193
    9294my $certdata = './tempfile.cer';
     
    143145# Authors: DJ Lucas
    144146#          Bruce Dubbs
     147#
     148# Version 20120211
    145149
    146150certdata="certdata.txt"
     
    194198  # Make sure that the cert is trusted...
    195199  grep "CKA_TRUST_SERVER_AUTH" "${tempfile}" | \
    196     grep "CKT_NETSCAPE_TRUST_UNKNOWN" > /dev/null
     200    egrep "TRUST_UNKNOWN|NOT_TRUSTED" > /dev/null
    197201
    198202  if test "${?}" = "0"; then
     
    238242#!/bin/bash
    239243# Begin /bin/remove-expired-certs.sh
     244#
     245# Version 20120211
     246
     247# Make sure the date is parsed correctly on all systems
     248function mydate()
     249{
     250  local y=$( echo $1 | cut -d" " -f4 )
     251  local M=$( echo $1 | cut -d" " -f1 )
     252  local d=$( echo $1 | cut -d" " -f2 )
     253  local m
     254
     255  case $M in
     256    Jan) m="01";;
     257    Feb) m="02";;
     258    Mar) m="03";;
     259    Apr) m="04";;
     260    May) m="05";;
     261    Jun) m="06";;
     262    Jul) m="07";;
     263    Aug) m="08";;
     264    Sep) m="09";;
     265    Oct) m="10";;
     266    Nov) m="11";;
     267    Dec) m="12";;
     268  esac
     269
     270  certdate="${y}${m}${d}"
     271}
    240272
    241273OPENSSL=/usr/bin/openssl
     
    252284  notafter=$( $OPENSSL x509 -enddate -in "${cert}" -noout )
    253285  date=$( echo ${notafter} |  sed 's/^notAfter=//' )
    254 
    255   if [ $( date -d "${date}" +%Y%m%d ) -lt ${today} ]; then
     286  mydate "date"
     287
     288  if [ ${certdate} -lt ${today} ]; then
    256289     echo "${cert} is expired! Removing..."
    257290     rm -f "${cert}"
Note: See TracChangeset for help on using the changeset viewer.