--- xtel-3.3.0.orig/Config.tmpl +++ xtel-3.3.0/Config.tmpl @@ -17,7 +17,7 @@ #define INSTALLDEMON /* Pour générer avec OSF-Motif */ -/*#define MOTIF*/ +#define MOTIF /* Pour ne pas utiliser TERMIO */ /*#define NO_TERMIO*/ @@ -44,10 +44,23 @@ /*#define NO_TVR*/ /* Pour debug du demon "xteld" */ -#define DEBUG_XTELD +/*#define DEBUG_XTELD*/ /* Pour la distribution RedHat Linux */ -#define REDHAT +/*#define REDHAT*/ + +/* Pour la distribution Debian/GNU-Linux */ +#define DEBIAN /* Pas de popup-menu (pb LessTif) */ #define DONT_USE_POPUP + +/* Ne pas définir pour utiliser mktemp() au lieu de mkstemp() */ +#define HAS_MKSTEMP + +/* Pour éviter les dépassements de capacité des buffers si l'OS le permet */ +#define HAS_SNPRINTF + +/* en remplacement de sys_errlist[] si possible */ +#define HAS_STRERROR + --- xtel-3.3.0.orig/FAQ.txt +++ xtel-3.3.0/FAQ.txt @@ -46,7 +46,7 @@ Dans le cas de XFree86, le mieux est d'ajouter la ligne : -FontPath "/usr/X11R6/lib/X11/fonts/xtel/" +FontPath "/usr/share/fonts/X11/xtel/" dans le fichier XF86Config et de relancer le serveur. --- xtel-3.3.0.orig/Imakefile +++ xtel-3.3.0/Imakefile @@ -4,12 +4,16 @@ XCOMM Auteur : Pierre FICHEUX XCOMM $Id: Imakefile,v 1.29 2001/02/10 23:54:28 pierre Exp $ XCOMM +XCOMM Modified for Debian GNU/Linux by Guillaume Morin and Eric Delaunay #define IHaveSubdirs #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' #define PassDependFlags 'DEPENDFLAGS=$(DEPENDFLAGS)' #include "Config.tmpl" +#include "Motif.tmpl" + +#define XmClientLibs -lXm BITMAPSDIR= bitmaps PIXMAPSDIR= pixmaps @@ -26,7 +30,7 @@ #ifdef NO_TERMIO TERMIOCFLAGS = -DNO_TERMIO #else -#if defined(USE_TERMIOS) || defined(__FreeBSD__) +#if defined(USE_TERMIOS) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__) TERMIOCFLAGS = -DUSE_TERMIOS #endif #endif @@ -95,15 +99,26 @@ DEPENDFLAGS = $(XTELCFLAGS) +#ifdef DEBIAN + XTELLIGNES = lignes + XTELSERVICES = services + XTELCFGDIR = /etc/xtel + XTELLOGDIR = /var/log + SBINDIR = /usr/sbin +#else XTELLIGNES = xtel.lignes XTELSERVICES = xtel.services + XTELCFGDIR = $(XTELDIR) + XTELLOGDIR = $(XTELDIR) + SBINDIR = $(BINDIR) +#endif -CONF_DEFINES = '-DFICHIER_DEFINITION_LIGNES="$(LIBDIR)/xtel/$(XTELLIGNES)"' \ - '-DFICHIER_DEFINITION_SERVICES="$(LIBDIR)/xtel/$(XTELSERVICES)"' +CONF_DEFINES = '-DFICHIER_DEFINITION_LIGNES="$(XTELCFGDIR)/$(XTELLIGNES)"' \ + '-DFICHIER_DEFINITION_SERVICES="$(XTELCFGDIR)/$(XTELSERVICES)"' TELE_DEFINES = '-DXTERM_PATH="$(BINDIR)/xterm"' -XTELD_DEFINES = '-DFICHIER_LOG="$(LIBDIR)/xtel/xtel.log"' \ +XTELD_DEFINES = '-DFICHIER_LOG="$(XTELLOGDIR)/xtel.log"' \ '-DXTEL_LIBDIR="$(LIBDIR)/xtel"' @@ -121,7 +136,7 @@ #endif /* lectra */ #else #ifdef LinuxArchitecture -#ifdef REDHAT +#if defined(REDHAT) || defined(DEBIAN) DIAL_DEFINES = '-DFICHIER_LCK="/var/lock/LCK..%s"' #else DIAL_DEFINES = '-DFICHIER_LCK="/usr/spool/uucp/LCK..%s"' @@ -154,7 +169,7 @@ $(RM) program #endif /* ComplexPurifyTarget */ #else -CDEBUGFLAGS= -O $(XTELCFLAGS) $(SVR4CFLAGS) +CDEBUGFLAGS= -g -O2 $(XTELCFLAGS) $(SVR4CFLAGS) #endif /* PURE */ INCLUDES= -IWidgets -IVideotex @@ -241,19 +256,22 @@ InstallManPage(xteld,$(MANDIR)) #ifdef INSTALLDEMON -InstallProgram(xteld, $(BINDIR)) -InstallProgramWithFlags(mdmdetect, $(BINDIR), $(INSTUIDFLAGS)) -InstallNamedProg(make_xtel_lignes.sh,make_xtel_lignes,$(BINDIR)) +InstallProgram(xteld,$(SBINDIR)) +InstallProgramWithFlags(mdmdetect,$(SBINDIR),$(INSTUIDFLAGS)) + +install:: + @sed 's:^XTEL_LIGNES=.*:XTEL_LIGNES=$(XTELCFGDIR)/$(XTELLIGNES):;s:^MDMDETECT=.*:MDMDETECT=$(SBINDIR)/mdmdetect:' < make_xtel_lignes.sh > $(DESTDIR)$(SBINDIR)/make_xtel_lignes + chmod 755 $(DESTDIR)$(SBINDIR)/make_xtel_lignes install:: - @if [ -r $(LIBDIR)/xtel/$(XTELLIGNES) ]; then \ - cp $(LIBDIR)/xtel/$(XTELLIGNES) $(LIBDIR)/xtel/$(XTELLIGNES).old; fi - @if [ -r $(LIBDIR)/xtel/$(XTELSERVICES) ]; then \ - cp $(LIBDIR)/xtel/$(XTELSERVICES) $(LIBDIR)/xtel/$(XTELSERVICES).old; fi - -InstallNonExecFile($(XTELLIGNES), $(LIBDIR)/xtel) -InstallNonExecFile($(XTELSERVICES), $(LIBDIR)/xtel) -InstallNonExecFile(modem.list, $(LIBDIR)/xtel) + @if [ -r $(DESTDIR)$(XTELCFGDIR)/$(XTELLIGNES) ]; then \ + mv $(DESTDIR)$(XTELCFGDIR)/$(XTELLIGNES) $(DESTDIR)$(XTELCFGDIR)/$(XTELLIGNES).old; fi + @if [ -r $(DESTDIR)$(XTELCFGDIR)/$(XTELSERVICES) ]; then \ + mv $(DESTDIR)$(XTELCFGDIR)/$(XTELSERVICES) $(DESTDIR)$(XTELCFGDIR)/$(XTELSERVICES).old; fi + +InstallNamedNonExec(xtel.lignes,$(XTELLIGNES),$(XTELCFGDIR)) +InstallNamedNonExec(xtel.services,$(XTELSERVICES),$(XTELCFGDIR)) +InstallNonExecFile(modem.list,$(LIBDIR)/xtel) #endif SpecialObjectRule(teleinfo.o, teleinfo.c, $(TELE_DEFINES)) --- xtel-3.3.0.orig/README_IMINITEL.txt +++ xtel-3.3.0/README_IMINITEL.txt @@ -38,7 +38,7 @@ Dans le cas de I-Minitel, la connexion au service est TCP/IP d'un bout à l'autre et la machine supportant xteld aura un role de routeur d'accès aux -services I-Minitel. En particuliers: +services I-Minitel. En particulier: * Le premier client xtel initialise la connexion PPP de xteld vers le serveur 3622. xteld mets alors en place la route vers le serveur @@ -64,11 +64,12 @@ xtel.services (répertoire /usr/X11R6/lib/X11/xtel). Les fichiers de configuration pppd sont les suivants: - /etc/ppp/ip-up.iminitel Script d'initialisation de la route I-Minitel, + /etc/ppp/ip-up.d/iminitel Script d'initialisation de la route I-Minitel, exécuté à la connexion - /etc/ppp/ip-down.iminitelScript exécuté lors de la coupure de connexion + /etc/ppp/ip-down.d/iminitel Script exécuté lors de la coupure de connexion I-Minitel + Chat-script de composition, contient le numéro /etc/ppp/chat-iminitel d'appel 3622 et les caractéristiques de la connexion PPP (login/password) --- xtel-3.3.0.orig/Videotex/Videotex.c +++ xtel-3.3.0/Videotex/Videotex.c @@ -914,6 +914,36 @@ } /* + * Convertit un keysym X en une chaîne à envoyer. + */ +static const char * +fleche_emettre(VideotexPart *pv, KeySym ks) { + if (pv->mode_videotex) { + switch (ks) { + case XK_Left: + return "\x08"; /* ^H */ + case XK_Right: + return "\x09"; /* ^I */ + case XK_Down: + return "\x0A"; /* ^J */ + case XK_Up: + return "\x0B"; /* ^K */ + } + } else { + switch (ks) { + case XK_Up: + return "\e[A"; + case XK_Down: + return "\e[B"; + case XK_Right: + return "\e[C"; + case XK_Left: + return "\e[D"; + } + } +} + +/* * Action touche clavier ==> emission vers le fd de connexion ou bien * affichage On simule le comportement du Minitel (defaut => Majuscule, shift * => minuscule) @@ -929,8 +959,22 @@ KeySym ks; VideotexWidget vw = (VideotexWidget) w; register VideotexPart *pv = &vw->videotex; + int ret; + const char *emettre = NULL; + + ret = XLookupString(pevent, &buf[0], 1, &ks, 0); - if ((XLookupString(pevent, &buf[0], 1, &ks, 0) != 0) && ((pevent->state & Mod1Mask) == 0) && pv->mode_videotex) { + emettre = fleche_emettre(pv, ks); + + if (emettre) { + if (pv->connecte && pv->fd_connexion > 0) { + write(pv->fd_connexion, emettre, strlen(emettre)); + } else { + const char *c; + for (c = emettre; *c; c++) + videotexDecode(w, *c); + } + } else if ((ret != 0) && ((pevent->state & Mod1Mask) == 0) && pv->mode_videotex) { if ((pevent->state & (ShiftMask | LockMask)) == 0) buf[0] = toupper(buf[0]); else @@ -1031,7 +1075,28 @@ chaine[i] = toupper(chaine[i]); write(pv->fd_connexion, chaine, strlen(chaine)); + + } else if (pv->attributs[rang][i].jeu == G2 + && pv->attributs[rang][i].code[0] >= 0x2C + && pv->attributs[rang][i].code[0] <= 0x2F) { + const char *emettre; + switch (pv->attributs[rang][i].code[0]) { + case 0x2C: + emettre = fleche_emettre(pv, XK_Left); + break; + case 0x2D: + emettre = fleche_emettre(pv, XK_Up); + break; + case 0x2E: + emettre = fleche_emettre(pv, XK_Right); + break; + case 0x2F: + emettre = fleche_emettre(pv, XK_Down); + break; + } + write(pv->fd_connexion, emettre, strlen(emettre)); } + } } --- xtel-3.3.0.orig/XTel.ad +++ xtel-3.3.0/XTel.ad @@ -10,7 +10,7 @@ XTel*serveur: localhost XTel*commandeImpression: pnmflip -r90 %s | pnmtops | lpr -h -XTel*commandeImpressionAscii: a2ps %s | lpr -h +XTel*commandeImpressionAscii: a2ps -o - %s | lpr -h XTel*petiteFonte: False XTel*nomService: xtel XTel*font: -*-helvetica-medium-r-*-*-14-*-*-*-*-*-iso8859-1 --- xtel-3.3.0.orig/XTelm.ad +++ xtel-3.3.0/XTelm.ad @@ -10,7 +10,7 @@ XTelm*serveur: localhost XTelm*commandeImpression: pnmflip -r90 %s | pnmtops | lpr -h -XTelm*commandeImpressionAscii: a2ps %s | lpr -h +XTelm*commandeImpressionAscii: a2ps -o - %s | lpr -h XTelm*petiteFonte: False XTelm*nomService: xtel ! Type d'arret: 0=Pas d'arret, 1=Form Feed, 2=SUITE, 3=SUITE ou Form Feed --- xtel-3.3.0.orig/config.c +++ xtel-3.3.0/config.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef USE_SYSLOG #include #endif /* USE_SYSLOG */ @@ -163,6 +164,7 @@ if (sep[0] == 0) { if (get_separator (buf, sep) < 0) { log_err ("lecture_services: erreur lecture separateur"); + fclose(fp); return -1; } } @@ -205,7 +207,7 @@ { FILE *fp; register int i; - char *p, sep[2] = {0, 0}; + char *p, sep[3] = {0, 0, 0}; if ((fp = fopen (FICHIER_DEFINITION_LIGNES, "r")) == NULL) { sprintf (buf, "Erreur a l'ouverture du fichier %s", FICHIER_DEFINITION_LIGNES); @@ -228,6 +230,7 @@ if (sep[0] == 0) { if (get_separator (buf, sep) < 0) { log_err ("lecture_configuration_lignes: erreur lecture separateur"); + fclose(fp); return -1; } } @@ -300,11 +303,27 @@ definition_lignes[i].type_dialer = DIALER_MODEM; } - definition_lignes[i].delai = atoi (next_token (NULL, "\n")); + /* + * Ajoute NL à la liste des séparateurs pour autoriser une fin de ligne + * après le champ délai + */ + sep[1] = '\n'; + definition_lignes[i].delai = atoi (next_token (NULL, sep)); -#ifdef DEBUG_XTELD1 + /* + * colonne 8 = tempo entre 2 ioctls (pour vieux modems) + * 0 par défaut, i.e. colonne non présente. + * saisie en millisecondes, stockage en microsecondes. + */ + p = next_token (NULL, "\n"); + if (isdigit(*p)) + definition_lignes[i].tempo = atoi(p)*1000; + else + definition_lignes[i].tempo = 0; + +#ifdef DEBUG_XTELD if (!flag_old_config) - log_debug ("LIGNES: %s %s %d %d %d >%s< %d", definition_lignes[i].device, definition_lignes[i].nom, definition_lignes[i].speed, definition_lignes[i].cs, definition_lignes[i].parity, definition_lignes[i].chat, definition_lignes[i].delai); + log_debug ("LIGNES: %s %s %d %d %d >%s< %d (%d)", definition_lignes[i].device, definition_lignes[i].nom, definition_lignes[i].speed, definition_lignes[i].cs, definition_lignes[i].parity, definition_lignes[i].chat, definition_lignes[i].delai, definition_lignes[i].tempo); else log_debug ("LIGNES: %s %s %d", definition_lignes[i].nom, definition_lignes[i].chat, definition_lignes[i].delai); #endif --- xtel-3.3.0.orig/debian/FAQ.txt +++ xtel-3.3.0/debian/FAQ.txt @@ -0,0 +1,181 @@ +The XTEL FAQ + +Here are some of the frequently asked questions about Xtel. + +Can I use Xtel for commercial purposes? +When I start Xtel, I get an error message about the fonts'loading +what should I do? +Can I use Xtel without having TCP/IP? +How do I specify a xteld server name? +When I start Xtel, I receive "Erreur de connexion au serveur XTEL...", what +should I do? +The modem dos not connect to, what should I do? +Which modems are supported by Xtel? +Could I use TVR with Xtel? +The modem does not dial, what should I do? +Is there an english version of Xtel? +Is there a Windows version of the Xtel client? +Can I find any binary distributions of Xtel? +Where can I get information on Xtel? +Is Xtel I-Minitel compatible? +The xtel program installed from .rpm package does not work on my system, what +should I do? +How to customize Xtel key shortcuts? +------------------------------------------------------------------------------ + +* Can I use Xtel for commercial purposes? + +Xtel is distributed under the terms of the GNU General Public License which +allows you this kind of use. The main restriction is to distribute the source +code if you decide to sell Xtel. + +* When I start Xtel, I get an error message about the fonts loading +what should I do ? + +Read the README! + +Xtel uses special fonts which are normally installed by the "make install" +command. To make these fonts recognized by X launch : + +xset +fp directory_where_the_fonts_are + +If you use XFree86, it is better to add this + +FontPath "/usr/share/fonts/X11/xtel/" + +in XF86Config and reload the server. + +* Can I use Xtel without having TCP/IP? + +No, there is no more NO_NETWORK option since 3.3.0 release. + +This flag does not exists anymore because LINUX and all other UNIX systems xtel +can run on supports TCP/IP protocol. The loopback interface (named lo on LINUX, +address 127.0.0.1) can support all Xtel communication needs, therefore there is +no requirements on the availibitily of a connection to a local network or to +the Internet. + +Moreover, this flag was sometimes misinterpreted by users which sent annoying +emails to the author! + +* How do I specify a xteld server name? + +The default server name is localhost. This is the appropriate configuration +when the server and the client run on the same computer. There are +different ways to change the name : + * When you launch Xtel use the -serveur option + * In the X Ressources file add this line + + xtel*serveur: the_server + +* When I start Xtel, I receive "Erreur de connexion au serveur XTEL...", what +should I do? + +The specified server is not available using TCP/IP or the xteld daemon is not +correctly installed (read the LISEZMOI concerning the modification of +/etc/services and /etc/inetd.conf). Warning, if you use TCP/IP, the xteld +daemon MUST NEVER BE LAUNCHED MANUALLY (it will be launched by the inetd +superserver) + +If Yellow Pages/NIS service is enabled, the xtel service shall be declared in +the corresponding NIS map. + +* The modem dos not connect to, what should I do? + +See below. + +* Which modems are supported by Xtel? + +All modems supporting the V.23 protocol could be used with Xtel. Therefore all +modems which have been agreed by France Telecom should work. Watch out - the +V.23 mode of some modems (like USR ones) is disabled by default. In that case, +use a correct AT command in xtel.lignes to enable it. + +Read carefully the README file which contains information about +detecting/configuring modems. + +If your modem does not appear in the list, please DON'T ASK ME the right +configuration to be used. I don't know it. + + * Read the documentation supplied with your modem or ask the vendor about + the code sequence to switch to V23 mode. + * Or try to discover the right code sequence with using a terminal emulator. + Your mileage may vary. + +* Could I use TVR with Xtel? + +Yes, if you have a modem which supports it ! As far as I know, only some COM1 +and Djinn Flash modems support it. + +[Image] Last news: TVR is accessible from I-Minitel, which is supported since +the 3.3.0 release of XTel. + +* The modem does not dial, what should I do? + + 1. Add a \d (this is a delay) at the beginning of the dialing string in + xtel.ligne file. It makes the modem synchronize on the xteld speed. + + 2. If this does not help, uncomment the line + + #define DEBUG_XTELD + + in the Config.tmpl file. Xteld will then display debugging information on + /dev/console by default or use syslogd if you have enabled this option. + +* Is there an english version of Xtel? + +Not yet. The MINITELR is mainly used in France. However, the 3.1 version and +newer should be very easy to translate because all messages are gathered in the +ressources file Xtel-msg (or Xtelm-Msg for the Motif or Lesstif version). + +* Is there a Windows version of the Xtel client? + +No, but xteld can be used with Hyperterminal Private Edition 3.0 up to 5.0 from +Hilgraeve. + +* Can I find any binary distributions of Xtel? + +Yes, but for some OSs only. Check out the xtel homepage. + +* Where can I get information on Xtel? + +In the french linux or x11 newgroups like fr.comp.os.linux.configuration or +fr.comp.apps.x11. If you can't find any answers, you can email me : +pierre@ai.alienor.fr + +* Is Xtel I-Minitel compatible? + +Yes. Customize the xtel.services configuration file as needed. + +* The xtel program installed from .rpm package does not work on my system, what +should I do? + +Rebuild the .rpm binary package from its source .src.rpm: + + rpm --rebuild xtel-3.3.0-1.src.rpm + +then install it again from /usr/src/redhat/RPMS/i386. + +* How to customize Xtel key shortcuts? + +Xtel is using standard translation tables, therefore adding lines like the +following ones in your X11 resource file (.Xdefaults or alike) will be enough: + +xtel*ecran_minitel.translations: #override \n\ +Tab: emission-commande(H) \n\ +BackSpace: emission-commande(G) + +Below is the mapping between Minitel keys and commands: + ENVOI A + RETOUR B + REPETITION C + GUIDE D + ANNULATION E + SOMMAIRE F + CORRECTION G + SUITE H + CONNEXION_FIN I +------------------------------------------------------------------------------- +This file has been (quickly) translated by Guillaume Morin +. +Last update on 2001-08-19 by Eric Delaunay . --- xtel-3.3.0.orig/debian/README.Debian +++ xtel-3.3.0/debian/README.Debian @@ -0,0 +1,37 @@ +xtel for Debian +---------------------- + +XTel is an X emulator of the French Minitel. + +The Minitel is a dedicated terminal for accessing the Teletel, +the French videotex network. + +The French Teletel network was created in 1980 by France Telecom, French +telecommunications operator. With it more than 20 million users can access +more than 25,000 on-line services. Users are billed as part of their telephone +bill, and France Telecom pays the service provider the appropriate amount +according to service usage and level (~0.10FF/mm - ~10.00FF/mm). + +How can you see examples of videotex screenshots: +* Look at /usr/share/doc/xtel/xtel.png +* Select "charge enregistrement" in "Fichier" menu. Choose a file + in /usr/share/doc/xtel/examples. Select "Lecteur" in "Enregistrement" menu... + You can now push the button "play". + +There is a Internet/Teletel gateway: see http://www.minitel.fr +(XTel can now use this gateway but this service isn't free...) + +Before using xtel, the X font server must be restarted as Xtel needs +special fonts to work. These fonts are installed along with the package. + +Please note that the I-Minitel configuration needs initial checking. +Check /etc/ppp/peers/iminitel for modem options (line, speed, ...) +before trying your first connection to i-iminitel server. Your may +also need to enable this service in /etc/xtel/services. + + +This Readme has been written by Christophe Le Bars +and completed by Christian Perrier . + + -- Christian Perrier , Sun, 18 Feb 2007 19:41:49 z + --- xtel-3.3.0.orig/debian/bullet.gif.base64 +++ xtel-3.3.0/debian/bullet.gif.base64 @@ -0,0 +1,19 @@ +R0lGODlhFAAPANcAAAAAACoIADMKADoLAD0MADUbFTYcFTscFQBAQEENAEYOAEoPAEwPAEUe +FVMSAVURAFkSAV0VA0IvKl01KmEVAmIXBWUVAmQXBGkWAWgZBnEYAncdBnEdCHgZAnwcBHoi +DHskDn0iC34jDXwkDXcpFnsqFkAAQEBAAEBAQFNDQGNYVXlcVXhtagAA/wD/AACAgADAwAD/ +/4EcA4geBIIiCocjCoohBo0uF58sD5AuFpYuFJwtEZAwGJY0G5k1HZ42HKIqDKcoCKwrC6wu +D6MzF6Q3G6c5HagxE7E2F7UyErU2FqA5IKVGL65EKr1EJbhFKIZfVZpSQKFlVqN2a6p4bMc+ +G/8AAMlAHsVFJcRTN8JTOMxTNclVOMlYO85YO9tPLNFRMdhRMNxSMN9ZN+NYNutfO85dQNxf +QORhQeZvUuhwUu9yU/V2VfJ4WfZ6W/p0Ufx2Uv19W/5/XIAAgMAAwP8A/4CAAP+Jav+NbP+S +bv+Uc/+VdP+Zdv+hf8DAAP//AICAgIiBgJODgKKYlamZla6albSbla2rqrWsqrmtqryuq8DA +wP///62qrLWqs7mqtryrucDAwP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAIsALAAAAAAUAA8ABwjMABcJHCjQUBQq +UwoRXEhQERMhSYYAmVGCEEOChoJU+UImDJYjNjAgurgoUZErZeDIeYPGyQ4PDwZdlDJEzJs8 +fPCw2WKEBoUVF3koGROHT589brz0tDCBISIZSMCwwaPnjposP0JQIHCxAw4nZ9a0SWOmSQ4O +EARcJGGDyBMuXbQ06THiAoMDF6FoqKHjxxIfN0BkcDCABckHGDaEEPGBQwUHBAwcIilIAQQK +FCI8WDCgQCCSAg81IJAgwYAAEiaDHniIRQoVn1fLXhgQADs= --- xtel-3.3.0.orig/debian/changelog +++ xtel-3.3.0/debian/changelog @@ -0,0 +1,524 @@ +xtel (3.3.0-22) unstable; urgency=medium + + [ Samuel Thibault ] + * control: Bump Standards-Version to 4.2.0 (no changes). + * watch: Fix. + + [ OndÅ™ej Nový ] + * d/changelog: Remove trailing whitespaces + * d/control: Set Vcs-* to salsa.debian.org + + -- Samuel Thibault Tue, 01 Jan 2019 18:07:00 +0100 + +xtel (3.3.0-21) unstable; urgency=medium + + * Use canonical anonscm vcs URL. + * control: Migrate priority to optional. + * control: Bump Standards-Version to 4.1.4. + + -- Samuel Thibault Sun, 29 Apr 2018 12:36:23 +0200 + +xtel (3.3.0-20) unstable; urgency=medium + + * menu: Convert to xtel.desktop. + * control: Bump Standards-Version to 3.9.8. + + -- Samuel Thibault Sun, 04 Sep 2016 19:36:24 +0200 + +xtel (3.3.0-19) unstable; urgency=medium + + * compat: Bump to 9. + * Drop commented dh_ calls. + * rules: Clear. + + -- Samuel Thibault Tue, 22 Dec 2015 21:35:56 +0100 + +xtel (3.3.0-18) unstable; urgency=medium + + * Bump Standards-Version to 3.9.6 (no changes). + + [ Dhole ] + * Don't store timestamps when calling gzip and remove timestamps from png + to make package build reproducibly (Closes: #789965). + + -- Samuel Thibault Tue, 07 Jul 2015 23:59:08 +0200 + +xtel (3.3.0-17.1) unstable; urgency=medium + + * Non-maintainer upload. + * Eliminate libxp-dev build dependency (Closes: #733290). + + -- Michael Gilbert Fri, 19 Sep 2014 04:20:50 +0000 + +xtel (3.3.0-17) unstable; urgency=low + + * Build-depend on libmotif-dev instead of lesstif2-dev (Closes: #714677). + + -- Samuel Thibault Mon, 01 Jul 2013 23:29:56 +0200 + +xtel (3.3.0-16) unstable; urgency=low + + * Fix mdmdetect crash due to incorrect argument parsing. + + -- Samuel Thibault Sat, 29 Jun 2013 21:48:25 +0200 + +xtel (3.3.0-15) unstable; urgency=low + + * Explicictly build-depend on libxp-dev, pulled through XmClientLibs from + xutils-dev (Closes: #707623). + + -- Samuel Thibault Tue, 14 May 2013 01:35:51 +0200 + +xtel (3.3.0-14) unstable; urgency=low + + * control,rules: Use imagemagick instead of gif2png. + + -- Samuel Thibault Sun, 10 Jun 2012 21:27:43 +0200 + +xtel (3.3.0-13) unstable; urgency=low + + * debian/rules: Add build-{arch,indep} rules. + * control: Bump Standards-Version to 3.9.3 (no changes). + + -- Samuel Thibault Fri, 08 Jun 2012 23:29:28 +0200 + +xtel (3.3.0-12) unstable; urgency=low + + * protocoles.c: Fix crash on bogus fclose(). + * modem.c: Fix format security issue. + * Imakefile: Set debugging flags to -g -O2. + * debian/control: Depend on hardening-check. + * debian/rules: Set DEB_BUILD_HARDENING=1 to enable hardening. + + -- Samuel Thibault Mon, 07 Nov 2011 00:40:40 +0100 + +xtel (3.3.0-11) unstable; urgency=low + + * Bump Standards-Version to 3.9.2 (no change needed) + * Remove spurious fonts installation in non-standard place. + + -- Samuel Thibault Sun, 10 Apr 2011 21:10:19 +0200 + +xtel (3.3.0-10) unstable; urgency=low + + * debian/control: Add netpbm to Depends: to fix print. + * Videotex/Videotex.c: Add arrow keys binding. + + -- Samuel Thibault Sun, 17 Oct 2010 01:05:08 +0200 + +xtel (3.3.0-9) unstable; urgency=low + + * debian/postinst: Drop loading debconf/confmodule, as it makes + configuration hang and is actually unused. + * debian/control: Bump Standards-Version to 3.9.1 (no changes needed). + + -- Samuel Thibault Tue, 24 Aug 2010 21:38:22 +0200 + +xtel (3.3.0-8) unstable; urgency=low + + * Define MAXPATHLEN to fix hurd-i386 build. + * Define USE_TERMIOS on kfreebsd-* too. + + -- Samuel Thibault Tue, 09 Mar 2010 22:43:37 +0000 + +xtel (3.3.0-7) unstable; urgency=low + + * debian/control: + - New maintainer (Closes: #474129). + - Bump Standards-Version to 3.8.4 (no changes needed). + - Replace xbase-clients build-dep with xfonts-utils (for bdftopcf and + mkfontdir). + - Replace xutils with xutils-dev (for xmkmf) (Closes: #527508). + - Drop xbase-clients and xfonts-utils Depends. + - Fix spelling. + - Move ppp from Depends to Recommends. + - Add xterm to Recommends for teleinfo support + * debian/rules: Remove install-stamp on clean. + * xteld.man: Replace quotes with double quotes. + * debian/prerm: Remove call to install-docs. + * Enable teleinfo support and fix it for UTF-8 support (Closes: #572730). + + -- Samuel Thibault Sat, 06 Mar 2010 16:03:18 +0100 + +xtel (3.3.0-6) unstable; urgency=low + + * QA upload. + * Acknowledging NMUs, thanks to those who took care; Closes: #332160, + #264614, #281225, #285962, #314770, #324273, #330324 + * debian/control + - set QA Group as maintainer + - bump Standards-Version to 3.8.0 + - added Homepage field + - replaced build-dep on xlibs-data with xbitmaps; thanks to Julien Cristau + and Lucas Nussbaum for the bug reports; Closes: #419015, #484185 + - replaced build-dep on x-dev with x11proto-core-dev + - replaced depends on netbase with "openbsd-inetd | inet-superserver" + - remove article from short description + * make_xtel_lignes.sh + - shebang uses bash now; thanks to Raphael Geissert for the report; + Closes: #486063 + * debian/watch + - added + * debian/doc-base + - converted to UTF-8 + - updated section to Network/Communication + * debian/menu + - updated section to Applications/Network/Communication + * debian/rules + - don't ignore error on clean + - removed DH_COMPAT export + * debian/compat + - added with value 5 + + -- Sandro Tosi Thu, 31 Jul 2008 23:08:54 +0200 + +xtel (3.3.0-5.6) unstable; urgency=low + + * Non-maintainer upload to fix pending debconf issues. + * Remove the overzealous debconf notes. Move their text to README.Debian + Closes: #388988, #383395, #400012, #247639 + + -- Christian Perrier Sun, 18 Feb 2007 19:43:02 +0100 + +xtel (3.3.0-5.5) unstable; urgency=high + + * Non-maintainer upload. + * Add dependency on ${misc:Depends}. Closes: #405631 + + -- Andreas Barth Wed, 10 Jan 2007 19:20:07 +0000 + +xtel (3.3.0-5.4) unstable; urgency=medium + + * Non-maintainer upload. + * Only call update-inetd from postrm if present (closes: #389352). Usually + update-inetd is there, but if it's missing, we know that no inetd is + installed, so we don't need to update the (nonexistent) inetd + configuration. + + -- martin f. krafft Sat, 7 Oct 2006 12:10:44 +0200 + +xtel (3.3.0-5.3) unstable; urgency=low + + * Non-maintainer upload. + * X fonts transition (Closes: #362406) + * lesstif1 is deprecated, transition to lesstif2 (Closes: #374231) + * Removed X11R6 from menu, dirs + * Updated FAQ with correct font paths + * Fixed manpage rule to use debhelper + * Added x11-common predends by policy 11.8.7 + * Fixed menu quoting that lintian croaks about + * Corrected FSF address + * Updated standards version to 3.7.2 from 3.6.2 + * Bumped up compat ... + * Removed conffiles. Debhelper does this for us. + * Changed rules 'tmp' to 'xtel' for new debhelper compat + * Removed debian/substvars, debian/postrm.debhelper, + debian/prerm.debhelper and debian/postinst.debhelper + + -- Kai Hendry Wed, 19 Jul 2006 17:16:28 +0900 + +xtel (3.3.0-5.2) unstable; urgency=low + + * Non-maintainer upload. + * Use perl's base64 decoding instead of mime-codecs, which no longer + seems to exist. debian/rules has the change, and debian/control + drops build-dependency on mime-codecs. Patch from Andreas Jochens. + Closes: #351958. + * debian/control: Bumbed Standards-Version to 3.6.2. No changes needed. + + -- Lars Wirzenius Thu, 9 Mar 2006 19:43:55 +0000 + +xtel (3.3.0-5.1) unstable; urgency=high + + * Non-maintainer upload. + * Split xlibs-dev build-dep (Closes: #346787). + * Add debconf-2.0 alternative (Closes: #332160). + * Added Japanese debconf translation (Closes: #264614). + * Updated German debconf translation (Closes: #281225). + * Added Danish debconf translation (Closes: #285962). + * Added Czech debconf translation (Closes: #314770). + * Added Vietnamese debconf translation (Closes: #324273). + * Updated Swedish debconf translation (Closes: #330324). + + -- Luk Claes Fri, 20 Jan 2006 18:20:54 +0100 + +xtel (3.3.0-5) unstable; urgency=low + + * Added russian debconf template file. Closes: #137707. + * Switched from mimencode to base64-decode for processing base64 encoded + image file at compile time. Closes: #212335. + * Switched to po-debconf (de, es, pt_BR, ru and sv translations may be + checked again to be sure they are correct). Closes: #203601. + + -- Eric Delaunay Thu, 25 Sep 2003 00:42:02 +0200 + +xtel (3.3.0-4) unstable; urgency=low + + * fix capitalization in description (closes: #125569) + * mark some /etc files as conffiles (closes: #132170) + (Thanks to David Kimdon ). + * New maintainer e-mail address. + + -- Eric Delaunay Sat, 9 Feb 2002 19:05:32 +0100 + +xtel (3.3.0-3) unstable; urgency=low + + * Change from dhelp to doc-base to support both dhelp & dwww at the same + time. Added doc-base to Build-depends. Closes: #111320. + * Added bullet images into the HTML documentation index page. Need to be + encoded in pure text (base64 for instance) to be representable in the diff. + Therefore metamail is appended to Build-depends (provides mimencode). + + -- Eric Delaunay Wed, 5 Sep 2001 23:58:05 +0200 + +xtel (3.3.0-2) unstable; urgency=low + + * Oops, added -f to rm in debian/rules clean target. Closes: #111073. + + -- Eric Delaunay Mon, 3 Sep 2001 21:54:39 +0200 + +xtel (3.3.0-1) testing unstable; urgency=low + + * New maintainer. + * New upstream release (new I-Minitel support). Closes: #87642. + * Now depends on ppp (required for I-Minitel to work). + * Several security fixes not already applied to the upstream release: + - potential security breaks in upstream script files for I-Minitel support. + - security hole when creating temporary files while printing a hardcopy of + the screen. + - race condition when creating the lock file. + - run xteld under control of tcpd to be able to restrict access to the + service from network. + Closes: #87787. + * Better handling of lock files (both classic modem connection and new + I-Minitel support based on a ppp link). Closes: #5174. + * Fixed bad X resource in Xtel[m].ad (missing '-o -' in a2ps printing + command). + * Added missing libxaw7-dev to build-depends. Closes: #105378. + * New debconf's translations: Brazilian portuguese and Spanish. + Closes: #93308, #102990. + * Simplified autobuild of the Debian package. + * Better support of very old slow modems (configurable sleep time between + ioctls). + * Hurd fixes (get rid of sys_errlist and termios patch). + Thanks to Marcus Brinkmann . + Closes: #101633. + * Added rudimentary dhelp support for french documentation. + + -- Eric Delaunay Fri, 31 Aug 2001 19:11:09 +0200 + +xtel (3.2.1-15) unstable; urgency=low + + * Added (again) xutils to Build-Depends (closes: #89374) + (something weird happened) + + -- Guillaume Morin Mon, 12 Mar 2001 13:06:21 +0100 + +xtel (3.2.1-14) unstable; urgency=high + + * applied patch from Eric Delaunay to fix segfaults (closes: #43566) + * applied patch from Eric Delaunay to fix a symlink vulnerability + * Marked app-defaults files as conffiles + + -- Guillaume Morin Tue, 6 Mar 2001 17:24:00 +0100 + +xtel (3.2.1-13) unstable; urgency=low + + * Added the swedish translation of the debconf note (closes: #83278) + * Added the german translation of the debconf note (closes: #83536) + + -- Guillaume Morin Sat, 27 Jan 2001 15:43:31 +0100 + +xtel (3.2.1-12) unstable; urgency=low + + * Removed the symlink created by xlibs (closes: #77974) + + -- Guillaume Morin Thu, 30 Nov 2000 11:26:29 +0100 + +xtel (3.2.1-11) unstable; urgency=low + + * Added xutils to Depends (closes: #76324) + + -- Guillaume Morin Sun, 5 Nov 2000 23:54:08 +0100 + +xtel (3.2.1-10) unstable; urgency=low + + * Recompiled for Xfree 4.0.1 + * control: Modified Build-Depends for XF4 + * Switched /usr/X11R6/lib/X11/app-defaults/ -> /etc/X11/app-defaults/ + + -- Guillaume Morin Sat, 4 Nov 2000 19:59:16 +0100 + +xtel (3.2.1-9) unstable; urgency=low + + * control: Added xbase-clients to Build-Depends field (closes: #66992) + + -- Guillaume Morin Mon, 10 Jul 2000 20:26:02 +0200 + +xtel (3.2.1-8) unstable; urgency=low + + * Fixed a little typo in the lignes file (thanks to P. Biondi) + * rules: fixed a comment + * Changed maintainer email address + + -- Guillaume Morin Fri, 7 Jul 2000 20:43:09 +0200 + +xtel (3.2.1-7) unstable; urgency=low + + * copyright: fixed location of the GPL + * rules now use gif2png to make the diff smaller + * postrm: makes sure that the logrotate conf file is removed + * Fixed xtel logrotate configuration file + * rules: fixed clean target + + -- Guillaume Morin Sun, 5 Mar 2000 11:56:03 +0100 + +xtel (3.2.1-6) unstable; urgency=low + + * Fixed another symlink problem (closes: #58162) + + -- Guillaume Morin Sun, 14 Feb 2000 17:58:38 +0100 + +xtel (3.2.1-5) unstable; urgency=low + + * Added Build-Depends field in control file + * Logrotate is now recommended + * Converted gif example into png + * Changed use of logrotate to fit with the current policy + * Added "compress" to logrotate.conf + * Fixed creation of the symlink to french doc directory (closes: #55131) + * Fixed cosmetic problems in the Imakefile and rules files + * Changed directory names in the copyright file for the current policy + * Modified rules to have a smaller diff file + * Made modifications in Imakefile clearer + * Changed directory names in README.Debian for the current policy + * Added english translation of the FAQ + + -- Guillaume Morin Sun, 9 Jan 2000 17:04:32 +0100 + +xtel (3.2.1-4) unstable; urgency=low + + * New maintainer (sponsored by Christophe Le Bars ) + + -- Guillaume Morin Tue, 4 Jan 2000 23:49:24 +0100 + +xtel (3.2.1-3) unstable; urgency=low + + * Yet another sponsor upload for Guillaume Morin :) + * Fixed debconf dependency in control file + * Added comments in the rules file + * French documentation files are no longer in /usr/share/doc/xtel + * Added the symlink /usr/share/doc/xtel/fr to /usr/share/doc/LANG/fr/xtel + * Fixed duplication of logrotate.conf + + -- Christophe Le Bars Tue, 21 Dec 1999 21:15:34 +0100 + +xtel (3.2.1-2) unstable; urgency=low + + * Sponsor upload for Guillaume Morin + * Added the /usr/doc/xtel symlink to /usr/share/doc/xtel + * Added the /usr/doc/LANG/fr/xtel symlink to /usr/share/doc/LANG/fr/xtel + * Fixed debconf note priority + * Fixed installation of documentation in french doc directory + * Fixed installation of examples + * Fixed location of the lograte configuration file + * Debconf note is more complete + + -- Christophe Le Bars Tue, 30 Nov 1999 19:35:22 +0100 + +xtel (3.2.1-1) unstable; urgency=low + + * Sponsor upload for Guillaume Morin + * New upstream version with pristine sources (closes: #46706, #48183) + * Converted package management to debhelper + * Added debconf support + * Converted fonts management to use /etc/X11/fonts (closes: #20982) + + -- Christophe Le Bars Sat, 2 Oct 1999 17:52:42 +0200 + +xtel (3.2.0-1) unstable; urgency=low + + * New upstream release with pristine sources + + -- Christophe Le Bars Thu, 15 Oct 1998 23:41:00 +0200 + +xtel (3.1.4-4) frozen unstable; urgency=high + + * Changed FSF address + * Fixed conffiles permissions + * Changed xtel manual page directory + * Fixed postinst set -e handling + * Updated standards-version + * Compiled against lesstif 0.83-2 (Fixed a core dump bug) + + -- Christophe Le Bars Thu, 16 Apr 1998 00:53:18 +0200 + +xtel (3.1.4-3) unstable; urgency=low + + * Compiled against lesstif + * Fixed mixed dependencies (Bug#14805) + + -- Christophe Le Bars Thu, 13 Nov 1997 00:41:05 +0100 + +xtel (3.1.4-2) unstable; urgency=low + + * Build with libc6 + + -- Christophe Le Bars Fri, 26 Sep 1997 18:26:17 +0200 + +xtel (3.1.4-1) stable unstable; urgency=medium + + * Fix a security problem in the postinst script (Bug#11775) + * New upstream source (bug fixes only release) + * Add a menu entry + + -- Christophe Le Bars Sun, 10 Aug 1997 23:51:29 +0200 + +xtel (3.1.3-1) unstable; urgency=low + + * New upstream source + * Added xteld manpage (Bug#6072) + + -- Christophe Le Bars Sat, 1 Mar 1997 14:17:08 +0100 + +xtel (3.1.1-1) frozen unstable; urgency=low + + * New upstream source (bug fixes only release) + * Fixed typo in service configuration file (Bug#5765) + + -- Christophe Le Bars Tue, 10 Dec 1996 00:16:23 +0100 + +xtel (3.1-2) frozen unstable; urgency=low + + * Fixed section field in control file + + -- Christophe Le Bars Sat, 16 Nov 1996 22:04:36 +0100 + +xtel (3.1-1) unstable; urgency=low + + * New upstream version + * Fixed documentation typo (Bug#4439) + * Support multiple architectures (Bug#4037) + * Added weekly logfile rotation + * Converted package management files to new Debian-1.2 style + + -- Christophe Le Bars Sat, 19 Oct 1996 23:08:17 +0200 + +xtel (3.0.7-2); urgency=low + + * Added postinst and prerm scripts + * Depend on netbase (>=2.04) + * syslogd support + * more FSSTND compliant + * Added documentation + +xtel (3.0.7-1); urgency=low + + * Initial release + * Added Debian Linux package maintenance system files + + +Local variables: +mode: debian-changelog +End: + --- xtel-3.3.0.orig/debian/compat +++ xtel-3.3.0/debian/compat @@ -0,0 +1 @@ +9 --- xtel-3.3.0.orig/debian/control +++ xtel-3.3.0/debian/control @@ -0,0 +1,26 @@ +Source: xtel +Section: comm +Priority: optional +Maintainer: Samuel Thibault +Standards-Version: 4.2.0 +Build-Depends: libmotif-dev,libx11-dev,libxmu-dev,libxpm-dev,libxt-dev,x11proto-core-dev,xbitmaps,libxaw7-dev,debhelper (>= 9),imagemagick,xfonts-utils,xutils-dev,libjpeg-dev, doc-base, xfonts-utils +Homepage: http://pficheux.free.fr/xtel/ +Vcs-Git: https://salsa.debian.org/debian/xtel.git +Vcs-Browser: https://salsa.debian.org/debian/xtel + +Package: xtel +Architecture: any +Pre-Depends: x11-common (>= 1:7.0.0) +Depends: openbsd-inetd | inet-superserver, ${shlibs:Depends}, ${misc:Depends}, netpbm +Recommends: logrotate, ppp, xterm +Description: X emulator of the French Minitel + This is a lesstif Minitel client that runs on color/black and white + X Display and a xteld daemon that can make Minitel connection with + one or more modems. + . + The Minitel is a dedicated terminal for accessing the Teletel, + the French videotex network. + Thus, this package is almost only for French users. + This package now supports the 3622 I-Minitel protocol + (more information on http://www.i-minitel.com). + --- xtel-3.3.0.orig/debian/copyright +++ xtel-3.3.0/debian/copyright @@ -0,0 +1,27 @@ +This package was debianized by Eric Delaunay on +Sun, 19 Aug 2001 16:58:03 +0200 + +It was downloaded from http://pficheux.free.fr/xtel/ + +Upstream Author: Pierre Ficheux + +Copyright: + +XTel is Copyright (C) 1991-1994 Lectra Systemes & Pierre Ficheux + + 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, or (at your option) + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- xtel-3.3.0.orig/debian/dhelp +++ xtel-3.3.0/debian/dhelp @@ -0,0 +1,16 @@ + +fr/comm +XTel, Emulateur Minitel sous X11 +fr/index.html + +XTEL permet d'émuler un Minitel 1B, 2 ou TVR (Télétel Vitesse Rapide) +sur un terminal X, ou une station de travail couleur, monochrome ou à +niveaux de gris. +Il est utilisable en réseau, c'est-à-dire qu'une des machines +du réseau commande les MODEMS et dialogue avec les services Télétel, les +utilisateurs de XTEL dialoguent avec cette machine "serveur" par socket +internet (utilisation d'un service TCP et du super-démon "inetd"). +XTEL implémente désormais le protocole I-Minitel du 3622 (plus de détails sur +http://www.i-minitel.com). + + --- xtel-3.3.0.orig/debian/docs +++ xtel-3.3.0/debian/docs @@ -0,0 +1 @@ +debian/FAQ.txt --- xtel-3.3.0.orig/debian/index-fr.html +++ xtel-3.3.0/debian/index-fr.html @@ -0,0 +1,32 @@ + + + + +XTEL 3.3 + + + +

XTEL 3.3

+
+

+

+
XTel, Emulateur Minitel sous X11

+
Informations générales sur XTEL

+ +
La Foire aux Questions sur XTEL

+
Tout ce que vous voulez savoir sur XTEL et que vous n'avez jamais osé + demander.

+ +
La génèse de XTel...

+
Courte histoire du développement de XTEL.

+ +
XTEL et I-Minitel

+
Informations sur la technologie I-Minitel.

+ +
+

+


+Page créée par Eric Delaunay, delaunay@debian.org +

+ + --- xtel-3.3.0.orig/debian/logrotate.conf +++ xtel-3.3.0/debian/logrotate.conf @@ -0,0 +1,9 @@ + +/var/log/xtel.log { + rotate 2 + weekly + compress + missingok + notifempty +} + --- xtel-3.3.0.orig/debian/postinst +++ xtel-3.3.0/debian/postinst @@ -0,0 +1,49 @@ +#! /bin/sh +# postinst script for xtel +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + update-inetd --remove xtel + update-inetd --add \ + "xtel stream tcp nowait root /usr/sbin/tcpd /usr/sbin/xteld" + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- xtel-3.3.0.orig/debian/postrm +++ xtel-3.3.0/debian/postrm @@ -0,0 +1,46 @@ +#! /bin/sh +# postrm script for xtel +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see /usr/doc/packaging-manual/ + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + [ -x "$(command -v xtel 2>/dev/null)" ] && update-inetd --disable xtel + + if [ "$1" = purge ] + then + [ -x "$(command -v xtel 2>/dev/null)" ] && update-inetd --remove xtel + rm -f /var/log/xtel.log* + rm -f /etc/logrotate.d/xtel + fi + + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + + --- xtel-3.3.0.orig/debian/prerm +++ xtel-3.3.0/debian/prerm @@ -0,0 +1,46 @@ +#! /bin/sh +# prerm script for xtel +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/doc/packaging-manual/ + +case "$1" in + remove|upgrade|deconfigure) +# install-info --quiet --remove /usr/info/xtel.info.gz + if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \ + -a -L /usr/doc/xtel ]; then + rm -f /usr/doc/xtel + fi + if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \ + -a -L /usr/doc/LANG/fr/xtel ]; then + rm -f /usr/doc/LANG/fr/xtel + fi + + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- xtel-3.3.0.orig/debian/rules +++ xtel-3.3.0/debian/rules @@ -0,0 +1,45 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_build: + # Imake commands + xmkmf + make Xtel + # convert the mean gif file into a png file + convert xtel.gif +set date:create +set date:modify -define png:exclude-chunk=time xtel.png + +override_dh_auto_clean: + dh_auto_clean + rm -f xtel.png + find . -name Makefile -print | xargs rm -f + +override_dh_auto_install: + $(MAKE) install DESTDIR=`pwd`/debian/xtel + # Install font support and fonts + install -m 644 fonts/fonts.alias debian/xtel/etc/X11/fonts/misc/xtel.alias + install -m 644 fonts/*.pcf.gz debian/xtel/usr/share/fonts/X11/misc/ + # Install app-default for xtel + install -m 644 XTel-color debian/xtel/etc/X11/app-defaults/ + # Install logrotate conf file + install -m 644 debian/logrotate.conf debian/xtel/etc/logrotate.d/xtel + # Install menu + install -d debian/xtel/usr/share/applications + install -m 644 debian/xtel.desktop debian/xtel/usr/share/applications + # Remove non-standard font directory + rm -rf debian/xtel/usr/share/fonts/X11/xtel + rm -rf debian/xtel/fonts + # Install french documentation in the french docs directory + install -m 644 debian/index-fr.html debian/xtel/usr/share/doc/LANG/fr/xtel/index.html + perl -MMIME::Base64 -ne 'print decode_base64($$_)' < debian/bullet.gif.base64 > debian/xtel/usr/share/doc/LANG/fr/xtel/bullet.gif + install -m 644 HISTOIRE.txt debian/xtel/usr/share/doc/LANG/fr/xtel/ + install -m 644 LISEZMOI.txt debian/xtel/usr/share/doc/LANG/fr/xtel/ + install -m 644 FAQ.txt debian/xtel/usr/share/doc/LANG/fr/xtel/ + install -m 644 README_IMINITEL.txt debian/xtel/usr/share/doc/LANG/fr/xtel/ + gzip -9vn debian/xtel/usr/share/doc/LANG/fr/xtel/*.txt + # Install png image example + install -m 644 xtel.png debian/xtel/usr/share/doc/xtel/ + # Create a symlink in /usr/share/doc/xtel to the french doc directory + ln -s ../LANG/fr/xtel debian/xtel/usr/share/doc/xtel/fr + #rm -f debian/xtel/usr/X11R6/lib/X11/app-defaults --- xtel-3.3.0.orig/debian/watch +++ xtel-3.3.0/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://pficheux.free.fr/xtel/tele.html http://pficheux.free.fr/xtel/download/xtel-(.*)\.(?:tar\.xz|txz|tar\.bz2|tbz2|tar\.gz|tgz) --- xtel-3.3.0.orig/debian/xtel.desktop +++ xtel-3.3.0/debian/xtel.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=Xtel +Exec=/usr/bin/xtel +Type=Application +Categories=Network;Dialup; --- xtel-3.3.0.orig/debian/xtel.dirs +++ xtel-3.3.0/debian/xtel.dirs @@ -0,0 +1,8 @@ +etc/xtel +etc/logrotate.d +usr/sbin +usr/share/fonts/X11/misc +etc/X11/fonts/misc +usr/share/doc/LANG/fr/xtel +usr/share/doc/xtel/examples +etc/X11/app-defaults --- xtel-3.3.0.orig/debian/xtel.doc-base +++ xtel-3.3.0/debian/xtel.doc-base @@ -0,0 +1,18 @@ +Document: xtel +Title: XTel, Emulateur Minitel sous X11 +Author: Eric Delaunay +Abstract: XTEL permet d'émuler un Minitel 1B, 2 ou TVR (Télétel Vitesse Rapide) + sur un terminal X, ou une station de travail couleur, monochrome ou à + niveaux de gris. + Il est utilisable en réseau, c'est-à-dire qu'une des machines + du réseau commande les MODEMS et dialogue avec les services Télétel, les + utilisateurs de XTEL dialoguent avec cette machine "serveur" par socket + internet (utilisation d'un service TCP et du super-démon "inetd"). + XTEL implémente désormais le protocole I-Minitel du 3622 (plus de détails sur + http://www.i-minitel.com). +Section: Network/Communication + +Format: HTML +Files: /usr/share/doc/xtel/fr/index.html +Index: /usr/share/doc/xtel/fr/index.html + --- xtel-3.3.0.orig/debian/xtel.examples +++ xtel-3.3.0/debian/xtel.examples @@ -0,0 +1 @@ +exemples/*.vdt --- xtel-3.3.0.orig/debian/xtel.manpages +++ xtel-3.3.0/debian/xtel.manpages @@ -0,0 +1,2 @@ +xtel.man +xteld.man --- xtel-3.3.0.orig/demon.h +++ xtel-3.3.0/demon.h @@ -96,6 +96,7 @@ char *chat; /* chat-script */ char type_dialer; /* type du dialer */ int delai; /* timeout du dialogue Modem */ + int tempo; /* tempos entre ioctl (pour vieux modems) en µs */ }; /* @@ -132,8 +133,10 @@ #endif /* NO_NETWORK */ /* Fichier d'état I-Minitel */ -#define IMINITEL_FILE "/tmp/.iminitel" +#define IMINITEL_FILE "/var/run/iminitel" #define IMINITEL_TIMEOUT 45 +/* Fichier de lock de la session PPP I-Minitel */ +#define IMINITEL_LOCKFILE "/var/run/ppp-iminitel.pid" /* Base /proc */ #define PROC_BASE "/proc" --- xtel-3.3.0.orig/dial.c +++ xtel-3.3.0/dial.c @@ -58,6 +58,8 @@ static char nom_lck[256]; extern char type_client; +static int try_lock (char *lock_file); + /* * fonction UNDIAL */ @@ -81,7 +83,7 @@ { char buf[80], erreur; struct stat statb; - int fdlck, fd; + int fd; for (numero_ligne = 0 ; numero_ligne != nb_lignes && definition_lignes[numero_ligne].type_dialer != DIALER_M1 ; numero_ligne++) ; @@ -96,7 +98,7 @@ /* * Recherche la premiere ligne non deja utilise par un programme UUCP */ - for (;;) { + while (numero_ligne < nb_lignes) { #ifdef SVR4 if (stat (definition_lignes[numero_ligne].nom, &statb) != 0) { erreur_a_xtel ("mydial()", errno); @@ -109,19 +111,9 @@ #ifdef DEBUG_XTELD log_debug( "ligne= %s, device= %s, lock= %s", definition_lignes[numero_ligne].nom, definition_lignes[numero_ligne].device, nom_lck); #endif - /* Si le lock existe */ - if (stat (nom_lck, &statb) == 0) { - if (numero_ligne == nb_lignes-1) { - /* Dommage, c'etait la derniere :-( */ - erreur_a_xtel ("[0] Aucun MODEM disponible !", 0); - return (-1); - } - } - else { - /* Sinon, on verifie que le device corresponde */ - if (device == NULL || strcmp (device, definition_lignes[numero_ligne].device) == 0) - break; - else { + /* On verifie que le device corresponde */ + if (device != NULL && strcmp (device, definition_lignes[numero_ligne].device) != 0) { + /* sinon on passe à la ligne suivante */ if (numero_ligne == nb_lignes - 1) { #ifdef DEBUG_XTELD log_debug ("%s != %s", device, definition_lignes[numero_ligne].device); @@ -129,32 +121,39 @@ erreur_a_xtel ("[2] Pas de device correspondant !", 0); return -1; } - } + numero_ligne++; + continue; + } + /* Si c'est le bon device, on tente du poser le lock */ + if (try_lock( nom_lck ) < 0) { + /* le modem est occupé... on passe au suivant */ + numero_ligne++; + } + else { + break; } - - once_again: - numero_ligne++; } - -#ifdef DEBUG_XTELD - log_debug ("creation de %s", nom_lck); -#endif - - /* on cree un fichier semaphore LCK..ttyxx */ - if ((fdlck = open (nom_lck, O_WRONLY|O_EXCL|O_CREAT, 0644)) < 0) { - erreur_a_xtel (nom_lck, errno); + if (numero_ligne >= nb_lignes) { + /* Dommage, c'etait la derniere :-( */ + erreur_a_xtel ("[0] Aucun MODEM disponible !", 0); return (-1); } - /* on ecrit le PID dedans */ - sprintf (buf, "%10d\n", getpid ()); - write (fdlck, buf, strlen (buf)); - close (fdlck); - #ifdef DEBUG_XTELD log_debug ("Ouverture de la ligne %s", definition_lignes[numero_ligne].nom); #endif /* ouvre la ligne */ + if (definition_lignes[numero_ligne].tempo > 0) { + /* + * Pour les vieux modems, dans certains cas, il faut réinitialiser le + * port série avant de pouvoir communiquer avec le modem. + * Ceci est effectué en ouvrant puis refermant le device avec un certain + * délai entre chaque opération. + */ + fd = open (definition_lignes[numero_ligne].nom, O_RDWR|O_NDELAY); + usleep(definition_lignes[numero_ligne].tempo); + close(fd); + } if ((fd = open (definition_lignes[numero_ligne].nom, O_RDWR|O_NDELAY)) < 0) { /* Derniere ligne, on passe l'erreur */ if (numero_ligne == nb_lignes-1) { @@ -169,13 +168,13 @@ } /* Init des parametres de la ligne */ - init_tty (fd, definition_lignes[numero_ligne].speed, definition_lignes[numero_ligne].cs, definition_lignes[numero_ligne].parity, definition_lignes[numero_ligne].flags, definition_lignes[numero_ligne].type_dialer); + init_tty (fd, definition_lignes[numero_ligne].speed, definition_lignes[numero_ligne].cs, definition_lignes[numero_ligne].parity, definition_lignes[numero_ligne].flags, definition_lignes[numero_ligne].type_dialer, definition_lignes[numero_ligne].tempo); #ifdef DEBUG_XTELD log_debug ("Dialogue Modem..."); #endif - erreur = do_chat (fd, definition_lignes[numero_ligne].chat, (unsigned long)definition_lignes[numero_ligne].delai, telno, NULL, 0); + erreur = do_chat (fd, definition_lignes[numero_ligne].chat, (unsigned long)definition_lignes[numero_ligne].delai, definition_lignes[numero_ligne].tempo, telno, NULL, 0); /* * Test de l'erreur en sortie @@ -196,8 +195,10 @@ erreur_a_xtel (nom_lck, errno); } close (fd); - numero_ligne++; } + + once_again: + numero_ligne++; } /* @@ -208,3 +209,93 @@ return (-1); } + +/* Verrouille la ligne serie (retourne 0 si ok, -1 si erreur) */ +static int try_lock (char *lock_file) +{ + char buf[256]; + struct stat statb; + int fd, n; + pid_t pid; + + /* Test du lock */ + do { + fd = open( lock_file, O_CREAT | O_EXCL | O_WRONLY, 0644 ); + if (fd < 0) { + /* erreur lors de la création du fichier de lock */ + if (errno == EEXIST) { + /* le fichier existe : voir si le programme qui l'a créé existe toujours */ + fd = open( lock_file, O_RDONLY ); + if (fd >= 0) { + n = read( fd, buf, 11 ); + close( fd ); + if (n > 0) { + buf[n] = '\0'; + pid = atoi(buf); + /* teste l'existence du processus ayant créé le fichier */ + if (pid == 0 || kill(pid,0) == -1 && errno == ESRCH) { + if (unlink(lock_file) == 0) { +#ifdef DEBUG_XTELD + log_debug ("Removed stale lock %s (pid %d)", lock_file, pid); +#endif + /* et on retente la création dudit fichier */ + fd = -1; + } + else { +#ifdef DEBUG_XTELD + log_debug ("Can't remove stale lock %s", lock_file); +#endif + return -1; + } + } + else { +#ifdef DEBUG_XTELD + char *line = strrchr( lock_file, '/' )+6; /* après le /LCK.. */ + log_debug ("Device %s is already locked by pid %d", line, pid); +#endif + return -1; + } + } + else { +#ifdef DEBUG_XTELD + log_debug ("Can't read pid from lock file %s", lock_file); +#endif + return -1; + } + } + else if (errno != ENOENT) { + /* il ne vient pas d'être effacé par un autre programme */ + /* c'est donc un vrai problème */ +#ifdef DEBUG_XTELD + log_debug ("%s: %s", lock_file, strerror(errno)); +#endif + return -1; + } + } + else { + /* fichier impossible à créer */ +#ifdef DEBUG_XTELD + log_debug ("Can't create lock file %s (%s)", lock_file, strerror(errno)); +#endif + return -1; + } + } + } while (fd < 0); + + /* Le lock est posé ; il faut y inscrire le pid de ce programme */ + sprintf (buf, "%10d\n", getpid()); + if (write (fd, buf, 11) != 11) { +#ifdef DEBUG_XTELD + log_debug ("Error writing to file %s (%s)", lock_file, strerror(errno)); +#endif + close (fd); + return -1; + } +#ifdef DEBUG_XTELD + log_debug ("fichier lock %s cree", nom_lck); +#endif + + close (fd); + return 0; +} + --- xtel-3.3.0.orig/global.h +++ xtel-3.3.0/global.h @@ -22,6 +22,11 @@ #ifndef _global_h #define _global_h +/* + * pour récupérer la config globale du programme + */ +#include "Config.tmpl" + #ifndef EXTERN #define EXTERN extern #endif @@ -203,10 +208,9 @@ /* * Variables */ -#ifndef __FreeBSD__ -#ifndef __GLIBC__ +#ifndef HAS_STRERROR extern char *sys_errlist[]; -#endif +#define strerror(e) (sys_errlist[e]) #endif /* xtel.c */ --- xtel-3.3.0.orig/globald.h +++ xtel-3.3.0/globald.h @@ -26,6 +26,11 @@ #define True 1 #define False 0 +/* + * pour récupérer la config globale du programme + */ +#include "Config.tmpl" + #ifndef EXTERN #define EXTERN extern #endif @@ -33,10 +38,9 @@ /* * Variables */ -#ifndef __FreeBSD__ -#ifndef __GLIBC__ +#ifndef HAS_STRERROR extern char *sys_errlist[]; -#endif +#define strerror(e) (sys_errlist[e]) #endif EXTERN struct definition_ligne definition_lignes[MAX_LIGNES]; @@ -74,9 +78,9 @@ void ian_init (char*); /* modem.c */ -void init_tty (int, int, int, int, int, int); +void init_tty (int, int, int, int, int, int, int); void restore_tty (int); -int do_chat (int, char*, unsigned long, char*, char*, int); +int do_chat (int, char*, unsigned long, int, char*, char*, int); void init_debug (char*); void close_debug (void); #else --- xtel-3.3.0.orig/iminitel/Imakefile +++ xtel-3.3.0/iminitel/Imakefile @@ -1,5 +1,13 @@ XCOMM $Id: Imakefile,v 1.2 2001/02/11 00:15:50 pierre Exp $ + +#include "../Config.tmpl" + PPPDIR=/etc/ppp +SBINDIR=/usr/sbin + +#ifdef DEBIAN +SEDCMD=sed 's:$$1:$$PPP_IFACE:;s:$$2:$$PPP_TTY:;s:$$3:$$PPP_SPEED:;s:$$4:$$PPP_LOCAL:;s:$$5:$$PPP_REMOTE:;s:$$6:$$PPP_IPPARAM:' +#endif all:: @@ -8,12 +16,20 @@ depend:: install:: -InstallNonExecFile(iminitel, $(PPPDIR)/peers) -InstallNonExecFile(chat-iminitel, $(PPPDIR)) +InstallNonExecFile(iminitel,$(PPPDIR)/peers) +InstallNonExecFile(chat-iminitel,$(PPPDIR)) InstallNamedProg(connect_iminitel.sh,connect_iminitel,$(LIBDIR)/xtel) -InstallNamedProg(install_iminitel.sh,install_iminitel,$(BINDIR)) -InstallNamedProg(ip-up.iminitel,ip-up.iminitel, $(PPPDIR)) -InstallNamedProg(ip-down.iminitel,ip-down.iminitel, $(PPPDIR)) - +#ifdef DEBIAN +MakeDirectories(install,$(PPPDIR)/ip-up.d $(PPPDIR)/ip-down.d) install:: - install_iminitel + @$(SEDCMD) < ip-up.iminitel > $(DESTDIR)$(PPPDIR)/ip-up.d/iminitel + @$(SEDCMD) < ip-down.iminitel > $(DESTDIR)$(PPPDIR)/ip-down.d/iminitel + chmod 755 $(DESTDIR)$(PPPDIR)/ip-up.d/iminitel $(DESTDIR)$(PPPDIR)/ip-down.d/iminitel +#else +InstallNamedProg(install_iminitel.sh,install_iminitel,$(SBINDIR)) +InstallNamedProg(ip-up.iminitel,ip-up.iminitel,$(PPPDIR)) +InstallNamedProg(ip-down.iminitel,ip-down.iminitel,$(PPPDIR)) +#endif + +XCOMM install:: +XCOMM install_iminitel --- xtel-3.3.0.orig/iminitel/connect_iminitel.sh +++ xtel-3.3.0/iminitel/connect_iminitel.sh @@ -1,17 +1,8 @@ #!/bin/sh # $Id: connect_iminitel.sh,v 1.2 2001/02/11 00:16:52 pierre Exp $ -IMINITEL_FILE=/tmp/.iminitel case "$1" in start) - # Test lock - if [ -r ${IMINITEL_FILE} ]; then - exit 1 - fi - - # Pose le lock - echo -n > ${IMINITEL_FILE} - # Appel serveur 3622 /usr/sbin/pppd call iminitel ipparam iminitel exit $? @@ -19,10 +10,9 @@ stop) # Si ppp est encore actif, on coupe - if [ -r ${IMINITEL_FILE} ]; then - . ${IMINITEL_FILE} - # Tue de demon pppd - kill `cat /var/run/${IMINITEL_INTERFACE}.pid` + if [ -r /var/run/ppp-iminitel.pid ]; then + # Tue le demon pppd + kill `head -1 /var/run/ppp-iminitel.pid` fi ;; --- xtel-3.3.0.orig/iminitel/iminitel +++ xtel-3.3.0/iminitel/iminitel @@ -3,3 +3,4 @@ noauth lock idle 120 +linkname iminitel --- xtel-3.3.0.orig/iminitel/ip-down.iminitel +++ xtel-3.3.0/iminitel/ip-down.iminitel @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/sh # $Id: ip-down.iminitel,v 1.1 2001/02/05 09:34:59 pierre Exp $ # I-Minitel if [ "$6" = "iminitel" ]; then - rm -f /tmp/.iminitel + rm -f /var/run/iminitel fi --- xtel-3.3.0.orig/iminitel/ip-up.iminitel +++ xtel-3.3.0/iminitel/ip-up.iminitel @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # $Id: ip-up.iminitel,v 1.1 2001/02/05 09:34:59 pierre Exp $ # I-Minitel if [ "$6" = "iminitel" ]; then @@ -19,10 +19,14 @@ shift i=`expr $i + 1` done - /sbin/route add -host $1 gw ${IMINITEL_ADDR} - cat < /tmp/.iminitel -IMINITEL_SERVER=$1 + /sbin/route add -host ${1} gw ${IMINITEL_ADDR} + # crée le fichier d'état I-Minitel. + # Utilise un nommage temporaire pour être sûr que tout son contenu sera + # disponible lors de la lecture (asynchrone) par xteld. + cat < /var/run/iminitel.tmp +IMINITEL_SERVER=${1} IMINITEL_INTERFACE=${IMINITEL_INTERFACE} EOF + mv /var/run/iminitel.tmp /var/run/iminitel fi --- xtel-3.3.0.orig/imprime.c +++ xtel-3.3.0/imprime.c @@ -28,26 +28,49 @@ int mode; { FILE *fp; - char cmd[256], n[256]; + int fd = -1; + char cmd[256]; + char n[] = "/var/tmp/xtelXXXXXX"; + /* crée le fichier de telle façon qu'il soit impossible de le détourner + * avec un lien symbolique préalablement établi. + */ +#ifdef HAS_MKSTEMP + fd = mkstemp(n); +#else + if (mktemp(n) != NULL) + fd = open (n, O_CREAT | O_EXCL | O_WRONLY, 0600); +#endif - sprintf (n, "/tmp/xtel%d.ppm", getpid()); - if ((fp = fopen (n, "w")) == NULL) { + if (fd < 0) { perror (n); - exit (1); } - - if (mode == VIDEOTEX) { - videotexDumpScreen (ecran_minitel, fp); - sprintf (cmd, rsc_xtel.commandeImpression, n); - } - else { /* ASCII */ - videotexConversionAscii (ecran_minitel, fp); - sprintf (cmd, rsc_xtel.commandeImpressionAscii, n); + else if ((fp = fdopen( fd, "wb" )) == NULL) { + close (fd); + unlink (n); + perror (n); } + else { + if (mode == VIDEOTEX) { + videotexDumpScreen (ecran_minitel, fp); +#ifdef HAS_SNPRINTF + snprintf (cmd, sizeof(cmd), rsc_xtel.commandeImpression, n); +#else + sprintf (cmd, rsc_xtel.commandeImpression, n); +#endif + } + else { /* ASCII */ + videotexConversionAscii (ecran_minitel, fp); +#ifdef HAS_SNPRINTF + snprintf (cmd, sizeof(cmd), rsc_xtel.commandeImpressionAscii, n); +#else + sprintf (cmd, rsc_xtel.commandeImpressionAscii, n); +#endif + } - fclose (fp); - system (cmd); - unlink (n); + fclose (fp); + system (cmd); + unlink (n); + } } void imprime_page_courante_ascii (w, client_data, call_data) --- xtel-3.3.0.orig/lecteur.c +++ xtel-3.3.0/lecteur.c @@ -100,9 +100,13 @@ kill (pid_teleinfo, SIGKILL); close (fd_teleinfo); } else { + char s[8]; + int n; if (mode_emulation == MODE_TELEINFO_FR) c = conversion_teleinfo_fr (c,3); - write (fd_teleinfo, &c, 1); + n = snprintf (s, sizeof (s), "%lc", (unsigned char) c); + if (n != -1) + write (fd_teleinfo, s, n); } } else { --- xtel-3.3.0.orig/ligne.c +++ xtel-3.3.0/ligne.c @@ -172,9 +172,13 @@ selection_mode_emulation (ecran_minitel, "V", NULL); return; } else { + char s[8]; + int n; if (mode_emulation == MODE_TELEINFO_FR) c = conversion_teleinfo_fr (c,1); - write (fd_teleinfo, &c, 1); + n = snprintf (s, sizeof(s), "%lc", (unsigned char) c); + if (n != -1) + write (fd_teleinfo, s, n); } } else { videotexDecode (ecran_minitel, c); --- xtel-3.3.0.orig/make_xtel_lignes.sh +++ xtel-3.3.0/make_xtel_lignes.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # $Id: make_xtel_lignes.sh,v 1.5 2001/02/11 19:27:59 pierre Exp $ # Détection des modems @@ -27,10 +27,8 @@ exit 1 fi -if [ -r $XTEL_LIGNES ]; then - echo "Copie de l'ancien $XTEL_LIGNES sur ${XTEL_LIGNES}.$$" - mv $XTEL_LIGNES ${XTEL_LIGNES}.$$ -fi +NEW_XTEL_LIGNES=$XTEL_LIGNES.$$ +rm -f $NEW_XTEL_LIGNES j=0 for i in 0 1 2 3 @@ -111,9 +109,9 @@ echo -n "Quel votre préfixe d'appel (exemple: 0w) ? " read c < /dev/tty - echo "# $m $MDM" >> $XTEL_LIGNES - echo "modem${j}${2}/dev/${TTYLINE}${2}$3${2}7${2}E${2}$4 atdt$c\\T\\r CONNECT${2}30" | sed -e 's/-/ /g' >> $XTEL_LIGNES - echo >> $XTEL_LIGNES + echo "# $m $MDM" >> $NEW_XTEL_LIGNES + echo "modem${j}${2}/dev/${TTYLINE}${2}$3${2}7${2}E${2}$4 atdt$c\\T\\r CONNECT${2}30" | sed -e 's/-/ /g' >> $NEW_XTEL_LIGNES + echo >> $NEW_XTEL_LIGNES j=`expr $j + 1` else sleep 1 @@ -121,7 +119,11 @@ fi done -if [ ! -r $XTEL_LIGNES -a -r ${XTEL_LIGNES}.$$ ]; then - echo "Aucun modem détecté, restauration du $XTEL_LIGNES" - mv ${XTEL_LIGNES}.$$ $XTEL_LIGNES +if [ ! -r $NEW_XTEL_LIGNES ]; then + echo "Aucun modem détecté." +else + if [ $j -gt 1 ]; then s="s"; fi + echo "$j modem$s détecté$s, création du $XTEL_LIGNES" + if [ -f $XTEL_LIGNES ]; then mv ${XTEL_LIGNES} $XTEL_LIGNES.old ; fi + mv $NEW_XTEL_LIGNES $XTEL_LIGNES fi --- xtel-3.3.0.orig/mdmdetect.c +++ xtel-3.3.0/mdmdetect.c @@ -22,6 +22,7 @@ /* Detection du modem pour generation du xtel.lignes */ +#include "Config.tmpl" #include #include #include @@ -37,17 +38,21 @@ #include #include #include +#ifdef USE_TERMIOS +#include +#else #include +#endif #ifdef SVR4 #include #endif /* SVR4 */ #define TIMEOUT_READ 5 +#define TEMPO 1000000 -#ifndef __FreeBSD__ -#ifndef __GLIBC__ +#ifndef HAS_STRERROR extern char *sys_errlist[]; -#endif +#define strerror(e) (sys_errlist[e]) #endif extern char *xtel_basename (), *next_token (); @@ -100,13 +105,14 @@ { char buf[256]; struct stat statb; - FILE *fplock; + int fd, n; + pid_t pid; /* A la mode UUCP... */ #ifdef SVR4 sprintf (buf, "/dev/%s", line); if (stat (buf, &statb) != 0) { - fprintf (stderr, "%s: %s\n", buf, sys_errlist[errno]); + fprintf (stderr, "%s: %s\n", buf, strerror(errno)); the_end (1); } @@ -116,19 +122,64 @@ #endif /* SVR4 */ /* Test du lock */ - if (stat (lock_file, &statb) == 0) { - fprintf (stderr, "Lock file %s already exists, exiting.\n", lock_file); - the_end (1); - } + do { + fd = open( lock_file, O_CREAT | O_EXCL | O_WRONLY, 0644 ); + if (fd < 0) { + /* erreur lors de la création du fichier de lock */ + if (errno == EEXIST) { + /* le fichier existe : voir si le programme qui l'a créé existe toujours */ + fd = open( lock_file, O_RDONLY ); + if (fd >= 0) { + n = read( fd, buf, 11 ); + close( fd ); + if (n > 0) { + buf[n] = '\0'; + pid = atoi(buf); + /* teste l'existence du processus ayant créé le fichier */ + if (pid == 0 || kill(pid,0) == -1 && errno == ESRCH) { + if (unlink(lock_file) == 0) { + fprintf (stderr, "Removed stale lock %s (pid %d)\n", lock_file, pid); + /* et on retente la création dudit fichier */ + fd = -1; + } + else { + fprintf (stderr, "Can't remove stale lock %s\n", lock_file); + the_end (1); + } + } + else { + fprintf (stderr, "Device %s is already locked by pid %d\n", line, pid); + the_end (1); + } + } + else { + fprintf (stderr, "Can't read pid from lock file %s\n", lock_file); + the_end (1); + } + } + else if (errno != ENOENT) { + /* il ne vient pas d'être effacé par un autre programme */ + /* c'est donc un vrai problème */ + fprintf (stderr, "%s: %s\n", lock_file, strerror(errno)); + the_end (1); + } + } + else { + /* fichier impossible à créer */ + fprintf (stderr, "Can't create lock file %s (%s)\n", lock_file, strerror(errno)); + the_end (1); + } + } + } while (fd < 0); - /* Pose le lock */ - if (!(fplock = fopen (lock_file, "w"))) { - fprintf (stderr, "%s: %s\n", lock_file, sys_errlist[errno]); + /* Le lock est posé ; il faut y inscrire le pid de ce programme */ + sprintf (buf, "%10d\n", getpid()); + if (write (fd, buf, 11) != 11) { + fprintf (stderr, "Error writing to file %s (%s)\n", lock_file, strerror(errno)); + close (fd); the_end (1); } - - fprintf (fplock, "%10d\n", getpid()); - fclose (fplock); + close (fd); } /* Lecture d'une ligne terminee par '\n' */ @@ -191,27 +242,20 @@ } /* Recherche de mot-cle */ -static int check_for_kw (int fd, char *builder, char *kw, char *s) +static char* check_for_kw (int fd, char *s) { - char modem_string[4096], chat_script[256]; + static char modem_string[4096], chat_script[256]; fprintf (stderr, "."); fflush (stderr); sprintf (chat_script, "%s\r OK", s); - if (do_chat (fd, chat_script, TIMEOUT_READ, NULL, modem_string, sizeof(modem_string)) != 0) - return 0; + if (do_chat (fd, chat_script, TIMEOUT_READ, TEMPO, NULL, modem_string, sizeof(modem_string)) != 0) + return NULL; if (debug) - log_debug ("[%s] check_for_kw %s: reponse= %s", builder, kw, modem_string); + log_debug ("reponse= %s", modem_string); - if (strstr (modem_string, kw)) { - if (debug) - log_debug ("%s trouve !", kw); - - return 1; - } - - return 0; + return modem_string; } @@ -219,7 +263,8 @@ int ac; char **av; { - char *cp, *str1, *str2; + char cmd[6]; + char *cp, *fab, *modem_string, *reponse; register int i; int found = 0; #ifdef DEBUG_XTELD @@ -233,17 +278,20 @@ /* Lecture de la ligne de commande */ while (--ac) { - if ((cp = *++av) == NULL) - break; + cp = *++av; if (*cp == '-' && *++cp) { switch(*cp) { case 'b' : + if (!--ac) + Usage(progname); builder = *++av; break; case 'd' : ++debug; break; case 'l' : + if (!--ac) + Usage(progname); modem_list = *++av; break; case 'q' : @@ -285,7 +333,29 @@ } } - if (!query) { + if (query) { + /* Lecture de la liste des modems */ + while (read_a_line (fdl, buf, sizeof(buf)) > 0) { + + if (debug) + log_debug ("(%s)", buf); + + if (buf[0] == '#' || buf[0] == '\n') + continue; + + /* Fabricant */ + if (buf[0] == '[') { + fab = strdup (&buf[1]); + fab[strlen(fab)-2] = 0; + if (query) + printf ("%s\n", fab); + + continue; + } + } + } + + else { /* Test et lock de la ligne */ check_and_lock (cp); @@ -296,65 +366,53 @@ } /* Ligne en mode 'raw' */ - init_tty (fd, B9600, CS8, 2, 0, 0); + init_tty (fd, B9600, CS8, 2, 0, 0, TEMPO); /* Test de presence de modem */ - if (do_chat (fd, "AT\r OK", 3, NULL, NULL, 0)) { + if (do_chat (fd, "AT\r OK", 3, TEMPO, NULL, NULL, 0)) { /* On insiste un peu */ - if (do_chat (fd, "AT\r OK", 3, NULL, NULL, 0)) { + if (do_chat (fd, "AT\r OK", TEMPO, 3, NULL, NULL, 0)) { fprintf (stderr, "Pas de modem présent !\n"); the_end (1); } } - } - - /* Lecture de la liste des modems */ - while (read_a_line (fdl, buf, sizeof(buf)) > 0) { - - if (debug) - log_debug ("(%s)", buf); - - if (buf[0] == '#' || buf[0] == '\n') - continue; - - /* Fabricant */ - if (buf[0] == '[') { - str1 = strdup (&buf[1]); - str1[strlen(str1)-2] = 0; - if (query) - printf ("%s\n", str1); - - continue; - } - - /* Si on a specifie un fabricant, teste le nom */ - if (query || (builder && strcmp (str1, builder))) - continue; - - /* Mot-cle a tester */ - str2 = next_token (buf, ":"); - - if (!str2) { - fprintf (stderr, "Erreur de lecture %s\n", modem_list); - the_end (1); - } - /* Interrogation par ATI puis ATIx */ - found = 0; - if ((found = check_for_kw (fd, str1, str2, "ATI")) == 0) { - for (i = '0' ; i <= '9' ; i++) { - char cmd[6]; - - sprintf (cmd, "ATI%c", i); - if ((found = check_for_kw (fd, str1, str2, cmd)) > 0) { - break; + /* interrogation du modem sur l'ensemble des registres de configuration */ + strcpy (cmd, "ATI"); + for (i = -1 ; !found && i <= 9 ; i++) { + if (i >= 0) + sprintf (cmd, "ATI%d", i); + if ((reponse = check_for_kw (fd, cmd)) != NULL) { + /* on a une réponse : rechercher dans la base */ + lseek (fdl, 0, 0); + found = 0; + while (!found && read_a_line (fdl, buf, sizeof(buf)) > 0) { + if (debug) + log_debug ("(%s)", buf); + if (buf[0] == '#' || buf[0] == '\n') { + /* commentaire ou ligne blanche */ + } + else if (buf[0] == '[') { + /* Fabricant */ + fab = strdup (&buf[1]); + fab[strlen(fab)-2] = 0; + } + else if (!builder || strcmp (builder, fab)==0) { + /* description d'un modem */ + modem_string = next_token (buf, ":"); /* Mot-clé à tester */ + if (strstr (reponse, modem_string)) { + if (debug) + log_debug ("%s trouve !", modem_string); + found = 1; + } + } } } } if (found) { if (debug) - log_debug ("str2= %s buf= %s", str2, buf); + log_debug ("builder= %s modem id= %s", fab, modem_string); puts ("\n"); --- xtel-3.3.0.orig/modem.c +++ xtel-3.3.0/modem.c @@ -61,7 +61,7 @@ static struct termiox termx; #endif /* lectra && SVR4 && !sun || hpux */ -#ifndef SYSLOG +#ifndef USE_SYSLOG static FILE *fp_console; #endif static char prefix[256]; @@ -89,28 +89,28 @@ /* Syslog or not syslog ? */ #ifdef USE_SYSLOG -void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7) +void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7, p8) char *fmt; -int p1, p2, p3, p4, p5, p6, p7; +int p1, p2, p3, p4, p5, p6, p7, p8; { char msg[256]; - sprintf (msg, fmt, p1, p2, p3, p4, p5, p6, p7); - syslog (LOG_INFO, msg); + sprintf (msg, fmt, p1, p2, p3, p4, p5, p6, p7, p8); + syslog (LOG_INFO, "%s", msg); } void log_err (s) char *s; { - syslog (LOG_ERR, s); + syslog (LOG_ERR, "%s", s); } #else -void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7) +void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7, p8) char *fmt; -int p1, p2, p3, p4, p5, p6, p7; +int p1, p2, p3, p4, p5, p6, p7, p8; { fprintf (fp_console, "%s[%d] ", prefix, getpid()); - fprintf (fp_console, fmt, p1, p2, p3, p4, p5, p6, p7); + fprintf (fp_console, fmt, p1, p2, p3, p4, p5, p6, p7, p8); fprintf (fp_console, "\n\r"); } @@ -123,7 +123,7 @@ if (*s != '%') fputc (*s, fp_console); else if (*(s+1) == 'm') { - fprintf (fp_console, "%s", sys_errlist[errno]); + fprintf (fp_console, "%s", strerror(errno)); s++; } @@ -151,13 +151,15 @@ } /* Init des parametres de ligne */ -void init_tty (int fd, int speed, int csize, int parity, int flags, int dialer) +void init_tty (int fd, int speed, int csize, int parity, int flags, int dialer, int tempo) { #ifdef NO_TERMIO ioctl (fd, TIOCGETP, &term); + usleep(tempo); memcpy ((char *)&term_sauve, (char *)&term, sizeof(struct sgttyb)); term.sg_flags |= RAW; ioctl (fd, TIOCSETP, &term); + usleep(tempo); /* Flags, pour l'instant RTS/CTS */ /* FIXME: comment passer la ligne en RTS/CTS sans termio ? */ @@ -166,9 +168,11 @@ #ifdef USE_TERMIOS ioctl (fd, TIOCGETA, &term); + usleep(tempo); memcpy ((char *)&term_sauve, (char *)&term, sizeof(struct termios)); #else ioctl (fd, TCGETA, &term); + usleep(tempo); memcpy ((char *)&term_sauve, (char *)&term, sizeof(struct termio)); #endif /* USE_TERMIOS */ @@ -185,7 +189,8 @@ */ term.c_cflag &= ~(CSIZE|CSTOPB); term.c_cflag |= (CREAD|HUPCL); - term.c_ispeed = term.c_ospeed = speed; + cfsetispeed (&term, speed); + cfsetospeed (&term, speed); #else term.c_cflag &= ~(CSIZE|CBAUD|CLOCAL); @@ -236,35 +241,44 @@ /* Affectation des parametres */ #ifdef USE_TERMIOS ioctl (fd, TIOCSETA, &term); + usleep(tempo); #else ioctl (fd, TCSETA, &term); + usleep(tempo); #endif /* USE_TERMIOS */ #endif /* NO_TERMIO */ } /* Restauration des parametres */ -void restore_tty (fd) +void restore_tty (int fd) { #ifdef ultrix int temp = 0; #endif + int tempo = 0; /* remet la ligne en l'etat */ #ifdef NO_TERMIO term.sg_ispeed = term.sg_ospeed = B0; ioctl (fd, TIOCSETP, &term); + usleep(tempo); ioctl (fd, TIOCSETP, &term_sauve); + usleep(tempo); #else #ifdef USE_TERMIOS - term.c_ispeed = B0; - term.c_ospeed = B0; + cfsetispeed (&term, B0); + cfsetospeed (&term, B0); ioctl (fd, TIOCSETAW, &term); + usleep(tempo); ioctl (fd, TIOCSETA, &term_sauve); + usleep(tempo); #else term.c_cflag &= ~CBAUD; term.c_cflag |= B0; ioctl (fd, TCSETAW, &term); + usleep(tempo); ioctl (fd, TCSETA, &term_sauve); + usleep(tempo); #endif /* USE_TERMIOS */ #endif /* NO_TERMIO */ #ifdef ultrix @@ -277,18 +291,18 @@ /* * Dialogue avec le Modem (chatons, chatons...) */ -int do_chat (fd, chat_script, tmax, telno, reply_buf, reply_size) +int do_chat (fd, chat_script, tmax, tempo, telno, reply_buf, reply_size) int fd; char *chat_script; unsigned long tmax; +int tempo; char *telno, *reply_buf; int reply_size; { fd_set a_lire, t_a_lire; - int i, erreur, fin, nbread, cmodem; + int i, erreur, fin, nbread, cmodem = 0; char *pt_chat, c, *q; - delai_maxi.tv_sec = tmax; erreur = 0; pt_chat = chat_script; fin = 0; @@ -307,16 +321,20 @@ * (comme le Hayes Optima par exemple)... */ #ifdef USE_TERMIOS - ioctl (fd, TCIOCGETA, &term); + ioctl (fd, TIOCGETA, &term); + usleep(tempo); #else ioctl (fd, TCGETA, &term); + usleep(tempo); #endif /* USE_TERMIOS */ if ((term.c_cflag | CLOCAL) == 0) { term.c_cflag |= CLOCAL; #ifdef USE_TERMIOS - ioctl (fd, TCIOCSETA, &term); + ioctl (fd, TIOCSETA, &term); + usleep(tempo); #else ioctl (fd, TCSETA, &term); + usleep(tempo); #endif /* USE_TERMIOS */ cmodem = 1; } @@ -475,6 +493,7 @@ for (;;) { t_a_lire = a_lire; + delai_maxi.tv_sec = tmax; nbread = select (32, &t_a_lire, NULL, NULL, &delai_maxi); /* Si il y a qque chose a lire */ @@ -565,9 +584,10 @@ /* erreur read */ else { #ifdef DEBUG_XTELD - log_debug ("Erreur read !"); + log_debug ("Erreur read ! (errno=%d)",errno); #endif - erreur = 1; + /*erreur = 1;*/ + if (++erreur > 10) break; } } @@ -592,9 +612,11 @@ if (cmodem) { term.c_cflag &= ~CLOCAL; #ifdef USE_TERMIOS - ioctl (fd, TCIOCSETA, &term); + ioctl (fd, TIOCSETA, &term); + usleep(tempo); #else ioctl (fd, TCSETA, &term); + usleep(tempo); #endif /* USE_TERMIOS */ } #endif --- xtel-3.3.0.orig/modem.list +++ xtel-3.3.0/modem.list @@ -41,3 +41,7 @@ ACCURA:ACCURA-288/336:,:38400:\datm1&k3\r-OK-atb2\r-OK RCV56:Accura-56K:,:38400:\dat&fm1e0&k3f3\r-OK SMO14400:OPTIMA-144:,:38400:\datm1&k3\r-OK-atb2\r-OK + +[SAGEM] +TELSAT 14402:TelSat 14402:,:38400:\dATZ0\r-OK + --- xtel-3.3.0.orig/procedure.c +++ xtel-3.3.0/procedure.c @@ -241,7 +241,7 @@ fclose (fp); } else - fprintf (stderr, "run_procedure: %s: %s\n", (current_pd->p).filename, sys_errlist[errno]); + fprintf (stderr, "run_procedure: %s: %s\n", (current_pd->p).filename, strerror(errno)); } break; @@ -255,7 +255,7 @@ fclose (fp); } else - fprintf (stderr, "run_procedure: %s: %s\n", (current_pd->p).filename, sys_errlist[errno]); + fprintf (stderr, "run_procedure: %s: %s\n", (current_pd->p).filename, strerror(errno)); } break; --- xtel-3.3.0.orig/protocoles.c +++ xtel-3.3.0/protocoles.c @@ -63,6 +63,7 @@ #endif i++; proto++; } + fclose(fp); } return i; --- xtel-3.3.0.orig/teleinfo.c +++ xtel-3.3.0/teleinfo.c @@ -87,7 +87,7 @@ */ strcpy (master, "/dev/ptmx"); if ((fd_master = open ("/dev/ptmx", O_RDWR)) < 0) - teleinfo_fatal ("/dev/ptmx", sys_errlist[errno]); + teleinfo_fatal ("/dev/ptmx", strerror(errno)); sighold (SIGCLD); if (grantpt (fd_master) == -1) teleinfo_fatal ("could not grant slave pty"); @@ -157,7 +157,7 @@ teleinfo_fatal ("erreur ouverture maitre"); if ((fd_teleinfo = open (pty_s, O_RDWR)) < 0) - teleinfo_fatal (pty_s, sys_errlist[errno]); + teleinfo_fatal (pty_s, strerror(errno)); /* Configuration de la ligne (mode RAW) */ #ifdef SVR4 @@ -279,7 +279,8 @@ break; case 0x0e : - c = 0xef ; + //c = 0xef ; + c = 0; break ; case 0x1b : @@ -310,11 +311,17 @@ if (read (*fid, &c, 1) == 1) { if (mode_emulation == MODE_TELEINFO_FR) c = conversion_teleinfo_fr (c,2); - + if (flag_connexion) write (socket_xteld, &c, 1); - else - write (fd_teleinfo, &c, 1); + else { + char s[8]; + int n; + + n = sprintf(s, sizeof(s), "%lc", (unsigned char) c); + if (n != -1) + write (fd_teleinfo, s, n); + } } } --- xtel-3.3.0.orig/xaw.c +++ xtel-3.3.0/xaw.c @@ -1270,7 +1270,7 @@ hand_cursor = XCreateFontCursor (XtDisplay(top), XC_hand2); if (code_erreur != 0) - sprintf (buf, "%s : %s", s, sys_errlist[code_erreur]); + sprintf (buf, "%s : %s", s, strerror(code_erreur)); else { if (s[0] == '[') strcpy (buf, rsc_xtel.erreur[s[1]-'0']); --- xtel-3.3.0.orig/xm.c +++ xtel-3.3.0/xm.c @@ -868,7 +868,7 @@ int code_erreur; { if (code_erreur != 0) - sprintf (buf, "%s : %s", s, sys_errlist[code_erreur]); + sprintf (buf, "%s : %s", s, strerror(code_erreur)); else { if (s[0] == '[') strcpy (buf, rsc_xtel.erreur[s[1]-'0']); --- xtel-3.3.0.orig/xtel.c +++ xtel-3.3.0/xtel.c @@ -42,6 +42,8 @@ #include "pixmaps/xtel.xpm" #endif /* NO_XPM */ +#include + static Colormap current_cmap; static Cursor teleph_cursor; static Pixmap pixmap_icone = None; @@ -446,6 +448,8 @@ int i; Widget topLevel; + setlocale(LC_ALL, ""); + if (prototype_xtel == 0) { if (PATCHLEVEL != 0) printf ("XTEL %d.%d.%d, Emulateur MINITEL/I-MINITEL\n", version_xtel, revision_xtel, PATCHLEVEL); @@ -639,9 +643,9 @@ XtRealizeWidget(topLevel); - /* XtAddCallback (ecran_minitel, XtNmodeCallback, (XtCallbackProc)selection_mode_emulation, (XtPointer)"A"); XtAddCallback (ecran_minitel, XtNmodefrCallback, (XtCallbackProc)selection_mode_emulation, (XtPointer)"F"); + /* XtAddCallback (ecran_minitel, XtNenregCallback, (XtCallbackProc)enregistre_caractere, (XtPointer)NULL); */ init_xtel (); --- xtel-3.3.0.orig/xtel.lignes +++ xtel-3.3.0/xtel.lignes @@ -17,7 +17,10 @@ #modem0,/dev/modem,1200,7,E,\dat\r OK ATM1S27=16&N2S40=1S9=100&N2\r OK atdt\T\r CONNECT,30 # Modem USR Sporter 56K -#modem0,/dev/modem,1200,7,E,\dat\r OK AT&F1M1S27=16S34=8S40=6&N2S9=100&B2 OK atdt\T\r CONNECT,30 +#modem0,/dev/modem,1200,7,E,\dat\r OK AT&F1M1S27=16S34=8S40=6&N2S9=100&B2\r OK atdt\T\r CONNECT,30 + +#Modem USR Courier I-modem externe bios 2.50 +#modem0,/dev/modem,38400,7,E,\dat\r OK AT&f1m1l1b0*v2=3s34=8&n2s27=16s40=1s9=100&b2\r OK atdt\T\r CONNECT,30 # Minitel 1 #modem0,/dev/modem,1200,7,E,minitel1,30 --- xtel-3.3.0.orig/xtel.man +++ xtel-3.3.0/xtel.man @@ -1,6 +1,6 @@ .\" Copyright (c) 1991-98 Lectra-Systemes .\" $Id: xtel.man,v 1.10 1998/10/02 15:09:58 pierre Exp $ -.TH XTEL n "Lectra-Systemes" "10/98" +.TH XTEL 1 "Lectra-Systemes" "10/98" .UC 5 .SH NOM xtel \- Emulateur MINITEL --- xtel-3.3.0.orig/xteld.c +++ xtel-3.3.0/xteld.c @@ -64,6 +64,7 @@ #include #include #include +#include #ifdef NO_TERMIO #include @@ -81,6 +82,10 @@ #include #include +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif /* ndef MAXPATHLEN */ + #define XTELD_INPUT 0 #define XTELD_OUTPUT 1 @@ -204,9 +209,13 @@ char buf[256]; if (stat (IMINITEL_FILE, &statb) < 0) { - /* Ne devrait pas arriver */ - erreur_a_xtel (IMINITEL_FILE, errno); - exit (1); + if (errno != ENOENT) { + /* Ne devrait pas arriver */ + erreur_a_xtel (IMINITEL_FILE, errno); + exit (1); + } + else + return 0; } /* Fichier non vide, on lit les parametres */ @@ -272,7 +281,7 @@ } else if (type_client == CLIENT_W_HYPER) { if (e) - sprintf (buf, "%s: %s", s, sys_errlist[errno]); + sprintf (buf, "%s: %s", s, strerror(errno)); else { if (*s == '[') strcpy (buf, s + 3); @@ -435,10 +444,12 @@ /* signal a XTEL la deconnexion */ write (XTELD_OUTPUT, CHAINE_REPONSE_DECONNEXION, 1); +#if 0 /* symlink attack vulnerability */ /* supprime le fichier de log */ sprintf (buf, "/tmp/.xtel-%s", utilisateur); unlink (buf); - +#endif + if ((fplog= fopen(FICHIER_LOG, "a")) != NULL) { long t= time(0), duree; char *at= ctime(&t); @@ -696,7 +707,7 @@ if (!strncmp (device_associe, "@tcp", 4) || !strncmp (device_associe, "@imi", 4)) { char *tcp_port; int maxtime; - struct stat statb; + int fd; /* Valide la saisie */ saisie_active = 1; @@ -708,17 +719,63 @@ if (!strncmp (device_associe, "@imi", 4)) { strcpy (iminitel_script, code_teletel); + /* On vérifie si déjà connecté (i.e. existence du fichier lock + * /var/run/ppp-iminitel.pid qui contient le pid du processus ppp + * normalement encore actif) */ + fd = open( IMINITEL_LOCKFILE, O_RDONLY ); + if (fd >= 0) { + /* le fichier existe : voir si le programme qui l'a créé existe toujours */ + char buf[20]; + int n; + /* lit la première ligne contenant le PID du processus qui l'a créé */ + n = read( fd, buf, sizeof(buf) ); + close( fd ); + if (n > 0) { + /* récupère le PID */ + pid_t pid; + buf[n] = '\0'; + pid = (pid_t)atoi( buf ); + /* teste l'existence du processus ayant créé le fichier */ + if (pid == 0 || (kill(pid,0) == -1 && errno == ESRCH)) { + if (unlink(IMINITEL_LOCKFILE) == 0) { +#ifdef DEBUG_XTELD + log_debug ("Removed stale lock %s (pid %d)", IMINITEL_LOCKFILE, pid); +#endif + /* et on redémarrera la connexion ppp */ + fd = -1; + } + else { + erreur_a_xtel (IMINITEL_LOCKFILE, errno); + return; + } + } + else { + /* le processus existe encore -> connexion supposée active */ + } + } + } + else if (errno != ENOENT) { + /* il ne vient pas d'être effacé par un autre programme */ + /* c'est donc un vrai problème */ + erreur_a_xtel (IMINITEL_LOCKFILE, errno); + return; + } /* Si pas deja connecte, on lance la connexion */ - if (stat (IMINITEL_FILE, &statb) < 0) { - /* Execution du script de connexion avec option 'start' */ - sprintf (buf, "%s/%s start", XTEL_LIBDIR, iminitel_script); -#ifdef DEBUG_XTELD - log_debug ("execute: %s", buf); -#endif - if (system (buf) != 0) { - erreur_a_xtel (buf, errno); - exit (1); - } + if (fd < 0) { + /* Effacer éventuellement le fichier d'état I-Minitel */ + if (unlink( IMINITEL_FILE ) < 0 && errno != ENOENT) { + erreur_a_xtel( IMINITEL_FILE, errno ); + return; + } + /* Execution du script de connexion avec option 'start' */ + sprintf (buf, "%s/%s start", XTEL_LIBDIR, iminitel_script); +#ifdef DEBUG_XTELD + log_debug ("execute: %s", buf); +#endif + if (system (buf) != 0) { + erreur_a_xtel (buf, errno); + exit (1); + } } /* Temps maxi d'attente de connexion */ @@ -1006,6 +1063,7 @@ signal(SIGTERM, SIG_DFL); /* creation du fichier de log */ +#if 0 /* symlink attack vulnerability */ sprintf (buf, "/tmp/.xtel-%s", utilisateur); if ((fplog = fopen (buf, "w"))) { #ifdef DEBUG_XTELD @@ -1019,6 +1077,7 @@ fprintf (fplog, "SERVICE = %s\n", service); fclose (fplog); } +#endif if ((fplog= fopen(FICHIER_LOG, "a")) != NULL) { char *at; --- xtel-3.3.0.orig/xteld.man +++ xtel-3.3.0/xteld.man @@ -1,6 +1,6 @@ .\" Copyright (c) 1991-98 Lectra-Systemes .\" $Id: xteld.man,v 1.10 2001/02/11 00:11:35 pierre Exp $ -.TH XTELD n "Lectra-Systemes" "10/98" +.TH XTELD 8 "Lectra-Systemes" "10/98" .UC 5 .SH NOM xteld \- démon de l'émulateur Minitel XTEL @@ -23,7 +23,7 @@ .SH UTILISATION .LP -\fIxteld\fP utilise le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel\.services"\fP +\fIxteld\fP utilise le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel.services"\fP (sous Xfree86) qui contient la liste des services disponibles sous la forme : .sp .I "[Nom du device,]" @@ -108,7 +108,7 @@ pendant 180 secondes (tant que c'est gratuit !). Le \fITélétel3\fP est accessible à tous les utilisateurs pendant 60 secondes, l'utilisateur \fIuser2\fP y a droit pendant 120 secondes. Les connexions provenant de -'linuxbox' ne sont autorisées qu'à 'user1'. Tous les utilisateurs de 'pcwin' +"linuxbox" ne sont autorisées qu'à "user1". Tous les utilisateurs de "pcwin" ont droit au service. .PP La dernière ligne définit une possibilité de numéro de téléphone @@ -116,7 +116,7 @@ (mot\-clé \fIDirect\fP), l'utilisateur saisira directement le numéro lors de la composition dans \fIxtel\fP. .LP -On utilise également le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel\.lignes"\fP +On utilise également le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel.lignes"\fP qui définit les lignes disponibles et la procédure de composition. Ce fichier est de la forme : .sp @@ -128,7 +128,8 @@ .I "[Parité,]" .I "chat-script avec le modem" , -.I "delai maxi de réponse du modem en secondes." +.I "delai maxi de réponse du modem en secondes" +.I "[,temporisation entre commandes en millisecondes.]" .sp Et ce pour chaque ligne utilisable. Si le premier champs (nom du device) est répété sur plusieurs lignes, cela signifie que plusieurs modem physiques sont associés au @@ -157,15 +158,21 @@ comme utilisant un \fBMinitel 2\fP comme modem. .sp Si le chat-script est remplace par la chaine \fIminitel1\fP, la ligne est définie -comme utilisant un \fBMinitel 1/1B\fI comme modem. A ce moment la, le menu "Services" +comme utilisant un \fBMinitel 1/1B\fP comme modem. A ce moment la, le menu "Services" ne sera pas affiché dans xtel et l'utilisateur devra composer son numéro à la main (le M1/M1B ne sachant théoriquement pas composer de numéro). +.sp +Le champ temporisation est optionnel et peut contenir une durée (en ms) +d'attente entre l'envoi de chaque commande au modem dans la phase +d'initialisation. Il permet un meilleur support de certains anciens modems qui +n'acceptaient pas de recevoir un flot de commande trop rapide. S'il n'est pas +précisé, aucune temporisation n'est effectuée (c'est le comportement standard de \fIxteld\fP). .sp 2 .B "Exemples :" .in +10 .nf /dev/cua0,\\dat\\r OK atdt\\T\\r CONNECT,30 -v23,/dev/cua1,1200,7,E,\\dat\\r OK atdt\\T\\r CONNECT,30 +v23,/dev/cua1,1200,7,E,\\dat\\r OK atdt\\T\\r CONNECT,30,250 tvr,/dev/cua2:rtscts,9600,8,N,\\dat\\r OK atdt\\T\\r CONNECT,30 .fi .in -10 @@ -188,6 +195,12 @@ secondes maxi. Si le délai est dépassé, \fIxteld\fP essayera sur la ligne suivante du fichier jusqu'à un succès ou la fin du fichier. .sp +La ligne +.I v23 +déclare aussi une temporisation de +.I 250ms +entre chaque commande transmise au modem. +.sp .B "Remarques :" .sp Le format du chat-script accepte les séquences suivantes :