mainGnuTLS - Support: sr #107481, Missing output from gnutls-cli on...

 
 

sr #107481: Missing output from gnutls-cli on Solaris

Submitter:  Knut Anders Hatlen <kah>
Submitted:  Thu 23 Sep 2010 07:56:22 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  nmav
Open/Closed:  Closed Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 23 Sep 2010 10:35:18 AM UTC, comment #2: 

Thanks for the quick response! I pulled the latest development sources and verified that the problem is fixed now.

Knut Anders Hatlen <kah>
Thu 23 Sep 2010 08:02:31 AM UTC, comment #1: 

Thank you. I've commited a fix in the repository.

Nikos Mavrogiannopoulos <nmav>
Group administrator
Thu 23 Sep 2010 07:56:22 AM UTC, original submission:  

I've seen the following problem with GnuTLS 2.8.6 and 2.10.1 on Solaris 10 and Solaris 11 Express:

When I execute gnutls-cli in a terminal, for example "gnutls-cli -p 993 imap.gmail.com", I see the following lines at the end of the output:

- MAC: MD5
- Compression: NULL
- Handshake was completed

- Simple Client Mode:

  • OK Gimap ready for requests from X.Y.Z.W x31if2123995weq.86


However, if I redirect the output to a file, or pipe it to another process, I only see this output at the end:

$ gnutls-cli -p 993 imap.gmail.com < /dev/null | cat
(...)
- MAC: MD5
- Compression: NULL

  • OK Gimap ready for requests from X.Y.Z.W m37if2142737wej.5


Note that the "Handshake was completed" line and "Simple Client Mode" have disappeared. This causes problems for programs that look for these lines to verify that the handshake was successful. For example, the open-tls-stream function in Emacs hangs because of it.

I think this is caused by these lines in src/cli.c:

  /* do not buffer */
#if !(defined WIN32 || defined __WIN32_)
  setbuf (stdin, NULL);
#endif
  setbuf (stdout, NULL);
  setbuf (stderr, NULL);

Apparently, this will remove buffered contents that haven't been flushed yet. If I add

  fflush(stdout);
  fflush(stderr);

before the calls to setbuf(), the output becomes the expected one even in the case where the output is redirected/piped.

Knut Anders Hatlen <kah>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nmav (Posted a comment)
  • -email is unavailable- added by kah (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-29 nmav StatusNone Done
        Assigned toNone nmav
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code