On Thu, Dec 04, 2014 at 02:39:34PM +0100, Axel Beckert wrote:
> 
> So there are indeed a small number of code locations which look
> suspiciously similar.

There are other similarities between the initial commit of abduco and
dtach, such as the code declaring abduco's client to server protocol:

[abduco/abduco.c lines 61-67]           |[dtach-0.8/dtach.h lines 89-96]
enum PacketType {                       |enum
        MSG_CONTENT = 0,                |{
        MSG_ATTACH  = 1,                |        MSG_PUSH        = 0,
        MSG_DETACH  = 2,                |        MSG_ATTACH      = 1,
        MSG_RESIZE  = 3,                |        MSG_DETACH      = 2,
        MSG_REDRAW  = 4,                |        MSG_WINCH       = 3,
};                                      |        MSG_REDRAW      = 4,
                                        |};

[abduco/abduco.c lines 69-78]           |[dtach-0.8/dtach.h lines 106-116]
/* packet sent from client to server */ |/* The client to master protocol. */
typedef struct {                        |struct packet
        unsigned char type;             |{
        unsigned char len;              |        unsigned char type;
        union {                         |        unsigned char len;
                char msg[sizeof(struct w|        union
insize)];                               |        {
                struct winsize ws;      |                unsigned char buf[sizeo
                int i;                  |f(struct winsize)];
        } u;                            |                struct winsize ws;
} ClientPacket;                         |        } u;
                                        |};

and the same escape sequence trick that dtach uses to move to the bottom
of the screen along with similar code for handling the suspend key:

[abduco/abduco.c line 161]              |[dtach-0.8/dtach.h line 128]
        fprintf(stdout, "\e[999H\r\n"); |#define EOS "\033[999H"

[abduco/client.c lines 126-133]         |[dtach-0.8/attach.c lines 105-115]
                                } else i|        if (!no_suspend && (pkt->u.buf[
f (pkt.u.msg[0] == cur_term.c_cc[VSUSP])|0] == cur_term.c_cc[VSUSP]))
 {                                      |        {
                                        |                /* Tell the master that
pkt.type = MSG_DETACH;                  | we are suspending. */
                                        |                pkt->type = MSG_DETACH;
client_send_packet(&pkt);               |                write(s, pkt, sizeof(st
                                        |ruct packet));
tcsetattr(0, TCSADRAIN, &orig_term);    |
                                        |                /* And suspend... */
client_show_cursor();                   |                tcsetattr(0, TCSADRAIN,
                                        | &orig_term);
info(NULL);                             |                printf(EOS "\r\n");
                                        |                kill(getpid(), SIGTSTP)
kill(getpid(), SIGTSTP);                |;
                                        |                tcsetattr(0, TCSADRAIN,
tcsetattr(0, TCSADRAIN, &cur_term);     | &cur_term);

Note that in abduco, client_send_packet(&pkt) will write the raw
contents of pkt to a socket, and info(NULL) will write the "\e[999H\r\n"
escape sequence to stdout.

> It should also be mentioned that the initial reporter of this issue,
> Ned, is the author of dtach, see http://dtach.sourceforge.net/.
> 
> I neither claim that this is a bad sign nor that this is a good sign.
> 
> I though consider it suspicious that this was not mentioned in the
> original report, hence I think it's important to mention it myself.
> 

I'm not sure why this would be suspicious, however I do confirm that I
am the author of dtach.

-- 
Ned T. Crigler


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to