On Fri, Nov 02, 2012 at 10:03:55AM +0000, Adam D. Barratt wrote: > I'm possibly missing something, but...: > > ++ g_string_append_c (str, c); > ++ if (strstr (str->str, "QUIT") || (str->len > 10)) > ++ break; > > Isn't that "wait for QUIT or any 11 eleven characters", rather than > "wait for QUIT"?
Yes, this is true. This is a helper program spawned from NM applet or gnome-shell and communicating over a pipe. The NM authentication helper programs all use the identical wait_for_quit function, which is really waiting for the first of any of the following "semaphores" from the parent: 1) "QUIT" 2) any 11 characters 3) any I/O error 4) any input after 20 seconds elapsed Any of these events allow the function to return, which in turn allows the program to exit normally. The contents of str are not used in any other way. I suppose the length limit here is to avoid accumulating a large buffer just in case the parent process sends something other than QUIT for some reason. Thanks for your feedback. -- mike -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

