Control: tag -1 + confirmed Hi,
Ned T. Crigler wrote: > abduco is derived from dtach, According to the abduco upstream web page, it is only "in many ways very similar", but not derived. I checked the initial import of abduco (commit 89cbbb3aa6aea7ca7410096aeacc3316a3532344) against dtach 0.8. I first checked it with dwdiff -c dtach-0.8/main.c abduco/abduco.c dwdiff -c dtach-0.8/attach.c abduco/client.c dwdiff -c dtach-0.8/master.c abduco/server.c dwdiff -c dtach-0.8/main.c abduco/server.c dwdiff -c dtach-0.8/master.c abduco/abduco.c and didn't find any similarities. Also the file listing does not look very similar: ls -l dtach-0.8 abduco abduco: total 52 -rw-r--r-- 1 abe abe 1574 Dec 4 13:55 abduco.1 -rw-r--r-- 1 abe abe 10121 Dec 4 13:55 abduco.c -rw-r--r-- 1 abe abe 3168 Dec 4 13:55 client.c -rw-r--r-- 1 abe abe 72 Dec 4 13:55 config.def.h -rw-r--r-- 1 abe abe 364 Dec 4 13:55 config.mk -rw-r--r-- 1 abe abe 1780 Dec 4 13:55 debug.c -rw-r--r-- 1 abe abe 765 Dec 4 13:54 LICENSE -rw-r--r-- 1 abe abe 1544 Dec 4 13:55 Makefile -rw-r--r-- 1 abe abe 271 Dec 4 13:55 README -rw-r--r-- 1 abe abe 6661 Dec 4 13:55 server.c dtach-0.8: total 244 -rw-r--r-- 1 abe abe 5963 Jan 31 2008 attach.c -rw-r--r-- 1 abe abe 3513 Jan 31 2008 config.h.in -rwxr-xr-x 1 abe abe 155943 Jan 31 2008 configure* -rw-r--r-- 1 abe abe 903 Jan 31 2008 configure.ac -rw-r--r-- 1 abe abe 17992 Jan 31 2008 COPYING -rw-r--r-- 1 abe abe 5204 Jan 31 2008 dtach.1 -rw-r--r-- 1 abe abe 2864 Jan 31 2008 dtach.h -rw-r--r-- 1 abe abe 3510 Jan 31 2008 dtach.spec -rw-r--r-- 1 abe abe 6692 Jan 31 2008 main.c -rw-r--r-- 1 abe abe 953 Jan 31 2008 Makefile.in -rw-r--r-- 1 abe abe 14174 Jan 31 2008 master.c -rw-r--r-- 1 abe abe 7891 Jan 31 2008 README > While abduco may be considered a rewrite of dtach that just has > similar looking portions of code left in it, I then took similarity-tester (from Wheezy) and ran it as follows: → sim_c dtach-0.8/*.c / abduco/*.c File dtach-0.8/attach.c: 988 tokens File dtach-0.8/main.c: 844 tokens File dtach-0.8/master.c: 2600 tokens File /: separator File abduco/abduco.c: 2028 tokens File abduco/client.c: 774 tokens File abduco/debug.c: 394 tokens File abduco/server.c: 1554 tokens Total: 9182 tokens dtach-0.8/attach.c: line 45-62 |dtach-0.8/master.c: line 178-195 [76] fflush(stdout); | kill(-pty->pid, sig); } |} | /* Connects to a unix domain socket */ |/* Creates a new unix domain socket. * static int |static int connect_socket(char *name) |create_socket(char *name) { |{ int s; | int s; struct sockaddr_un sockun; | struct sockaddr_un sockun; | s = socket(PF_UNIX, SOCK_STREAM, 0); | s = socket(PF_UNIX, SOCK_STREAM, 0); if (s < 0) | if (s < 0) return -1; | return -1; sockun.sun_family = AF_UNIX; | sockun.sun_family = AF_UNIX; strcpy(sockun.sun_path, name); | strcpy(sockun.sun_path, name); if (connect(s, (struct sockaddr*)&soc | if (bind(s, (struct sockaddr*)&sockun { | { close(s); | close(s); dtach-0.8/attach.c: line 179-184 |abduco/abduco.c: line 316-321 [54] cur_term.c_iflag &= ~(IXON|IXOFF); | cur_term.c_iflag &= ~(IGNBRK|BRKINT|P cur_term.c_oflag &= ~(OPOST); | cur_term.c_oflag &= ~(OPOST); cur_term.c_lflag &= ~(ECHO|ECHONL|ICA | cur_term.c_lflag &= ~(ECHO|ECHONL|ICA cur_term.c_cflag &= ~(CSIZE|PARENB); | cur_term.c_cflag &= ~(CSIZE|PARENB); cur_term.c_cflag |= CS8; | cur_term.c_cflag |= CS8; cur_term.c_cc[VLNEXT] = VDISABLE; | cur_term.c_cc[VLNEXT] = _POSIX_VDISAB dtach-0.8/attach.c: line 166-175 |dtach-0.8/master.c: line 420-429 [46] atexit(restore_term); | atexit(unlink_socket); | /* Set some signals. */ | /* Set up some signals. */ signal(SIGPIPE, SIG_IGN); | signal(SIGPIPE, SIG_IGN); signal(SIGXFSZ, SIG_IGN); | signal(SIGXFSZ, SIG_IGN); signal(SIGHUP, die); | signal(SIGHUP, SIG_IGN); signal(SIGTERM, die); | signal(SIGTTIN, SIG_IGN); signal(SIGINT, die); | signal(SIGTTOU, SIG_IGN); signal(SIGQUIT, die); | signal(SIGINT, die); signal(SIGWINCH, win_change); | signal(SIGTERM, die); dtach-0.8/main.c: line 142-153 |dtach-0.8/main.c: line 164-175 [42] else if (*p == 'e') | else if (*p == 'r') { | { ++argv; --argc; | ++argv; --argc; if (argc < 1) | if (argc < 1) { | { printf("%s: No escape character " | printf("%s: No redraw method " "specified.\n", progname); | "specified.\n", progname); printf("Try '%s --help' for more | printf("Try '%s --help' for more "information.\n", progname); | "information.\n", progname); return 1; | return 1; } | } if (argv[0][0] == '^' && argv[0][1 | if (strcmp(argv[0], "none") == 0) dtach-0.8/master.c: line 168-171 |dtach-0.8/master.c: line 172-175 [39] if (ioctl(pty->slave, TIOCGPGRP, &pgr | if (ioctl(pty->fd, TIOCGPGRP, &pgrp) kill(-pgrp, sig) >= 0) | kill(-pgrp, sig) >= 0) return; | return; #endif |#endif dtach-0.8/master.c: line 193-202 |dtach-0.8/master.c: line 203-213 [33] if (bind(s, (struct sockaddr*)&sockun | if (setnonblocking(s) < 0) { | { close(s); | close(s); return -1; | return -1; } | } if (listen(s, 128) < 0) | /* chmod it to prevent any suprises * { | if (chmod(name, 0600) < 0) close(s); | { return -1; | close(s); } | return -1; | } dtach-0.8/attach.c: line 197-200 |dtach-0.8/attach.c: line 253-257 [30] pkt.type = MSG_REDRAW; | win_changed = 0; pkt.len = redraw_method; | ioctl(0, TIOCGWINSZ, &pkt.u.ws); | pkt.type = MSG_WINCH; write(s, &pkt, sizeof(struct packet)) | ioctl(0, TIOCGWINSZ, &pkt.u.ws); | write(s, &pkt, sizeof(pkt)); dtach-0.8/attach.c: line 184-190 |abduco/abduco.c: line 321-326 [28] cur_term.c_cc[VLNEXT] = VDISABLE; | cur_term.c_cc[VLNEXT] = _POSIX_VDISAB cur_term.c_cc[VMIN] = 1; | cur_term.c_cc[VMIN] = 1; cur_term.c_cc[VTIME] = 0; | cur_term.c_cc[VTIME] = 0; tcsetattr(0, TCSADRAIN, &cur_term); | tcsetattr(0, TCSADRAIN, &cur_term); | /* Clear the screen. This assumes VT1 | client_clear_screen(); write(1, "\33[H\33[J", 6); | dtach-0.8/master.c: line 447-450 |abduco/abduco.c: line 261-264 [26] nullfd = open("/dev/null", O_RDWR); | int fd = open("/dev/null", O_RDWR) dup2(nullfd, 0); | dup2(fd, 0); dup2(nullfd, 1); | dup2(fd, 1); dup2(nullfd, 2); | dup2(fd, 2); dtach-0.8/master.c: line 258-260 |dtach-0.8/master.c: line 480-482 [24] FD_SET(p->fd, &writefds); | FD_SET(p->fd, &readfds); if (p->fd > highest_fd) | if (p->fd > highest_fd) highest_fd = p->fd; | highest_fd = p->fd; dtach-0.8/master.c: line 420-426 |dtach-0.8/master.c: line 426-430 [24] atexit(unlink_socket); | signal(SIGTTIN, SIG_IGN); | signal(SIGTTOU, SIG_IGN); /* Set up some signals. */ | signal(SIGINT, die); signal(SIGPIPE, SIG_IGN); | signal(SIGTERM, die); signal(SIGXFSZ, SIG_IGN); | signal(SIGCHLD, die); signal(SIGHUP, SIG_IGN); | signal(SIGTTIN, SIG_IGN); | So there are indeed a small number of code locations which look suspiciously similar. Compared to the amount of code, I wouldn't say that abduco is a "rewrite of dtach that just has similar looking portions of code left in it" but rather guess that abduco's author took a few small hunks of code from dtach. I don't think this looks like being based on dtach's code. Nevertheless this means that abduco contains code from dtach and not only a handful of lines (which could be declared as coincidence as the two programs do similar things) but dozens of lines. Still not much, but IMHO enough to confirm Ned's claim. 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. Regards, Axel -- ,''`. | Axel Beckert <a...@debian.org>, http://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE `- | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5 -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org