|
|
@ -134,7 +134,7 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const
|
|
|
|
FILE *fout;
|
|
|
|
FILE *fout;
|
|
|
|
char iceauthority[200];
|
|
|
|
char iceauthority[200];
|
|
|
|
char *host, *auth;
|
|
|
|
char *host, *auth;
|
|
|
|
host = tqstrdup(dcopServer);
|
|
|
|
host = tqstrdup(dcopServer.ascii());
|
|
|
|
auth = tqstrdup(iceAuth);
|
|
|
|
auth = tqstrdup(iceAuth);
|
|
|
|
int tempfile;
|
|
|
|
int tempfile;
|
|
|
|
int oldumask = umask(077);
|
|
|
|
int oldumask = umask(077);
|
|
|
@ -150,8 +150,8 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iceauthorityFile = iceauthority;
|
|
|
|
iceauthorityFile = iceauthority;
|
|
|
|
//FIXME we should change owner of iceauthority file, but don't have permissions
|
|
|
|
//FIXME we should change owner of iceauthority file, but don't have permissions
|
|
|
|
setenv("ICEAUTHORITY", iceauthorityFile, 1);
|
|
|
|
setenv("ICEAUTHORITY", iceauthorityFile.local8Bit(), 1);
|
|
|
|
|
|
|
|
|
|
|
|
fout = popen("iceauth >/dev/null 2>&1", "w");
|
|
|
|
fout = popen("iceauth >/dev/null 2>&1", "w");
|
|
|
|
if (!fout) {
|
|
|
|
if (!fout) {
|
|
|
|
kdError() << "error in tdesudo running iceauth" << endl;
|
|
|
|
kdError() << "error in tdesudo running iceauth" << endl;
|
|
|
@ -191,8 +191,8 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const
|
|
|
|
TQString c = "/usr/bin/xauth -q -f " + m_tmpname + " generate "
|
|
|
|
TQString c = "/usr/bin/xauth -q -f " + m_tmpname + " generate "
|
|
|
|
+ TQString::fromLocal8Bit(disp) + " . trusted timeout 60";
|
|
|
|
+ TQString::fromLocal8Bit(disp) + " . trusted timeout 60";
|
|
|
|
blockSigChild(); // pclose uses waitpid()
|
|
|
|
blockSigChild(); // pclose uses waitpid()
|
|
|
|
|
|
|
|
|
|
|
|
if (!(f = popen(c, "r"))) {
|
|
|
|
if (!(f = popen(c.local8Bit(), "r"))) {
|
|
|
|
kdWarning() << k_lineinfo << "Cannot run: " << c << "\n";
|
|
|
|
kdWarning() << k_lineinfo << "Cannot run: " << c << "\n";
|
|
|
|
unblockSigChild();
|
|
|
|
unblockSigChild();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -251,7 +251,7 @@ TdeSudo::TdeSudo(TQWidget *parent, const char *name,const TQString& icon, const
|
|
|
|
else if (priority)
|
|
|
|
else if (priority)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString n = args->getOption("p");
|
|
|
|
TQString n = args->getOption("p");
|
|
|
|
int intn = atoi(n);
|
|
|
|
int intn = atoi(n.ascii());
|
|
|
|
intn = (intn * 40 / 100) - (20 + 0.5);
|
|
|
|
intn = (intn * 40 / 100) - (20 + 0.5);
|
|
|
|
|
|
|
|
|
|
|
|
TQString strn;
|
|
|
|
TQString strn;
|
|
|
@ -334,7 +334,7 @@ void TdeSudo::receivedOut(TDEProcess*, char*buffer, int buflen)
|
|
|
|
pcTmp[buflen]='\0';
|
|
|
|
pcTmp[buflen]='\0';
|
|
|
|
TQString strOut(pcTmp);
|
|
|
|
TQString strOut(pcTmp);
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << strOut << std::endl;
|
|
|
|
std::cout << strOut.local8Bit() << std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
static int badpass = 0;
|
|
|
|
static int badpass = 0;
|
|
|
|
|
|
|
|
|
|
|
|