help-gsasl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stream buffering problems in batch mode


From: Enrico Scholz
Subject: stream buffering problems in batch mode
Date: Mon, 25 Feb 2008 22:20:43 +0100
User-agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b28 (linux)

Hi,

I try to use 'gsasl' (0.2.24) with the gnus email reader as an external
GSSAPI authenticator.  This MUA needs to know when authentication succeeded
an looks for the 'Client authentication finished' string, like in

| # gsasl mailbox 143 --mechanism GSSAPI ...
| . OK Capability completed.
| . AUTHENTICATE GSSAPI
| +
| YIICGgYJKoZIhvcSAQICAQBuggIJMIICBaADAgE
| ...
| . OK Logged in.
| Client authentication finished (server trusted)...
| Enter application data (EOF to finish):


Unfortunately, 'gsasl' uses stdout for printing IMAP responses and stderr
for printing the status message ('Client authentication finished').

When running 'gsasl' in batch mode (stdout/err are connected to pipes,
not ttys), output is fully buffered and gnus gets confused due to
missing/mixed data.


I suggest to enable line buffered mode in a way like

---
+  if (!isatty(1))
+    {
+      setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
+      setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
+    }
---



Enrico





reply via email to

[Prev in Thread] Current Thread [Next in Thread]