CVS: tmda/contrib ChangeLog,1.99,1.100 vmailmgr-vdir.sh,1.1,1.2 vpopmail-vdir.sh,1.2,1.3

Timothy Legant <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/contrib
In directory sc8-pr-cvs1:/tmp/cvs-serv11884/contrib

Modified Files:
	ChangeLog vmailmgr-vdir.sh vpopmail-vdir.sh 
Log Message:
vmailmgr-vdir.sh, vpopmail-vdir.sh: Modified to return error
code if home directory lookup fails.



Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/ChangeLog,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- ChangeLog	19 Apr 2003 14:13:50 -0000	1.99
+++ ChangeLog	18 Jun 2003 03:29:11 -0000	1.100
@@ -1,3 +1,8 @@
+2003-06-17  Tim Legant  <[email protected]>
+
+	* vmailmgr-vdir.sh, vpopmail-vdir.sh: Modified to return error
+	code if home directory lookup fails.
+
 2003-04-19  Gre7g Luterman <[email protected]>
 
 	* Removed getuserinfo-vpopmail.sh

Index: vmailmgr-vdir.sh
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/vmailmgr-vdir.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vmailmgr-vdir.sh	21 Jan 2003 05:31:35 -0000	1.1
+++ vmailmgr-vdir.sh	18 Jun 2003 03:29:11 -0000	1.2
@@ -23,18 +23,26 @@
 # Set IFS to a newline (no space, no tab)
 IFS='
 '
-set `${LISTVDOMAIN} $1`
+output=$(${LISTVDOMAIN} $1)
+rc=$?
+
+if [ $rc -ne 0 ]; then
+    exit $rc
+fi
+
+set -- $output
+
 # Reset IFS to a space, tab, newline.
 IFS=' 	
 '
-set $2
+set -- $2
 
 # $2, now the user's home directory, is relative to $HOME and looks like this:
 #
 # ./users/<username>
 #
 # Strip off the leading dot, but leave the (now leading) '/'.
-homedir=`echo $2 | ${SED} 's/^\.//'`
+homedir=$(echo $2 | ${SED} 's/^\.//')
 
 # No separating '/' necessary because 'homedir' begins with '/'.
-echo ${HOME}${homedir}
+echo "${HOME}${homedir}"

Index: vpopmail-vdir.sh
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/vpopmail-vdir.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vpopmail-vdir.sh	3 Feb 2003 20:43:29 -0000	1.2
+++ vpopmail-vdir.sh	18 Jun 2003 03:29:11 -0000	1.3
@@ -22,4 +22,20 @@
     vuser="$1@$2"
 fi
 
-${VUSERINFO} -d $vuser
+output=$(${VUSERINFO} -d "$vuser")
+rc=$?
+
+if [ $rc -ne 0 ]; then
+    exit $rc
+fi
+
+set -- $output
+
+# Older versions of vuserinfo prefaced the home directory with 'dir: '
+if [ -n "$2" ]; then
+    $1=$2
+fi
+
+echo $1
+
+exit 0

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.