[X2Go-Dev] Help with x2goclient's sshd_config

Mihai Moldovan ionic at ionic.de
Mon May 30 05:03:14 CEST 2016


On 23.05.2016 02:14 PM, Mike DePaulo wrote:
> [...]
> I've tried 2 different approaches, you can see them below. Ignore the
> x2goDebug line.
> 
> diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
> index 925085b..a1d92a8 100644
> --- a/src/onmainwindow.cpp
> +++ b/src/onmainwindow.cpp
> @@ -10292,6 +10292,8 @@ void ONMainWindow::generateEtcFiles()
>      /* This may need some sanitization, i.e., appDir could
> potentially include whitespace. */
>         <<appDir<<"/sftp-server\n";
>  #endif
> +    x2goDebug<<"LogLevel DEBUG1";

Force a flush of the current line by appending a newline, like so:
out << "LogLevel DEBUG1\n";

Otherwise, the stream might wait for more input to come for the current line
(but as it never comes, the line isn't written at all.)


> +    out<<"LogLevel DEBUG1";
>      file.close();
>      x2goDebug<<etcDir +"/sshd_config created.";
>  }
> 
> ----------------
> diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
> index 925085b..928da70 100644
> --- a/src/onmainwindow.cpp
> +++ b/src/onmainwindow.cpp
> @@ -10293,6 +10293,13 @@ void ONMainWindow::generateEtcFiles()
>         <<appDir<<"/sftp-server\n";
>  #endif
>      file.close();

This attempt is definitely wrong. The file is being closed here. Afterwards, you
cannot write to it anymore. (Or well, you do, but it lands who knows where
exactly. Most likely not in the selected file/the file previously associated
with the FD.)


> +    if (debugging)
> +    {
> +        QTextStream out2 ( &file );
> +        x2goDebug<<"LogLevel DEBUG1";
> +        out2<<"LogLevel DEBUG1";
> +        file.close();
> +    }
>      x2goDebug<<etcDir +"/sshd_config created.";
>  }



Mihai


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x2go.org/pipermail/x2go-dev/attachments/20160530/c201d297/attachment.pgp>


More information about the x2go-dev mailing list