[PC-BSD Commits] r19816 - pcbsd/branches/9.1/src-qt4/pc-usermanager

svn at pcbsd.org svn at pcbsd.org
Fri Oct 19 13:16:10 PDT 2012


Author: kris
Date: 2012-10-19 20:16:10 +0000 (Fri, 19 Oct 2012)
New Revision: 19816

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

MFC fix to creating users home-directory inside a jail



Modified: pcbsd/branches/9.1/src-qt4/pc-usermanager/usermanagerback.cpp
===================================================================
--- pcbsd/branches/9.1/src-qt4/pc-usermanager/usermanagerback.cpp	2012-10-19 20:15:33 UTC (rev 19815)
+++ pcbsd/branches/9.1/src-qt4/pc-usermanager/usermanagerback.cpp	2012-10-19 20:16:10 UTC (rev 19816)
@@ -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