mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add the ability to specify "PEFS" as the personacrypt device through the SysAdm API.
This commit is contained in:
@@ -92,10 +92,12 @@ bool UserManager::addUser(QJsonObject* out, QJsonObject obj){
|
||||
QString dev = obj.value("personacrypt_init").toString();
|
||||
if(dev.startsWith("/dev/")){ dev = dev.remove(0,5); }
|
||||
//Verify that the given device is valid
|
||||
QStringList valid = getAvailablePersonaCryptDevices();
|
||||
for(int i=0; i<valid.length(); i++){
|
||||
if(valid[i].startsWith(dev+": ")){ PCdev = dev; } //this is a valid device
|
||||
}
|
||||
if(dev!="PEFS"){
|
||||
QStringList valid = getAvailablePersonaCryptDevices();
|
||||
for(int i=0; i<valid.length(); i++){
|
||||
if(valid[i].startsWith(dev+": ")){ PCdev = dev; } //this is a valid device
|
||||
}
|
||||
}else{ PCdev = dev; } //PEFS device
|
||||
if(PCdev!=dev){ return false; } //invalid inputs - invalid device for PersonaCrypt
|
||||
}
|
||||
QTemporaryFile pwfile("/tmp/.XXXXXXXXXXXXXXX");
|
||||
@@ -169,10 +171,12 @@ bool UserManager::modifyUser(QJsonObject* out, QJsonObject obj){
|
||||
QString dev = obj.value("personacrypt_init").toString();
|
||||
if(dev.startsWith("/dev/")){ dev = dev.remove(0,5); }
|
||||
//Verify that the given device is valid
|
||||
QStringList valid = getAvailablePersonaCryptDevices();
|
||||
for(int i=0; i<valid.length(); i++){
|
||||
if(valid[i].startsWith(dev+": ")){ PCdev = dev; } //this is a valid device
|
||||
}
|
||||
if(dev!="PEFS"){
|
||||
QStringList valid = getAvailablePersonaCryptDevices();
|
||||
for(int i=0; i<valid.length(); i++){
|
||||
if(valid[i].startsWith(dev+": ")){ PCdev = dev; } //this is a valid device
|
||||
}
|
||||
}else{ PCdev = dev; } //PEFS device
|
||||
if(PCdev!=dev){ return false; } //invalid inputs - invalid device for PersonaCrypt
|
||||
}
|
||||
//Now start assembling the external command
|
||||
|
||||
Reference in New Issue
Block a user