|
|
@ -76,7 +76,11 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
|
|
|
|
|
|
|
|
|
|
|
|
if(passphrase)
|
|
|
|
if(passphrase)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pipe(ppass);
|
|
|
|
if (pipe(ppass) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pass = fdopen(ppass[1], "w");
|
|
|
|
pass = fdopen(ppass[1], "w");
|
|
|
|
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
|
|
|
|
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
|
|
|
@ -104,9 +108,21 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
|
|
|
|
error = "";
|
|
|
|
error = "";
|
|
|
|
output = "";
|
|
|
|
output = "";
|
|
|
|
|
|
|
|
|
|
|
|
pipe(pin);
|
|
|
|
if (pipe(pin) < 0) {
|
|
|
|
pipe(pout);
|
|
|
|
// An error occurred
|
|
|
|
pipe(perr);
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pipe(pout) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pipe(perr) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQApplication::flushX();
|
|
|
|
TQApplication::flushX();
|
|
|
|
if(!(child_pid = fork()))
|
|
|
|
if(!(child_pid = fork()))
|
|
|
@ -241,8 +257,13 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // if input.isEmpty()
|
|
|
|
else { // if input.isEmpty()
|
|
|
|
write(pin[1], "\n", 1);
|
|
|
|
if (write(pin[1], "\n", 1) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
//kdDebug(5100) << "All input was written to pin[1]" << endl;
|
|
|
|
//kdDebug(5100) << "All input was written to pin[1]" << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(pin[1]);
|
|
|
|
close(pin[1]);
|
|
|
@ -398,7 +419,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
|
|
|
|
|
|
|
|
|
|
|
|
if(passphrase)
|
|
|
|
if(passphrase)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pipe(ppass);
|
|
|
|
if (pipe(ppass) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pass = fdopen(ppass[1], "w");
|
|
|
|
pass = fdopen(ppass[1], "w");
|
|
|
|
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
|
|
|
|
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
|
|
|
@ -418,9 +443,21 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
|
|
|
|
error = "";
|
|
|
|
error = "";
|
|
|
|
output = "";
|
|
|
|
output = "";
|
|
|
|
|
|
|
|
|
|
|
|
pipe(pin);
|
|
|
|
if (pipe(pin) < 0) {
|
|
|
|
pipe(pout);
|
|
|
|
// An error occurred
|
|
|
|
pipe(perr);
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pipe(pout) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pipe(perr) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( passphrase ) {
|
|
|
|
if( passphrase ) {
|
|
|
|
if( mVersion >= "1.0.7" ) {
|
|
|
|
if( mVersion >= "1.0.7" ) {
|
|
|
@ -617,7 +654,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { // if input.isEmpty()
|
|
|
|
else { // if input.isEmpty()
|
|
|
|
write(pin[1], "\n", 1);
|
|
|
|
if (write(pin[1], "\n", 1) < 0) {
|
|
|
|
|
|
|
|
// An error occurred
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
|
|
|
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
//kdDebug(5100) << "All input was written to pin[1]" << endl;
|
|
|
|
//kdDebug(5100) << "All input was written to pin[1]" << endl;
|
|
|
|
close (pin[1]);
|
|
|
|
close (pin[1]);
|
|
|
|
pin[1] = -1;
|
|
|
|
pin[1] = -1;
|
|
|
|