|
|
@ -937,7 +937,7 @@ TQString TDEStorageDevice::mountPath() {
|
|
|
|
file.close();
|
|
|
|
file.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// While this device is not directly mounted, it could concievably be mounted via the Device Mapper
|
|
|
|
// While this device is not directly mounted, it could conceivably be mounted via the Device Mapper
|
|
|
|
// If so, try to retrieve the mount path...
|
|
|
|
// If so, try to retrieve the mount path...
|
|
|
|
TQStringList slaveDeviceList = holdingDevices();
|
|
|
|
TQStringList slaveDeviceList = holdingDevices();
|
|
|
|
for ( TQStringList::Iterator slavedevit = slaveDeviceList.begin(); slavedevit != slaveDeviceList.end(); ++slavedevit ) {
|
|
|
|
for ( TQStringList::Iterator slavedevit = slaveDeviceList.begin(); slavedevit != slaveDeviceList.end(); ++slavedevit ) {
|
|
|
@ -953,7 +953,7 @@ TQString TDEStorageDevice::mountPath() {
|
|
|
|
return TQString::null;
|
|
|
|
return TQString::null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString TDEStorageDevice::mountDevice(TQString mediaName, TQString mountOptions, TQString* errRet, int* retcode) {
|
|
|
|
TQString TDEStorageDevice::mountDevice(TQString mediaName, TDEStorageMountOptions mountOptions, TQString* errRet, int* retcode) {
|
|
|
|
int internal_retcode;
|
|
|
|
int internal_retcode;
|
|
|
|
if (!retcode) {
|
|
|
|
if (!retcode) {
|
|
|
|
retcode = &internal_retcode;
|
|
|
|
retcode = &internal_retcode;
|
|
|
@ -969,12 +969,37 @@ TQString TDEStorageDevice::mountDevice(TQString mediaName, TQString mountOptions
|
|
|
|
KTempFile passwordFile(TQString::null, "tmp", 0600);
|
|
|
|
KTempFile passwordFile(TQString::null, "tmp", 0600);
|
|
|
|
passwordFile.setAutoDelete(true);
|
|
|
|
passwordFile.setAutoDelete(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString optionString;
|
|
|
|
|
|
|
|
if (mountOptions["ro"] == "true") {
|
|
|
|
|
|
|
|
optionString.append(" -r");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions["atime"] != "true") {
|
|
|
|
|
|
|
|
optionString.append(" -A");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions["utf8"] == "true") {
|
|
|
|
|
|
|
|
optionString.append(" -c utf8");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions["sync"] == "true") {
|
|
|
|
|
|
|
|
optionString.append(" -s");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions.contains("filesystem")) {
|
|
|
|
|
|
|
|
optionString.append(TQString(" -t %1").arg(mountOptions["filesystem"]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions.contains("locale")) {
|
|
|
|
|
|
|
|
optionString.append(TQString(" -c %1").arg(mountOptions["locale"]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString passFileName = passwordFile.name();
|
|
|
|
TQString passFileName = passwordFile.name();
|
|
|
|
TQString devNode = deviceNode();
|
|
|
|
TQString devNode = deviceNode();
|
|
|
|
passFileName.replace("'", "'\\''");
|
|
|
|
passFileName.replace("'", "'\\''");
|
|
|
|
devNode.replace("'", "'\\''");
|
|
|
|
devNode.replace("'", "'\\''");
|
|
|
|
mediaName.replace("'", "'\\''");
|
|
|
|
mediaName.replace("'", "'\\''");
|
|
|
|
TQString command = TQString("pmount -p '%1' %2 '%3' '%4' 2>&1").arg(passFileName).arg(mountOptions).arg(devNode).arg(mediaName);
|
|
|
|
TQString command = TQString("pmount -p '%1' %2 '%3' '%4' 2>&1").arg(passFileName).arg(optionString).arg(devNode).arg(mediaName);
|
|
|
|
|
|
|
|
|
|
|
|
FILE *exepipe = popen(command.ascii(), "r");
|
|
|
|
FILE *exepipe = popen(command.ascii(), "r");
|
|
|
|
if (exepipe) {
|
|
|
|
if (exepipe) {
|
|
|
@ -995,7 +1020,7 @@ TQString TDEStorageDevice::mountDevice(TQString mediaName, TQString mountOptions
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString TDEStorageDevice::mountEncryptedDevice(TQString passphrase, TQString mediaName, TQString mountOptions, TQString* errRet, int* retcode) {
|
|
|
|
TQString TDEStorageDevice::mountEncryptedDevice(TQString passphrase, TQString mediaName, TDEStorageMountOptions mountOptions, TQString* errRet, int* retcode) {
|
|
|
|
int internal_retcode;
|
|
|
|
int internal_retcode;
|
|
|
|
if (!retcode) {
|
|
|
|
if (!retcode) {
|
|
|
|
retcode = &internal_retcode;
|
|
|
|
retcode = &internal_retcode;
|
|
|
@ -1018,12 +1043,37 @@ TQString TDEStorageDevice::mountEncryptedDevice(TQString passphrase, TQString me
|
|
|
|
pwFile->writeBlock(passphrase.ascii(), passphrase.length());
|
|
|
|
pwFile->writeBlock(passphrase.ascii(), passphrase.length());
|
|
|
|
pwFile->flush();
|
|
|
|
pwFile->flush();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString optionString;
|
|
|
|
|
|
|
|
if (mountOptions["ro"] == "true") {
|
|
|
|
|
|
|
|
optionString.append(" -r");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions["atime"] != "true") {
|
|
|
|
|
|
|
|
optionString.append(" -A");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions["utf8"] == "true") {
|
|
|
|
|
|
|
|
optionString.append(" -c utf8");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions["sync"] == "true") {
|
|
|
|
|
|
|
|
optionString.append(" -s");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions.contains("filesystem")) {
|
|
|
|
|
|
|
|
optionString.append(TQString(" -t %1").arg(mountOptions["filesystem"]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mountOptions.contains("locale")) {
|
|
|
|
|
|
|
|
optionString.append(TQString(" -c %1").arg(mountOptions["locale"]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString passFileName = passwordFile.name();
|
|
|
|
TQString passFileName = passwordFile.name();
|
|
|
|
TQString devNode = deviceNode();
|
|
|
|
TQString devNode = deviceNode();
|
|
|
|
passFileName.replace("'", "'\\''");
|
|
|
|
passFileName.replace("'", "'\\''");
|
|
|
|
devNode.replace("'", "'\\''");
|
|
|
|
devNode.replace("'", "'\\''");
|
|
|
|
mediaName.replace("'", "'\\''");
|
|
|
|
mediaName.replace("'", "'\\''");
|
|
|
|
TQString command = TQString("pmount -p '%1' %2 '%3' '%4' 2>&1").arg(passFileName).arg(mountOptions).arg(devNode).arg(mediaName);
|
|
|
|
TQString command = TQString("pmount -p '%1' %2 '%3' '%4' 2>&1").arg(passFileName).arg(optionString).arg(devNode).arg(mediaName);
|
|
|
|
|
|
|
|
|
|
|
|
FILE *exepipe = popen(command.ascii(), "r");
|
|
|
|
FILE *exepipe = popen(command.ascii(), "r");
|
|
|
|
if (exepipe) {
|
|
|
|
if (exepipe) {
|
|
|
|