Ignore:
Timestamp:
07/02/13 12:04:46 (15 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
f5021cc
Parents:
796a591
Message:

Update the enable_user_pefs script
Now it will check if PEFS is available on the system and fail if not
It will also auto-correct if the users home-directory is a symlink

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/xtrafiles/local/bin/enable_user_pefs

    r1620346 r9f8fa2c  
    55 
    66PEFSDBDIR="/var/db/pefs" 
     7 
     8# Check if we can safely enable PEFS on this system 
     9if [ ! -e "/boot/kernel/pefs.ko" ] ; then 
     10   echo "Error: Requires PEFS in base system!" 
     11   exit 1 
     12fi 
    713 
    814USER="$1" 
     
    2127 
    2228if [ "$USERHOMEDIR" != "`realpath ${USERHOMEDIR}`" ] ; then 
    23   echo "Warning: PEFS will not work with sym-linked home dirs.." 
     29  NEWDIR=`realpath $USERHOMEDIR` 
     30  echo "Updating sym-linked home dir ${USERHOMEDIR} -> ${NEWDIR}" 
     31  OLDLINE=`cat /etc/master.passwd | grep "^${USER}:" | cut -d ':' -f 4-` 
     32  NEWLINE=`echo $OLDLINE | sed "s|:${USERHOMEDIR}:|:${NEWDIR}:|g"` 
     33  sed -i '.bak' "s|${OLDLINE}|${NEWLINE}|g" /etc/master.passwd 
     34  pwd_mkdb -p /etc/master.passwd 
    2435  USERHOMEDIR=`realpath $USERHOMEDIR` 
    2536fi 
     
    5970fi 
    6071 
     72# Copy /etc/pam.d/ template files 
     73cp /usr/local/share/pcbsd/pefs/other /etc/pam.d/other 
     74cp /usr/local/share/pcbsd/pefs/system /etc/pam.d/system 
Note: See TracChangeset for help on using the changeset viewer.