linux-decnet-commit Mailing List for DECnet for Linux (Page 36)
Brought to you by:
chrissie_c,
ph3-der-loewe
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(20) |
Feb
(27) |
Mar
(25) |
Apr
(12) |
May
(2) |
Jun
(6) |
Jul
(36) |
Aug
(12) |
Sep
(12) |
Oct
(16) |
Nov
(5) |
Dec
(5) |
2003 |
Jan
(8) |
Feb
(9) |
Mar
(25) |
Apr
(18) |
May
(29) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(10) |
Oct
(5) |
Nov
(3) |
Dec
(9) |
2004 |
Jan
(17) |
Feb
|
Mar
(9) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(2) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(5) |
Feb
|
Mar
(13) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(13) |
Oct
(83) |
Nov
(2) |
Dec
|
2006 |
Jan
(21) |
Feb
(1) |
Mar
(32) |
Apr
(31) |
May
(3) |
Jun
(1) |
Jul
|
Aug
(7) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(13) |
2007 |
Jan
(1) |
Feb
(7) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2008 |
Jan
(4) |
Feb
(13) |
Mar
(24) |
Apr
(18) |
May
(10) |
Jun
|
Jul
|
Aug
(40) |
Sep
(72) |
Oct
(61) |
Nov
(9) |
Dec
(2) |
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(41) |
Aug
(28) |
Sep
(2) |
Oct
(5) |
Nov
(4) |
Dec
|
2011 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Patrick C. <pa...@us...> - 2002-07-19 15:10:30
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory usw-pr-cvs1:/tmp/cvs-serv11771 Modified Files: found.c Log Message: Better processing of commondata messages Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** found.c 17 Jul 2002 18:36:25 -0000 1.4 --- found.c 19 Jul 2002 15:10:26 -0000 1.5 *************** *** 153,156 **** --- 153,157 ---- int len; char inbuf[1024]; + int ptr = 0; if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT)) <= 0) *************** *** 176,180 **** ! /* Dispatch a foundation message */ switch (inbuf[0]) { --- 177,181 ---- ! /* Dispatch foundation messages */ switch (inbuf[0]) { *************** *** 187,195 **** if (debug) printf("Unbind from host. reason = %d\n", inbuf[1]); ! return 0; /* Common data goes straight to the terminal processor */ case FOUND_MSG_COMMONDATA: ! return terminal_processor(inbuf+4, len-4); default: --- 188,210 ---- if (debug) printf("Unbind from host. reason = %d\n", inbuf[1]); ! return -1; /* Common data goes straight to the terminal processor */ case FOUND_MSG_COMMONDATA: ! { ! int ptr = 2; ! while (ptr < len) ! { ! int msglen = inbuf[ptr] | inbuf[ptr+1]<<8; ! ! if (debug) ! printf("FOUND: commondata: %d bytes\n",msglen); ! ! ptr += 2; ! terminal_processor(inbuf+ptr, msglen); ! ptr += msglen; ! } ! } ! break; default: *************** *** 197,201 **** inbuf[0]); } ! return -1; } --- 212,216 ---- inbuf[0]); } ! return 0; } |
From: Patrick C. <pa...@us...> - 2002-07-18 15:55:47
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory usw-pr-cvs1:/tmp/cvs-serv9390 Modified Files: cterm.c dnlogin.h tty.c Log Message: Add readchar support. Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** cterm.c 17 Jul 2002 18:36:25 -0000 1.5 --- cterm.c 18 Jul 2002 15:55:44 -0000 1.6 *************** *** 2,5 **** --- 2,7 ---- (c) 2002 P.J. Caulfield pa...@de... + Portions based on code (c) 2000 Eduardo M Serrat + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 32,37 **** #include "dnlogin.h" ! // We get sent (in order) ! // 11, 7, 2, 7 #define CTERM_MSG_INITIATE 1 #define CTERM_MSG_START_READ 2 --- 34,46 ---- #include "dnlogin.h" ! #ifndef TRUE ! #define TRUE 1 ! #endif ! ! #ifndef FALSE ! #define FALSE 0 ! #endif ! ! /* CTERM message numbers */ #define CTERM_MSG_INITIATE 1 #define CTERM_MSG_START_READ 2 *************** *** 49,52 **** --- 58,128 ---- #define CTERM_MSG_INPUT_STATE 14 + struct logical_terminal_characteristics + { + short mode_writing_allowed; + int terminal_attributes; + char terminal_type[6]; + short output_flow_control; + short output_page_stop; + short flow_character_pass_through; + short input_flow_control; + short loss_notification; + int line_width; + int page_length; + int stop_length; + int cr_fill; + int lf_fill; + int wrap; + int horizontal_tab; + int vertical_tab; + int form_feed; + }; + + struct physical_terminal_characteristics + { + int input_speed; + int output_speed; + int character_size; + short parity_enable; + int parity_type; + short modem_present; + short auto_baud_detect; + short management_guaranteed; + char switch_char_1; + char switch_char_2; + short eigth_bit; + short terminal_management_enabled; + }; + + struct handler_maintained_characteristics + { + short ignore_input; + short control_o_pass_through; + short raise_input; + short normal_echo; + short input_escseq_recognition; + short output_escseq_recognition; + int input_count_state; + short auto_prompt; + short error_processing; + }; + + + static struct logical_terminal_characteristics + log_char = {FALSE,3,{5,'V','T','2','0','0'} + ,TRUE, + TRUE,TRUE,TRUE,TRUE,80,24,0,0, + 0,1,1,1,1}; + + static struct physical_terminal_characteristics + phy_char = {9600,9600,8,FALSE,1,FALSE,FALSE, + FALSE,0,0,FALSE,FALSE}; + + static struct handler_maintained_characteristics + han_char = {FALSE,FALSE,FALSE,TRUE,TRUE,TRUE, + 1,FALSE,FALSE}; + + unsigned char char_attr[256]; + /* Process incoming CTERM messages */ static int cterm_process_initiate(char *buf, int len) *************** *** 74,83 **** unsigned short sodisplay = buf[11]| buf[12]<<8; unsigned short lowwater = buf[13]| buf[14]<<8; ! unsigned char term_len = buf[16]; // TODO flags ! tty_set_terminators(buf+17, term_len); ! tty_start_read(buf+17+term_len, len-term_len-16, eoprompt); tty_set_timeout(timeout); tty_set_maxlen(maxlength); --- 150,161 ---- unsigned short sodisplay = buf[11]| buf[12]<<8; unsigned short lowwater = buf[13]| buf[14]<<8; ! unsigned char term_len = buf[15]; // TODO flags ! if (debug & 2) fprintf(stderr, "term_len = %d\n", term_len); ! ! tty_set_terminators(buf+16, term_len); ! tty_start_read(buf+16+term_len, len-term_len-16, eoprompt); tty_set_timeout(timeout); tty_set_maxlen(maxlength); *************** *** 101,106 **** { unsigned short flags = buf[1] | buf[2]<<8; ! unsigned char prefixdata = buf[3]; ! unsigned char postfixdata = buf[4]; // TODO: flags... --- 179,184 ---- { unsigned short flags = buf[1] | buf[2]<<8; ! unsigned char prefixdata = buf[3]; ! unsigned char postfixdata = buf[4]; // TODO: flags... *************** *** 116,120 **** static int cterm_process_read_characteristics(char *buf, int len) ! {return len;} static int cterm_process_characteristics(char *buf, int len) --- 194,422 ---- static int cterm_process_read_characteristics(char *buf, int len) ! { ! int bufptr = 2;/* skip past flags */ ! char outbuf[256]; ! int outptr = 0; ! int procnt = 0; ! ! outbuf[outptr++] = CTERM_MSG_CHARACTERISTINCS; ! ! while (bufptr < len) ! { ! unsigned short selector = buf[bufptr] | buf[bufptr+1]<<8; ! ! bufptr += 2; ! ! if (debug & 2) ! fprintf(stderr, "CTERM: selector = %d\n", selector); ! ! if ((selector & 0x200) == 0) /* Physical characteristics */ ! { ! outbuf[outptr++] = selector & 0xFF; ! outbuf[outptr++] = 0; ! ! switch (selector & 0xFF) ! { ! case 0x01: /* Input speed */ ! outbuf[outptr++] = phy_char.input_speed; ! outbuf[outptr++] = phy_char.input_speed >> 8; ! break; ! ! case 0x02: /* Output speed */ ! outbuf[outptr++] = phy_char.output_speed; ! outbuf[outptr++] = phy_char.output_speed >> 8; ! break; ! ! case 0x03: /* Character size */ ! outbuf[outptr++] = phy_char.character_size; ! outbuf[outptr++] = phy_char.character_size >> 8; ! break; ! ! case 0x04: /* Parity enable */ ! outbuf[outptr++] = phy_char.parity_enable; ! break; ! ! case 0x05: /* Parity type */ ! outbuf[outptr++] = phy_char.parity_type; ! outbuf[outptr++] = phy_char.parity_type >> 8; ! break; ! ! case 0x06: /* Modem Present */ ! outbuf[outptr++] = phy_char.modem_present; ! break; ! ! case 0x07: /* Auto baud detect */ ! outbuf[outptr++] = phy_char.auto_baud_detect; ! break; ! ! case 0x08: /* Management guaranteed */ ! outbuf[outptr++] = phy_char.management_guaranteed; ! break; ! ! case 0x09: /* SW 1 */ ! break; ! ! case 0x0A: /* SW 2 */ ! break; ! ! case 0x0B: /* Eight bit */ ! outbuf[outptr++] = phy_char.eigth_bit; ! break; ! ! case 0x0C: /* Terminal Management */ ! outbuf[outptr++] = phy_char.terminal_management_enabled; ! break; ! } ! } ! if ((selector & 0x300) == 0x100) /* Logical Characteristics*/ ! { ! outbuf[outptr++] = selector & 0xFF; ! outbuf[outptr++] = 1; ! ! switch(selector & 0xFF) ! { ! case 0x01: /* Mode writing allowed */ ! outbuf[outptr++] = log_char.mode_writing_allowed; ! break; ! ! case 0x02: /* Terminal attributes */ ! outbuf[outptr++] = log_char.terminal_attributes; ! outbuf[outptr++] = log_char.terminal_attributes >> 8; ! break; ! ! case 0x03: /* Terminal Type */ ! memcpy(&outbuf[outptr],log_char.terminal_type, 6); ! outptr += 6; ! break; ! ! case 0x04: /* Output flow control */ ! outbuf[outptr++] = log_char.output_flow_control; ! break; ! ! case 0x05: /* Output page stop */ ! outbuf[outptr++] = log_char.output_page_stop; ! break; ! ! case 0x06: /* Flow char pass through */ ! outbuf[outptr] = log_char.flow_character_pass_through; ! break; ! ! case 0x07: /* Input flow control */ ! outbuf[outptr++] = log_char.input_flow_control; ! break; ! ! case 0x08: /* Loss notification */ ! outbuf[outptr++] = log_char.loss_notification; ! break; ! ! case 0x09: /* Line width */ ! outbuf[outptr++] = log_char.line_width; ! outbuf[outptr++] = log_char.line_width >> 8; ! break; ! ! case 0x0A: /* Page length */ ! outbuf[outptr++] = log_char.page_length; ! outbuf[outptr++] = log_char.page_length >> 8; ! break; ! ! case 0x0B: /* Stop length */ ! outbuf[outptr++] = log_char.stop_length; ! outbuf[outptr++] = log_char.stop_length >> 8; ! break; ! ! case 0x0C: /* CR-FILL */ ! outbuf[outptr++] = log_char.cr_fill; ! outbuf[outptr++] = log_char.cr_fill >> 8; ! break; ! ! case 0x0D: /* LF-FILL */ ! outbuf[outptr++] = log_char.lf_fill; ! outbuf[outptr++] = log_char.lf_fill >> 8; ! break; ! ! case 0x0E: /* wrap */ ! outbuf[outptr++] = log_char.wrap; ! outbuf[outptr++] = log_char.wrap >> 8; ! break; ! ! case 0x0F: /* Horizontal tab */ ! outbuf[outptr++] = log_char.horizontal_tab; ! outbuf[outptr++] = log_char.horizontal_tab >> 8; ! break; ! ! case 0x10: /* Vertical tab */ ! outbuf[outptr++] = log_char.vertical_tab; ! outbuf[outptr++] = log_char.vertical_tab >> 8; ! break; ! ! case 0x11: /* Form feed */ ! outbuf[outptr++] = log_char.form_feed; ! outbuf[outptr++] = log_char.form_feed >> 8; ! break; ! } ! } ! if ((selector & 0x300) == 0x200) /* Handler Charact */ ! { ! unsigned char c; ! ! outbuf[outptr++] = selector & 0xFF; ! outbuf[outptr++] = 2; ! ! switch (selector & 0xFF) ! { ! case 0x01: /* IGNORE INPUT */ ! outbuf[outptr++] = han_char.ignore_input; ! break; ! ! case 0x02: /* Character Attributes */ ! c = buf[bufptr++]; ! outbuf[outptr++] = c; ! outbuf[outptr++] = 0xFF; ! outbuf[outptr++] = char_attr[(int)c]; ! break; ! ! case 0x03: /* Control-o pass through */ ! outbuf[outptr++] = han_char.control_o_pass_through; ! break; ! ! case 0x04: /* Raise Input */ ! outbuf[outptr++] = han_char.raise_input; ! break; ! ! case 0x05: /* Normal Echo */ ! outbuf[outptr++] = han_char.normal_echo; ! break; ! ! case 0x06: /* Input Escape Seq Recognition */ ! outbuf[outptr++]=han_char.input_escseq_recognition; ! break; ! ! case 0x07: /* Output Esc Seq Recognition */ ! outbuf[outptr++] = han_char.output_escseq_recognition; ! break; ! ! case 0x08: /* Input count state */ ! outbuf[outptr++] = han_char.input_count_state; ! outbuf[outptr++] = han_char.input_count_state >> 8; ! break; ! ! case 0x09: /* Auto Prompt */ ! outbuf[outptr++] = han_char.auto_prompt; ! break; ! ! case 0x0A: /* Error processing option */ ! outbuf[outptr++] = han_char.error_processing; ! break; ! ! case 0x0B: /* Error processing option rsxm+ ed*/ ! outbuf[outptr++] = han_char.error_processing; ! break; ! } ! } ! } ! ! found_common_write(outbuf, outptr); ! return len; ! } static int cterm_process_characteristics(char *buf, int len) *************** *** 146,150 **** break; case CTERM_MSG_START_READ: ! offset += cterm_process_start_read(buf+offset, len-offset); break; case CTERM_MSG_READ_DATA: --- 448,452 ---- break; case CTERM_MSG_START_READ: ! offset += cterm_process_start_read(buf+offset+1, len-offset); break; case CTERM_MSG_READ_DATA: Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dnlogin.h 16 Jul 2002 10:21:31 -0000 1.5 --- dnlogin.h 18 Jul 2002 15:55:44 -0000 1.6 *************** *** 33,37 **** extern void tty_set_timeout(unsigned short to); extern void tty_set_maxlen(unsigned short len); ! extern int tty_process_terminal(char *inbuf, int len); extern int tty_setup(char *name, int setup); --- 33,37 ---- extern void tty_set_timeout(unsigned short to); extern void tty_set_maxlen(unsigned short len); ! extern int tty_process_terminal(unsigned char *inbuf, int len); extern int tty_setup(char *name, int setup); Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** tty.c 17 Jul 2002 18:36:25 -0000 1.3 --- tty.c 18 Jul 2002 15:55:44 -0000 1.4 *************** *** 40,43 **** --- 40,45 ---- /* Input state buffers & variables */ static unsigned char terminators[32]; + static char rahead_buf[128]; + static int rahead_len=0; static char input_buf[1024]; static int input_len=0; *************** *** 49,52 **** --- 51,55 ---- static int max_read_len = sizeof(input_buf); static int echo = 1; + static int reading = 0; static int insert_mode = 0; *************** *** 69,84 **** { if (debug & 4) ! fprintf(stderr, "TTY start_read prompt='%s' len = %d, maxlen=%d\n", ! prompt, promptlen, len); if (promptlen) write(termfd, prompt, promptlen); /* Save the actual prompt in one buffer and the prefilled ! data in th input buffer */ memcpy(prompt_buf, prompt, promptlen); prompt_len = promptlen; ! memcpy(input_buf, prompt+promptlen, len-promptlen); ! input_len = len-promptlen; input_pos = input_len; } --- 72,104 ---- { if (debug & 4) ! fprintf(stderr, "TTY start_read promptlen = %d, maxlen=%d\n", ! promptlen, len); if (promptlen) write(termfd, prompt, promptlen); /* Save the actual prompt in one buffer and the prefilled ! data in the input buffer */ memcpy(prompt_buf, prompt, promptlen); prompt_len = promptlen; ! memcpy(input_buf, prompt+promptlen, len); ! input_len = 0; input_pos = input_len; + max_read_len = len; + + /* Now add in any typeahead + TODO: Are there flags to disable this? */ + if (rahead_len) + { + int copylen = rahead_len; + + fprintf(stderr, "PJC: readahead = %d bytes\n", rahead_len); + /* Don't overflow the input buffer */ + if (input_len + copylen > sizeof(input_buf)) + copylen = sizeof(input_buf)-input_len; + + memcpy(input_buf+input_len, rahead_buf, copylen); + input_len += copylen; + } + reading = 1; } *************** *** 142,146 **** static void erase_eol(void) { ! write(termfd, "\033[1K", 4); } --- 162,166 ---- static void erase_eol(void) { ! write(termfd, "\033[0K", 4); } *************** *** 155,159 **** /* Input from keyboard */ ! int tty_process_terminal(char *buf, int len) { int i; --- 175,179 ---- /* Input from keyboard */ ! int tty_process_terminal(unsigned char *buf, int len) { int i; *************** *** 167,181 **** } ! /* Swap LF for CR */ ! //PJC: is this right?? ! if (buf[i] == '\n') ! buf[i] = '\r'; ! if (is_terminator(buf[i])) { send_input(&buf[i], 1, 0); return 0; } /* Is it ESCAPE ? */ if (buf[i] == ESC && esc_len == 0) --- 187,205 ---- } ! /* Terminators */ ! // TODO: flag for echoing terminators if (is_terminator(buf[i])) { send_input(&buf[i], 1, 0); + reading = 0; return 0; } + /* Swap LF for CR */ + //PJC: is this right?? + if (buf[i] == '\n') + buf[i] = '\r'; + + /* Is it ESCAPE ? */ if (buf[i] == ESC && esc_len == 0) *************** *** 185,188 **** --- 209,214 ---- } + fprintf(stderr, "input_pos=%d, input_len = %d\n", input_pos, input_len); + /* Still processing escape sequence */ if (esc_len) *************** *** 192,196 **** { /* Process escape sequences */ ! if (strncmp(esc_buf, "\033[C", 3)) /* Cursor RIGHT */ { if (input_pos < input_len) --- 218,222 ---- { /* Process escape sequences */ ! if (strncmp(esc_buf, "\033[D", 3)) /* Cursor RIGHT */ { if (input_pos < input_len) *************** *** 200,206 **** } } ! if (strncmp(esc_buf, "\033[D", 3)) /* Cursor LEFT */ { ! if (input_pos) { input_pos--; --- 226,232 ---- } } ! if (strncmp(esc_buf, "\033[C", 3)) /* Cursor LEFT */ { ! if (input_pos > 0) { input_pos--; *************** *** 214,218 **** /* Process non-terminator control chars */ ! if (buf[i] < ' ') { switch (buf[i]) --- 240,244 ---- /* Process non-terminator control chars */ ! if (buf[i] < ' ' || buf[i] == DEL) { switch (buf[i]) *************** *** 224,228 **** move_cursor_abs(prompt_len); erase_eol(); ! input_pos = 0; break; case CTRL_H: // back to start of line --- 250,254 ---- move_cursor_abs(prompt_len); erase_eol(); ! input_pos = input_len = 0; break; case CTRL_H: // back to start of line *************** *** 236,239 **** --- 262,274 ---- send_input(input_buf, input_len, 0); input_len = input_pos = 0; + reading = 0; + break; + case DEL: + if (input_pos > 0) + { + input_pos--; + input_len = input_pos; + write(termfd, "\033[D \033[D", 7); + } break; } *************** *** 241,246 **** --- 276,293 ---- } + + /* Read not active, store in the read ahead buffer */ + if (!reading) + { + if (rahead_len < sizeof(rahead_buf)) + rahead_buf[rahead_len++] = buf[i]; + continue; + } + + if (echo) + { write(termfd, &buf[i], 1); + } if (debug & 4) fprintf(stderr, "TTY: input_len=%d, pos=%d\n", *************** *** 251,258 **** input_len = input_pos; ! if (input_len == max_read_len) { ! send_input(input_buf, input_len, 0); input_len = input_pos = 0; } } --- 298,310 ---- input_len = input_pos; ! if (input_len >= max_read_len) { ! char buf[1024]; ! memcpy(buf, prompt_buf, prompt_len); ! memcpy(buf+prompt_len, input_buf, input_len); ! ! send_input(buf, input_len+prompt_len, 0); input_len = input_pos = 0; + reading = 0; } } |
From: Patrick C. <pa...@us...> - 2002-07-18 09:39:08
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv17276 Modified Files: changelog dnet-common.copyright dnet-progs.copyright libdnet-dev.copyright libdnet.copyright Log Message: Update copyrights. Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** changelog 10 Dec 2001 12:01:35 -0000 1.18 --- changelog 18 Jul 2002 09:39:04 -0000 1.19 *************** *** 1,6 **** dnprogs (2.18-1) unstable; urgency=low * Fix dependancies in dnet-progs so libdnet gets pulled in too even when ! build by the autobuilders. Closes: bug#122893 * Fix sending of binary files by FAL by block. * Add .html, .tgz & .bz2 file types to FAL types list --- 1,31 ---- + dnprogs (2.19-1) unstable; urgency=low + + * Suggests: iproute + * dnet-progs.init.d doesn't give errors when stopping on a + system with no DECnet in the kernel + * Remove node_address setting from modutils into init.d so + it works when DECnet is compiled into the kernel + * Makefile fixes + * startnet fixes to arg parsing + * phone uses pixmap directory properly + * ctermd now responds to DEL, ^X etc (hooray!) + * dnetd task_server now won't run arbitrary programs. + * dntask prints error messages if the connection fails. + * setether uses "ip" command if available rather than ifconfig + * Added timeout switch to dnping + * FAL no longer eats directories starting with '0' + Thanks to Matjaz Godec + * Add virtual-root feature to FAL + * Change to libdnet_daemon to allow RSX to connect + * Fixed truncate option in FAL + * Fixed wildard fetching in FAL so it works with dncopy + * Changes to FAL to allow RSX file transfers + + -- Patrick Caulfield <pa...@de...> Wed, 17 Jul 2002 16:38:52 +0100 + dnprogs (2.18-1) unstable; urgency=low * Fix dependancies in dnet-progs so libdnet gets pulled in too even when ! built by the autobuilders. Closes: bug#122893 * Fix sending of binary files by FAL by block. * Add .html, .tgz & .bz2 file types to FAL types list Index: dnet-common.copyright =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-common.copyright,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnet-common.copyright 7 Feb 2001 21:30:13 -0000 1.1 --- dnet-common.copyright 18 Jul 2002 09:39:04 -0000 1.2 *************** *** 2,6 **** (C) 1996-2001 Eduardo Serrat ! (C) 1996-2001 Patrick Caulfield You are free to distribute this software under the terms of the GNU General --- 2,6 ---- (C) 1996-2001 Eduardo Serrat ! (C) 1996-2002 Patrick Caulfield You are free to distribute this software under the terms of the GNU General Index: dnet-progs.copyright =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.copyright,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnet-progs.copyright 7 Feb 2001 21:30:13 -0000 1.1 --- dnet-progs.copyright 18 Jul 2002 09:39:04 -0000 1.2 *************** *** 2,6 **** (C) 1996-2001 Eduardo Serrat ! (C) 1996-2001 Patrick Caulfield You are free to distribute this software under the terms of the GNU General --- 2,6 ---- (C) 1996-2001 Eduardo Serrat ! (C) 1996-2002 Patrick Caulfield You are free to distribute this software under the terms of the GNU General Index: libdnet-dev.copyright =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/libdnet-dev.copyright,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** libdnet-dev.copyright 7 Feb 2001 21:29:19 -0000 1.2 --- libdnet-dev.copyright 18 Jul 2002 09:39:04 -0000 1.3 *************** *** 2,6 **** (C) 1996-2001 Eduardo Serrat ! (C) 1996-2001 Patrick Caulfield (C) 1999 Steve Whitehouse --- 2,6 ---- (C) 1996-2001 Eduardo Serrat ! (C) 1996-2002 Patrick Caulfield (C) 1999 Steve Whitehouse Index: libdnet.copyright =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/libdnet.copyright,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** libdnet.copyright 7 Feb 2001 21:29:19 -0000 1.2 --- libdnet.copyright 18 Jul 2002 09:39:04 -0000 1.3 *************** *** 2,6 **** (C) 1996-2001 Eduardo Serrat ! (C) 1996-2001 Patrick Caulfield (C) 1999 Steve Whitehouse --- 2,6 ---- (C) 1996-2001 Eduardo Serrat ! (C) 1996-2002 Patrick Caulfield (C) 1999 Steve Whitehouse |
From: Patrick C. <pa...@us...> - 2002-07-17 18:36:29
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory usw-pr-cvs1:/tmp/cvs-serv31930 Modified Files: Makefile cterm.c dnlogin.c found.c tty.c Log Message: Still very basic but can now login to cterm on Linux Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Makefile 16 Jul 2002 10:21:31 -0000 1.2 --- Makefile 17 Jul 2002 18:36:25 -0000 1.3 *************** *** 3,8 **** include ../Makefile.common - CFLAGS+=-I../apps - PROG1=dnlogin --- 3,6 ---- Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** cterm.c 16 Jul 2002 09:48:12 -0000 1.4 --- cterm.c 17 Jul 2002 18:36:25 -0000 1.5 *************** *** 29,33 **** #include <netdnet/dn.h> #include <netdnet/dnetdb.h> - #include "cterm.h" #include "dn_endian.h" #include "dnlogin.h" --- 29,32 ---- *************** *** 138,142 **** while (offset < len) { ! if (debug > 2) fprintf(stderr, "CTERM: got msg: %d, len=%d\n", buf[offset], len); --- 137,141 ---- while (offset < len) { ! if (debug & 2) fprintf(stderr, "CTERM: got msg: %d, len=%d\n", buf[offset], len); *************** *** 199,209 **** { char newbuf[len+9]; ! newbuf[0] = 0; ! newbuf[1] = 0; ! newbuf[2] = 0; ! newbuf[3] = 0; ! memcpy(newbuf+4, buf, len); ! return found_common_write(newbuf, len+4); } --- 198,215 ---- { char newbuf[len+9]; + if (debug & 2) fprintf(stderr, "CTERM: sending input data: len=%d\n", + len); ! newbuf[0] = CTERM_MSG_READ_DATA; ! newbuf[1] = flags; ! newbuf[2] = 0; // low-water 1 ! newbuf[3] = 0; // low-water 2 ! newbuf[4] = 0; // vert pos ! newbuf[5] = 0; // horiz pos ! newbuf[6] = 0; // term pos 1 ! newbuf[7] = 0; // term pos 2 ! memcpy(newbuf+8, buf, len); ! ! return found_common_write(newbuf, len+8); } Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dnlogin.c 16 Jul 2002 18:41:06 -0000 1.5 --- dnlogin.c 17 Jul 2002 18:36:25 -0000 1.6 *************** *** 29,33 **** #include <netdnet/dn.h> #include <netdnet/dnetdb.h> - #include "cterm.h" #include "dn_endian.h" #include "dnlogin.h" --- 29,32 ---- *************** *** 100,104 **** fprintf(f, " -V show version number\n"); fprintf(f, " -e <char> set exit char\n"); ! fprintf(f, " -d debug information\n"); fprintf(f, "\n"); --- 99,103 ---- fprintf(f, " -V show version number\n"); fprintf(f, " -e <char> set exit char\n"); ! fprintf(f, " -d <mask> debug information\n"); fprintf(f, "\n"); *************** *** 116,120 **** opterr = 0; optind = 0; ! while ((opt = getopt(argc, argv, "?Vhdte:")) != EOF) { switch (opt) --- 115,119 ---- opterr = 0; optind = 0; ! while ((opt = getopt(argc, argv, "?Vhd:te:")) != EOF) { switch (opt) *************** *** 138,142 **** case 'd': ! debug++; break; } --- 137,141 ---- case 'd': ! debug = atoi(optarg); break; } Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** found.c 16 Jul 2002 09:48:12 -0000 1.3 --- found.c 17 Jul 2002 18:36:25 -0000 1.4 *************** *** 35,39 **** /* Foundation services messages */ #define FOUND_MSG_BIND 1 ! #define FOUND_MSG_UNBIND 3 #define FOUND_MSG_BINDACCEPT 4 #define FOUND_MSG_ENTERMODE 5 --- 35,39 ---- /* Foundation services messages */ #define FOUND_MSG_BIND 1 ! #define FOUND_MSG_UNBIND 2 #define FOUND_MSG_BINDACCEPT 4 #define FOUND_MSG_ENTERMODE 5 *************** *** 143,147 **** header.len = dn_htons(len); ! if (debug > 2) fprintf(stderr, "FOUND: sending common message %d bytes:\n", len); --- 143,147 ---- header.len = dn_htons(len); ! if (debug & 1) fprintf(stderr, "FOUND: sending common message %d bytes:\n", len); *************** *** 164,170 **** } ! if (debug > 2) fprintf(stderr, "FOUND: got message %d bytes:\n", len); ! if (debug > 3) { int i; --- 164,170 ---- } ! if (debug & 1) fprintf(stderr, "FOUND: got message %d bytes:\n", len); ! if (debug & 8) { int i; *************** *** 183,186 **** --- 183,191 ---- printf("connected to %s host\n", hosttype[inbuf[4]-1]); return send_bindaccept(); + + case FOUND_MSG_UNBIND: + if (debug) + printf("Unbind from host. reason = %d\n", inbuf[1]); + return 0; /* Common data goes straight to the terminal processor */ Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** tty.c 16 Jul 2002 18:41:06 -0000 1.2 --- tty.c 17 Jul 2002 18:36:25 -0000 1.3 *************** *** 29,33 **** #include <netdnet/dn.h> #include <netdnet/dnetdb.h> - #include "cterm.h" #include "dn_endian.h" #include "dnlogin.h" --- 29,32 ---- *************** *** 42,51 **** static unsigned char terminators[32]; static char input_buf[1024]; ! static int input_len; ! static int input_pos; static char prompt_buf[1024]; ! static char prompt_len; static char esc_buf[132]; ! static int esc_len; static int max_read_len = sizeof(input_buf); static int echo = 1; --- 41,50 ---- static unsigned char terminators[32]; static char input_buf[1024]; ! static int input_len=0; ! static int input_pos=0; static char prompt_buf[1024]; ! static char prompt_len=0; static char esc_buf[132]; ! static int esc_len=0; static int max_read_len = sizeof(input_buf); static int echo = 1; *************** *** 69,73 **** void tty_start_read(char *prompt, int len, int promptlen) { ! write(termfd, prompt, len); /* Save the actual prompt in one buffer and the prefilled --- 68,75 ---- void tty_start_read(char *prompt, int len, int promptlen) { ! if (debug & 4) ! fprintf(stderr, "TTY start_read prompt='%s' len = %d, maxlen=%d\n", ! prompt, promptlen, len); ! if (promptlen) write(termfd, prompt, promptlen); /* Save the actual prompt in one buffer and the prefilled *************** *** 165,171 **** } - if (echo) - write(termfd, &buf[i], 1); - /* Swap LF for CR */ //PJC: is this right?? --- 167,170 ---- *************** *** 180,188 **** /* Is it ESCAPE ? */ ! if (buf[i] == ESC && !esc_len) { esc_buf[esc_len++] = buf[i]; continue; } /* Still processing escape sequence */ if (esc_len) --- 179,188 ---- /* Is it ESCAPE ? */ ! if (buf[i] == ESC && esc_len == 0) { esc_buf[esc_len++] = buf[i]; continue; } + /* Still processing escape sequence */ if (esc_len) *************** *** 209,214 **** } esc_len = 0; - continue; } } --- 209,214 ---- } esc_len = 0; } + continue; } *************** *** 235,238 **** --- 235,239 ---- case CTRL_M: send_input(input_buf, input_len, 0); + input_len = input_pos = 0; break; } *************** *** 240,253 **** } input_buf[input_pos++] = buf[i]; if (input_len < input_pos) ! input_len = input_len; if (input_len == max_read_len) { send_input(input_buf, input_len, 0); } - - // TODO: Loads more. } return 0; --- 241,259 ---- } + if (echo) + write(termfd, &buf[i], 1); + + if (debug & 4) fprintf(stderr, "TTY: input_len=%d, pos=%d\n", + input_len, input_pos); + input_buf[input_pos++] = buf[i]; if (input_len < input_pos) ! input_len = input_pos; if (input_len == max_read_len) { send_input(input_buf, input_len, 0); + input_len = input_pos = 0; } } return 0; |
From: Patrick C. <pa...@us...> - 2002-07-17 15:42:42
|
Update of /cvsroot/linux-decnet/dnprogs In directory usw-pr-cvs1:/tmp/cvs-serv31455 Modified Files: Makefile.common Log Message: bump the version numer to 2.19 We're getting near to realese. Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** Makefile.common 18 Jan 2002 19:15:45 -0000 1.15 --- Makefile.common 17 Jul 2002 15:42:36 -0000 1.16 *************** *** 54,58 **** MAJOR_VERSION=2 ! MINOR_VERSION=18 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) --- 54,58 ---- MAJOR_VERSION=2 ! MINOR_VERSION=19 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) |
From: Patrick C. <pa...@us...> - 2002-07-17 15:38:00
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv29822 Modified Files: open.cc Log Message: Fix wildcard fetching so it works with dncopy (and according to the spec!) Index: open.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/open.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** open.cc 17 Jul 2002 15:24:57 -0000 1.13 --- open.cc 17 Jul 2002 15:37:57 -0000 1.14 *************** *** 257,291 **** { case dap_accomp_message::END_OF_STREAM: ! ! // write metafile ! if (params.use_metafiles && create) ! create_metafile(gl.gl_pathv[glob_entry], attrib_msg); ! ! // move onto next file ! if (glob_entry < gl.gl_pathc-1) ! { ! glob_entry++; ! fclose(stream); ! stream = fopen(gl.gl_pathv[glob_entry], write_access?"w":"r"); ! if (!stream) ! { ! return_error(); ! return false; ! } ! num_records = 0; ! current_record = 0; ! if (record_lengths) delete[] record_lengths; ! ! if (!send_file_attributes(block_size, use_records, gl.gl_pathv[glob_entry], ! display, SEND_DEV)) ! return false; ! return send_ack_and_unblock(); ! } ! else // End of wildcard list ! { ! reply.set_cmpfunc(dap_accomp_message::RESPONSE); ! reply.write(conn); ! return false; ! } return true; --- 257,262 ---- { case dap_accomp_message::END_OF_STREAM: ! reply.set_cmpfunc(dap_accomp_message::RESPONSE); ! reply.write(conn); return true; *************** *** 312,319 **** delete_file(); ! reply.set_cmpfunc(dap_accomp_message::RESPONSE); ! reply.write(conn); return true; - break; default: --- 283,316 ---- delete_file(); ! // write metafile ! if (params.use_metafiles && create) ! create_metafile(gl.gl_pathv[glob_entry], attrib_msg); ! ! // move onto next file ! if (glob_entry < gl.gl_pathc-1) ! { ! glob_entry++; ! stream = fopen(gl.gl_pathv[glob_entry], write_access?"w":"r"); ! if (!stream) ! { ! return_error(); ! return false; ! } ! num_records = 0; ! current_record = 0; ! if (record_lengths) delete[] record_lengths; ! ! if (!send_file_attributes(block_size, use_records, gl.gl_pathv[glob_entry], ! display, SEND_DEV)) ! return false; ! return send_ack_and_unblock(); ! } ! else // End of wildcard list ! { ! reply.set_cmpfunc(dap_accomp_message::RESPONSE); ! reply.write(conn); ! return false; ! } return true; default: |
From: Patrick C. <pa...@us...> - 2002-07-17 15:28:29
|
Update of /cvsroot/linux-decnet/dnprogs/dnetd In directory usw-pr-cvs1:/tmp/cvs-serv26002 Modified Files: dnetd.c Log Message: Remove trailing spaces Index: dnetd.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnetd/dnetd.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dnetd.c 19 Jun 2001 10:49:18 -0000 1.4 --- dnetd.c 17 Jul 2002 15:28:26 -0000 1.5 *************** *** 1,5 **** /****************************************************************************** (c) 1999 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /****************************************************************************** (c) 1999 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 77,81 **** int i; char name[PATH_MAX]; ! // Split the daemon command into a command and its args argp = strtok(daemon_name, " "); --- 77,81 ---- int i; char name[PATH_MAX]; ! // Split the daemon command into a command and its args argp = strtok(daemon_name, " "); *************** *** 170,174 **** strcpy(binary_dir, BINARY_PREFIX); strcat(binary_dir, "/sbin"); ! // Deal with command-line arguments. Do these before the check for root // so we can check the version number and get help without being root. --- 170,174 ---- strcpy(binary_dir, BINARY_PREFIX); strcat(binary_dir, "/sbin"); ! // Deal with command-line arguments. Do these before the check for root // so we can check the version number and get help without being root. *************** *** 177,183 **** while ((opt=getopt(argc,argv,"?vVhp:sdl:")) != EOF) { ! switch(opt) { ! case 'h': usage(argv[0], stdout); exit(0); --- 177,183 ---- while ((opt=getopt(argc,argv,"?vVhp:sdl:")) != EOF) { ! switch(opt) { ! case 'h': usage(argv[0], stdout); exit(0); *************** *** 203,207 **** exit(1); break; ! case 'p': if (stat(optarg, &st) < 0) --- 203,207 ---- exit(1); break; ! case 'p': if (stat(optarg, &st) < 0) *************** *** 217,221 **** strcpy(binary_dir, optarg); break; ! case 'l': if (optarg[0] != 's' && --- 217,221 ---- strcpy(binary_dir, optarg); break; ! case 'l': if (optarg[0] != 's' && *************** *** 237,241 **** // be able to do MIRROR dnet_set_optdata(condata, sizeof(condata)); ! fd = dnet_daemon(0, NULL, verbosity, debug?0:1); if (fd > -1) --- 237,241 ---- // be able to do MIRROR dnet_set_optdata(condata, sizeof(condata)); ! fd = dnet_daemon(0, NULL, verbosity, debug?0:1); if (fd > -1) *************** *** 255,259 **** return 0; } ! // Dispatch the object internally // If it's a named object then run a task script --- 255,259 ---- return 0; } ! // Dispatch the object internally // If it's a named object then run a task script |
From: Patrick C. <pa...@us...> - 2002-07-17 15:25:00
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv24525 Modified Files: open.cc Log Message: do TRUNCATE on a file before we close it, rather than after :) Index: open.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/open.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** open.cc 17 Jul 2002 10:40:45 -0000 1.12 --- open.cc 17 Jul 2002 15:24:57 -0000 1.13 *************** *** 286,293 **** --- 286,300 ---- reply.set_cmpfunc(dap_accomp_message::RESPONSE); reply.write(conn); + return false; } return true; case dap_accomp_message::CLOSE: + + // This option needs to be done before close + if (am->get_fop_bit(dap_attrib_message::FB$TEF) || + attrib_msg->get_fop_bit(dap_attrib_message::FB$TEF)) + truncate_file(); + // finished task if (stream) *************** *** 297,301 **** } ! // Do close options if (am->get_fop_bit(dap_attrib_message::FB$SPL) || attrib_msg->get_fop_bit(dap_attrib_message::FB$SPL)) --- 304,308 ---- } ! // Do post-close options if (am->get_fop_bit(dap_attrib_message::FB$SPL) || attrib_msg->get_fop_bit(dap_attrib_message::FB$SPL)) *************** *** 304,314 **** attrib_msg->get_fop_bit(dap_attrib_message::FB$DLT)) delete_file(); - if (am->get_fop_bit(dap_attrib_message::FB$TEF) || - attrib_msg->get_fop_bit(dap_attrib_message::FB$TEF)) - truncate_file(); reply.set_cmpfunc(dap_accomp_message::RESPONSE); reply.write(conn); ! return false; break; --- 311,318 ---- attrib_msg->get_fop_bit(dap_attrib_message::FB$DLT)) delete_file(); reply.set_cmpfunc(dap_accomp_message::RESPONSE); reply.write(conn); ! return true; break; |
From: Patrick C. <pa...@us...> - 2002-07-17 10:40:48
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv15940 Modified Files: open.cc Log Message: Set MACCODE to 5 for EOF rather than 1 as previously. This is what VMS does and RSX seems to need it. Index: open.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/open.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** open.cc 17 Jul 2002 07:34:23 -0000 1.11 --- open.cc 17 Jul 2002 10:40:45 -0000 1.12 *************** *** 657,661 **** dap_status_message status; ! status.set_code(010047); // EOF status.write(conn); conn.set_blocked(false); --- 657,661 ---- dap_status_message status; ! status.set_code(050047); // EOF status.write(conn); conn.set_blocked(false); |
From: Patrick C. <pa...@us...> - 2002-07-17 09:24:27
|
Update of /cvsroot/linux-decnet/dnprogs/dndir In directory usw-pr-cvs1:/tmp/cvs-serv10533/dndir Modified Files: dndir.cc Log Message: cast to get rid of warning on 64bit machines. Index: dndir.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dndir/dndir.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dndir.cc 16 Jul 2002 09:47:12 -0000 1.4 --- dndir.cc 17 Jul 2002 09:24:24 -0000 1.5 *************** *** 617,621 **** else { ! printf("%-*s",filename_width-(strlen(name)-filename_width), ""); } ++(*printed); --- 617,621 ---- else { ! printf("%-*s",(int)(filename_width-(strlen(name)-filename_width)), ""); } ++(*printed); |
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv8244 Modified Files: directory.cc directory.h erase.cc fal.8 fal.cc open.cc params.h rename.cc submit.cc task.cc task.h Log Message: Add "Virtual root" feature to FAL Index: directory.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/directory.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** directory.cc 10 Jul 2002 07:45:24 -0000 1.5 --- directory.cc 17 Jul 2002 07:34:22 -0000 1.6 *************** *** 137,140 **** --- 137,141 ---- filespec[1] = '\0'; } + add_vroot(filespec); struct stat st; *************** *** 238,242 **** // munge the resultant name a bit more than it, also the NAME file // is mandatory for directory listings (quite reasonable really!) ! bool fal_directory::send_dir_entry(const char *path, int display) { struct stat st; --- 239,243 ---- // munge the resultant name a bit more than it, also the NAME file // is mandatory for directory listings (quite reasonable really!) ! bool fal_directory::send_dir_entry(char *path, int display) { struct stat st; *************** *** 286,290 **** else { ! name_msg->set_namespec(path); } --- 287,294 ---- else { ! char publicname[PATH_MAX]; ! strcpy(publicname, path); ! remove_vroot(publicname); ! name_msg->set_namespec(publicname); } Index: directory.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/directory.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** directory.h 26 Apr 2000 08:22:02 -0000 1.1.1.1 --- directory.h 17 Jul 2002 07:34:23 -0000 1.2 *************** *** 15,18 **** dap_alloc_message *alloc_msg; ! bool send_dir_entry(const char *path, int); }; --- 15,18 ---- dap_alloc_message *alloc_msg; ! bool send_dir_entry(char *path, int); }; Index: erase.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/erase.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** erase.cc 27 Oct 2000 16:05:27 -0000 1.2 --- erase.cc 17 Jul 2002 07:34:23 -0000 1.3 *************** *** 1,5 **** /****************************************************************************** (c) 1998-2000 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /****************************************************************************** (c) 1998-2000 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 65,69 **** int pathno = 0; char unixname[PATH_MAX]; ! dap_access_message *am = (dap_access_message *)m; --- 65,69 ---- int pathno = 0; char unixname[PATH_MAX]; ! dap_access_message *am = (dap_access_message *)m; *************** *** 76,79 **** --- 76,80 ---- { strcpy(unixname, am->get_filespec()); + add_vroot(unixname); } *************** *** 107,118 **** } conn.set_blocked(true); ! if (gl.gl_pathc == 1) { ! if (!send_file_attributes(gl.gl_pathv[0], am->get_display(), SEND_DEV)) return false; } ! // Delete all the files do --- 108,119 ---- } conn.set_blocked(true); ! if (gl.gl_pathc == 1) { ! if (!send_file_attributes(gl.gl_pathv[0], am->get_display(), SEND_DEV)) return false; } ! // Delete all the files do *************** *** 120,124 **** status = unlink(gl.gl_pathv[pathno]); ! if (verbose > 1) DAPLOG((LOG_DEBUG, "in fal_erase: unlink '%s', result = %d\n", gl.gl_pathv[pathno], status)); --- 121,125 ---- status = unlink(gl.gl_pathv[pathno]); ! if (verbose > 1) DAPLOG((LOG_DEBUG, "in fal_erase: unlink '%s', result = %d\n", gl.gl_pathv[pathno], status)); Index: fal.8 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/fal.8,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** fal.8 9 Dec 2001 16:26:24 -0000 1.5 --- fal.8 17 Jul 2002 07:34:23 -0000 1.6 *************** *** 9,13 **** Options: .br ! [\-dvVhmt] [\-l logtype] [\-a auto-type] [\-f <auto-file>] .SH DESCRIPTION .PP --- 9,13 ---- Options: .br ! [\-dvVhmt] [\-l logtype] [\-a auto-type] [\-f <auto-file>] [\-r <virtual-root>] .SH DESCRIPTION .PP *************** *** 15,26 **** is a daemon that serves incoming DAP (Data Access protocol) connections from remote systems. It enables transparent file access to files from OpenVMS ! machines using standard DECnet syntax. It should be started at system boot time (after DECnet has been started) and must be run as root. .br ! The file names output by .B fal ! will adapt depending on the sytax of files that are requested ! of it. If VMS-style filenames are requested then VMS-style filenames will be returned. If Unix-style filenames are requested then Unix-style (native) filenames will be returned. Note that to force fal to diplay the contents of --- 15,26 ---- is a daemon that serves incoming DAP (Data Access protocol) connections from remote systems. It enables transparent file access to files from OpenVMS ! machines using standard DECnet syntax. It should be started at system boot time (after DECnet has been started) and must be run as root. .br ! The file names output by .B fal ! will adapt depending on the sytax of files that are requested ! of it. If VMS-style filenames are requested then VMS-style filenames will be returned. If Unix-style filenames are requested then Unix-style (native) filenames will be returned. Note that to force fal to diplay the contents of *************** *** 34,40 **** that will look familiar to VMS users. Of course it also understands this syntax when files and directories are requested of it. One of the problems with ! this is that Unix filenames with non-VMS syntax (eg double dots or "funny" characters) or files with uppercase letter in their names will not be accessible ! from VMS using VMS syntax. You must use Unix syntax to access these files through FAL. .br --- 34,40 ---- that will look familiar to VMS users. Of course it also understands this syntax when files and directories are requested of it. One of the problems with ! this is that Unix filenames with non-VMS syntax (eg double dots or "funny" characters) or files with uppercase letter in their names will not be accessible ! from VMS using VMS syntax. You must use Unix syntax to access these files through FAL. .br *************** *** 45,49 **** file. .br ! By default all files sent by fal will be sent in STREAMLF format. This is configurable by the many command-line switches detailed below. --- 45,49 ---- file. .br ! By default all files sent by fal will be sent in STREAMLF format. This is configurable by the many command-line switches detailed below. *************** *** 110,121 **** .I "\-u" Enable users to override the two above options with a .fal_auto file in her/his ! home directory. This file should contain a single word: .B guess, ext ! or .B none. ! Note that ! .B -u and a .fal_auto file takes effect even if no ! .B -a option is present. .TP --- 110,121 ---- .I "\-u" Enable users to override the two above options with a .fal_auto file in her/his ! home directory. This file should contain a single word: .B guess, ext ! or .B none. ! Note that ! .B -u and a .fal_auto file takes effect even if no ! .B -a option is present. .TP *************** *** 133,136 **** --- 133,144 ---- flags in which case a .$ADF$ takes precedence over a fal metafile or a guessed file type. + .TP + .I "\-r <virtual root>" + Run FAL in a "virtual root". All file accesses will be done below this directory + rather than the normal root filesystem. ie access for "/" or "SYSDISK:[000000]" + will start at the specified directory. Requests for ".." will be refused. + NOTE: This is not a chroot, fal still runs in the normal filesystem. also note + that this will lose the ability to access users home directories: all users doing + a "DIR LINUX::*.*" from VMS will see the virtual root instead. .TP .I "\-d" *************** *** 138,143 **** .TP .I "\-v" ! Verbose. The more of these there are the more verbose fal will be. Don't use ! more than one for normal operation because it will seriously impair performance. .TP --- 146,151 ---- .TP .I "\-v" ! Verbose. The more of these there are the more verbose fal will be. Don't use ! more than one for normal operation because it will seriously impair performance. .TP Index: fal.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/fal.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** fal.cc 27 Oct 2000 16:05:27 -0000 1.3 --- fal.cc 17 Jul 2002 07:34:23 -0000 1.4 *************** *** 1,5 **** /****************************************************************************** ! (c) 1998-1999 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /****************************************************************************** ! (c) 1998-2002 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 68,71 **** --- 68,73 ---- p.use_metafiles = false; p.use_adf = false; + p.vroot[0] = '\0'; + p.vroot_len = 0; #ifdef NO_FORK *************** *** 77,85 **** opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?vVhdmtul:a:f:")) != EOF) { ! switch(opt) { ! case 'h': usage(argv[0], stdout); exit(0); --- 79,87 ---- opterr = 0; optind = 0; ! while ((opt=getopt(argc,argv,"?vVhdmtul:a:f:r:")) != EOF) { ! switch(opt) { ! case 'h': usage(argv[0], stdout); exit(0); *************** *** 109,112 **** --- 111,123 ---- break; + case 'r': + strcpy(p.vroot, optarg); + + // Virtual root must end in (one) slash + if (p.vroot[strlen(p.vroot)-1] != '/') + strcat(p.vroot, "/"); + p.vroot_len = strlen(p.vroot); + break; + case 'V': printf("\nfal from dnprogs version %s\n\n", VERSION); *************** *** 141,145 **** p.use_file = true; break; - } } --- 152,155 ---- *************** *** 163,166 **** --- 173,195 ---- init_daemon_logging("fal", log_char); + // Check the vroot exists and is a directory + if (p.vroot_len) + { + struct stat st; + if (stat(p.vroot, &st) == -1) + { + DAPLOG((LOG_ERR, "Virtual root %s does not exist. FAL won't start\n", p.vroot)); + exit(4); + } + if (!S_ISDIR(st.st_mode)) + { + DAPLOG((LOG_ERR, "Virtual root %s is not a directory. FAL won't start\n", p.vroot)); + exit(4); + } + + if (p.verbosity) + DAPLOG((LOG_INFO, "Using virtual root %s\n", p.vroot)); + } + // Be a daemon int sockfd = dnet_daemon(DNOBJECT_FAL, *************** *** 184,192 **** if (strncasecmp(line, "none", 4) == 0) p.auto_type = fal_params::NONE; ! if (strncasecmp(line, "ext", 3) == 0) p.auto_type = fal_params::CHECK_EXT; ! if (strncasecmp(line, "guess", 5) == 0) p.auto_type = fal_params::GUESS_TYPE; ! if (verbose) DAPLOG((LOG_INFO, "Using conversion type '%s' in local file.\n", p.type_name())); } --- 213,221 ---- if (strncasecmp(line, "none", 4) == 0) p.auto_type = fal_params::NONE; ! if (strncasecmp(line, "ext", 3) == 0) p.auto_type = fal_params::CHECK_EXT; ! if (strncasecmp(line, "guess", 5) == 0) p.auto_type = fal_params::GUESS_TYPE; ! if (verbose) DAPLOG((LOG_INFO, "Using conversion type '%s' in local file.\n", p.type_name())); } *************** *** 196,200 **** dnet_accept(sockfd, 0, NULL, 0); dap_connection *newone = new dap_connection(sockfd, 65535, verbose); ! fal_server f(*newone, p); f.run(); --- 225,229 ---- dnet_accept(sockfd, 0, NULL, 0); dap_connection *newone = new dap_connection(sockfd, 65535, verbose); ! fal_server f(*newone, p); f.run(); *************** *** 213,216 **** --- 242,246 ---- fprintf(f," -f<file> File containing types for -ae\n"); fprintf(f," -l<type> Logging type(s:syslog, e:stderr, m:mono)\n"); + fprintf(f," -r<dir> base directory for FAL file operations\n"); fprintf(f," -u Allow users to override global auto_types\n"); fprintf(f," -v Verbose (repeat to increase verbosity)\n"); Index: open.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/open.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** open.cc 10 Jul 2002 07:11:46 -0000 1.10 --- open.cc 17 Jul 2002 07:34:23 -0000 1.11 *************** *** 119,123 **** // Convert % wildcards to ? ! if (vms_format) convert_vms_wildcards(filespec); // Expand wildcards --- 119,126 ---- // Convert % wildcards to ? ! if (vms_format) ! convert_vms_wildcards(filespec); ! else ! add_vroot(filespec); // Expand wildcards Index: params.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/params.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** params.h 26 Apr 2000 08:22:02 -0000 1.1.1.1 --- params.h 17 Jul 2002 07:34:23 -0000 1.2 *************** *** 8,16 **** enum {GUESS_TYPE, CHECK_EXT, NONE} auto_type; char auto_file[PATH_MAX]; bool use_file; bool use_metafiles; bool use_adf; int remote_os; ! char *type_name() { --- 8,18 ---- enum {GUESS_TYPE, CHECK_EXT, NONE} auto_type; char auto_file[PATH_MAX]; + char vroot[PATH_MAX]; + int vroot_len; bool use_file; bool use_metafiles; bool use_adf; int remote_os; ! char *type_name() { Index: rename.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/rename.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** rename.cc 27 Oct 2000 16:05:27 -0000 1.2 --- rename.cc 17 Jul 2002 07:34:23 -0000 1.3 *************** *** 71,74 **** --- 71,75 ---- { strcpy(oldname, am->get_filespec()); + add_vroot(oldname); } display = am->get_display(); *************** *** 97,100 **** --- 98,102 ---- { strcpy(newname, nm->get_namespec()); + add_vroot(oldname); } int status = rename(oldname, newname); Index: submit.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/submit.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** submit.cc 27 Oct 2000 16:05:27 -0000 1.2 --- submit.cc 17 Jul 2002 07:34:23 -0000 1.3 *************** *** 1,5 **** /****************************************************************************** (c) 1998-2000 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /****************************************************************************** (c) 1998-2000 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 70,74 **** int pathno = 0; char unixname[PATH_MAX]; ! dap_access_message *am = (dap_access_message *)m; --- 70,74 ---- int pathno = 0; char unixname[PATH_MAX]; ! dap_access_message *am = (dap_access_message *)m; *************** *** 81,84 **** --- 81,85 ---- { strcpy(unixname, am->get_filespec()); + add_vroot(unixname); } *************** *** 112,119 **** } conn.set_blocked(true); ! if (gl.gl_pathc == 1) { ! if (!send_file_attributes(gl.gl_pathv[0], am->get_display(), SEND_DEV)) { --- 113,120 ---- } conn.set_blocked(true); ! if (gl.gl_pathc == 1) { ! if (!send_file_attributes(gl.gl_pathv[0], am->get_display(), SEND_DEV)) { *************** *** 122,126 **** } } ! // Submit all the files do --- 123,127 ---- } } ! // Submit all the files do *************** *** 131,135 **** status = system(cmd); ! if (verbose > 1) DAPLOG((LOG_DEBUG, "in fal_submit: '%s', result = %d\n", gl.gl_pathv[pathno], status)); --- 132,136 ---- status = system(cmd); ! if (verbose > 1) DAPLOG((LOG_DEBUG, "in fal_submit: '%s', result = %d\n", gl.gl_pathv[pathno], status)); Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** task.cc 16 Jul 2002 07:51:44 -0000 1.10 --- task.cc 17 Jul 2002 07:34:23 -0000 1.11 *************** *** 1,4 **** /****************************************************************************** ! (c) 1998-2000 P.J. Caulfield pa...@ty... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 1998-2002 P.J. Caulfield pa...@ty... This program is free software; you can redistribute it and/or modify *************** *** 89,92 **** --- 89,127 ---- } + /* Add the virtual "root" directory to the filename */ + void fal_task::add_vroot(char *name) + { + // Add in the vroot + if (params.vroot_len) + { + /* Security measure...if the name has ".." in it then blank the whole lot out and + confuse the user. + well, it stops them escaping the root + */ + if (strstr(name, "..")) + name[0] = '\0'; + + if (verbose > 3) DAPLOG((LOG_DEBUG, "add_vroot: name is %s, vroot='%s' (len=%d)\n", name, params.vroot, params.vroot_len)); + memmove(name + params.vroot_len, name, strlen(name)); + memmove(name, params.vroot, params.vroot_len); + + if (verbose > 3) DAPLOG((LOG_DEBUG, "add_vroot: name is now %s\n", name)); + } + } + + /* Remove the virtual "root" directory to the filename */ + void fal_task::remove_vroot(char *name) + { + if (params.vroot_len) + { + if (verbose > 3) DAPLOG((LOG_INFO, "remove_vroot: name is %s\n", name)); + + memmove(name, name + params.vroot_len-1, strlen(name)); + + if (verbose > 3) DAPLOG((LOG_INFO, "remove_vroot: name is now %s\n", name)); + } + + } + // Splits a filename up into volume, directory and file parts. // The volume and directory are just for display purposes (they get sent back *************** *** 161,164 **** --- 196,202 ---- realpath(unixname, fullname); + // Remove the vroot, but leave a leading slash + remove_vroot(fullname); + // Find the last slash in the name lastslash = fullname + strlen(fullname); *************** *** 415,418 **** --- 453,457 ---- } } + add_vroot(unixname); } Index: task.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** task.h 27 Oct 2000 16:05:27 -0000 1.2 --- task.h 17 Jul 2002 07:34:23 -0000 1.3 *************** *** 27,31 **** void calculate_crc(unsigned char *, int); ! protected: dap_connection &conn; int verbose; --- 27,31 ---- void calculate_crc(unsigned char *, int); ! protected: dap_connection &conn; int verbose; *************** *** 46,50 **** virtual bool send_file_attributes(unsigned int &, bool &, char *, int, dev_option); ! void return_error(); void return_error(int); --- 46,50 ---- virtual bool send_file_attributes(unsigned int &, bool &, char *, int, dev_option); ! void return_error(); void return_error(int); *************** *** 54,57 **** --- 54,59 ---- void make_unix_filespec(char *, char *); void convert_vms_wildcards(char *); + void add_vroot(char *); + void remove_vroot(char *); bool is_vms_name(char *); bool send_ack_and_unblock(); *************** *** 77,81 **** bool fake_file_type(const char *name, dap_attrib_message *attrib_msg); void create_metafile(char *name, dap_attrib_message *attrib_msg); ! // The pseudo device name we use static const char *sysdisk_name; --- 79,83 ---- bool fake_file_type(const char *name, dap_attrib_message *attrib_msg); void create_metafile(char *name, dap_attrib_message *attrib_msg); ! // The pseudo device name we use static const char *sysdisk_name; *************** *** 84,88 **** void meta_filename(const char *file, char *metafile); bool adf_filename(const char *file, char *metafile); ! // auto_types structure class auto_types --- 86,90 ---- void meta_filename(const char *file, char *metafile); bool adf_filename(const char *file, char *metafile); ! // auto_types structure class auto_types *************** *** 97,101 **** next = NULL; } ! char ext[40]; unsigned int block_size; --- 99,103 ---- next = NULL; } ! char ext[40]; unsigned int block_size; *************** *** 138,142 **** // The rest is a mystery to me. }; ! static auto_types *auto_types_list; static const char *default_types_file; --- 140,144 ---- // The rest is a mystery to me. }; ! static auto_types *auto_types_list; static const char *default_types_file; |
From: Patrick C. <pa...@us...> - 2002-07-16 18:41:11
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory usw-pr-cvs1:/tmp/cvs-serv29034 Modified Files: dnlogin.c tty.c Added Files: tty.h Log Message: Add some (untested) line-editting code --- NEW FILE: tty.h --- /****************************************************************************** (c) 2002 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ****************************************************************************** */ /* Key definitions */ #define CTRL_A 0x01 #define CTRL_B 0x02 #define CTRL_C 0x03 #define CTRL_D 0x04 #define CTRL_E 0x05 #define CTRL_F 0x06 #define CTRL_G 0x07 #define BELL 0x07 #define CTRL_H 0x08 #define BS 0x08 #define CTRL_I 0x09 #define CTRL_J 0x0A #define CTRL_K 0x0B #define CTRL_L 0x0C #define CTRL_M 0x0D #define CTRL_N 0x0E #define CTRL_O 0x0F #define CTRL_P 0x10 #define CTRL_Q 0x11 #define CTRL_R 0x12 #define CTRL_S 0x13 #define CTRL_T 0x14 //efine CTRL_U 0x15 #define CTRL_V 0x16 #define CTRL_W 0x17 #define CTRL_U 0x17 #define CTRL_X 0x18 #define CTRL_Y 0x19 #define CTRL_Z 0x1A #define ESC 0x1B #define DEL 0x7F Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dnlogin.c 16 Jul 2002 10:21:31 -0000 1.4 --- dnlogin.c 16 Jul 2002 18:41:06 -0000 1.5 *************** *** 34,40 **** /* The global state */ ! static int termfd = -1; int exit_char = 035; /* Default to ^] */ ! static int finished = 0; /* terminate mainloop */ int debug = 0; --- 34,40 ---- /* The global state */ ! int termfd = -1; int exit_char = 035; /* Default to ^] */ ! int finished = 0; /* terminate mainloop */ int debug = 0; *************** *** 94,103 **** static void usage(char *prog, FILE * f) { ! fprintf(f, "\nUSAGE: %s [OPTIONS] node\n\n", prog); fprintf(f, "\nOptions:\n"); fprintf(f, " -? -h display this help message\n"); fprintf(f, " -V show version number\n"); ! fprintf(f, " -e <char> set escape char\n"); fprintf(f, " -d debug information\n"); --- 94,103 ---- static void usage(char *prog, FILE * f) { ! fprintf(f, "\nUsage: %s [OPTIONS] node\n\n", prog); fprintf(f, "\nOptions:\n"); fprintf(f, " -? -h display this help message\n"); fprintf(f, " -V show version number\n"); ! fprintf(f, " -e <char> set exit char\n"); fprintf(f, " -d debug information\n"); Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** tty.c 16 Jul 2002 10:21:31 -0000 1.1 --- tty.c 16 Jul 2002 18:41:06 -0000 1.2 *************** *** 32,40 **** #include "dn_endian.h" #include "dnlogin.h" /* The global state */ ! static int termfd = -1; ! static int exit_char = 035; /* Default to ^] */ ! static int finished = 0; /* terminate mainloop */ /* Input state buffers & variables */ --- 32,41 ---- #include "dn_endian.h" #include "dnlogin.h" + #include "tty.h" /* The global state */ ! extern int termfd; ! extern int exit_char; ! extern int finished; /* Input state buffers & variables */ *************** *** 42,45 **** --- 43,47 ---- static char input_buf[1024]; static int input_len; + static int input_pos; static char prompt_buf[1024]; static char prompt_len; *************** *** 48,51 **** --- 50,54 ---- static int max_read_len = sizeof(input_buf); static int echo = 1; + static int insert_mode = 0; /* Output processor */ *************** *** 75,78 **** --- 78,82 ---- memcpy(input_buf, prompt+promptlen, len-promptlen); input_len = len-promptlen; + input_pos = input_len; } *************** *** 133,136 **** --- 137,155 ---- } + /* Erase to end of line */ + static void erase_eol(void) + { + write(termfd, "\033[1K", 4); + } + + /* Move to column "hpos", where hpos starts at 0 */ + static void move_cursor_abs(int hpos) + { + char buf[32]; + + sprintf(buf, "\r\033[%dC", hpos); + write(termfd, buf, strlen(buf)); + } + /* Input from keyboard */ int tty_process_terminal(char *buf, int len) *************** *** 149,152 **** --- 168,176 ---- write(termfd, &buf[i], 1); + /* Swap LF for CR */ + //PJC: is this right?? + if (buf[i] == '\n') + buf[i] = '\r'; + if (is_terminator(buf[i])) { *************** *** 155,160 **** } ! // TODO: process line-editting keys & flags ! input_buf[input_len++] = buf[i]; if (input_len == max_read_len) { --- 179,247 ---- } ! /* Is it ESCAPE ? */ ! if (buf[i] == ESC && !esc_len) ! { ! esc_buf[esc_len++] = buf[i]; ! continue; ! } ! /* Still processing escape sequence */ ! if (esc_len) ! { ! esc_buf[esc_len++] = buf[i]; ! if (isalpha(buf[i])) ! { ! /* Process escape sequences */ ! if (strncmp(esc_buf, "\033[C", 3)) /* Cursor RIGHT */ ! { ! if (input_pos < input_len) ! { ! input_pos++; ! write(termfd, esc_buf, esc_len); ! } ! } ! if (strncmp(esc_buf, "\033[D", 3)) /* Cursor LEFT */ ! { ! if (input_pos) ! { ! input_pos--; ! write(termfd, esc_buf, esc_len); ! } ! } ! esc_len = 0; ! continue; ! } ! } ! ! /* Process non-terminator control chars */ ! if (buf[i] < ' ') ! { ! switch (buf[i]) ! { ! case CTRL_B: // Up a line ! break; ! case CTRL_X: // delete input line ! case CTRL_U: // delete input line ! move_cursor_abs(prompt_len); ! erase_eol(); ! input_pos = 0; ! break; ! case CTRL_H: // back to start of line ! move_cursor_abs(prompt_len); ! input_pos = 0; ! break; ! case CTRL_A: /* switch overstrike/insert mode */ ! insert_mode = 1-insert_mode; ! break; ! case CTRL_M: ! send_input(input_buf, input_len, 0); ! break; ! } ! continue; ! } ! ! input_buf[input_pos++] = buf[i]; ! if (input_len < input_pos) ! input_len = input_len; ! if (input_len == max_read_len) { |
From: Patrick C. <pa...@us...> - 2002-07-16 10:21:34
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory usw-pr-cvs1:/tmp/cvs-serv28382 Modified Files: Makefile dnlogin.c dnlogin.h Added Files: README tty.c Log Message: Add a README and move tty handling into its own file. --- NEW FILE: README --- This is a proposed replacement for the rather unwieldy sethost program. It is nowhere near finished yet (though help would be appreciated!) and therefore is not built as part of the package. The principle is that found.c implements the foundation protocol in found.txt and cterm.c implements the cterm protocol on top of that, and the tty handling happens in tty.c. It should be easy to plug in other terminal protocols into here (eg dterm) if/when someone volunteers them. Patrick --- NEW FILE: tty.c --- /****************************************************************************** (c) 2002 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ****************************************************************************** */ #include <stdio.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <signal.h> #include <stdlib.h> #include <ctype.h> #include <termios.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/time.h> #include <sys/fcntl.h> #include <netdnet/dn.h> #include <netdnet/dnetdb.h> #include "cterm.h" #include "dn_endian.h" #include "dnlogin.h" /* The global state */ static int termfd = -1; static int exit_char = 035; /* Default to ^] */ static int finished = 0; /* terminate mainloop */ /* Input state buffers & variables */ static unsigned char terminators[32]; static char input_buf[1024]; static int input_len; static char prompt_buf[1024]; static char prompt_len; static char esc_buf[132]; static int esc_len; static int max_read_len = sizeof(input_buf); static int echo = 1; /* Output processor */ int (*send_input)(char *buf, int len, int flags); /* Raw write to terminal */ int tty_write(char *buf, int len) { return (write(termfd, buf, len) == len); } void tty_set_terminators(char *buf, int len) { memset(terminators, 0, sizeof(terminators)); memcpy(terminators, buf, len); } void tty_start_read(char *prompt, int len, int promptlen) { write(termfd, prompt, len); /* Save the actual prompt in one buffer and the prefilled data in th input buffer */ memcpy(prompt_buf, prompt, promptlen); prompt_len = promptlen; memcpy(input_buf, prompt+promptlen, len-promptlen); input_len = len-promptlen; } void tty_set_timeout(unsigned short to) { // TODO: } void tty_set_maxlen(unsigned short len) { max_read_len = len; } /* Set/Reset the local TTY mode */ int tty_setup(char *name, int setup) { struct termios new_term; static struct termios old_term; if (setup) { termfd = open(name, O_RDWR); tcgetattr(termfd, &old_term); new_term = old_term; new_term.c_iflag &= ~BRKINT; new_term.c_iflag |= IGNBRK; new_term.c_lflag &= ~ISIG; new_term.c_cc[VMIN] = 1; new_term.c_cc[VTIME] = 0; new_term.c_lflag &= ~ICANON; new_term.c_lflag &= ~(ECHO | ECHOCTL | ECHONL); tcsetattr(termfd, TCSANOW, &new_term); } else { tcsetattr(termfd, TCSANOW, &old_term); close(termfd); } return 0; } static short is_terminator(char c) { short termind, msk, aux; termind = c / 8; aux = c - (termind * 8); msk = (1 << aux); if (terminators[termind] && msk) { return 1; } return 0; } /* Input from keyboard */ int tty_process_terminal(char *buf, int len) { int i; for (i=0; i<len; i++) { if (buf[i] == exit_char) { finished = 1; return 0; } if (echo) write(termfd, &buf[i], 1); if (is_terminator(buf[i])) { send_input(&buf[i], 1, 0); return 0; } // TODO: process line-editting keys & flags input_buf[input_len++] = buf[i]; if (input_len == max_read_len) { send_input(input_buf, input_len, 0); } // TODO: Loads more. } return 0; } Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Makefile 16 Jun 2002 18:58:07 -0000 1.1 --- Makefile 16 Jul 2002 10:21:31 -0000 1.2 *************** *** 9,13 **** MANPAGES=dnlogin.1 ! PROG1OBJS=dnlogin.o found.o cterm.o all: $(PROG1) --- 9,13 ---- MANPAGES=dnlogin.1 ! PROG1OBJS=dnlogin.o found.o cterm.o tty.o all: $(PROG1) *************** *** 22,26 **** install -m 0644 $(MANPAGES) $(prefix)/man/man1 ! dep depend: $(CC) $(CFLAGS) -MM *.c >.depend 2>/dev/null --- 22,26 ---- install -m 0644 $(MANPAGES) $(prefix)/man/man1 ! dep depend: $(CC) $(CFLAGS) -MM *.c >.depend 2>/dev/null Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dnlogin.c 25 Jun 2002 07:08:14 -0000 1.3 --- dnlogin.c 16 Jul 2002 10:21:31 -0000 1.4 *************** *** 35,173 **** /* The global state */ static int termfd = -1; ! static int exit_char = 035; /* Default to ^] */ static int finished = 0; /* terminate mainloop */ int debug = 0; - - /* Input state buffers & variables */ - static unsigned char terminators[32]; - static char input_buf[1024]; - static int input_len; - static char prompt_buf[1024]; - static char prompt_len; - static char esc_buf[132]; - static int esc_len; - static int max_read_len = sizeof(input_buf); - static int echo = 1; - - /* Output processor */ - int (*send_input)(char *buf, int len, int flags); - - /* Raw write to terminal */ - int tty_write(char *buf, int len) - { - return (write(termfd, buf, len) == len); - } - - void tty_set_terminators(char *buf, int len) - { - memset(terminators, 0, sizeof(terminators)); - memcpy(terminators, buf, len); - } - - void tty_start_read(char *prompt, int len, int promptlen) - { - write(termfd, prompt, len); - - /* Save the actual prompt in one buffer and the prefilled - data in th input buffer */ - memcpy(prompt_buf, prompt, promptlen); - prompt_len = promptlen; - - memcpy(input_buf, prompt+promptlen, len-promptlen); - input_len = len-promptlen; - } - - void tty_set_timeout(unsigned short to) - { - // TODO: - } - - void tty_set_maxlen(unsigned short len) - { - max_read_len = len; - } - - /* Set/Reset the local TTY mode */ - static int setup_tty(char *name, int setup) - { - struct termios new_term; - static struct termios old_term; - - if (setup) - { - termfd = open(name, O_RDWR); - - tcgetattr(termfd, &old_term); - new_term = old_term; - - new_term.c_iflag &= ~BRKINT; - new_term.c_iflag |= IGNBRK; - new_term.c_lflag &= ~ISIG; - new_term.c_cc[VMIN] = 1; - new_term.c_cc[VTIME] = 0; - new_term.c_lflag &= ~ICANON; - new_term.c_lflag &= ~(ECHO | ECHOCTL | ECHONL); - tcsetattr(termfd, TCSANOW, &new_term); - } - else - { - tcsetattr(termfd, TCSANOW, &old_term); - close(termfd); - } - - return 0; - } - - static short is_terminator(char c) - { - short termind, msk, aux; - - termind = c / 8; - aux = c - (termind * 8); - msk = (1 << aux); - - if (terminators[termind] && msk) - { - return 1; - } - return 0; - } - - /* Input from keyboard */ - static int process_terminal(char *buf, int len) - { - int i; - - for (i=0; i<len; i++) - { - if (buf[i] == exit_char) - { - finished = 1; - return 0; - } - - if (echo) - write(termfd, &buf[i], 1); - - if (is_terminator(buf[i])) - { - send_input(&buf[i], 1, 0); - return 0; - } - - // TODO: process line-editting keys & flags - input_buf[input_len++] = buf[i]; - if (input_len == max_read_len) - { - send_input(input_buf, input_len, 0); - } - - // TODO: Loads more. - } - return 0; - } - static int mainloop(void) { --- 35,43 ---- /* The global state */ static int termfd = -1; ! int exit_char = 035; /* Default to ^] */ static int finished = 0; /* terminate mainloop */ int debug = 0; static int mainloop(void) { *************** *** 196,200 **** break; } ! process_terminal(inbuf, len); } --- 66,70 ---- break; } ! tty_process_terminal(inbuf, len); } *************** *** 282,288 **** if (found_setup_link(argv[optind], DNOBJECT_CTERM, cterm_process_network) == 0) { ! setup_tty("/dev/tty", 1); mainloop(); ! setup_tty(NULL, 0); } else --- 152,158 ---- if (found_setup_link(argv[optind], DNOBJECT_CTERM, cterm_process_network) == 0) { ! tty_setup("/dev/tty", 1); mainloop(); ! tty_setup(NULL, 0); } else Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dnlogin.h 16 Jul 2002 09:47:12 -0000 1.4 --- dnlogin.h 16 Jul 2002 10:21:31 -0000 1.5 *************** *** 33,37 **** --- 33,40 ---- extern void tty_set_timeout(unsigned short to); extern void tty_set_maxlen(unsigned short len); + extern int tty_process_terminal(char *inbuf, int len); + extern int tty_setup(char *name, int setup); + extern int (*send_input)(char *buf, int len, int flags); /* Global variables */ |
From: Patrick C. <pa...@us...> - 2002-07-16 10:12:01
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv26163 Modified Files: control rules Log Message: Replace dh_testversion with Build-Depends Index: control =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/control,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** control 21 Feb 2002 11:14:00 -0000 1.19 --- control 16 Jul 2002 10:11:59 -0000 1.20 *************** *** 3,7 **** Priority: extra Maintainer: Patrick Caulfield <pa...@de...> ! Build-Depends: debhelper, libncurses5-dev Standards-Version: 3.5.6 --- 3,7 ---- Priority: extra Maintainer: Patrick Caulfield <pa...@de...> ! Build-Depends: debhelper(>=2), libncurses5-dev Standards-Version: 3.5.6 Index: rules =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/rules,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** rules 12 Jul 2002 11:47:45 -0000 1.12 --- rules 16 Jul 2002 10:11:59 -0000 1.13 *************** *** 37,41 **** rm debian/tmp/usr/sbin/startnet install -m755 apps/setether.sh debian/tmp/sbin/setether - dh_testversion 2 dh_installdirs -pdnet-common dh_installchangelogs -pdnet-common --- 37,40 ---- |
From: Patrick C. <pa...@us...> - 2002-07-16 09:48:15
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory usw-pr-cvs1:/tmp/cvs-serv19898 Modified Files: cterm.c found.c Log Message: tidy conerror() Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** cterm.c 25 Jun 2002 07:08:14 -0000 1.3 --- cterm.c 16 Jul 2002 09:48:12 -0000 1.4 *************** *** 200,207 **** char newbuf[len+9]; ! newbuf[0] =0; ! newbuf[1] =0; ! newbuf[2] =0; ! newbuf[3] =0; memcpy(newbuf+4, buf, len); --- 200,207 ---- char newbuf[len+9]; ! newbuf[0] = 0; ! newbuf[1] = 0; ! newbuf[2] = 0; ! newbuf[3] = 0; memcpy(newbuf+4, buf, len); Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** found.c 18 Jun 2002 19:36:54 -0000 1.2 --- found.c 16 Jul 2002 09:48:12 -0000 1.3 *************** *** 108,112 **** if (wrote != sizeof(bindacc_msg)) { ! fprintf(stderr, "%s\n", found_connerror("read error")); return -1; } --- 108,112 ---- if (wrote != sizeof(bindacc_msg)) { ! fprintf(stderr, "%s\n", found_connerror()); return -1; } *************** *** 160,164 **** return 0; ! fprintf(stderr, "%s\n", found_connerror("read sock")); return -1; } --- 160,164 ---- return 0; ! fprintf(stderr, "%s\n", found_connerror()); return -1; } *************** *** 235,240 **** /* Return the text of a connection error */ ! char *found_connerror(char *default_msg) { #ifdef DSO_DISDATA struct optdata_dn optdata; --- 235,241 ---- /* Return the text of a connection error */ ! char *found_connerror() { + int saved_errno = errno; #ifdef DSO_DISDATA struct optdata_dn optdata; *************** *** 245,249 **** &optdata, &len) == -1) { ! return default_msg; } --- 246,250 ---- &optdata, &len) == -1) { ! return strerror(saved_errno); } *************** *** 287,296 **** case DNSTAT_TOOLONG: msg="A field in the access control message was too long"; break; ! default: msg=default_msg; break; } return msg; #else ! return strerror(errno); #endif } --- 288,297 ---- case DNSTAT_TOOLONG: msg="A field in the access control message was too long"; break; ! default: msg=strerror(saved_errno); break; } return msg; #else ! return strerror(saved_errno); #endif } |
From: Patrick C. <pa...@us...> - 2002-07-16 09:47:20
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory usw-pr-cvs1:/tmp/cvs-serv19446/dnlogin Modified Files: dnlogin.h Log Message: A bit of source tidying. Mainly removal of trailing blanks. Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dnlogin.h 25 Jun 2002 07:08:14 -0000 1.3 --- dnlogin.h 16 Jul 2002 09:47:12 -0000 1.4 *************** *** 16,20 **** /* Foundation services routines */ ! extern char *found_connerror(char *default_msg); extern int found_getsockfd(void); extern int found_write(char *buf, int len); --- 16,20 ---- /* Foundation services routines */ ! extern char *found_connerror(void); extern int found_getsockfd(void); extern int found_write(char *buf, int len); |
From: Patrick C. <pa...@us...> - 2002-07-16 09:47:20
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory usw-pr-cvs1:/tmp/cvs-serv19446/apps Modified Files: cterm.h Log Message: A bit of source tidying. Mainly removal of trailing blanks. Index: cterm.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/cterm.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** cterm.h 26 Apr 2000 08:22:03 -0000 1.1.1.1 --- cterm.h 16 Jul 2002 09:47:12 -0000 1.2 *************** *** 3,19 **** */ ! #define CTRL_X 0x18 ! #define CTRL_U 0x17 #define CTRL_O 0x0F #define CTRL_R 0x12 - #define CTRL_W 0x17 #define CTRL_S 0x13 - #define CTRL_Q 0x11 - #define CTRL_Y 0x19 - #define CTRL_C 0x03 #define CTRL_T 0x14 ! #define DEL 0x7F ! #define BS 0x08 #define ESC 0x1B static char BELL=0x07; --- 3,38 ---- */ ! #define CTRL_A 0x01 ! #define CTRL_B 0x02 ! #define CTRL_C 0x03 ! #define CTRL_D 0x04 ! #define CTRL_E 0x05 ! #define CTRL_F 0x06 ! #define CTRL_G 0x07 ! #define CTRL_H 0x08 ! #define BS 0x08 ! #define CTRL_I 0x09 ! #define CTRL_J 0x0A ! #define CTRL_K 0x0B ! #define CTRL_L 0x0C ! #define CTRL_M 0x0D ! #define CTRL_N 0x0E #define CTRL_O 0x0F + #define CTRL_P 0x10 + #define CTRL_Q 0x11 #define CTRL_R 0x12 #define CTRL_S 0x13 #define CTRL_T 0x14 ! //efine CTRL_U 0x15 ! #define CTRL_V 0x16 ! #define CTRL_W 0x17 ! #define CTRL_U 0x17 ! #define CTRL_X 0x18 ! #define CTRL_Y 0x19 ! #define CTRL_Z 0x1A #define ESC 0x1B + #define DEL 0x7F + + static char BELL=0x07; |
From: Patrick C. <pa...@us...> - 2002-07-16 09:47:18
|
Update of /cvsroot/linux-decnet/dnprogs/dndir In directory usw-pr-cvs1:/tmp/cvs-serv19446/dndir Modified Files: dndir.cc Log Message: A bit of source tidying. Mainly removal of trailing blanks. Index: dndir.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dndir/dndir.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dndir.cc 1 Jan 2001 18:11:46 -0000 1.3 --- dndir.cc 16 Jul 2002 09:47:12 -0000 1.4 *************** *** 1,5 **** /****************************************************************************** (c) 1998-1999 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /****************************************************************************** (c) 1998-1999 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 34,41 **** void print_short( unsigned int filename_width, ! int show_size, ! int show_date, ! int show_owner, ! int show_protection, int single_column, int entries_per_line, --- 34,41 ---- void print_short( unsigned int filename_width, ! int show_size, ! int show_date, ! int show_owner, ! int show_protection, int single_column, int entries_per_line, *************** *** 80,84 **** fprintf(f, " -v increase verbosity\n"); fprintf(f, " -V show version number\n"); ! fprintf(f, "\nExamples:\n\n"); fprintf(f, " dndir -l 'myvax::*.*'\n"); --- 80,84 ---- fprintf(f, " -v increase verbosity\n"); fprintf(f, " -V show version number\n"); ! fprintf(f, "\nExamples:\n\n"); fprintf(f, " dndir -l 'myvax::*.*'\n"); *************** *** 140,145 **** } ! ! // Get command-line options opterr = 0; optind = 0; --- 140,145 ---- } ! ! // Get command-line options opterr = 0; optind = 0; *************** *** 148,152 **** switch(opt) { ! case 'h': dndir_usage(stdout); exit(1); --- 148,152 ---- switch(opt) { ! case 'h': dndir_usage(stdout); exit(1); *************** *** 160,187 **** single_column++; break; ! ! case 'o': show_owner++; single_column++; break; ! case 'c': single_column++; break; ! case 'b': show_bytes++; break; ! case 's': show_size++; single_column++; break; ! case 'd': show_date++; single_column++; break; ! case 'l': show_date++; --- 160,187 ---- single_column++; break; ! ! case 'o': show_owner++; single_column++; break; ! case 'c': single_column++; break; ! case 'b': show_bytes++; break; ! case 's': show_size++; single_column++; break; ! case 'd': show_date++; single_column++; break; ! case 'l': show_date++; *************** *** 233,237 **** { dndir_usage(stderr); ! exit(2); } --- 233,237 ---- { dndir_usage(stderr); ! exit(2); } *************** *** 278,285 **** bool name_pending = false; ! if (show_full) { if (show_full_details(dirname, conn)) goto finished; ! } else --- 278,285 ---- bool name_pending = false; ! if (show_full) { if (show_full_details(dirname, conn)) goto finished; ! } else *************** *** 294,298 **** { case dap_message::NAME: ! { if (name_pending) { --- 294,298 ---- { case dap_message::NAME: ! { if (name_pending) { *************** *** 312,316 **** dap_name_message *nm = (dap_name_message *)m; ! if (nm->get_nametype() == dap_name_message::VOLUME && show_header) --- 312,316 ---- dap_name_message *nm = (dap_name_message *)m; ! if (nm->get_nametype() == dap_name_message::VOLUME && show_header) *************** *** 320,324 **** strcpy(volname, nm->get_namespec()); } ! if (nm->get_nametype() == dap_name_message::DIRECTORY && show_header) --- 320,324 ---- strcpy(volname, nm->get_namespec()); } ! if (nm->get_nametype() == dap_name_message::DIRECTORY && show_header) *************** *** 332,336 **** just_shown_header = 0; } ! if (nm->get_nametype() == dap_name_message::FILENAME) { --- 332,336 ---- just_shown_header = 0; } ! if (nm->get_nametype() == dap_name_message::FILENAME) { *************** *** 340,354 **** } break; ! case dap_message::PROTECT: ! { dap_protect_message *pm = (dap_protect_message *)m; strcpy(owner, pm->get_owner()); strcpy(prot, pm->get_protection()); ! } break; ! case dap_message::ATTRIB: ! { dap_attrib_message *am = (dap_attrib_message *)m; if (show_bytes) --- 340,354 ---- } break; ! case dap_message::PROTECT: ! { dap_protect_message *pm = (dap_protect_message *)m; strcpy(owner, pm->get_owner()); strcpy(prot, pm->get_protection()); ! } break; ! case dap_message::ATTRIB: ! { dap_attrib_message *am = (dap_attrib_message *)m; if (show_bytes) *************** *** 360,364 **** case dap_message::DATE: ! { dap_date_message *dm = (dap_date_message *)m; strcpy(cdt, dm->make_y2k(dm->get_cdt())); --- 360,364 ---- case dap_message::DATE: ! { dap_date_message *dm = (dap_date_message *)m; strcpy(cdt, dm->make_y2k(dm->get_cdt())); *************** *** 390,394 **** } } ! dap_contran_message cm; cm.set_confunc(dap_contran_message::SKIP); --- 390,394 ---- } } ! dap_contran_message cm; cm.set_confunc(dap_contran_message::SKIP); *************** *** 438,442 **** if (!single_column) printf("\n"); ! if (show_total) { --- 438,442 ---- if (!single_column) printf("\n"); ! if (show_total) { *************** *** 484,488 **** delete date_msg; } ! name_msg = (dap_name_message *)m; switch (name_msg->get_nametype()) --- 484,488 ---- delete date_msg; } ! name_msg = (dap_name_message *)m; switch (name_msg->get_nametype()) *************** *** 522,526 **** printf("%s File current locked by another user\n", name_msg->get_namespec()); ! dap_contran_message cm; cm.set_confunc(dap_contran_message::SKIP); --- 522,526 ---- printf("%s File current locked by another user\n", name_msg->get_namespec()); ! dap_contran_message cm; cm.set_confunc(dap_contran_message::SKIP); *************** *** 533,537 **** else { ! printf("Error opening %s: %s\n", dirname, sm->get_message()); return false; --- 533,537 ---- else { ! printf("Error opening %s: %s\n", dirname, sm->get_message()); return false; *************** *** 539,546 **** } break; ! case dap_message::ACK: break; ! case dap_message::ACCOMP: goto full_flush; --- 539,546 ---- } break; ! case dap_message::ACK: break; ! case dap_message::ACCOMP: goto full_flush; *************** *** 564,571 **** void print_short( unsigned int filename_width, ! int show_size, ! int show_date, ! int show_owner, ! int show_protection, int single_column, int entries_per_line, --- 564,571 ---- void print_short( unsigned int filename_width, ! int show_size, ! int show_date, ! int show_owner, ! int show_protection, int single_column, int entries_per_line, *************** *** 606,610 **** *printed = 0; } ! // Long filename, skip a field. if (strlen(name) >= filename_width && *printed) --- 606,610 ---- *printed = 0; } ! // Long filename, skip a field. if (strlen(name) >= filename_width && *printed) *************** *** 639,645 **** attrib_msg->get_alq(), protect_msg->get_owner()); ! printf("Created: %s\n", date_msg->make_y2k(date_msg->get_cdt())); ! printf("Revised: %s (%d)\n", date_msg->make_y2k(date_msg->get_rdt()), date_msg->get_rvn()); --- 639,645 ---- attrib_msg->get_alq(), protect_msg->get_owner()); ! printf("Created: %s\n", date_msg->make_y2k(date_msg->get_cdt())); ! printf("Revised: %s (%d)\n", date_msg->make_y2k(date_msg->get_rdt()), date_msg->get_rvn()); *************** *** 647,659 **** printf("Expires: <None specified>\n"); else ! printf("Expires: %s\n", date_msg->make_y2k(date_msg->get_edt())); ! if (date_msg->get_bdt()[0] == '\0') printf("Backup: <No backup recorded>\n"); else ! printf("Backup: %s\n", date_msg->make_y2k(date_msg->get_bdt())); ! printf("File organization: "); switch (attrib_msg->get_org()) --- 647,659 ---- printf("Expires: <None specified>\n"); else ! printf("Expires: %s\n", date_msg->make_y2k(date_msg->get_edt())); ! if (date_msg->get_bdt()[0] == '\0') printf("Backup: <No backup recorded>\n"); else ! printf("Backup: %s\n", date_msg->make_y2k(date_msg->get_bdt())); ! printf("File organization: "); switch (attrib_msg->get_org()) *************** *** 672,676 **** break; } ! printf("Record Format: "); switch (attrib_msg->get_rfm()) --- 672,676 ---- break; } ! printf("Record Format: "); switch (attrib_msg->get_rfm()) *************** *** 701,705 **** break; } ! printf("Record Attributes: "); bool done_one=false; --- 701,705 ---- break; } ! printf("Record Attributes: "); bool done_one=false; *************** *** 709,713 **** done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$CR) { --- 709,713 ---- done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$CR) { *************** *** 716,720 **** done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$PRN) { --- 716,720 ---- done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$PRN) { *************** *** 723,727 **** done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$BLK) { --- 723,727 ---- done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$BLK) { *************** *** 730,734 **** done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$LSA) { --- 730,734 ---- done_one=true; } ! if (attrib_msg->get_rat() & 1<<dap_attrib_message::FB$LSA) { *************** *** 739,748 **** if (!done_one) printf("None"); printf("\n"); ! printf("File protection: "); char prot[64]; strcpy(prot, protect_msg->get_protection()+1); prot[strlen(prot)-1] = '\0'; ! char *p = strtok(prot, ","); for (int c=0; c<4; c++) --- 739,748 ---- if (!done_one) printf("None"); printf("\n"); ! printf("File protection: "); char prot[64]; strcpy(prot, protect_msg->get_protection()+1); prot[strlen(prot)-1] = '\0'; ! char *p = strtok(prot, ","); for (int c=0; c<4; c++) |
From: Patrick C. <pa...@us...> - 2002-07-16 09:47:18
|
Update of /cvsroot/linux-decnet/dnprogs/dndel In directory usw-pr-cvs1:/tmp/cvs-serv19446/dndel Modified Files: dndel.cc Log Message: A bit of source tidying. Mainly removal of trailing blanks. Index: dndel.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dndel/dndel.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dndel.cc 27 Oct 2000 16:05:26 -0000 1.2 --- dndel.cc 16 Jul 2002 09:47:12 -0000 1.3 *************** *** 1,5 **** /****************************************************************************** (c) 1998-1999 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /****************************************************************************** (c) 1998-1999 P.J. Caulfield pa...@ty... ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 42,46 **** printf(" -? -h display this help message\n"); printf(" -V show version number\n"); ! printf("\nExamples:\n\n"); printf(" dndel -l 'myvax::*.*;'\n"); --- 42,46 ---- printf(" -? -h display this help message\n"); printf(" -V show version number\n"); ! printf("\nExamples:\n\n"); printf(" dndel -l 'myvax::*.*;'\n"); *************** *** 76,80 **** return true; } ! // Send an ACCESS DIRECTORY request. If we are running non-interactively then --- 76,80 ---- return true; } ! // Send an ACCESS DIRECTORY request. If we are running non-interactively then *************** *** 130,134 **** // Send CONTRAN/SKIP message. We need this if a file in the list is locked. static bool dap_send_skip(dap_connection &conn) ! { dap_contran_message cm; cm.set_confunc(dap_contran_message::SKIP); --- 130,134 ---- // Send CONTRAN/SKIP message. We need this if a file in the list is locked. static bool dap_send_skip(dap_connection &conn) ! { dap_contran_message cm; cm.set_confunc(dap_contran_message::SKIP); *************** *** 182,186 **** } break; ! case dap_message::ACCOMP: delete m; --- 182,186 ---- } break; ! case dap_message::ACCOMP: delete m; *************** *** 199,204 **** break; } ! fprintf(stderr, "Error deleting %s: %s\n", ! got_name?name:"file", sm->get_message()); delete m; --- 199,204 ---- break; } ! fprintf(stderr, "Error deleting %s: %s\n", ! got_name?name:"file", sm->get_message()); delete m; *************** *** 230,234 **** exit(0); } ! /* Get command-line options */ opterr = 0; --- 230,234 ---- exit(0); } ! /* Get command-line options */ opterr = 0; *************** *** 238,242 **** switch(opt) { ! case 'h': case '?': usage(); --- 238,242 ---- switch(opt) { ! case 'h': case '?': usage(); *************** *** 295,302 **** } } ! /* If non-interactive then the next command just deletes the files */ ! dap_directory_lookup(dir_conn, name, interactive || (verbose>0) ); ! /* Loop through the files we find */ while ((retval=dap_get_dir_entry(dir_conn, name)) > 0) --- 295,302 ---- } } ! /* If non-interactive then the next command just deletes the files */ ! dap_directory_lookup(dir_conn, name, interactive || (verbose>0) ); ! /* Loop through the files we find */ while ((retval=dap_get_dir_entry(dir_conn, name)) > 0) *************** *** 307,311 **** { char response[255]; ! printf("Delete %s ? ", name); fgets(response, sizeof(response), stdin); --- 307,311 ---- { char response[255]; ! printf("Delete %s ? ", name); fgets(response, sizeof(response), stdin); *************** *** 317,321 **** printf("Deleted %s\n", name); } ! } else if (verbose) { --- 317,321 ---- printf("Deleted %s\n", name); } ! } else if (verbose) { |
From: Patrick C. <pa...@us...> - 2002-07-16 09:45:56
|
Update of /cvsroot/linux-decnet/dnprogs In directory usw-pr-cvs1:/tmp/cvs-serv19137 Modified Files: FUTURE_PROJECTS Log Message: The symbiont lives. Index: FUTURE_PROJECTS =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/FUTURE_PROJECTS,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** FUTURE_PROJECTS 27 Oct 2000 16:05:26 -0000 1.2 --- FUTURE_PROJECTS 16 Jul 2002 09:45:53 -0000 1.3 *************** *** 6,11 **** happen then mail me on pa...@us.... But no promises. - - A print symbiont for VMS that forwards prints to lpd on Linux - - use dbm/gdbm for /etc/decnet.conf to speed lookups on sites with a large number of nodes. Possibly also include something like --- 6,9 ---- |
From: Patrick C. <pa...@us...> - 2002-07-16 09:41:11
|
Update of /cvsroot/linux-decnet/dnprogs In directory usw-pr-cvs1:/tmp/cvs-serv17282 Removed Files: dnprogs.lsm Log Message: Remove pointless file. --- dnprogs.lsm DELETED --- |
From: Patrick C. <pa...@us...> - 2002-07-16 07:51:48
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv3936 Modified Files: task.cc Log Message: Fix use of strncmp that caused directories starting with 0 to be ignored. Thanks to Matjaz Godec Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** task.cc 11 Jul 2002 14:58:03 -0000 1.9 --- task.cc 16 Jul 2002 07:51:44 -0000 1.10 *************** *** 371,380 **** { // Skip root directory specs ! if (dir[i] == '0' && strncmp(&dir[i], "000000", 6)) { i += 5; continue; } ! if (dir[i] == '0' && strncmp(&dir[i], "0,0", 3)) { i += 2; --- 371,380 ---- { // Skip root directory specs ! if (dir[i] == '0' && (strncmp(&dir[i], "000000", 6) == 0)) { i += 5; continue; } ! if (dir[i] == '0' && (strncmp(&dir[i], "0,0", 3) == 0)) { i += 2; |
From: Patrick C. <pa...@us...> - 2002-07-15 08:07:47
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv14057 Modified Files: dnet-common.init.d dnet-progs.init.d Log Message: Add support for "reload". actually this is a no-op for both scripts as dnet-common doesn't have any daemons and the dnet-progs daemons automatically reconfigure themselves anyway but it keeps them up with Debian policy. Index: dnet-common.init.d =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-common.init.d,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dnet-common.init.d 12 Jul 2002 11:47:45 -0000 1.4 --- dnet-common.init.d 15 Jul 2002 08:07:43 -0000 1.5 *************** *** 58,66 **** ;; ! restart|force-reload) ;; *) ! echo "Usage $0 {start|stop|restart|force-reload}" ;; esac --- 58,66 ---- ;; ! restart|reload|force-reload) ;; *) ! echo "Usage $0 {start|stop|restart|reload|force-reload}" ;; esac Index: dnet-progs.init.d =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.init.d,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dnet-progs.init.d 17 Apr 2002 09:45:06 -0000 1.5 --- dnet-progs.init.d 15 Jul 2002 08:07:43 -0000 1.6 *************** *** 46,49 **** --- 46,53 ---- ;; + # DECnet daemons all automatically reconfigure. + reload) + ;; + restart|force-reload) echo -n "Restarting DECnet daemons:" *************** *** 58,62 **** *) ! echo "Usage $0 {start|stop|restart|force-reload}" ;; esac --- 62,66 ---- *) ! echo "Usage $0 {start|stop|restart|reload|force-reload}" ;; esac |
From: Patrick C. <pa...@us...> - 2002-07-12 11:47:48
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory usw-pr-cvs1:/tmp/cvs-serv32036 Modified Files: rules dnet-common.init.d Log Message: Move setting of node address into init.d from modutils. Now it works correctly with DECnet compiled into the kernel Index: rules =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/rules,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** rules 25 Feb 2001 12:59:23 -0000 1.11 --- rules 12 Jul 2002 11:47:45 -0000 1.12 *************** *** 25,29 **** mkdir -p debian/tmp/sbin echo "alias net-pf-12 decnet" > debian/tmp/etc/modutils/decnet - echo "post-install decnet echo \`grep executor /etc/decnet.conf | cut -f2\` > /proc/sys/net/decnet/node_address" >> debian/tmp/etc/modutils/decnet echo '# DNET_INTERFACES specifies the names of ethernet interfaces whose' >> debian/tmp/etc/default/decnet echo '# MAC address is to be set to the DECnet node address' >> debian/tmp/etc/default/decnet --- 25,28 ---- Index: dnet-common.init.d =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-common.init.d,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dnet-common.init.d 26 Feb 2001 14:16:19 -0000 1.3 --- dnet-common.init.d 12 Jul 2002 11:47:45 -0000 1.4 *************** *** 51,54 **** --- 51,55 ---- echo -n "Starting DECnet..." $setether + echo "$ADDR" > /proc/sys/net/decnet/node_address echo "done." ;; |
From: Patrick C. <pa...@us...> - 2002-07-11 14:58:06
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory usw-pr-cvs1:/tmp/cvs-serv22661 Modified Files: task.cc Log Message: Send FILESPEC rather than FILENAME to RSX Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** task.cc 10 Jul 2002 07:11:46 -0000 1.8 --- task.cc 11 Jul 2002 14:58:03 -0000 1.9 *************** *** 518,522 **** dap_name_message name_msg; ! if (vms_format) { char vmsname[PATH_MAX]; --- 518,522 ---- dap_name_message name_msg; ! if (vms_format || params.remote_os == 4) { char vmsname[PATH_MAX]; |