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

svn at pcbsd.org svn at pcbsd.org
Tue Sep 11 12:10:16 PDT 2012


Author: kris
Date: 2012-09-11 19:10:16 +0000 (Tue, 11 Sep 2012)
New Revision: 19059

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

Change default user home dirs from /home -> /usr/home (Fixes issues with PEFS)

Create ZFS dataset if possible for each new user home-directory
Remove ZFS dataset for a home-directory when removing a user



Modified: pcbsd/current/src-qt4/pc-usermanager/adddlgcode.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-usermanager/adddlgcode.cpp	2012-09-11 18:48:51 UTC (rev 19058)
+++ pcbsd/current/src-qt4/pc-usermanager/adddlgcode.cpp	2012-09-11 19:10:16 UTC (rev 19059)
@@ -80,7 +80,7 @@
     }
     groupRadioNew->setText(groupText);
     
-    QString homeDir = "/home/";
+    QString homeDir = "/usr/home/";
     homeDir+=username;
     if (username != "") {
 	homeDir+="/";

Modified: pcbsd/current/src-qt4/pc-usermanager/simpleaddcode.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-usermanager/simpleaddcode.cpp	2012-09-11 18:48:51 UTC (rev 19058)
+++ pcbsd/current/src-qt4/pc-usermanager/simpleaddcode.cpp	2012-09-11 19:10:16 UTC (rev 19059)
@@ -218,7 +218,7 @@
        if (abortAdd == 0)
        {
            qDebug() << "Before back->addUser";
-	   back->addUser(username, fullname, "/home/" + username, "/bin/csh", QString::null, password);
+	   back->addUser(username, fullname, "/usr/home/" + username, "/bin/csh", QString::null, password);
 	   back->changePassword(username, password);
            qDebug() << "After back->addUser";
        }

Modified: pcbsd/current/src-qt4/pc-usermanager/usermanagerback.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-usermanager/usermanagerback.cpp	2012-09-11 18:48:51 UTC (rev 19058)
+++ pcbsd/current/src-qt4/pc-usermanager/usermanagerback.cpp	2012-09-11 19:10:16 UTC (rev 19059)
@@ -384,6 +384,9 @@
             case 2:
                 //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() )
 		   args << chroot << "pw";
                 args << "useradd";
@@ -432,7 +435,10 @@
 		   args << chroot << "pw";
                 args << "userdel";
                 args << userIt->getUsername();
-                if(userIt->getDeleteHome()) args << "-r";
+                if(userIt->getDeleteHome()) {
+			args << "-r";
+			system("/usr/local/share/pcbsd/scripts/rmzfsdir.sh " + userIt->getHome().toLatin1() );
+		}
 		if ( ! chroot.isEmpty() )
 		   QProcess::execute("chroot", args);
 		else



More information about the Commits mailing list