[PC-BSD Commits] r19815 - pcbsd/current/src-qt4/pc-usermanager

svn at pcbsd.org svn at pcbsd.org
Fri Oct 19 13:15:34 PDT 2012


Author: kris
Date: 2012-10-19 20:15:33 +0000 (Fri, 19 Oct 2012)
New Revision: 19815

Modified:
   pcbsd/current/src-qt4/pc-usermanager/usermanagerback.cpp
Log:

Fix a bug creating the users home-directory inside a jail



Modified: pcbsd/current/src-qt4/pc-usermanager/usermanagerback.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-usermanager/usermanagerback.cpp	2012-10-19 17:08:58 UTC (rev 19814)
+++ pcbsd/current/src-qt4/pc-usermanager/usermanagerback.cpp	2012-10-19 20:15:33 UTC (rev 19815)
@@ -385,7 +385,12 @@
                 //Add User
                 qDebug() << "Adding user " << userIt->getUsername();
 		// Create the new home-directory
-		system("/usr/local/share/pcbsd/scripts/mkzfsdir.sh " + userIt->getHome().toLatin1() );
+		if ( chroot.isEmpty() )
+		   system("/usr/local/share/pcbsd/scripts/mkzfsdir.sh " + userIt->getHome().toLatin1() );
+		else {
+		   system("mkdir -p " + chroot.toLatin1() + "/" + userIt->getHome().toLatin1() + " 2>/dev/null" );
+		   system("chroot " + chroot.toLatin1() + " ln -s /usr/home /home 2>/dev/null" );
+		}
 
 		if ( ! chroot.isEmpty() )
 		   args << chroot << "pw";



More information about the Commits mailing list