1 --- seyon-2.20c.orig/Seyon.ad
2 +++ seyon-2.20c/Seyon.ad
4 *statusBox.rng.label: RNG
10 -*quickKeyBox.Command.font: 6x10
12 -*quickKey1.visible: on
13 -*quickKey2.visible: on
14 -*quickKey3.visible: on
15 -*quickKey4.visible: on
16 -*quickKey5.visible: on
18 -!*quickKey1.action: DialEntries(1);
19 -!*quickKey2.action: DialEntries(3);
20 -!*quickKey3.action: FileTransfer(2, ou*);
21 -!*quickKey4.action: DivertFile(/tmp/lo);
22 -!*quickKey5.action: Hangup(); Beep();
23 -!RunScript(test1); Echo(ll);
25 -*quickKey1.label: Athena
26 -*quickKey2.label: Ch1
27 -*quickKey3.label: UpMail
28 -*quickKey4.label: DivMsg
29 -*quickKey5.label: Local
32 ! Fun messages. Send me more please.
36 "Have something funny? send it!" \
37 "I've fallen and I can't get up!"
39 ++*showFunMessages: off
40 *notImplemented*title: Seyon Feature
41 *notImplemented.dialog.label: \
42 This feature is not yet implemented\n\
43 --- seyon-2.20c.orig/1-CHANGES
44 +++ seyon-2.20c/1-CHANGES
46 Rolled in some obvious bug fixes from the Debian version of 2.14c:
47 * Fixed typo in Seyon.ad: s/replcae/replace
48 * Added #include <linux/serial.h> to SePort.c for Linux
49 - * Minor changes to ExecShellCommand; used to crash, should no more.
50 * Now under GPL (see 1-COPYING for details), new maintainer.
53 --- seyon-2.20c.orig/SeTerm.c
54 +++ seyon-2.20c/SeTerm.c
56 * This file contains routines for Seyon's terminal. The main routine is
57 * terminal(), which reads characters from the terminal and sends them to the
58 * port. That routine also forks a child process that reads characters from
59 - * the port and writes them to the temrinal. Once the parent receives SIGTERM
60 + * the port and writes them to the terminal. Once the parent receives SIGTERM
61 * (which should be sent by the grand parent), it kills the child and exits.
64 --- seyon-2.20c.orig/MultiList.c
65 +++ seyon-2.20c/MultiList.c
67 XfwfMultiListWidget mlw;
71 - XfwfMultiListItem *item;
73 + XfwfMultiListItem *item = NULL;
74 int ul_x,ul_y,str_x,str_y,w,h,item_index,has_item,text_h;
76 if (!XtIsRealized((Widget)mlw)) return;
77 --- seyon-2.20c.orig/SeInit.c
78 +++ seyon-2.20c/SeInit.c
82 extern void TopAbout(),
96 extern void upload_acc_ok(),
98 - manual_dial_action_ok(),
100 + setVal_action_ok(),
101 + manual_dial_action_ok(),
102 + divert_action_ok();
104 extern Boolean CvtStringToStringArray();
106 void HangupConfirm(),
116 Boolean inhibit_child = False;
122 Widget dialWidget, genericWidget;
123 pid_t w_child_pid = 0;
125 @@ -66,194 +66,202 @@
128 InitVariables(topLevel)
132 - char buffer[REG_BUF];
133 + char buffer[REG_BUF];
135 - sprintf(captureFile, "%s/%s", expand_fname(qres.defaultDirectory, buffer),
137 + expand_fname(qres.defaultDirectory, buffer, REG_BUF);
139 - SetNewlineTrMode(qres.newlineTranslation);
140 + if(REG_BUF > (1 + strlen(buffer) + strlen(qres.captureFile)))
141 + sprintf(captureFile, "%s/%s", buffer, qres.captureFile);
144 + printf("Buffer overflow in InitVariables: %s/%s\nExit\n",buffer, qres.captureFile);
148 + SetNewlineTrMode(qres.newlineTranslation);
152 SetIcon(topLevelWidget)
153 - Widget topLevelWidget;
154 + Widget topLevelWidget;
157 - XCreateBitmapFromData(XtDisplay(topLevelWidget),
158 - DefaultRootWindow(XtDisplay(topLevelWidget)),
159 - progIcon_bits, progIcon_width,
161 - XtVaSetValues(topLevelWidget, XtNiconPixmap, progIcon, NULL);
163 + XCreateBitmapFromData(XtDisplay(topLevelWidget),
164 + DefaultRootWindow(XtDisplay(topLevelWidget)),
165 + progIcon_bits, progIcon_width,
167 + XtVaSetValues(topLevelWidget, XtNiconPixmap, progIcon, NULL);
171 CreateCommandCenter()
173 - void GetQuickKeyResources(),
174 - GetValueByPopupOKAction(),
175 - DispatchActionsCallback();
177 - void KillChildProc();
184 - static Widget status[NUM_MDM_STAT];
185 - static Atom wm_delete_window;
186 - Dimension menuBoxWidth;
188 - struct _quickKeyRes quickKeyRes;
190 - char qKBuf[REG_BUF];
193 - static XtActionsRec actionTable[] = {
194 - {"UploadOk", upload_acc_ok},
195 - {"SetValOk", setVal_action_ok},
196 - {"ManualDialOk", manual_dial_action_ok},
197 - {"DivertOk", divert_action_ok},
198 - {"Exit", ExitAction},
199 - {"GetValueByPopupOK", GetValueByPopupOKAction},
202 - XtAppAddActions(XtWidgetToApplicationContext(topLevel), actionTable,
203 - XtNumber(actionTable));
205 - mainBox = SeAddPaned("mainBox", topLevel);
206 - statusBox = AddBox("statusBox", mainBox);
207 - messageBox = SeAddForm("messageBox", mainBox);
208 - quickKeyBox = AddBox("quickKeyBox", mainBox);
209 - menuBox = AddBox("menuBox", mainBox);
211 - status[0] = SeAddToggle("dcd", statusBox, NULL);
212 - status[1] = SeAddToggle("dtr", statusBox, NULL);
213 - status[2] = SeAddToggle("dsr", statusBox, NULL);
214 - status[3] = SeAddToggle("rts", statusBox, NULL);
215 - status[4] = SeAddToggle("cts", statusBox, NULL);
216 - status[5] = SeAddToggle("rng", statusBox, NULL);
218 - statusMessage = SeAddLabel("message", messageBox);
220 - AddButton("about", menuBox, TopAbout, NULL);
221 - AddButton("help", menuBox, TopHelp, NULL);
222 - AddButton("set", menuBox, TopSet, NULL);
223 - genericWidget = dialWidget = AddButton("dial", menuBox, TopDial, NULL);
224 - AddButton("transfer", menuBox, TopTransfer, NULL);
225 - AddButton("shellCommand", menuBox, TopShell, NULL);
226 - AddButton("misc", menuBox, TopMisc, NULL);
227 - AddButton("hangup", menuBox, HangupConfirm, NULL);
228 - w_exit = AddButton("exit", menuBox, ExitConfirm, NULL);
229 - w_kill = AddButton("kill", menuBox, KillChildProc, NULL);
231 - for (i = 0; i < MAX_SEQUICKKEYS; i++) {
232 - sprintf(qKBuf, "quickKey%d", i+1);
233 - GetQuickKeyResources(qKBuf, &quickKeyRes);
234 - if (quickKeyRes.visible) {
236 + void GetQuickKeyResources(),
237 + GetValueByPopupOKAction(),
238 + DispatchActionsCallback();
240 + void KillChildProc();
247 + static Widget status[NUM_MDM_STAT];
248 + static Atom wm_delete_window;
249 + Dimension menuBoxWidth;
251 + struct _quickKeyRes quickKeyRes;
253 + char qKBuf[LRG_BUF];
256 + static XtActionsRec actionTable[] = {
257 + {"UploadOk", upload_acc_ok},
258 + {"SetValOk", setVal_action_ok},
259 + {"ManualDialOk", manual_dial_action_ok},
260 + {"DivertOk", divert_action_ok},
261 + {"Exit", ExitAction},
262 + {"GetValueByPopupOK", GetValueByPopupOKAction},
265 + XtAppAddActions(XtWidgetToApplicationContext(topLevel), actionTable,
266 + XtNumber(actionTable));
268 + mainBox = SeAddPaned("mainBox", topLevel);
269 + statusBox = AddBox("statusBox", mainBox);
270 + messageBox = SeAddForm("messageBox", mainBox);
271 + quickKeyBox = AddBox("quickKeyBox", mainBox);
272 + menuBox = AddBox("menuBox", mainBox);
274 + status[0] = SeAddToggle("dcd", statusBox, NULL);
275 + status[1] = SeAddToggle("dtr", statusBox, NULL);
276 + status[2] = SeAddToggle("dsr", statusBox, NULL);
277 + status[3] = SeAddToggle("rts", statusBox, NULL);
278 + status[4] = SeAddToggle("cts", statusBox, NULL);
279 + status[5] = SeAddToggle("rng", statusBox, NULL);
281 + statusMessage = SeAddLabel("message", messageBox);
283 + AddButton("about", menuBox, TopAbout, NULL);
284 + AddButton("help", menuBox, TopHelp, NULL);
285 + AddButton("set", menuBox, TopSet, NULL);
286 + genericWidget = dialWidget = AddButton("dial", menuBox, TopDial, NULL);
287 + AddButton("transfer", menuBox, TopTransfer, NULL);
288 + AddButton("shellCommand", menuBox, TopShell, NULL);
289 + AddButton("misc", menuBox, TopMisc, NULL);
290 + AddButton("hangup", menuBox, HangupConfirm, NULL);
291 + w_exit = AddButton("exit", menuBox, ExitConfirm, NULL);
292 + w_kill = AddButton("kill", menuBox, KillChildProc, NULL);
294 + for (i = 0; i < MAX_SEQUICKKEYS; i++) {
295 + sprintf(qKBuf, "quickKey%d", i+1); /* qKBuf is large enough here... */
296 + GetQuickKeyResources(qKBuf, &quickKeyRes);
297 + if (quickKeyRes.visible) {
300 - AddButton(qKBuf, quickKeyBox, DispatchActionsCallback, NULL);
303 - if (n == 0) XtDestroyWidget(quickKeyBox);
305 - XtOverrideTranslations(topLevel,
306 - XtParseTranslationTable("<Message>WM_PROTOCOLS: Exit()"));
308 - /* Call UpdateStatusBox() before realizing the top-level widget so that
309 - the status widget array in that function would be properly initialized
310 - before the user is able to call hangup(), since the latter passes NULL
311 - to UpdateStatusBox() */
312 - UpdateStatusBox((XtPointer)status);
314 - XtSetMappedWhenManaged(topLevel, False);
315 - XtRealizeWidget(topLevel);
316 - XtVaGetValues(menuBox, XtNwidth, &menuBoxWidth, NULL);
317 - XtVaSetValues(statusBox, XtNwidth, menuBoxWidth, NULL);
318 - if (n) XtVaSetValues(quickKeyBox, XtNwidth, menuBoxWidth, NULL);
321 - * (ideally one should not assume any fixed numbers, but this will do
324 - * width of message box = label width
325 - * + 2*border width (2*1)
326 - * + defaultDistance (right) (1)
327 - * + horizDistance (left) (4)
329 - * desired width of label = width of menu box
330 - * - hSpace of menu box (2*4) (to align with buttons)
331 - * - border with of label (2*1)
332 - * = width of menu box - 10
334 - * => width of message box = width of menu box - 10 + 7
335 - * => width of message box < width of menu box
336 - * => menu box width is the controlling factor in deciding the widnow
337 - * width, as desired.
339 - XtVaSetValues(statusMessage, XtNresizable, True, NULL);
340 - XtVaSetValues(statusMessage, XtNwidth, menuBoxWidth - 10, NULL);
341 - XtVaSetValues(statusMessage, XtNresizable, False, NULL);
343 - wm_delete_window = XInternAtom(XtDisplay(topLevel),
344 - "WM_DELETE_WINDOW", False);
345 - XSetWMProtocols(XtDisplay(topLevel), XtWindow(topLevel),
346 - &wm_delete_window, 1);
347 + AddButton(qKBuf, quickKeyBox, DispatchActionsCallback, NULL);
350 + if (n == 0) XtDestroyWidget(quickKeyBox);
352 + XtOverrideTranslations(topLevel,
353 + XtParseTranslationTable("<Message>WM_PROTOCOLS: Exit()"));
355 + /* Call UpdateStatusBox() before realizing the top-level widget so that
356 + the status widget array in that function would be properly initialized
357 + before the user is able to call hangup(), since the latter passes NULL
358 + to UpdateStatusBox() */
359 + UpdateStatusBox((XtPointer)status);
361 + XtSetMappedWhenManaged(topLevel, False);
362 + XtRealizeWidget(topLevel);
363 + XtVaGetValues(menuBox, XtNwidth, &menuBoxWidth, NULL);
364 + XtVaSetValues(statusBox, XtNwidth, menuBoxWidth, NULL);
365 + if (n) XtVaSetValues(quickKeyBox, XtNwidth, menuBoxWidth, NULL);
368 + * (ideally one should not assume any fixed numbers, but this will do
371 + * width of message box = label width
372 + * + 2*border width (2*1)
373 + * + defaultDistance (right) (1)
374 + * + horizDistance (left) (4)
376 + * desired width of label = width of menu box
377 + * - hSpace of menu box (2*4) (to align with buttons)
378 + * - border with of label (2*1)
379 + * = width of menu box - 10
381 + * => width of message box = width of menu box - 10 + 7
382 + * => width of message box < width of menu box
383 + * => menu box width is the controlling factor in deciding the widnow
384 + * width, as desired.
386 + XtVaSetValues(statusMessage, XtNresizable, True, NULL);
387 + XtVaSetValues(statusMessage, XtNwidth, menuBoxWidth - 10, NULL);
388 + XtVaSetValues(statusMessage, XtNresizable, False, NULL);
390 + wm_delete_window = XInternAtom(XtDisplay(topLevel),
391 + "WM_DELETE_WINDOW", False);
392 + XSetWMProtocols(XtDisplay(topLevel), XtWindow(topLevel),
393 + &wm_delete_window, 1);
411 - char msgStr[LRG_BUF];
422 + char msgStr[LRG_BUF];
425 - popup = SeAddPopup("about", parent);
426 - mBox = SeAddPaned("mBox", popup);
427 - uBox = SeAddBox("uBox", mBox);
428 - lBox = SeAddBox("lBox", mBox);
430 - msg = SeAddLabel("msg", uBox);
431 - pic = SeAddLabel("pic", uBox);
432 - caption = SeAddLabel("caption", uBox);
433 + popup = SeAddPopup("about", parent);
434 + mBox = SeAddPaned("mBox", popup);
435 + uBox = SeAddBox("uBox", mBox);
436 + lBox = SeAddBox("lBox", mBox);
438 + msg = SeAddLabel("msg", uBox);
439 + pic = SeAddLabel("pic", uBox);
440 + caption = SeAddLabel("caption", uBox);
442 - sprintf(msgStr, "%s %s rev. %s\n%s\n%s\n%s", "Seyon version", VERSION,
443 + /* msgStr is big enough here */
444 + sprintf(msgStr, "%s %s rev. %s\n%s\n%s\n%s", "Seyon version", VERSION,
445 REVISION, "Copyright 1992-1993", "(c) Muhammad M. Saggaf",
446 "All rights reserved");
447 - XtVaSetValues(msg, XtNlabel, msgStr, NULL);
448 + XtVaSetValues(msg, XtNlabel, msgStr, NULL);
450 - pix = XCreateBitmapFromData(XtDisplay(pic),
451 - DefaultRootWindow(XtDisplay(pic)),
452 - authPic_bits, authPic_width,
454 - XtVaSetValues(pic, XtNbitmap, pix, NULL);
456 - width1 = SeWidgetWidth(msg);
457 - width2 = SeWidgetWidth(pic);
458 - width1 = width1 > width2 ? width1 : width2;
459 - width2 = SeWidgetWidth(caption);
460 - width1 = width1 > width2 ? width1 : width2;
462 - XtVaSetValues(msg, XtNwidth, width1, NULL);
463 - XtVaSetValues(pic, XtNwidth, width1, NULL);
464 - XtVaSetValues(caption, XtNwidth, width1, NULL);
465 + pix = XCreateBitmapFromData(XtDisplay(pic),
466 + DefaultRootWindow(XtDisplay(pic)),
467 + authPic_bits, authPic_width,
469 + XtVaSetValues(pic, XtNbitmap, pix, NULL);
471 + width1 = SeWidgetWidth(msg);
472 + width2 = SeWidgetWidth(pic);
473 + width1 = width1 > width2 ? width1 : width2;
474 + width2 = SeWidgetWidth(caption);
475 + width1 = width1 > width2 ? width1 : width2;
477 + XtVaSetValues(msg, XtNwidth, width1, NULL);
478 + XtVaSetValues(pic, XtNwidth, width1, NULL);
479 + XtVaSetValues(caption, XtNwidth, width1, NULL);
481 - SeAddButton("dismiss", lBox, DestroyShell);
482 + SeAddButton("dismiss", lBox, DestroyShell);
484 - XtPopupSpringLoaded(popup);
485 + XtPopupSpringLoaded(popup);
489 @@ -262,151 +270,151 @@
496 - Widget DoDisplayFile();
497 - Widget displayPopup;
498 + Widget DoDisplayFile();
499 + Widget displayPopup;
501 - XtVaSetValues(widget, XtNsensitive, False, NULL);
502 - displayPopup = DoDisplayFile(widget, qres.helpFile);
503 - XtAddCallback(displayPopup, XtNdestroyCallback, SetSensitiveOn, widget);
504 + XtVaSetValues(widget, XtNsensitive, False, NULL);
505 + displayPopup = DoDisplayFile(widget, qres.helpFile);
506 + XtAddCallback(displayPopup, XtNdestroyCallback, SetSensitiveOn, widget);
508 - PositionShell(displayPopup, widget, SHELLPOS_HWFH);
509 - XtPopup(displayPopup, XtGrabNone);
510 + PositionShell(displayPopup, widget, SHELLPOS_HWFH);
511 + XtPopup(displayPopup, XtGrabNone);
518 - SeyonMessage("Line Disconnected");
520 + SeyonMessage("Line Disconnected");
528 - DestroyShell(widget);
530 + DestroyShell(widget);
535 HangupConfirm(widget)
547 - if (qres.hangupConfirm) {
548 - popup = AddSimplePopup("hangup", widget);
549 - dialog = SeAddDialog("dialog", popup);
550 + if (qres.hangupConfirm) {
551 + popup = AddSimplePopup("hangup", widget);
552 + dialog = SeAddDialog("dialog", popup);
554 - XawDialogAddButton(dialog, "yes", DoHangup, (XtPointer) dialog);
555 - XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
556 + XawDialogAddButton(dialog, "yes", DoHangup, (XtPointer) dialog);
557 + XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
559 - PopupCentered(popup, widget);
563 + PopupCentered(popup, widget);
574 - DestroyShell(widget);
576 + DestroyShell(widget);
586 - ExitNoHangup(widget);
588 + ExitNoHangup(widget);
601 - if (qres.exitConfirm && !qres.ignoreModemDCD && Online()) {
602 - popup = AddSimplePopup("exit", widget);
603 - dialog = SeAddDialog("dialog", popup);
604 + if (qres.exitConfirm && !qres.ignoreModemDCD && Online()) {
605 + popup = AddSimplePopup("exit", widget);
606 + dialog = SeAddDialog("dialog", popup);
608 - XawDialogAddButton(dialog, "yes", ExitHangup, NULL);
609 - XawDialogAddButton(dialog, "no", ExitNoHangup, NULL);
610 - XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
611 + XawDialogAddButton(dialog, "yes", ExitHangup, NULL);
612 + XawDialogAddButton(dialog, "no", ExitNoHangup, NULL);
613 + XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
615 - PopupCentered(popup, widget);
619 + PopupCentered(popup, widget);
630 - Boolean wExitButtonStatus;
631 + Boolean wExitButtonStatus;
633 - /* Prevent the user from exiting the program by f.delete if exiting
634 - is not permitted */
635 - XtVaGetValues(w_exit, XtNsensitive, &wExitButtonStatus, NULL);
636 - ReturnIfTrue(!wExitButtonStatus);
638 + /* Prevent the user from exiting the program by f.delete if exiting
639 + is not permitted */
640 + XtVaGetValues(w_exit, XtNsensitive, &wExitButtonStatus, NULL);
641 + ReturnIfTrue(!wExitButtonStatus);
646 w_exit_up(w_exit_status)
647 - Boolean w_exit_status;
648 + Boolean w_exit_status;
650 - XtVaSetValues(w_exit, XtNsensitive, w_exit_status, NULL);
651 + XtVaSetValues(w_exit, XtNsensitive, w_exit_status, NULL);
655 SetKillButtonSens(killWidgetStatus)
656 - Boolean killWidgetStatus;
657 + Boolean killWidgetStatus;
659 - XtVaSetValues(w_kill, XtNsensitive, killWidgetStatus, NULL);
660 - w_exit_up(!killWidgetStatus);
661 + XtVaSetValues(w_kill, XtNsensitive, killWidgetStatus, NULL);
662 + w_exit_up(!killWidgetStatus);
666 w_kill_up(w_kill_status)
667 - Boolean w_kill_status;
668 + Boolean w_kill_status;
670 - SetKillButtonSens(w_kill_status);
671 + SetKillButtonSens(w_kill_status);
677 - if (w_child_pid == 0) return;
678 - if (kill(w_child_pid, SIGTERM) == 0) w_child_pid = 0;
679 + if (w_child_pid == 0) return;
680 + if (kill(w_child_pid, SIGTERM) == 0) w_child_pid = 0;
684 GetQuickKeyResources(quickKeyName, quickKeyRes)
685 - String quickKeyName;
686 - struct _quickKeyRes *quickKeyRes;
687 + String quickKeyName;
688 + struct _quickKeyRes *quickKeyRes;
690 #define offset(field) XtOffsetOf(struct _quickKeyRes, field)
691 - static XtResource resources[] = {
692 - {"visible", "Visible", XtRBoolean, sizeof(Boolean),
693 - offset(visible), XtRImmediate, (XtPointer)False},
694 - {"action", "Action", XtRString, sizeof(String),
695 - offset(action), XtRString, (XtPointer)""},
697 + static XtResource resources[] = {
698 + {"visible", "Visible", XtRBoolean, sizeof(Boolean),
699 + offset(visible), XtRImmediate, (XtPointer)False},
700 + {"action", "Action", XtRString, sizeof(String),
701 + offset(action), XtRString, (XtPointer)""},
705 - XtGetSubresources(topLevel, (XtPointer)quickKeyRes, quickKeyName, "Command",
706 - resources, XtNumber(resources), NULL, 0);
707 + XtGetSubresources(topLevel, (XtPointer)quickKeyRes, quickKeyName, "Command",
708 + resources, XtNumber(resources), NULL, 0);
712 @@ -414,140 +422,140 @@
714 #define offset(field) XtOffsetOf(struct QueryResources, field)
716 - static XtResource resources[] = {
717 - {"modems", "Modems", XtRString, sizeof(String),
718 - offset(modems), XtRString, (XtPointer)""},
719 - {"script", "Script", XtRString, sizeof(String),
720 - offset(script), XtRString, (XtPointer) NULL},
721 + static XtResource resources[] = {
722 + {"modems", "Modems", XtRString, sizeof(String),
723 + offset(modems), XtRString, (XtPointer)""},
724 + {"script", "Script", XtRString, sizeof(String),
725 + offset(script), XtRString, (XtPointer) NULL},
727 - {"defaultBPS", "DefaultBPS", XtRString, sizeof(String),
728 - offset(defaultBPS), XtRString, (XtPointer) "9600"},
729 - {"defaultBits", "DefaultBits", XtRInt, sizeof(int),
730 - offset(defaultBits), XtRImmediate, (XtPointer) 8},
731 - {"defaultParity", "DefaultParity", XtRInt, sizeof(int),
732 - offset(defaultParity), XtRImmediate, (XtPointer) 0},
733 - {"defaultStopBits", "DefaultStopBits", XtRInt, sizeof(int),
734 - offset(defaultStopBits), XtRImmediate, (XtPointer) 1},
735 - {"stripHighBit", "StripHighBit", XtRBoolean, sizeof(Boolean),
736 - offset(stripHighBit), XtRImmediate, (XtPointer) False},
737 - {"backspaceTranslation", "BackspaceTranslation", XtRBoolean,
738 - sizeof(Boolean), offset(backspaceTranslation), XtRImmediate,
739 - (XtPointer) False},
740 - {"metaKeyTranslation", "MetaKeyTranslation", XtRBoolean,
741 - sizeof(Boolean), offset(metaKeyTranslation), XtRImmediate,
743 - {"xonxoffFlowControl", "XonxoffFlowControl", XtRBoolean,
744 - sizeof(Boolean), offset(xonxoffFlowControl), XtRImmediate,
745 - (XtPointer) False},
746 - {"rtsctsFlowControl", "RtsctsFlowControl", XtRBoolean,
747 - sizeof(Boolean), offset(rtsctsFlowControl), XtRImmediate,
748 - (XtPointer) False},
749 - {"newlineTranslation", "NewlineTranslation", XtRString,
750 - sizeof(String), offset(newlineTranslation), XtRImmediate,
753 - {"dialPrefix", "DialPrefix", XtRString, sizeof(String),
754 - offset(dialPrefix), XtRString, (XtPointer) "ATDT"},
755 - {"dialSuffix", "DialSuffix", XtRString, sizeof(String),
756 - offset(dialSuffix), XtRString, (XtPointer) "^M"},
757 - {"dialCancelString", "DialCancelString", XtRString, sizeof(String),
758 - offset(dialCancelString), XtRString, (XtPointer) "^M"},
760 - {"dialTimeOut", "DialTimeOut", XtRInt, sizeof(int),
761 - offset(dialTimeOut), XtRImmediate, (XtPointer) 45},
762 - {"dialDelay", "DialDelay", XtRInt, sizeof(int),
763 - offset(dialDelay), XtRImmediate, (XtPointer) 10},
764 - {"dialRepeat", "DialRepeat", XtRInt, sizeof(int),
765 - offset(dialRepeat), XtRImmediate, (XtPointer) 5},
767 - {"connectString", "ConnectString", XtRString, sizeof(String),
768 - offset(connectString), XtRString, (XtPointer) "CONNECT"},
769 - {"noConnectString1", "NoConnectString1", XtRString, sizeof(String),
770 - offset(noConnectString[0]), XtRString, (XtPointer) "NO CARRIER"},
771 - {"noConnectString2", "NoConnectString2", XtRString, sizeof(String),
772 - offset(noConnectString[1]), XtRString, (XtPointer) "NO DIALTONE"},
773 - {"noConnectString3", "NoConnectString3", XtRString, sizeof(String),
774 - offset(noConnectString[2]), XtRString, (XtPointer) "BUSY"},
775 - {"noConnectString4", "NoConnectString4", XtRString, sizeof(String),
776 - offset(noConnectString[3]), XtRString, (XtPointer) "VOICE"},
778 - {"hangupBeforeDial", "HangupBeforeDial", XtRBoolean, sizeof(Boolean),
779 - offset(hangupBeforeDial), XtRImmediate, (XtPointer)True},
780 - {"dialAutoStart", "DialAutoStart", XtRBoolean, sizeof(Boolean),
781 - offset(dialAutoStart), XtRImmediate, (XtPointer)False},
782 - {"dialDirFormat", "DialDirFormat", XtRString, sizeof(String),
783 - offset(dialDirFormat), XtRString,
784 - (XtPointer)"%-15s %-15s %6s %1c%1c%1c %1c%1c %s"},
785 - {"defaultPhoneEntries", "DefaultPhoneEntries", XtRString, sizeof(String),
786 - offset(defaultPhoneEntries), XtRString, (XtPointer)NULL},
788 - {"startupAction", "StartupAction", XtRString, sizeof(String),
789 - offset(startupAction), XtRString,
790 - (XtPointer)"RunScript(startup);"},
791 - {"postConnectAction", "PostConnectAction", XtRString, sizeof(String),
792 - offset(postConnectAction), XtRString, (XtPointer)"Beep();"},
794 - {"autoZmodem", "AutoZmodem", XtRBoolean, sizeof(Boolean),
795 - offset(autoZmodem), XtRImmediate, (XtPointer)True},
796 - {"autoZmodemAction", "AutoZmodemAction", XtRString, sizeof(String),
797 - offset(autoZmodemAction), XtRString,
798 - (XtPointer)"ShellCommand($rz);"},
800 - {"modemVMin", "ModemVMin", XtRInt, sizeof(int),
801 - offset(modemVMin), XtRImmediate, (XtPointer) 1},
802 - {"ignoreModemDCD", "IgnoreModemDCD", XtRBoolean, sizeof(Boolean),
803 - offset(ignoreModemDCD), XtRImmediate, (XtPointer) False},
804 - {"hangupViaDTR", "HangupViaDTR", XtRBoolean, sizeof(Boolean),
805 - offset(hangupViaDTR), XtRImmediate, (XtPointer)False},
806 - {"modemAttentionString", "ModemAttentionString", XtRString, sizeof(String),
807 - offset(modemAttentionString), XtRString, (XtPointer)"+++"},
808 - {"modemHangupString", "ModemHangupString", XtRString, sizeof(String),
809 - offset(modemHangupString), XtRString, (XtPointer)"ATH^M"},
810 - {"hangupConfirm", "HangupConfirm", XtRBoolean, sizeof(Boolean),
811 - offset(hangupConfirm), XtRImmediate, (XtPointer) True},
812 - {"exitConfirm", "ExitConfirm", XtRBoolean, sizeof(Boolean),
813 - offset(exitConfirm), XtRImmediate, (XtPointer) True},
814 - {"neverBeep", "NeverBeep", XtRBoolean, sizeof(Boolean),
815 - offset(neverBeep), XtRImmediate, (XtPointer)False},
817 - {"defaultDirectory", "DefaultDirectory", XtRString, sizeof(String),
818 - offset(defaultDirectory), XtRString, (XtPointer) "~/.seyon"},
819 - {"scriptDirectory", "scriptDirectory", XtRString, sizeof(String),
820 - offset(scriptDirectory), XtRString, (XtPointer) NULL},
821 - {"startupFile", "StartupFile", XtRString, sizeof(String),
822 - offset(startupFile), XtRString, (XtPointer) "startup"},
823 - {"phoneFile", "PhoneFile", XtRString, sizeof(String),
824 - offset(phoneFile), XtRString, (XtPointer) "phonelist"},
825 - {"protocolsFile", "ProtocolsFile", XtRString, sizeof(String),
826 - offset(protocolsFile), XtRString, (XtPointer) "protocols"},
827 - {"captureFile", "CaptureFile", XtRString, sizeof(String),
828 - offset(captureFile), XtRString, (XtPointer) "capture"},
829 - {"helpFile", "HelpFile", XtRString, sizeof(String),
830 - offset(helpFile), XtRString, (XtPointer) HELPFILE},
832 - {"modemStatusInterval", "ModemStatusInterval", XtRInt, sizeof(int),
833 - offset(modemStatusInterval), XtRImmediate, (XtPointer) 5},
835 - {"idleGuard", "IdleGuard", XtRBoolean, sizeof(Boolean),
836 - offset(idleGuard), XtRImmediate, (XtPointer) False},
837 - {"idleGuardInterval", "IdleGuardInterval", XtRInt, sizeof(int),
838 - offset(idleGuardInterval), XtRImmediate, (XtPointer) 300},
839 - {"idleGuardString", "IdleGuardString", XtRString, sizeof(String),
840 - offset(idleGuardString), XtRImmediate, (XtPointer) " ^H"},
842 - {"showFunMessages", "ShowFunMessages", XtRBoolean, sizeof(Boolean),
843 - offset(showFunMessages), XtRImmediate, (XtPointer) True},
844 - {"funMessagesInterval", "FunMessagesInterval", XtRInt, sizeof(int),
845 - offset(funMessagesInterval), XtRImmediate, (XtPointer) 15},
846 - {"funMessages", "FunMessages", XtRStringArray, sizeof(String*),
847 - offset(funMessages), XtRStringArray, (XtPointer) NULL},
849 + {"defaultBPS", "DefaultBPS", XtRString, sizeof(String),
850 + offset(defaultBPS), XtRString, (XtPointer) "9600"},
851 + {"defaultBits", "DefaultBits", XtRInt, sizeof(int),
852 + offset(defaultBits), XtRImmediate, (XtPointer) 8},
853 + {"defaultParity", "DefaultParity", XtRInt, sizeof(int),
854 + offset(defaultParity), XtRImmediate, (XtPointer) 0},
855 + {"defaultStopBits", "DefaultStopBits", XtRInt, sizeof(int),
856 + offset(defaultStopBits), XtRImmediate, (XtPointer) 1},
857 + {"stripHighBit", "StripHighBit", XtRBoolean, sizeof(Boolean),
858 + offset(stripHighBit), XtRImmediate, (XtPointer) False},
859 + {"backspaceTranslation", "BackspaceTranslation", XtRBoolean,
860 + sizeof(Boolean), offset(backspaceTranslation), XtRImmediate,
861 + (XtPointer) False},
862 + {"metaKeyTranslation", "MetaKeyTranslation", XtRBoolean,
863 + sizeof(Boolean), offset(metaKeyTranslation), XtRImmediate,
865 + {"xonxoffFlowControl", "XonxoffFlowControl", XtRBoolean,
866 + sizeof(Boolean), offset(xonxoffFlowControl), XtRImmediate,
867 + (XtPointer) False},
868 + {"rtsctsFlowControl", "RtsctsFlowControl", XtRBoolean,
869 + sizeof(Boolean), offset(rtsctsFlowControl), XtRImmediate,
870 + (XtPointer) False},
871 + {"newlineTranslation", "NewlineTranslation", XtRString,
872 + sizeof(String), offset(newlineTranslation), XtRImmediate,
875 + {"dialPrefix", "DialPrefix", XtRString, sizeof(String),
876 + offset(dialPrefix), XtRString, (XtPointer) "ATDT"},
877 + {"dialSuffix", "DialSuffix", XtRString, sizeof(String),
878 + offset(dialSuffix), XtRString, (XtPointer) "^M"},
879 + {"dialCancelString", "DialCancelString", XtRString, sizeof(String),
880 + offset(dialCancelString), XtRString, (XtPointer) "^M"},
882 + {"dialTimeOut", "DialTimeOut", XtRInt, sizeof(int),
883 + offset(dialTimeOut), XtRImmediate, (XtPointer) 45},
884 + {"dialDelay", "DialDelay", XtRInt, sizeof(int),
885 + offset(dialDelay), XtRImmediate, (XtPointer) 10},
886 + {"dialRepeat", "DialRepeat", XtRInt, sizeof(int),
887 + offset(dialRepeat), XtRImmediate, (XtPointer) 5},
889 + {"connectString", "ConnectString", XtRString, sizeof(String),
890 + offset(connectString), XtRString, (XtPointer) "CONNECT"},
891 + {"noConnectString1", "NoConnectString1", XtRString, sizeof(String),
892 + offset(noConnectString[0]), XtRString, (XtPointer) "NO CARRIER"},
893 + {"noConnectString2", "NoConnectString2", XtRString, sizeof(String),
894 + offset(noConnectString[1]), XtRString, (XtPointer) "NO DIALTONE"},
895 + {"noConnectString3", "NoConnectString3", XtRString, sizeof(String),
896 + offset(noConnectString[2]), XtRString, (XtPointer) "BUSY"},
897 + {"noConnectString4", "NoConnectString4", XtRString, sizeof(String),
898 + offset(noConnectString[3]), XtRString, (XtPointer) "VOICE"},
900 + {"hangupBeforeDial", "HangupBeforeDial", XtRBoolean, sizeof(Boolean),
901 + offset(hangupBeforeDial), XtRImmediate, (XtPointer)True},
902 + {"dialAutoStart", "DialAutoStart", XtRBoolean, sizeof(Boolean),
903 + offset(dialAutoStart), XtRImmediate, (XtPointer)False},
904 + {"dialDirFormat", "DialDirFormat", XtRString, sizeof(String),
905 + offset(dialDirFormat), XtRString,
906 + (XtPointer)"%-15s %-15s %6s %1c%1c%1c %1c%1c %s"},
907 + {"defaultPhoneEntries", "DefaultPhoneEntries", XtRString, sizeof(String),
908 + offset(defaultPhoneEntries), XtRString, (XtPointer)NULL},
910 + {"startupAction", "StartupAction", XtRString, sizeof(String),
911 + offset(startupAction), XtRString,
912 + (XtPointer)"RunScript(startup);"},
913 + {"postConnectAction", "PostConnectAction", XtRString, sizeof(String),
914 + offset(postConnectAction), XtRString, (XtPointer)"Beep();"},
916 + {"autoZmodem", "AutoZmodem", XtRBoolean, sizeof(Boolean),
917 + offset(autoZmodem), XtRImmediate, (XtPointer)True},
918 + {"autoZmodemAction", "AutoZmodemAction", XtRString, sizeof(String),
919 + offset(autoZmodemAction), XtRString,
920 + (XtPointer)"ShellCommand($rz);"},
922 + {"modemVMin", "ModemVMin", XtRInt, sizeof(int),
923 + offset(modemVMin), XtRImmediate, (XtPointer) 1},
924 + {"ignoreModemDCD", "IgnoreModemDCD", XtRBoolean, sizeof(Boolean),
925 + offset(ignoreModemDCD), XtRImmediate, (XtPointer) False},
926 + {"hangupViaDTR", "HangupViaDTR", XtRBoolean, sizeof(Boolean),
927 + offset(hangupViaDTR), XtRImmediate, (XtPointer)False},
928 + {"modemAttentionString", "ModemAttentionString", XtRString, sizeof(String),
929 + offset(modemAttentionString), XtRString, (XtPointer)"+++"},
930 + {"modemHangupString", "ModemHangupString", XtRString, sizeof(String),
931 + offset(modemHangupString), XtRString, (XtPointer)"ATH^M"},
932 + {"hangupConfirm", "HangupConfirm", XtRBoolean, sizeof(Boolean),
933 + offset(hangupConfirm), XtRImmediate, (XtPointer) True},
934 + {"exitConfirm", "ExitConfirm", XtRBoolean, sizeof(Boolean),
935 + offset(exitConfirm), XtRImmediate, (XtPointer) True},
936 + {"neverBeep", "NeverBeep", XtRBoolean, sizeof(Boolean),
937 + offset(neverBeep), XtRImmediate, (XtPointer)False},
939 + {"defaultDirectory", "DefaultDirectory", XtRString, sizeof(String),
940 + offset(defaultDirectory), XtRString, (XtPointer) "~/.seyon"},
941 + {"scriptDirectory", "scriptDirectory", XtRString, sizeof(String),
942 + offset(scriptDirectory), XtRString, (XtPointer) NULL},
943 + {"startupFile", "StartupFile", XtRString, sizeof(String),
944 + offset(startupFile), XtRString, (XtPointer) "startup"},
945 + {"phoneFile", "PhoneFile", XtRString, sizeof(String),
946 + offset(phoneFile), XtRString, (XtPointer) "phonelist"},
947 + {"protocolsFile", "ProtocolsFile", XtRString, sizeof(String),
948 + offset(protocolsFile), XtRString, (XtPointer) "protocols"},
949 + {"captureFile", "CaptureFile", XtRString, sizeof(String),
950 + offset(captureFile), XtRString, (XtPointer) "capture"},
951 + {"helpFile", "HelpFile", XtRString, sizeof(String),
952 + offset(helpFile), XtRString, (XtPointer) HELPFILE},
954 + {"modemStatusInterval", "ModemStatusInterval", XtRInt, sizeof(int),
955 + offset(modemStatusInterval), XtRImmediate, (XtPointer) 5},
957 + {"idleGuard", "IdleGuard", XtRBoolean, sizeof(Boolean),
958 + offset(idleGuard), XtRImmediate, (XtPointer) False},
959 + {"idleGuardInterval", "IdleGuardInterval", XtRInt, sizeof(int),
960 + offset(idleGuardInterval), XtRImmediate, (XtPointer) 300},
961 + {"idleGuardString", "IdleGuardString", XtRString, sizeof(String),
962 + offset(idleGuardString), XtRImmediate, (XtPointer) " ^H"},
964 + {"showFunMessages", "ShowFunMessages", XtRBoolean, sizeof(Boolean),
965 + offset(showFunMessages), XtRImmediate, (XtPointer) True},
966 + {"funMessagesInterval", "FunMessagesInterval", XtRInt, sizeof(int),
967 + offset(funMessagesInterval), XtRImmediate, (XtPointer) 15},
968 + {"funMessages", "FunMessages", XtRStringArray, sizeof(String*),
969 + offset(funMessages), XtRStringArray, (XtPointer) NULL},
974 - XtSetTypeConverter(XtRString, XtRStringArray, CvtStringToStringArray,
975 - NULL, 0, XtCacheNone, NULL);
976 + XtSetTypeConverter(XtRString, XtRStringArray, CvtStringToStringArray,
977 + NULL, 0, XtCacheNone, NULL);
979 - XtGetApplicationResources(topLevel, (XtPointer)&qres, resources,
980 - XtNumber(resources), NULL, 0);
981 + XtGetApplicationResources(topLevel, (XtPointer)&qres, resources,
982 + XtNumber(resources), NULL, 0);
984 --- seyon-2.20c.orig/SeDial.c
985 +++ seyon-2.20c/SeDial.c
987 {XMapRaised(XtDisplay(widget), XtWindow(popup)); return;}
989 if (disItems[0] == NULL) {
990 - strcpy(phoneFile, qres.phoneFile);
991 + strncpy(phoneFile, qres.phoneFile, REG_BUF);
992 if (ReadParsePhoneFile(phoneFile, disItems) < 0) return;
994 form = XtParent(widget);
996 Widget dialog = XtParent(widget);
997 char phoneNumber[SM_BUF];
999 - strcpy(phoneNumber, XawDialogGetValueString(dialog));
1000 + strncpy(phoneNumber, XawDialogGetValueString(dialog), SM_BUF);
1001 DestroyShell(dialog);
1002 ExecManualDial(XtParent(GetShell(widget)), phoneNumber);
1005 inhibit_child = True;
1008 - strcpy(phone_number, phoneNumber);
1009 + strncpy(phone_number, phoneNumber, SM_BUF);
1013 @@ -442,15 +442,15 @@
1014 if ((ptr = (char*)strstr(raw, keyword)) != NULL) {
1015 ptr += strlen(keyword);
1016 if (strncmp(ptr, "CURRENT", 3)) {
1018 + strncpy(buf, ptr, REG_BUF);
1021 + strncpy(var, wrd, sizeof(*var));
1024 - strcpy(var, "CURRENT");
1025 + strncpy(var, "CURRENT", sizeof(*var));
1029 + strncpy(var, def, sizeof(*var));
1037 - sprintf(svar, "%d", *var);
1038 - sprintf(sdef, "%d", def);
1039 + sprintf(svar, "%d", *var); /* safe */
1040 + sprintf(sdef, "%d", def); /* safe */
1042 GetStrField(raw, keyword, svar, sdef);
1046 signal(SIGALRM, SIG_DFL);
1048 - strcpy(dialMsg, "TIMEOUT");
1049 + strncpy(dialMsg, "TIMEOUT", SM_BUF);
1050 longjmp(dial_env, 1);
1055 dialString[REG_BUF];
1061 if (setjmp(dial_env) != 0) {
1065 itemName = ddItems[k]->name;
1066 - sprintf(dialString, "\r%s %s%s", ddItems[k]->prefix, ddItems[k]->number,
1067 - ddItems[k]->suffix);
1068 + strncpy(dialString, FmtString("\r%s %s%s", ddItems[k]->prefix,
1069 + ddItems[k]->number, ddItems[k]->suffix), REG_BUF);
1071 if (mbaud(ddItems[k]->baud) < 0)
1072 se_warningf("invalid BPS value in dialing directory: %s",
1073 @@ -552,14 +554,23 @@
1076 itemName = phone_number;
1077 - sprintf(dialString, "\r%s %s%s", qres.dialPrefix, phone_number,
1079 + strncpy(dialString, FmtString("\r%s %s%s", qres.dialPrefix, phone_number,
1080 + qres.dialSuffix), REG_BUF);
1083 + length_remaining = SM_BUF;
1085 - sprintf(dialMsg, "Dialing %s", itemName);
1087 + strncpy(dialMsg, "Dialing ", length_remaining);
1088 + length_remaining -= strlen("Dialing ");
1089 + strncat(dialMsg, itemName, length_remaining);
1092 - sprintf(dialMsg, "Redialing:%d %s", dialTry, itemName);
1093 + strncpy(dialMsg, "Redialing ", length_remaining);
1094 + length_remaining -= strlen("Redialing ");
1095 + sprintf(dialMsg, "%1.1d ", dialTry);
1096 + length_remaining -= 2;
1097 + strncat(dialMsg, itemName, length_remaining);
1099 ProcRequest(SET_MESSAGE, "Setting Up...", "");
1102 for (i = 0; i < 3; i++)
1103 if (*(bufPtr = StripSpace(qres.noConnectString[i])) &&
1104 strncmp(modemResponse, bufPtr, strlen(bufPtr)) == 0) {
1105 - strcpy(dialMsg, modemResponse);
1106 + strncpy(dialMsg, modemResponse, SM_BUF);
1107 longjmp(dial_env, 1);
1110 @@ -601,15 +612,20 @@
1115 String rawItems[MAX_ENT + 1];
1118 disItemsBuf[REG_BUF];
1119 + char filename[LRG_BUF];
1125 - if ((fp = open_file(fname, qres.defaultDirectory)) == NULL)
1126 + strncpy(filename, fname, REG_BUF);
1128 + if ((fp = open_file(filename, REG_BUF, qres.defaultDirectory)) == NULL)
1131 ReadCommentedFile(fp, rawItems);
1132 @@ -623,11 +639,9 @@
1134 /* Find the number */
1135 GetWord(buf, ddItems[i]->number);
1136 -/* strcpy(ddItems[i]->number, GetFirstWord(buf));*/
1139 GetWord((buf = lptr), ddItems[i]->name);
1140 -/* strcpy(ddItems[i]->name, GetNextWord());*/
1142 /* Find other stuff */
1143 GetStrField(buf, "BPS=", ddItems[i]->baud, qres.defaultBPS);
1144 @@ -643,8 +657,20 @@
1148 + /* Ick... This is horrible - using a user-provided format string
1149 + means we have no easy way of limiting string length. HACK HACK
1150 + HACK Use fprintf to output to /dev/null and count the number of
1151 + bytes... It would be nice if we could rely on having snprintf() */
1153 + devnull = fopen("/dev/null", "r+");
1154 + if(NULL == devnull)
1156 + printf("Open /dev/null failed!?!\n");
1160 for (n = 0; n < i; n++) {
1161 - sprintf(disItemsBuf, qres.dialDirFormat,
1162 + length = fprintf(devnull, qres.dialDirFormat,
1165 strncmp((sHold = ddItems[n]->baud), "CUR", 3) ? sHold : "????",
1166 @@ -658,10 +684,33 @@
1167 strcmp(sHold, qres.dialSuffix) ? 'S' : 'D' : '?',
1168 ddItems[n]->script);
1170 - disItemsBuf[SM_BUF - 1] = '\0';
1171 - disItems[n] = XtNewString(disItemsBuf);
1172 + if(REG_BUF >= length)
1174 + sprintf(disItemsBuf, qres.dialDirFormat,
1176 + ddItems[n]->number,
1177 + strncmp((sHold = ddItems[n]->baud), "CUR", 3) ? sHold : "????",
1178 + (iHold = ddItems[n]->bits) == 100 ? '?' : itoa(iHold),
1179 + (iHold = ddItems[n]->parity) ? (iHold == 1 ? 'O' :
1180 + (iHold == 2 ? 'E' : '?')) : 'N',
1181 + (iHold = ddItems[n]->stopBits) == 100 ? '?' : itoa(iHold),
1182 + strncmp((sHold = ddItems[n]->prefix), "CUR", 3) ?
1183 + strcmp(sHold, qres.dialPrefix) ? 'P' : 'D' : '?',
1184 + strncmp((sHold = ddItems[n]->suffix), "CUR", 3) ?
1185 + strcmp(sHold, qres.dialSuffix) ? 'S' : 'D' : '?',
1186 + ddItems[n]->script);
1187 + disItemsBuf[SM_BUF - 1] = '\0';
1188 + disItems[n] = XtNewString(disItemsBuf);
1192 + printf("ReadParsePhoneFile: attempted overrun: %s\n",ddItems[n]->name);
1202 --- seyon-2.20c.orig/SePort.c
1203 +++ seyon-2.20c/SePort.c
1206 #include <linux/serial.h>
1207 #include <sys/ioctl.h>
1208 -#include <linux/fs.h>
1209 +/* #include <linux/fs.h> */
1210 #include <linux/tty.h>
1213 @@ -127,20 +127,30 @@
1224 - for (; (c = *s); s++) {
1225 - if (*s == '^' && *(s + 1))
1226 - if (*(++s) == '^') c = *s;
1227 - else c = *s & 0x1f;
1229 - if (c == '~') sleep(1);
1230 - else send_tbyte(c);
1233 + for (; (c = *s); s++)
1235 + if (*s == '^' && *(s + 1))
1237 + if (*(++s) == '^')
1255 @@ -150,10 +160,7 @@
1259 - char buf[REG_BUF];
1261 - sprintf(buf, fmt, a, b, c);
1262 - MdmPutString(buf);
1263 + MdmPutString(FmtString(fmt,a,b,c));
1270 static Boolean useModemControl = True;
1274 if (newModem) useModemControl = True;
1276 @@ -350,11 +357,11 @@
1279 mport(s) /* get/set port string */
1284 - strcpy(modem_port, s);
1285 - return (modem_port);
1287 + strncpy(modem_port, s, sizeof(modem_port));
1288 + return (modem_port);
1292 @@ -946,16 +953,13 @@
1296 -sendf_slowly(format, a, b, c)
1298 +sendf_slowly(fmt, a, b, c)
1304 - char buffer[SM_BUF];
1306 - sprintf(buffer, format, a, b, c);
1307 - send_slowly(buffer);
1308 + send_slowly(FmtString(fmt,a,b,c));
1316 - strcpy(modem_port, modem);
1317 + strncpy(modem_port, modem, REG_BUF);
1321 @@ -1004,50 +1008,82 @@
1333 #if LF_USE_ASCII_PID
1341 #if LF_USE_DEV_NUMBERS
1346 - /* Get our PID, and initialize the filename strings */
1348 + /* Get our PID, and initialize the filename strings */
1351 #if !LF_USE_DEV_NUMBERS
1352 - modemname = strrchr(modem_port, '/');
1353 - sprintf(lckf, "%s/%s%s", LF_PATH, LF_PREFIX,
1354 - (modemname ? (modemname + 1) : modem_port));
1356 - if(stat(modem_port, &mbuf) < 0) {
1357 - SePErrorF("could not stat modem port %s", modem_port, "", "");
1360 - sprintf(lckf,"%s/%s%03u.%03u.%03u", LF_PATH, LF_PREFIX, major(mbuf.st_dev),
1361 - major(mbuf.st_rdev), minor(mbuf.st_rdev));
1362 + modemname = strrchr(modem_port, '/');
1365 + if( SM_BUF > (1 + strlen(LF_PATH) + strlen(LF_PREFIX) + strlen(modemname)))
1366 + sprintf(lckf, "%s/%s%s", LF_PATH, LF_PREFIX, (modemname + 1));
1369 + SePErrorF("Buffer too small for lock filename in lock_tty(): %s", modemname, "", "");
1375 + if( SM_BUF > (1 + strlen(LF_PATH) + strlen(LF_PREFIX) + strlen(modem_port)))
1376 + sprintf(lckf, "%s/%s%s", LF_PATH, LF_PREFIX, (modem_port));
1379 + SePErrorF("Buffer too small for lock filename in lock_tty(): %s", modem_port, "", "");
1385 + if(stat(modem_port, &mbuf) < 0) {
1386 + SePErrorF("could not stat modem port %s", modem_port, "", "");
1389 + if( SM_BUF > (10 + strlen(LF_PATH) + strlen(LF_PREFIX)))
1390 + sprintf(lckf,"%s/%s%03u.%03u.%03u", LF_PATH, LF_PREFIX, major(mbuf.st_dev),
1391 + major(mbuf.st_rdev), minor(mbuf.st_rdev));
1394 + SePErrorF("Buffer too small for lock filename in lock_tty():", "", "", "");
1397 #endif /* LF_USE_DEV_NUMBERS */
1399 - sprintf(ltmp, "%s/%s%d", LF_PATH, "LTMP.", pid);
1400 - /* Create the LTMP.<pid> file and scribble our PID in it */
1402 - if ((lfd = creat(ltmp, 0644)) == -1) {
1403 - SePErrorF("Could not create temporary lock file %s", ltmp, "", "");
1406 + if( SM_BUF > (11 + strlen(LF_PATH)))
1407 + sprintf(ltmp, "%s/%s%d", LF_PATH, "LTMP.", pid);
1410 + SePErrorF("Buffer too small for ltmp filename in lock_tty():", "", "", "");
1413 + /* Create the LTMP.<pid> file and scribble our PID in it */
1415 + if ((lfd = creat(ltmp, 0644)) == -1) {
1416 + SePErrorF("Could not create temporary lock file %s", ltmp, "", "");
1420 #if LF_USE_ASCII_PID
1421 - sprintf(pidstr, "%10d\n", pid);
1422 - write(lfd, pidstr, 11);
1423 + /* pidstr is easily large enough */
1424 + sprintf(pidstr, "%10d\n", pid);
1425 + write(lfd, pidstr, 11);
1427 - write(lfd, (char*)&pid, sizeof(pid));
1428 + write(lfd, (char*)&pid, sizeof(pid));
1434 * Attempt to link directly - if it works, we're done.
1435 --- seyon-2.20c.orig/protocols
1436 +++ seyon-2.20c/protocols
1438 # you have to use the resources
1439 # zmodemAutoDownload and
1440 # zmodemAutoDownloadCommand for that.
1441 -# see the manula page for more details.
1442 +# see the manual page for more details.
1444 # the format is simple.
1448 # you can put comments on a single line
1449 # or at the end of a line
1451 -regular_zmodem_dl "$ cd /usr/dl; rz -vv" n # like in here
1454 +#regular_zmodem_dl "$ cd /usr/dl; rz -vv" n # like in here
1456 # blank lines are OK too, for readability.
1458 # the title has to be either a single word, like the above
1461 # you put anything instead of y as long as it starts
1462 # with y: y, Y, yes, yep ..etc.
1464 -"regular zmodem ul" "$ cd /usr/src; sz -vv" y
1467 +#"regular zmodem ul" "$ cd /usr/src; sz -vv" y
1469 # anything that doesn't start with a y is a no
1470 # e.g. n, N, NO, Not, nope, nien, nono ..etc.
1471 # even hello, but the use of words that doesn't start
1472 # with n is highly discouraged
1474 -graphic_zmodem_dl "cd /usr/dl; grz No
1475 -xrz3D "$cd /usr/dl; xrz" NO
1478 +#graphic_zmodem_dl "cd /usr/dl; grz No
1479 +#xrz3D "$cd /usr/dl; xrz" NO
1481 # here is my own protocols file
1482 # notice how I make it clear to myself
1483 # whether I'm uploading or downloading
1485 -"SEND - Zmodem" "$cd /usr/src; sz -vv" y
1486 -"RECEIVE - Reg. Zmodem" "$cd /usr/dl; rz -vv" n
1487 -"RECEIVE - Xrz3D" "$cd /usr/dl; xrz" n
1489 +#"SEND - Zmodem" "$cd /usr/src; sz -vv" y
1490 +#"RECEIVE - Reg. Zmodem" "$cd /usr/dl; rz -vv" n
1491 +#"RECEIVE - Xrz3D" "$cd /usr/dl; xrz" n
1493 +"Zmodem - RECEIVE" "$lrz" n
1494 +"Ymodem - RECEIVE" "$lrb" n
1495 +"Xmodem - RECEIVE" "$lrx" y
1497 +"Zmodem - SEND" "$lsz" y
1498 +"Ymodem - SEND" "$lsb" y
1499 +"Xmodem - SEND" "$lsx" y
1500 --- seyon-2.20c.orig/Seyon.ad.h
1501 +++ seyon-2.20c/Seyon.ad.h
1503 +"#include \"/etc/X11/seyon/Seyon-modem\"",
1504 "*.title: Seyon Command Center",
1505 "*.iconName: Seyon",
1508 "*XfwfMultiList.defaultColumns: 1",
1509 "*XfwfMultiList.verticaList: true",
1510 "*XfwfMultiList.maxSelectable: 100",
1511 -"*XfwfMultiList.Translations: #replcae \\n\
1512 +"*XfwfMultiList.Translations: #replace \\n\
1513 <Btn1Down>(2): Select() Notify() \\n\
1514 <Btn1Down>: Toggle() \\n\
1515 <Btn2Down>: Select() Notify() \\n\
1516 @@ -192,17 +193,6 @@
1517 "*statusBox.rts.label: RTS",
1518 "*statusBox.cts.label: CTS",
1519 "*statusBox.rng.label: RNG",
1520 -"*quickKeyBox.Command.font: 6x10",
1521 -"*quickKey1.visible: on",
1522 -"*quickKey2.visible: on",
1523 -"*quickKey3.visible: on",
1524 -"*quickKey4.visible: on",
1525 -"*quickKey5.visible: on",
1526 -"*quickKey1.label: Athena",
1527 -"*quickKey2.label: Ch1",
1528 -"*quickKey3.label: UpMail",
1529 -"*quickKey4.label: DivMsg",
1530 -"*quickKey5.label: Local",
1532 \"Hi there! Helloooooooooo!\" \
1533 \"Hugged your computer today?\" \
1535 \"In stereo (where available)\" \
1536 \"Have something funny? send it!\" \
1537 \"I've fallen and I can't get up!\"",
1538 +"+*showFunMessages: off",
1539 "*notImplemented*title: Seyon Feature",
1540 "*notImplemented.dialog.label: \
1541 This feature is not yet implemented\\n\
1542 --- seyon-2.20c.orig/SeErr.c
1543 +++ seyon-2.20c/SeErr.c
1544 @@ -107,28 +107,26 @@
1548 -SePopupWarningF(parent, fmt, a, b, c, d)
1549 +SePopupWarningF(parent, fmt, a, b, c)
1558 SePopupNoticeF(parent, 0, "Seyon Warning", DestroyParentPopup,
1564 -SePopupInitWarningF(parent, fmt, a, b, c, d)
1565 +SePopupInitWarningF(parent, fmt, a, b, c)
1574 SePopupNoticeF(parent, 0, "Seyon Initialization Warning",
1575 - DestroyParentPopup, fmt, a, b, c, d);
1576 + DestroyParentPopup, fmt, a, b, c);
1579 --- seyon-2.20c.orig/SeSubs.c
1580 +++ seyon-2.20c/SeSubs.c
1600 - fprintf(tfp, "%s\r\n", msg);
1602 + fprintf(tfp, "%s\r\n", msg);
1607 @@ -68,105 +68,96 @@
1620 - fprintf(tfp, fmt, a, b, c);
1621 - fprintf(tfp, "\r\n");
1622 + fprintf(tfp, fmt, a, b, c);
1623 + fprintf(tfp, "\r\n");
1631 - char buf[REG_BUF];
1632 + char buf[REG_BUF];
1634 - sprintf(buf, "\r>> Error: %s.", msg);
1636 + strncpy(buf, "\r>> Error: ",REG_BUF);
1637 + strncat(buf, msg, REG_BUF-12);
1638 + buf[REG_BUF - 1] = 0; /* Null-terminate to be sure */
1643 SeErrorF(fmt, a, b, c)
1653 - char buf[REG_BUF];
1655 - sprintf(buf, fmt, a, b, c);
1657 + SeError(FmtString(fmt, a, b, c));
1665 - char buf[REG_BUF];
1666 + char buf[REG_BUF];
1668 - sprintf(buf, "\r>> Warning: %s.", msg);
1670 + strncpy(buf, "\r>> Warning: ",REG_BUF);
1671 + strncat(buf, msg, REG_BUF-14);
1672 + buf[REG_BUF - 1] = 0; /* Null-terminate to be sure */
1677 se_warningf(fmt, a, b, c)
1687 - char buf[REG_BUF];
1689 - sprintf(buf, fmt, a, b, c);
1691 + se_warning(FmtString(fmt, a, b, c));
1699 - char buf[REG_BUF];
1700 + char buf[REG_BUF];
1702 - sprintf(buf, "\r>> Notice: %s.", msg);
1704 + strncpy(buf, "\r>> Notice: ",REG_BUF);
1705 + strncat(buf, msg, REG_BUF-13);
1706 + buf[REG_BUF - 1] = 0; /* Null-terminate to be sure */
1711 SeNoticeF(fmt, a, b, c)
1721 - char buf[REG_BUF];
1723 - sprintf(buf, fmt, a, b, c);
1725 + SeNotice(FmtString(fmt, a, b, c));
1733 - char buf[REG_BUF];
1735 - sprintf(buf, "%s: %s", msg, strerror(errno));
1737 + SeError(FmtString("%s: %s",msg,strerror(errno)));
1741 SePErrorF(fmt, a, b, c)
1751 - char buf[REG_BUF];
1753 - sprintf(buf, fmt, a, b, c);
1755 + SePError(FmtString(fmt,a,b,c));
1758 /* ------------------------------------------------------------
1759 @@ -180,12 +171,12 @@
1766 - if ((pid = fork()) < 0)
1767 - SePError("Faild to fork process");
1768 + if ((pid = fork()) < 0)
1769 + SePError("Faild to fork process");
1776 @@ -194,119 +185,119 @@
1779 ShellCommandHandler(sig, fio_p)
1785 - void PostExecPrep();
1786 + void PostExecPrep();
1788 - if (wait((int*)0) < 0) SePError("ShellCommand wait failed");
1789 - XoAppIgnoreSignal(app_con, SIGCHLD);
1790 + if (wait((int*)0) < 0) SePError("ShellCommand wait failed");
1791 + XoAppIgnoreSignal(app_con, SIGCHLD);
1794 - set_modem_fio(*(int *)fio_p);
1796 + set_modem_fio(*(int *)fio_p);
1798 - SeyonMessage("Shell Command Completed");
1800 - inhibit_child = False;
1801 + SeyonMessage("Shell Command Completed");
1803 + inhibit_child = False;
1807 ShellCommand(command)
1811 - ExecShellCommand(command, 1);
1812 + ExecShellCommand(command, 1);
1816 ExecShellCommand(command, top)
1822 - static char *shell = NULL;
1823 - char cmd[REG_BUF],
1828 - if (command == NULL) return;
1830 - if (shell == NULL) {
1831 - shell = (char*)getenv("SHELL");
1832 - if (!shell) shell = "/bin/sh";
1835 - if (top) PreExecPrep();
1837 - io_set_attr(tfd, &oldmode);
1838 - fio = get_modem_fio();
1841 - XoAppAddSignal(app_con, SIGCHLD, ShellCommandHandler, (XtPointer)&fio);
1842 - else signal(SIGCHLD, SIG_IGN);
1844 - forkRes = SeFork();
1845 - if (forkRes == 0) {
1846 - scmd = str_stripspc_copy(cmd, command);
1850 - if (*scmd == '$') {
1851 - SeNotice("Redirecting stdin/stdout");
1852 - mattach(); /* Attach modem to stdin/stdout */
1854 + static char *shell = NULL;
1855 + char cmd[REG_BUF],
1860 + if (command == NULL) return;
1862 + if (shell == NULL) {
1863 + shell = (char*)getenv("SHELL");
1864 + if (!shell) shell = "/bin/sh";
1867 - if (setuid(getuid()) < 0)
1868 - SePError("Failed to set effective uid");
1869 + if (top) PreExecPrep();
1871 - if (*scmd == CNULL) {
1872 - SeNotice(FmtString1("Executing the shell `%s'", shell));
1873 - execl(shell, shell, (char*)NULL);
1874 - SeError(FmtString1("Execution of the shell `%s' failed", shell));
1877 + io_set_attr(tfd, &oldmode);
1878 + fio = get_modem_fio();
1881 + XoAppAddSignal(app_con, SIGCHLD, ShellCommandHandler, (XtPointer)&fio);
1882 + else signal(SIGCHLD, SIG_IGN);
1884 + forkRes = SeFork();
1885 + if (forkRes == 0) {
1886 + scmd = str_stripspc_copy(cmd, command);
1890 + if (*scmd == '$') {
1891 + SeNotice("Redirecting stdin/stdout");
1892 + mattach(); /* Attach modem to stdin/stdout */
1896 + if (setuid(getuid()) < 0)
1897 + SePError("Failed to set effective uid");
1899 + if (*scmd == CNULL) {
1900 + SeNotice(FmtString1("Executing the shell `%s'", shell));
1901 + execl(shell, shell, (char*)NULL);
1902 + SeError(FmtString1("Execution of the shell `%s' failed", shell));
1906 - SeNotice(FmtString1("Executing the command `%s'", scmd));
1907 - execl(shell, shell, "-c", scmd, (char*)NULL);
1908 - SePError(FmtString1("Execution of the command `%s' failed", scmd));
1911 - else if (forkRes > 0) {
1912 - if (top) inhibit_child = True;
1914 + SeNotice(FmtString1("Executing the command `%s'", scmd));
1915 + execl(shell, shell, "-c", scmd, (char*)NULL);
1916 + SePError(FmtString1("Execution of the command `%s' failed", scmd));
1919 + else if (forkRes > 0) {
1920 + if (top) inhibit_child = True;
1922 wait((int*)0); /* Wait for the child process to terminate */
1926 - } /* if (forkRes == 0)... */
1928 + } /* if (forkRes == 0)... */
1934 - SuspContTerminal(TERM_SUSPEND);
1935 - SetKillButtonSens(True);
1936 + SuspContTerminal(TERM_SUSPEND);
1937 + SetKillButtonSens(True);
1943 - SuspContTerminal(TERM_CONTINUE);
1944 - SetKillButtonSens(False);
1945 + SuspContTerminal(TERM_CONTINUE);
1946 + SetKillButtonSens(False);
1952 - SuspContTerminal(0);
1954 + SuspContTerminal(0);
1961 - SuspContTerminal(1);
1963 + SuspContTerminal(1);
1968 @@ -318,33 +309,34 @@
1972 -expand_fname(fname, buffer)
1981 - str_stripspc_copy(name, fname);
1984 - for (i = 0; name[i]; i++) {
1985 - if (name[i] == '~') {
1986 - if ((home = (char *) getenv("HOME")) == NULL)
1988 - strcpy(buf, home);
1989 - buf += strlen(home);
1990 +expand_fname(fname, buffer, size)
2000 + str_stripspc_copy(name, fname);
2003 + for (i = 0; (name[i] && (buffer+REG_BUF > buf)); i++) {
2004 + if (name[i] == '~') {
2005 + if ((home = (char *) getenv("HOME")) == NULL)
2007 + strncpy(buf, home, size);
2008 + buf += strlen(home);
2028 @@ -353,11 +345,12 @@
2032 -open_file(fname, directory)
2035 +open_file(fname, size, directory)
2040 - return open_file_va(fname, directory, NULL);
2041 + return open_file_va(fname, size, directory, NULL);
2045 @@ -365,120 +358,79 @@
2049 -open_file_va(fname, dir1, dir2)
2055 - char name[REG_BUF],
2056 - fullname[REG_BUF],
2059 - str_stripspc_copy(name, fname);
2062 - sprintf(fullname, "%s/%s", expand_fname(dir1, buffer), name);
2064 - if ((fp = fopen(fullname, "r")) != NULL) {
2065 - strcpy(fname, fullname);
2070 - sprintf(fullname, "%s/%s", expand_fname(dir2, buffer), name);
2071 +open_file_va(fname, size, dir1, dir2)
2082 + str_stripspc_copy(name, fname);
2085 + fullname = FmtString("%s/%s", expand_fname(dir1, buffer, REG_BUF), name, "");
2086 + if ((fp = fopen(fullname, "r")) != NULL) {
2087 + strncpy(fname, fullname, size);
2091 - if ((fp = fopen(fullname, "r")) != NULL) {
2092 - strcpy(fname, fullname);
2096 + fullname = FmtString("%s/%s", expand_fname(dir2, buffer, REG_BUF), name, "");
2097 + if ((fp = fopen(fullname, "r")) != NULL) {
2098 + strncpy(fname, fullname, size);
2102 + } /* if (dir1)... */
2104 + if ((fp = fopen(name, "r")) != NULL) {
2105 + strncpy(fname, name, REG_BUF);
2108 - } /* if (dir1)... */
2110 - if ((fp = fopen(name, "r")) != NULL) {
2111 - strcpy(fname, name);
2115 - SeErrorF("/OFV/ Could not open the file `%s'", name, "", "");
2117 - SeNoticeF("Tried the default directory `%s'", dir1, "", "");
2119 - SeNoticeF("Tried the default directory `%s'", dir2, "", "");
2121 - SeNotice("Tried the current directory");
2122 + SeErrorF("/OFV/ Could not open the file `%s'", name, "", "");
2124 + SeNoticeF("Tried the default directory `%s'", dir1, "", "");
2126 + SeNoticeF("Tried the default directory `%s'", dir2, "", "");
2128 + SeNotice("Tried the current directory");
2135 - * another implementation of the above using varargs, currently not used
2138 -/*FILE *open_file_va(args)
2143 - char *name, *dir, fullname[REG_BUF];
2144 - char buffer[REG_BUF];
2147 - name = va_arg(args, char *);
2149 - if (fp = fopen(name, "r"))
2152 - while(dir = va_arg(args, char *))
2154 - sprintf(fullname, "%s/%s", expand_fname(SSpc(dir), buffer), name);
2156 - if (fp = fopen(fullname, "r"))
2162 - if (dir = (char *) getenv("HOME")) {
2163 - sprintf(fullname, "%s/%s", dir, name);
2165 - if (fp = fopen(fullname, "r"))
2169 - showf("<< Seyon: file '%s' not in current, default, or home directory >>",
2175 * read a file into a buffer
2185 - char buffer[REG_BUF + 1];
2187 + char buffer[REG_BUF + 1];
2190 - for (i = 0; i < MAX_ENT && fgets(buffer, REG_BUF, fp) != NULL; i++)
2191 - line[i] = strcpy((char *)malloc(sizeof(buffer)), SSpc(buffer));
2193 + for (i = 0; i < MAX_ENT && fgets(buffer, REG_BUF, fp) != NULL; i++)
2194 + line[i] = strcpy((char *)malloc(sizeof(buffer)), SSpc(buffer));
2199 - * similar to the above, but closes the file after readsing it
2200 + * similar to the above, but closes the file after reading it
2204 read_close_file(fp, line)
2210 - read_file(fp, line);
2212 + read_file(fp, line);
2217 @@ -487,12 +439,12 @@
2220 write_pipe_data(pd, data, size)
2228 - if (write(pd[1], data, size) < 0)
2229 - show("<< Could not write to pipe >>");
2230 + if (write(pd[1], data, size) < 0)
2231 + show("<< Could not write to pipe >>");
2235 @@ -501,11 +453,11 @@
2238 read_pipe_data(pd, data, size)
2246 - read(pd[0], data, size);
2247 + read(pd[0], data, size);
2251 @@ -515,30 +467,30 @@
2255 - struct stat statBuf;
2257 - static time_t totalIdleTime;
2258 - int timeToNextCall;
2260 - if (qres.idleGuard && !inhibit_child) {
2261 - if (fstat(tfd, &statBuf) < 0) {
2262 - SePError("/IG/ Could not stat the tty");
2265 + struct stat statBuf;
2267 + static time_t totalIdleTime;
2268 + int timeToNextCall;
2270 + if (qres.idleGuard && !inhibit_child) {
2271 + if (fstat(tfd, &statBuf) < 0) {
2272 + SePError("/IG/ Could not stat the tty");
2276 + if ((idleTime = time((time_t *) 0) - statBuf.st_mtime) >=
2277 + qres.idleGuardInterval * 0.99) {
2278 + MdmPutString(qres.idleGuardString);
2279 + timeToNextCall = qres.idleGuardInterval;
2280 + totalIdleTime += idleTime;
2281 + SeyonMessagef("Idle for %d minutes", (totalIdleTime + 30) / 60);
2284 + timeToNextCall = qres.idleGuardInterval - (int)idleTime;
2285 + totalIdleTime = 0;
2288 - if ((idleTime = time((time_t *) 0) - statBuf.st_mtime) >=
2289 - qres.idleGuardInterval * 0.99) {
2290 - MdmPutString(qres.idleGuardString);
2291 - timeToNextCall = qres.idleGuardInterval;
2292 - totalIdleTime += idleTime;
2293 - SeyonMessagef("Idle for %d minutes", (totalIdleTime + 30) / 60);
2296 - timeToNextCall = qres.idleGuardInterval - (int)idleTime;
2297 - totalIdleTime = 0;
2300 - XtAppAddTimeOut(app_con, timeToNextCall * 1000,
2301 + XtAppAddTimeOut(app_con, timeToNextCall * 1000,
2302 (XtTimerCallbackProc) IdleGuard, (XtPointer) app_con);
2306 --- seyon-2.20c.orig/Seyon.c
2307 +++ seyon-2.20c/Seyon.c
2308 @@ -72,314 +72,365 @@
2315 +main(int argc, char *argv[])
2318 - void DispatchActions(),
2320 - ShowOpenModemErrMsg();
2322 - char *arg[REG_BUF], termEmu[REG_BUF];
2323 - int sepIndex, i, n, retStatus;
2325 + void DispatchActions(),
2327 + ShowOpenModemErrMsg();
2329 + char *arg[REG_BUF],
2337 - char large_string[1024];
2338 + char large_string[LRG_BUF];
2341 - XtAppContext appContext;
2342 - char modemList[LRG_BUF],
2344 - *startupAction = modemList;
2345 + int length_remaining;
2346 + XtAppContext appContext;
2347 + char modemList[LRG_BUF],
2349 + *startupAction = modemList;
2351 - static char *fallbackResources[] = {
2352 + static char *fallbackResources[] = {
2353 #include "Seyon.ad.h"
2359 - static XrmOptionDescRec optionList[] = {
2360 - {"-modems", "modems", XrmoptionSepArg, NULL},
2361 - {"-script", "script", XrmoptionSepArg, NULL},
2362 - {"-entries", "defaultPhoneEntries", XrmoptionSepArg, NULL},
2363 - {"-dial", "dialAutoStart", XrmoptionNoArg, "True"},
2364 - {"-nodial", "dialAutoStart", XrmoptionNoArg, "False"},
2365 - {"-emulator", "emulator", XrmoptionSepArg, ""},
2366 - {"-noemulator", "noemulator", XrmoptionNoArg, ""},
2367 - {"-nodefargs", "nodefargs", XrmoptionNoArg, ""},
2369 + static XrmOptionDescRec optionList[] = {
2370 + {"-modems", "modems", XrmoptionSepArg, NULL},
2371 + {"-script", "script", XrmoptionSepArg, NULL},
2372 + {"-entries", "defaultPhoneEntries", XrmoptionSepArg, NULL},
2373 + {"-dial", "dialAutoStart", XrmoptionNoArg, "True"},
2374 + {"-nodial", "dialAutoStart", XrmoptionNoArg, "False"},
2375 + {"-emulator", "emulator", XrmoptionSepArg, ""},
2376 + {"-noemulator", "noemulator", XrmoptionNoArg, ""},
2377 + {"-nodefargs", "nodefargs", XrmoptionNoArg, ""},
2380 - for (i = 1; i < argc && strcmp(argv[i], "--"); i++);
2382 + for (i = 1; i < argc && strcmp(argv[i], "--"); i++);
2385 - /* Find if the -noemulator switch is given */
2386 - for (i = 1; i < sepIndex &&
2387 + /* Find if the -noemulator switch is given */
2388 + for (i = 1; i < sepIndex &&
2389 strncmp(argv[i], "-noemulator", max(4, strlen(argv[i]))); i++);
2391 - /* If no, launch Seyon via the emulator */
2392 - if (i >= sepIndex) {
2393 + /* If no, launch Seyon via the emulator */
2394 + if (i >= sepIndex) {
2396 - for (i = 1; i < sepIndex &&
2397 - strncmp(argv[i], "-emulator", max(3, strlen(argv[i]))); i++);
2398 - if (i < sepIndex - 1)
2399 - strcpy(termEmu, argv[i+1]);
2401 - strcpy(termEmu, SEYON_EMU_NAME);
2403 - /* Find if the -nodefargs switch is given */
2404 - for (i = 1; i < sepIndex &&
2405 - strncmp(argv[i], "-nodefargs", max(5, strlen(argv[i]))); i++);
2406 + for (i = 1; i < sepIndex &&
2407 + strncmp(argv[i], "-emulator", max(3, strlen(argv[i]))); i++);
2408 + if (i < sepIndex - 1)
2409 + strncpy(termEmu, argv[i+1], REG_BUF);
2411 + strncpy(termEmu, SEYON_EMU_NAME, REG_BUF);
2413 + /* Find if the -nodefargs switch is given */
2414 + for (i = 1; i < sepIndex &&
2415 + strncmp(argv[i], "-nodefargs", max(5, strlen(argv[i]))); i++);
2420 - /* If no, use the default emulator arguments */
2421 - if (i >= sepIndex) {
2422 + /* If no, use the default emulator arguments */
2423 + if (i >= sepIndex) {
2424 arg[n] = "-name"; n++;
2425 arg[n] = "Seyon"; n++;
2427 arg[n] = "Seyon Terminal Emulator"; n++;
2429 arg[n] = "Terminal"; n++;
2433 - /* Pass all switches aftetr '--' to the emulator */
2434 - for (i = sepIndex + 1; i < argc; i++, n++)
2435 + /* Pass all switches aftetr '--' to the emulator */
2436 + for (i = sepIndex + 1; i < argc; i++, n++)
2439 - arg[n] = "-e"; n++;
2440 + arg[n] = "-e"; n++;
2443 - arg[n] = argv[0]; n++;
2444 - arg[n] = "-noemulator"; n++;
2445 + arg[n] = argv[0]; n++;
2446 + arg[n] = "-noemulator"; n++;
2448 - /* Pass all switches before '--' to Seyon */
2449 - for (i = 1; i < sepIndex; i++, n++)
2450 + /* Pass all switches before '--' to Seyon */
2451 + for (i = 1; i < sepIndex; i++, n++)
2454 - arg[n] = "/bin/sh"; n++;
2455 - arg[n] = "-c"; n++;
2456 - arg[n] = large_string;
2457 - strcpy(arg[n], argv[0]);
2458 - strcat(arg[n], " -noemulator");
2459 - for (i = 1; i < sepIndex; i++) {
2460 - strcat(arg[n]," ");
2461 - strcat(arg[n],argv[i]);
2464 + arg[n] = "/bin/sh"; n++;
2465 + arg[n] = "-c"; n++;
2466 + arg[n] = large_string;
2467 + length_remaining = LRG_BUF;
2468 + strncpy(arg[n], argv[0], LRG_BUF);
2469 + length_remaining -= strlen(argv[0]);
2470 + length = strlen(" -noemulator");
2471 + if(length_remaining > length)
2473 + strncat(arg[n], " -noemulator", length_remaining);
2474 + length_remaining -= length;
2478 + printf("String overflow in parsing options\n");
2481 + for (i = 1; i < sepIndex; i++) {
2482 + length = strlen(argv[i]) + 1;
2483 + if(length_remaining > length)
2485 + strncat(arg[n]," ", 1);
2486 + strncat(arg[n],argv[i], length_remaining);
2490 + printf("String overflow in parsing options\n");
2497 - arg[n] = NULL; n++;
2498 + arg[n] = NULL; n++;
2501 - execvp(arg[0], arg);
2503 + execvp(arg[0], arg);
2505 - fprintf(stderr, "%s `%s.\n%s\n", ">> Warning: Could not execute",
2506 - termEmu, ">> Notice: Falling to `xterm'.");
2507 + fprintf(stderr, "%s `%s.\n%s\n", ">> Warning: Could not execute",
2508 + termEmu, ">> Notice: Falling to `xterm'.");
2511 - execvp(arg[0], arg);
2513 + execvp(arg[0], arg);
2515 - fprintf(stderr, "%s\n%s\n", ">> Error: Could not execute `xterm'.",
2516 - ">> Notice: Giving up.");
2518 - } /* if (i >= sepIndex)... */
2520 - /* ---------------------------------------------------------------------- */
2521 - /* ---------------------------------------------------------------------- */
2523 - /* The real program begins here */
2525 - topLevel = XtAppInitialize(&appContext, "Seyon", optionList,
2526 - XtNumber(optionList), &argc, argv,
2527 - fallbackResources, NULL, 0);
2528 - app_con = appContext;
2529 - GetResources(topLevel);
2531 - mainPid = getpid();
2532 - setup_signal_handlers();
2533 - SetIcon(topLevel);
2535 - printf("\r\n%s %s\r\n", "Seyon Copyright (c) 1992-1993 Muhammad M. Saggaf.",
2536 - "All rights reserved.");
2537 - printf("\rVersion %s rev. %s %s-%s %s@%s %s %s.\r\n\n", VERSION, REVISION,
2538 - COMPILE_HOSTTYPE, COMPILE_OSNAME, COMPILE_BY, COMPILE_HOST,
2539 - COMPILE_DATE, COMPILE_TIME);
2541 - if ((tfp = fopen("/dev/tty", "r+")) == NULL) {
2542 - PopupInitError("errTtyAccess", exit);
2545 + fprintf(stderr, "%s\n%s\n", ">> Error: Could not execute `xterm'.",
2546 + ">> Notice: Giving up.");
2548 + } /* if (i >= sepIndex)... */
2550 + /* ------------------------------------------------------------------ */
2551 + /* ------------------------------------------------------------------ */
2553 + /* The real program begins here */
2555 + topLevel = XtAppInitialize(&appContext, "Seyon", optionList,
2556 + XtNumber(optionList), &argc, argv,
2557 + fallbackResources, NULL, 0);
2558 + app_con = appContext;
2559 + GetResources(topLevel);
2561 + mainPid = getpid();
2562 + setup_signal_handlers();
2563 + SetIcon(topLevel);
2565 + printf("\r\n%s %s\r\n", "Seyon Copyright (c) 1992-1993 Muhammad M. Saggaf.",
2566 + "All rights reserved.");
2567 + printf("\rVersion %s rev. %s %s-%s %s@%s %s %s.\r\n\n", VERSION, REVISION,
2568 + COMPILE_HOSTTYPE, COMPILE_OSNAME, COMPILE_BY, COMPILE_HOST,
2569 + COMPILE_DATE, COMPILE_TIME);
2571 + if ((tfp = fopen("/dev/tty", "r+")) == NULL) {
2572 + PopupInitError("errTtyAccess", exit);
2576 - tfd = fileno(tfp);
2577 + tfd = fileno(tfp);
2579 - io_get_attr(tfd, &oldmode); /* get current console tty mode */
2580 - newmode = oldmode; /* copy (structure) to newmode */
2581 + io_get_attr(tfd, &oldmode); /* get current console tty mode */
2582 + newmode = oldmode; /* copy (structure) to newmode */
2584 #if HAVE_TERMIOS || HAVE_TERMIO
2585 - newmode.c_oflag &= ~OPOST;
2586 - newmode.c_iflag |= (IGNBRK | IGNPAR);
2587 - newmode.c_iflag &= ~(IXON | IXOFF | ISTRIP | BRKINT);
2588 - newmode.c_lflag &= ~(ICANON | ISIG | ECHO);
2589 - newmode.c_cflag |= CREAD;
2590 - newmode.c_cc[VMIN] = 1;
2591 - newmode.c_cc[VTIME] = 1;
2592 + newmode.c_oflag &= ~OPOST;
2593 + newmode.c_iflag |= (IGNBRK | IGNPAR);
2594 + newmode.c_iflag &= ~(IXON | IXOFF | ISTRIP | BRKINT);
2595 + newmode.c_lflag &= ~(ICANON | ISIG | ECHO);
2596 + newmode.c_cflag |= CREAD;
2597 + newmode.c_cc[VMIN] = 1;
2598 + newmode.c_cc[VTIME] = 1;
2601 - newmode.sg_flags = CBREAK;
2602 + newmode.sg_flags = CBREAK;
2609 - InitVariables(topLevel);
2610 + InitVariables(topLevel);
2612 - if (argc > 1 && strcmp(argv[1], "--")) {
2613 - SeErrorF("Unknown or incomplete command-line switch: `%s'", argv[1],
2615 - PopupInitError("errSwitches", do_exit);
2618 + if (argc > 1 && strcmp(argv[1], "--")) {
2619 + SeErrorF("Unknown or incomplete command-line switch: `%s'", argv[1],
2621 + PopupInitError("errSwitches", do_exit);
2625 - /* ---------------------------------------------------------------------- */
2626 + /* ------------------------------------------------------------------- */
2628 - /* Open modem port and configure it */
2629 + /* Open modem port and configure it */
2631 - strcpy(modemList, qres.modems);
2632 - curModem = GetFirstWord(modemList);
2633 + strncpy(modemList, qres.modems, LRG_BUF);
2634 + curModem = GetFirstWord(modemList);
2636 - show("Locating Modems...");
2637 + show("Locating Modems...");
2640 - if ((retStatus = OpenModem(curModem)) >= 0) break;
2642 + if ((retStatus = OpenModem(curModem)) >= 0) break;
2644 - ShowOpenModemErrMsg(curModem, retStatus);
2645 - if (retStatus != ERR_MDM_NOMODEM)
2646 + ShowOpenModemErrMsg(curModem, retStatus);
2647 + if (retStatus != ERR_MDM_NOMODEM)
2648 show(FmtString("Modem `%s' is Unavailable.\n", curModem, "", ""));
2649 - curModem = GetNextWord();
2650 - } while (curModem[0] != '\0');
2652 - if (retStatus < 0) {
2653 - SeError("No Modems Available");
2654 - PopupInitError("errModemInit", do_exit);
2658 - show(FmtString("Modem `%s' is Available.\n", curModem, "", ""));
2660 - /* ---------------------------------------------------------------------- */
2662 - CreateCommandCenter();
2664 - /* ---------------------------------------------------------------------- */
2665 + curModem = GetNextWord();
2666 + } while (curModem[0] != '\0');
2669 - pipe(scriptToMainPipe);
2670 - pipe(mainToTermPipe);
2671 - XtAppAddInput(appContext, child_pipe[0], (XtPointer)XtInputReadMask,
2672 - ExecProcRequest, NULL);
2673 - XtAppAddInput(appContext, scriptToMainPipe[0], (XtPointer)XtInputReadMask,
2674 - GetParameters, NULL);
2675 + if (retStatus < 0) {
2676 + SeError("No Modems Available");
2677 + PopupInitError("errModemInit", do_exit);
2681 + show(FmtString("Modem `%s' is Available.\n", curModem, "", ""));
2683 + /* ------------------------------------------------------------------- */
2685 + CreateCommandCenter();
2687 + /* ------------------------------------------------------------------- */
2690 + pipe(scriptToMainPipe);
2691 + pipe(mainToTermPipe);
2692 + XtAppAddInput(appContext, child_pipe[0], (XtPointer)XtInputReadMask,
2693 + ExecProcRequest, NULL);
2694 + XtAppAddInput(appContext, scriptToMainPipe[0], (XtPointer)XtInputReadMask,
2695 + GetParameters, NULL);
2698 + if (qres.showFunMessages)
2699 + XtAppAddTimeOut(appContext, qres.funMessagesInterval*1000,
2700 + FunMessage, NULL);
2702 + /* ------------------------------------------------------------------- */
2704 + length_remaining = LRG_BUF;
2705 + strncpy(startupAction, qres.startupAction, LRG_BUF);
2706 + length_remaining -= strlen(startupAction);
2709 + length = strlen(" RunScript();") + strlen(qres.script);
2710 + if (length_remaining > length)
2712 + sprintf(startupAction + strlen(startupAction),
2713 + " RunScript(%s);", qres.script);
2714 + length_remaining -= length;
2718 + printf("String overflow in parsing options\n");
2722 + if (qres.dialAutoStart)
2724 + length = strlen(" DialEntries(Default);");
2725 + if(length_remaining > length)
2727 + strncat(startupAction, " DialEntries(Default);", length);
2732 + printf("String overflow in parsing options\n");
2737 + /* ------------------------------------------------------------------- */
2740 - if (qres.showFunMessages) XtAppAddTimeOut(appContext,
2741 - qres.funMessagesInterval*1000, FunMessage, NULL);
2743 + ProcRequest(DISPATCH_ACTION, "", startupAction);
2745 - /* ---------------------------------------------------------------------- */
2746 + /* ------------------------------------------------------------------- */
2748 - strcpy(startupAction, qres.startupAction);
2749 - if (qres.script) sprintf(startupAction + strlen(startupAction),
2750 - " RunScript(%s);", qres.script);
2751 - if (qres.dialAutoStart) strcat(startupAction, " DialEntries(Default);");
2753 - /* ---------------------------------------------------------------------- */
2756 - ProcRequest(DISPATCH_ACTION, "", startupAction);
2758 - /* ---------------------------------------------------------------------- */
2760 - XtSetMappedWhenManaged(topLevel, True);
2761 - XtMapWidget(topLevel); /* I don't know why I need this, but I do */
2762 + XtSetMappedWhenManaged(topLevel, True);
2763 + XtMapWidget(topLevel); /* I don't know why I need this, but I do */
2766 - XtAppMainLoop(app_con);
2768 + XtAppMainLoop(app_con);
2773 -setup_signal_handlers()
2774 +setup_signal_handlers(void)
2776 - signal(SIGINT, SIG_IGN);
2777 - signal(SIGQUIT, SIG_IGN);
2778 + signal(SIGINT, SIG_IGN);
2779 + signal(SIGQUIT, SIG_IGN);
2782 - signal(SIGBUS, die);
2783 + signal(SIGBUS, die);
2785 - signal(SIGFPE, die);
2786 - signal(SIGILL, die);
2787 - signal(SIGIOT, die);
2788 - signal(SIGSEGV, die);
2789 - signal(SIGTERM, die);
2790 - signal(SIGTRAP, die);
2791 + signal(SIGFPE, die);
2792 + signal(SIGILL, die);
2793 + signal(SIGIOT, die);
2794 + signal(SIGSEGV, die);
2795 + signal(SIGTERM, die);
2796 + signal(SIGTRAP, die);
2804 - void KillChildProc();
2805 - signal(sig, SIG_IGN);
2806 + void KillChildProc();
2807 + signal(sig, SIG_IGN);
2809 - SeErrorF("Killed by signal %d", sig, "", "");
2810 - SeNoticeF("Debugging info: pid=%d.", getpid(), "", "");
2811 + SeErrorF("Killed by signal %d", sig, "", "");
2812 + SeNoticeF("Debugging info: pid=%d.", getpid(), "", "");
2814 - if (getpid() == mainPid) {
2817 + if (getpid() == mainPid) {
2821 - SeNotice("Press any key to exit");
2826 - write_child_info(child_pipe, KILL_TERM, "Terminal Proc Exited");
2829 + SeNotice("Press any key to exit");
2834 + write_child_info(child_pipe, KILL_TERM, "Terminal Proc Exited");
2844 - void KillChildProc();
2845 + void KillChildProc();
2847 - XtUnmapWidget(topLevel);
2850 + XtUnmapWidget(topLevel);
2858 - restore_orig_mode();
2861 + restore_orig_mode();
2867 - XtDestroyApplicationContext(XtWidgetToApplicationContext(topLevel));
2868 + XtDestroyApplicationContext(XtWidgetToApplicationContext(topLevel));
2869 /* XCloseDisplay(XtDisplay(topLevel));*/
2875 -cleanup_exit(status)
2877 +cleanup_exit(int status)
2879 - SeNotice("cleaning up..");
2881 + SeNotice("cleaning up..");
2888 - show("I'm rated PG-34!!");
2890 + show("I'm rated PG-34!!");
2893 --- seyon-2.20c.orig/SeTrans.c
2894 +++ seyon-2.20c/SeTrans.c
2898 if (disItems[0] == NULL) {
2899 - strcpy(protocolsFile, qres.protocolsFile);
2900 + strncpy(protocolsFile, qres.protocolsFile, REG_BUF);
2901 if (ReadParseProtFile(protocolsFile, disItems) < 0)
2907 DoTransfer(widget, clientData, callData)
2909 - XtPointer clientData,
2912 + XtPointer clientData,
2915 - XfwfMultiListReturnStruct *item;
2917 - String* actionData = (String*)clientData;
2918 - char fullCommand[LRG_BUF];
2921 - {if ((transCurItemIndex = atoi(actionData[0]) - 1) < 0 ||
2922 - transCurItemIndex > MAX_ENT - 1)
2923 - SimpleError("Invalid Entry Number");}
2925 - if ((item = XfwfMultiListGetHighlighted(mlw))->num_selected == 0)
2926 + XfwfMultiListReturnStruct *item;
2928 + String* actionData = (String*)clientData;
2929 + char fullCommand[LRG_BUF];
2930 + int length_remaining;
2933 + {if ((transCurItemIndex = atoi(actionData[0]) - 1) < 0 ||
2934 + transCurItemIndex > MAX_ENT - 1)
2935 + SimpleError("Invalid Entry Number");}
2937 + if ((item = XfwfMultiListGetHighlighted(mlw))->num_selected == 0)
2938 SimpleError("No Item Selected");
2939 - transCurItemIndex = item->selected_items[0];
2941 + transCurItemIndex = item->selected_items[0];
2944 - strcpy(fullCommand, protItems[transCurItemIndex]->command);
2945 + strncpy(fullCommand, protItems[transCurItemIndex]->command, LRG_BUF);
2947 - if (protItems[transCurItemIndex]->reqName)
2948 - if (actionData == NULL || actionData[1] == NULL) {
2949 + if (protItems[transCurItemIndex]->reqName)
2951 + if (actionData == NULL || actionData[1] == NULL)
2953 popup = GetShell(PopupDialogGetValue("upload", widget, exec_upload,
2954 - NULL, lastUploadFile));
2955 + NULL, lastUploadFile));
2956 PopupCentered(popup, (clientData) ? XtParent(GetShell(widget)) : widget);
2960 - strcat(strcat(fullCommand, " "), actionData[1]);
2962 - DestroyShell(widget);
2963 - ShellCommand(fullCommand);
2967 + length_remaining = LRG_BUF - strlen(fullCommand);
2968 + strncat(fullCommand, " ", length_remaining);
2969 + length_remaining -= 1;
2970 + strncat(fullCommand, actionData[1], length_remaining);
2973 + DestroyShell(widget);
2974 + ShellCommand(fullCommand);
2978 @@ -133,11 +141,11 @@
2981 Widget dialog = XtParent(widget);
2982 - static char cmd[REG_BUF];
2985 - strcpy(lastUploadFile, XawDialogGetValueString(dialog));
2986 - sprintf(cmd, "%s %s", protItems[transCurItemIndex]->command,
2988 + strncpy(lastUploadFile, XawDialogGetValueString(dialog), REG_BUF);
2989 + cmd = FmtString("%s %s", protItems[transCurItemIndex]->command,
2990 + lastUploadFile, "");
2992 DestroyShell(XtParent(GetShell(widget)));
2994 --- seyon-2.20c.orig/Seyon-co.ad
2995 +++ seyon-2.20c/Seyon-co.ad
3002 +*borderColor: lightBlue
3004 *Command.background: lightBlue
3005 -*Scrollbar.background: darkSeaGreen
3006 -*Toggle.background: darkOliveGreen
3007 -*Toggle.foreground: darkTurquoise
3008 -*List.background: grey
3009 -*XfwfMultiList.background: grey
3010 -*Text*background: grey
3011 -*Text*Scrollbar.background: darkSeaGreen
3012 +*Scrollbar.background: cyan
3013 +*Toggle.background: cyan
3014 +*Toggle.foreground: black
3015 +*List.background: tan
3016 +*XfwfMultiList.background: tan
3017 +*Text*background: tan
3018 +*Text*Scrollbar.background: cyan
3020 *ok.background: green
3021 -*cancel.background: tomato
3022 +*cancel.background: red
3023 *dismiss.background: orange
3024 -*hangup.background: orange
3025 -*exit.background: tomato
3026 -*kill.background: tomato
3027 +*hangup.background: red
3028 +*exit.background: red
3029 +*kill.background: red
3031 -*about*msg.background: grey
3032 -*about*pic.background: grey
3033 +*about*msg.background: tan
3034 +*about*pic.background: tan
3036 -*messageBox.message.background: grey
3037 +*messageBox.message.background: tan
3039 -*quickKeyBox.Command.background: darkOliveGreen
3040 -*quickKeyBox.Command.foreground: darkTurquoise
3041 +*quickKeyBox.Command.background: orange
3042 +*quickKeyBox.Command.foreground: black
3043 --- seyon-2.20c.orig/config.h
3044 +++ seyon-2.20c/config.h
3046 * HDB uucp does) rather than in binary form as other uucp prgrams do
3048 #ifndef LF_USE_ASCII_PID
3049 -#define LF_USE_ASCII_PID NO
3050 +#define LF_USE_ASCII_PID YES
3058 -#define LF_PATH "/usr/spool/uucp"
3059 +#define LF_PATH "/var/lock"
3066 #ifndef USE_NONSTD_BAUD
3067 -#define USE_NONSTD_BAUD NO
3068 +#define USE_NONSTD_BAUD YES
3072 --- seyon-2.20c.orig/Imakefile
3073 +++ seyon-2.20c/Imakefile
3083 --- seyon-2.20c.orig/makever.sh
3084 +++ seyon-2.20c/makever.sh
3086 echo "#define VERSION \"$VERSION\"" >> version.h
3087 echo "#define REVISION \"$REVISION\"" >> version.h
3089 -echo "#ifdef IS_MAIN" >> version.h
3090 -echo "static char version[] = \"\$Revision$VERSION.$REVISION \$\";"\
3092 -echo "#endif" >> version.h
3093 +#echo "#ifdef IS_MAIN" >> version.h
3094 +#echo "static char version[] = \"\$Revision$VERSION.$REVISION \$\";"\
3096 +#echo "#endif" >> version.h
3098 echo "Machine type is $machine, OS name is $system"
3099 --- seyon-2.20c.orig/SeScan.c
3100 +++ seyon-2.20c/SeScan.c
3105 -static ScanState = SC_OUTSIDE;
3106 -static ScanDelim = 0; /* Current string delimiter */
3107 +static int ScanState = SC_OUTSIDE;
3108 +static int ScanDelim = 0; /* Current string delimiter */
3112 --- seyon-2.20c.orig/SeSubsX.c
3113 +++ seyon-2.20c/SeSubsX.c
3116 if (onlineTime != oldOnlineTime) {
3117 oldOnlineTime = onlineTime;
3118 - sprintf(buf, "%02d:%02d", onlineTime / 60, onlineTime % 60);
3119 + /* Buffer is easily big enough */
3120 + sprintf(buf, "%02ld:%02ld", onlineTime / 60, onlineTime % 60);
3121 SeSetLabel(statusWidget[0], buf);
3125 msg = qres.funMessages[msg_index++];
3128 + /* Buffer is easily big enough */
3129 sprintf(vermsg, "Welcome to Seyon version %s.%s", VERSION, REVISION);
3134 procRequest.action = action;
3136 - if (msg) strcpy(procRequest.msg, msg);
3138 + strncpy(procRequest.msg, msg, 80);
3139 else *procRequest.msg = '\0';
3141 write_pipe_data(pd, &procRequest, sizeof(procRequest));
3143 struct _procRequest procRequest;
3145 procRequest.action = action;
3146 - strcpy(procRequest.msg, msg);
3147 - strcpy(procRequest.arg, arg);
3148 + strncpy(procRequest.msg, msg, 80);
3149 + strncpy(procRequest.arg, arg, 90);
3151 write_pipe_data(child_pipe, &procRequest, sizeof(procRequest));
3153 @@ -201,10 +204,7 @@
3157 - char buffer[SM_BUF];
3159 - sprintf(buffer, fmt, a, b, c);
3160 - write_child_info(pd, action, buffer);
3161 + write_child_info(pd, action, FmtString(fmt,a,b,c));
3165 @@ -222,10 +222,7 @@
3169 - char buf[REG_BUF];
3171 - sprintf(buf, fmt, a, b, c);
3172 - SeyonMessage(buf);
3173 + SeyonMessage(FmtString(fmt,a,b,c));
3177 --- seyon-2.20c.orig/SeActions.c
3178 +++ seyon-2.20c/SeActions.c
3180 /* SeDecl.h includes stdio.h */
3182 #include "version.h"
3183 +#include "config.h"
3185 #define CheckNumParam(num) {if (*numParam != num) \
3186 SimpleError("Wrong Number of Parameters");}
3192 +/* Widget dirWidget; */
3193 static String termWindowId = NULL;
3196 @@ -312,10 +313,18 @@
3201 + int length_remaining;
3205 - sprintf((lptr = line), "%s %s", param[0], param[1]);
3207 + length_remaining = WBSIZE;
3208 + length = 1 + strlen(param[0]) + strlen(param[1]);
3209 + if(length_remaining > length)
3210 + sprintf((lptr = line), "%s %s", param[0], param[1]);
3212 + printf("SetAction: string buffer would have overrun: %s %s\n",param[0], param[1]);
3216 @@ -413,12 +422,12 @@
3219 case ACTION_NEW_ACTION:
3220 - strcpy(actionName, stringData);
3221 + strncpy(actionName, stringData, sizeof(actionName));
3225 case ACTION_NEW_ARG:
3226 - strcpy((argsArray[numArgs] = args[numArgs]), stringData);
3227 + strncpy((argsArray[numArgs] = args[numArgs]), stringData, SM_BUF);
3231 --- seyon-2.20c.orig/SeScript.c
3232 +++ seyon-2.20c/SeScript.c
3234 if (qres.scriptDirectory) scriptDir = qres.scriptDirectory;
3235 else scriptDir = qres.defaultDirectory;
3237 - strcpy(buf, scriptFileName);
3238 - if ((scriptFP = open_file(buf, scriptDir)) == NULL)
3239 + strncpy(buf, scriptFileName, REG_BUF);
3240 + if ((scriptFP = open_file(buf, REG_BUF, scriptDir)) == NULL)
3243 exec_close_script(scriptFP);
3244 @@ -110,31 +110,33 @@
3247 exec_close_script(script_fp)
3252 - echo_flag = False;
3257 + echo_flag = False;
3262 - if (linkflag == 2)
3264 + if (linkflag == 2)
3268 - get_line(script_fp);
3270 + get_line(script_fp);
3272 - fclose(script_fp);
3277 - lptr = strcpy(line, "");
3279 + fclose(script_fp);
3285 + /* No buffer length problem here! */
3286 + /* But why do this??? */
3287 + lptr = strcpy(line, "");
3296 static char wf[MAX_LINE];
3300 GETTEST_ARG("waitfor");
3302 + strncpy(wf, word, MAX_LINE);
3310 - strcpy(label, word);
3311 + strncpy(label, word, WBSIZE);
3316 if_flag = 0; /* reset IF flag */
3319 -static if_negate = 0;
3320 +static int if_negate = 0;
3324 --- seyon-2.20c.orig/SeWin.c
3325 +++ seyon-2.20c/SeWin.c
3328 Widget dialog = XtParent(valueWidget);
3330 - strcpy(getValueDefValue, XawDialogGetValueString(dialog));
3331 + strncpy(getValueDefValue, XawDialogGetValueString(dialog), REG_BUF);
3332 DestroyShell(dialog);
3334 (*getValueExecProc)(XtParent(GetShell(valueWidget)), getValueDefValue);
3335 @@ -745,10 +745,7 @@
3339 - char buf[REG_BUF];
3341 - sprintf(buf, fmt, a, b, c);
3342 - SePopupMsg(parent, buf);
3343 + SePopupMsg(parent, FmtString(fmt,a,b,c));
3347 @@ -773,20 +770,16 @@
3351 -SePopupNoticeF(parent, title, call_back, fmt, a, b, c, d)
3352 +SePopupNoticeF(parent, title, call_back, fmt, a, b, c)
3355 void (*call_back) ();
3363 - char buf[REG_BUF];
3365 - sprintf(buf, fmt, a, b, c);
3366 - SePopupNotice(parent, title, call_back, buf);
3367 + SePopupNotice(parent, title, call_back, FmtString(fmt,a,b,c));
3371 @@ -918,10 +911,7 @@
3375 - char buffer[REG_BUF];
3377 - sprintf(buffer, fmt, a, b, c);
3378 - SetStatusMessage(buffer);
3379 + SetStatusMessage(FmtString(fmt,a,b,c));
3382 /*---------------------------------------------------------------------------+
3383 --- seyon-2.20c.orig/SeString.c
3384 +++ seyon-2.20c/SeString.c
3392 - char buf[TIN_BUF];
3393 + char buf[TIN_BUF];
3395 - sprintf(buf, "%d", num);
3397 + /* Buffer is safely big enough */
3398 + sprintf(buf, "%d", num);
3403 @@ -100,8 +101,11 @@
3404 char buffer[REG_BUF],
3407 - strcpy(buffer, source);
3408 + strncpy(buffer, source, REG_BUF);
3409 bufptr = str_strip_lead_end_space(buffer);
3411 + /* Must fit, as we can only have removed things from the original
3413 return strcpy(dest, bufptr);
3416 @@ -130,12 +134,34 @@
3419 FmtString(fmt, a, b, c)
3420 - char *fmt, *a, *b, *c;
3421 + char *fmt, *a, *b, *c;
3423 - static char strBuf[LRG_BUF];
3424 + static char strBuf[LRG_BUF];
3425 + static FILE *devnull=NULL;
3428 + bzero(&strBuf, LRG_BUF);
3430 + /* Ick... This is horrible - using a user-provided format string
3431 + means we have no easy way of limiting string length. HACK HACK
3432 + HACK Use fprintf to output to /dev/null and count the number of
3433 + bytes... It would be nice if we could rely on having snprintf() */
3435 + if(NULL == devnull)
3437 + devnull = fopen("/dev/null", "r+");
3438 + if(NULL == devnull)
3440 + printf("Open /dev/null failed!?!\n");
3443 + length = fprintf(devnull, fmt, a, b, c);
3446 + if(LRG_BUF >= length)
3447 + sprintf(strBuf, fmt, a, b, c);
3449 - sprintf(strBuf, fmt, a, b, c);
3458 else if (*line == '\"')
3460 for (wrd = ++line; *line != '\"' && *line; line++);
3462 for (wrd = line; !isspace(*line) && *line; line++);
3463 @@ -246,38 +273,38 @@
3464 * this routine is not currently used, and I'm not if it works
3468 -get_word(str, word)
3475 +/* get_word(str, word) */
3482 +/* while (isspace(*str) && *str) */
3486 +/* word[0] = '\0'; */
3488 +/* else if (*str == '\"') { */
3489 +/* for (wrd = ++str; *str != '\"' && *str; str++); */
3491 +/* strcpy(word, wrd); */
3497 +/* for (wrd = str; !isspace(*str) && *str; str++); */
3500 +/* strcpy(word, wrd); */
3504 - while (isspace(*str) && *str)
3510 - else if (*str == '\"') {
3511 - for (wrd = ++str; *str != '\"' && *str; str++);
3513 - strcpy(word, wrd);
3519 - for (wrd = str; !isspace(*str) && *str; str++);
3522 - strcpy(word, wrd);
3533 --- seyon-2.20c.orig/SeParse.y
3534 +++ seyon-2.20c/SeParse.y
3539 +#include <stdlib.h>
3540 #include "SeParse.h"
3544 void (*callbackProc)();
3546 --- seyon-2.20c.orig/SeSet.c
3547 +++ seyon-2.20c/SeSet.c
3549 struct _setValue *vptr;
3552 - strcpy(vptr->value, modem_port);
3553 + strncpy(vptr->value, modem_port, SM_BUF);
3556 curValObjPtr = (vptr = (struct _setValue *)client_data);
3557 --- seyon-2.20c.orig/startup
3558 +++ seyon-2.20c/startup
3560 # see the manual page for a complete listing of the keywords
3561 # that can be used with 'set'.
3566 # can be 5, 6, 7, or 8
3570 # can be 0 (= no parity), 1 (= odd parity), or 2 (= even parity)
3577 # can be nl, cr, or cr/lf
3578 # set newlineTranslation cr
3592 # put the modem initialization string here if you like one.
3593 # most modern modems do not need it since they store their setup in
3594 # non-volatile memory.
3596 -# echo "Initializing modem..."
3598 +echo "Initializing modem..."
3600 --- seyon-2.20c.orig/debian/changelog
3601 +++ seyon-2.20c/debian/changelog
3603 +seyon (2.20c-8) unstable; urgency=medium
3605 + * Added Build-Depends on bison. Closes: #123699.
3606 + * Turned app-defaults files into conffiles after lintian warning.
3608 + -- Steve McIntyre <93sam@debian.org> Wed, 19 Dec 2001 17:24:13 +0000
3610 +seyon (2.20c-7) unstable; urgency=low
3612 + * Added Build-Depends on libxaw-dev. Closes: #89742.
3614 + -- Steve McIntyre <93sam@debian.org> Thu, 15 Mar 2001 15:55:19 +0000
3616 +seyon (2.20c-6) unstable; urgency=low
3618 + * Properly added menu entry. Sorry! Closes: #80160.
3620 + -- Steve McIntyre <93sam@debian.org> Wed, 14 Mar 2001 00:03:32 +0000
3622 +seyon (2.20c-5) unstable; urgency=low
3624 + * Added xutils to Build-Depends. Closes: #89134.
3625 + * Changed dependency on x-terminal-emulator to xterm | x-terminal-emulator to fix lintian warning.
3626 + * Added menu hint. Closes: #80160.
3627 + * I still think there's no better place in the menu structure than Apps/Net. Closes: #15080.
3629 + -- Steve McIntyre <93sam@debian.org> Sat, 10 Mar 2001 11:12:39 +0000
3631 +seyon (2.20c-4) unstable; urgency=low
3633 + * New maintainer address.
3634 + * Renamed Build-Depends-Indep to Build-Depends.
3636 + -- Steve McIntyre <93sam@debian.org> Wed, 07 Mar 2001 22:53:31 +0000
3638 +seyon (2.20c-3) unstable; urgency=medium
3640 + * Removed a broken usleep() declaration from SeDecl.h. Closes: #87532
3642 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sun, 25 Feb 2001 11:31:56 +0000
3644 +seyon (2.20c-2) unstable; urgency=medium
3646 + * Move app-defaults file to /etc/X11/app-defaults. Closes: #86289
3647 + * Now explicitly depends on x-terminal-emulator instead of imlicitly on xterm. Closes: #75343
3648 + * Fixed includes from SePort.c, so it now builds again. Closes: 84487
3649 + * Updated Standards-Version, added Build-Depends.
3650 + * Fixed lots of lintian warnings.
3652 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sat, 24 Feb 2001 11:01:56 +0000
3654 +seyon (2.20c-1) unstable; urgency=low
3656 + * Call makever.sh with sh, so it doesn't need to be executable. Fixes Bug#38037
3658 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sun, 23 May 1999 20:19:56 +0100
3660 +seyon (2.20c-0) unstable; urgency=low
3662 + * Hurrah! Seyon is now free! Check the copyright file for more info.
3664 + * New upstream version, new upstream maintainer (me!)
3666 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sun, 09 May 1999 21:18:01 +0100
3668 +seyon (2.14c-12) frozen unstable; urgency=low
3670 + * Removed obsolete dependency on xbase. Would be important bug if we weren'y non-free...
3672 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sat, 06 Feb 1999 13:32:15 +0000
3674 +seyon (2.14c-11) frozen unstable; urgency=low
3676 + * Replaced Suggests: for now non-existent kermit package with ckermit.
3678 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Thu, 14 Jan 1999 23:54:15 +0000
3680 +seyon (2.14c-10) frozen unstable; urgency=low
3682 + * Integrated non-maintainer diff (9.1)
3684 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Wed, 30 Dec 1998 01:48:53 +0000
3686 +seyon (2.14c-9.1) frozen unstable; urgency=low
3688 + * non-maintainer (binary-only) upload for Alpha
3689 + * ignore error from $(ch_commands) as chmodding the Seyon symlink fails if
3690 + seyon isn't installed yet (and hence no /etc/X11/seyon/Seyon file).
3692 + -- Paul Slootman <paul@debian.org> Tue, 29 Dec 1998 20:11:10 +0100
3694 +seyon (2.14c-9) frozen unstable; urgency=low
3696 + * Fixed typo in mono app-default file; s/replcae/replace; thanks to Remo Badii <Remo.Badii@psi.ch> for pointing this one out.
3698 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sun, 24 Oct 1998 20:15:08 +0100
3700 +seyon (2.14c-8) unstable; urgency=low
3702 + * Fixed script-handling code so it no longer seg-faults after running a "shell" command. Fixes Bug#27015.
3703 + * Include examples for phonelist, protocols and startup. Fixes Bug#23268.
3705 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sat, 17 Oct 1998 22:03:16 +0100
3707 +seyon (2.14c-7) frozen unstable; urgency=low
3709 + * Added missing sunsite reference to copyright file. Fixes bug #19870
3710 + * Added error-checking to postinst - don't ask questions if something went wrong. Fizes bug #12608.
3711 + * Restores X beep after use; fixes bug #17231.
3713 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Thu, 26 Mar 1998 22:54:54 -0000
3715 +seyon (2.14c-6) unstable; urgency=low
3718 + * Added simple man page for seyon-emu.
3719 + * Other packaging fixes to close bug #19402.
3720 + * Uses correct devices (fixes bug #15061)
3721 + * Postinst fixed (fixes bug #16226)
3723 + -- Steve McIntyre <stevem@chiark.greenend.org.uk> Sat, 14 Mar 1998 20:31:43 -0000
3725 +seyon (2.14c-5.3) unstable; urgency=low
3727 + * Fixed postint to not fail if enter is pressed in response to the first
3728 + question with no 'y' or 'n'.
3729 + * Postinst and postrm do not use bashisms, changes them to use /bin/sh.
3731 + -- Joey Hess <joeyh@master.debian.org> Sun, 16 Nov 1997 00:42:06 -0500
3733 +seyon (2.14c-5.2) unstable; urgency=low
3737 + -- Joey Hess <joeyh@master.debian.org> Sun, 16 Nov 1997 00:42:06 -0500
3739 +seyon (2.14c-5.1) unstable; urgency=low
3741 + * Changed maintainer to Debian QA Group; seyon is orphaned.
3742 + * Updated to use new source format (#9561).
3743 + * Use pristine sources.
3744 + * Register with menu system.
3745 + * Depend on xbase for xterm.
3746 + * Use ttyS instead of cua (#4922).
3747 + * If upgrading, and we used cua before, update the conffiles to use ttyS
3749 + * Include phonelist in the examples directory (#6475).
3751 + -- Joey Hess <joeyh@master.debian.org> Mon, 1 Sep 1997 13:13:24 -0400
3753 +Wed Jul 24 23:18:23 1996 Sven Rudolph <sr1@inf.tu-dresden.de>
3755 + * debian.control: added exetended description (Bug#3689)
3757 + * debian.rules: corrected multiarchitecture support
3759 + * debian.control: added Section: and Priority:
3761 +Thu Apr 4 19:38:36 1996 Sven Rudolph <sr1@inf.tu-dresden.de>
3763 + * releasing 2.14c-3
3767 + * debian.postinst: fixed creytion of seyon-emu symlink
3769 + * debian.control: removed Package_Revision field
3770 + added Architecture field
3772 +Thu Sep 21 23:23:52 1995 Sven Rudolph <sr1@inf.tu-dresden.de>
3774 + * moved config data to /etc/X11/seyon
3776 + * debian.postinst: postinst doesn't modify
3777 + /etc/X11/xinit/Xresources and
3778 + /etc/X11/xdm/Xresources now
3780 + * debian.control: fixed entries for DEPENDS and OPTIONAL
3781 + (Bug#1409, Bug#1177)
3783 + * debian.control: corrected location of manpage (Bug#490)
3784 --- seyon-2.20c.orig/debian/substvars
3785 +++ seyon-2.20c/debian/substvars
3787 +shlibs:Depends=libc6 (>= 2.2.4-4), libxaw7 (>> 4.1.0), xlibs (>> 4.1.0)
3788 --- seyon-2.20c.orig/debian/rules.old
3789 +++ seyon-2.20c/debian/rules.old
3792 +##############################################################################
3793 +# Generic debian/rules file. Based on:
3795 +#> Sample debian.rules file - for GNU Hello (1.3).
3796 +#> Copyright 1994,1995 by Ian Jackson.
3797 +#> I hereby give you perpetual unlimited permission to copy,
3798 +#> modify and relicense this file, provided that you do not remove
3799 +#> my name from the file itself. (I assert my moral right of
3800 +#> paternity under the Copyright, Designs and Patents Act 1988.)
3802 +# Heavily modified by Joey Hess <joeyh@master.debian.org>
3804 +##############################################################################
3806 +# NOTE: You shouldn't have to edit this file. Edit debian/config instead.
3807 +# If you must edit this file to get your package to build properly, then
3808 +# I have failed. Let me know; mail me.
3810 +# (Currently not handled: multiple binary packages from 1 source package,
3811 +# and binary-indep rule.)
3813 +# NOTE: This file is designed so it doesn't need to be run as root. For
3814 +# actions that require that the user be root, the root password will be
3815 +# prompted for, if you're not already root.
3817 +##############################################################################
3820 +# * Fakeroot and sudo fixes.
3821 +# * Run dpkg-gencontrol after debstd, and delete substvars during clean.
3822 +# * Clean up junk files in subdirs.
3823 +# * Modifications for multiple binary package support.
3824 +# * Call debstd after fixing file perms.
3825 +# * Don't pass package name to debstd + fixes for multi binary packages.
3826 +# * Use build-stamp instead of build.
3827 +# * New email address.
3828 +# * Added changelog.
3830 +##############################################################################
3832 +# Include config file.
3833 +include debian/config
3835 +# Generate a makefile (via configure scriopt or xmkmf).
3837 + ifeq ($(strip $(use_imakefile)),y)
3841 + touch makefile-stamp
3843 +# Preserve some files that may get deleted/overwritten/modified otherwise.
3845 + ifneq ($(strip $(preserve_files)),)
3846 + $(foreach file,$(preserve_files),cp $(file) $(file).preserved ;)
3848 + touch preserve-stamp
3850 +build-stamp: preserve-stamp makefile-stamp
3857 +clean: preserve-stamp makefile-stamp
3859 + # Do actual cleaning up here.
3860 + -rm -f build-stamp
3862 + -find . -name '\#*\#' -o -name '*~' -o -name 'DEADJOE' -exec rm -f {} \;
3863 + -rm -f debian/files* debian/substvars debian/*.substvars $(clean_files)
3865 + # Remove Makefile that xmkmf creates.
3866 + ifeq ($(strip $(use_imakefile)),y)
3869 + # If we preserved some files, we need to restore them now.
3870 + ifneq ($(strip $(preserve_files)),)
3871 + $(foreach file,$(preserve_files),mv -f $(file).preserved $(file); )
3873 + -rm -f preserve-stamp makefile-stamp
3875 +# Build architecture-independent files here.
3876 +# (not yet set up to be used)
3877 +binary-indep: build
3880 +# Build architecture-dependent files here.
3884 + $(install_command)
3885 + # Set permissions and check package for problems, then build package.
3886 + @if [ "`whoami`" != root ]; then \
3887 + echo -e "\n ** Enter root password to set file permissions."; \
3888 + sudo debian/rules setperms; \
3890 + debian/rules setperms; \
3893 +# This must be run suid root, it sets the file permissions in debian/tmp
3895 + chown -R root.root debian/tmp
3896 + chmod -R g-ws debian/tmp
3897 + # Debstd handles lots of nasty details. This requires that the debmake
3898 + # package is installed.
3899 + -debstd $(debstd) $(docs)
3900 + dpkg-gencontrol -p$(package)
3902 + dpkg --build debian/tmp ..
3905 + @test -e $(test_file) -a -f debian/rules || (echo -e "\n\
3906 + ** \"$(test_file)\" or \"debian/rules\" does not exist.\n\
3907 + ** Either the package is not unpacked in this directory, or\n\
3908 + ** an incorrect test_file is specified in debian/config.\n" && false)
3911 +# This rm's the debian/tmp directory, and any other directories specified in
3914 + -rm -rf debian/tmp >/dev/null 2>&1
3915 + @if [ -d debian/tmp -o -n "$(tmp_dirs)" ]; then \
3916 + if [ "`whoami`" != root ]; then \
3917 + echo -e "\n ** Enter root password to remove temporary directories $(tmp_dirs)"; \
3918 + sudo rm -rf debian/tmp $(tmp_dirs); \
3920 + rm -rf debian/tmp $(tmp_dirs); \
3925 +binary: binary-indep binary-arch
3926 +.PHONY: clean setperms binary
3927 --- seyon-2.20c.orig/debian/postinst
3928 +++ seyon-2.20c/debian/postinst
3933 + abort-upgrade|abort-remove|abort-deconfigure)
3934 + exit 0;; # Don't prompt for configuration if something went wrong...
3939 +if [ "$1" = "configure" ]; then
3940 + if [ -d /usr/doc -a ! -e /usr/doc/$PACKAGE -a -d /usr/share/doc/$PACKAGE ]; then
3941 + ln -sf ../share/doc/$PACKAGE /usr/doc/$PACKAGE
3945 +if test -x /usr/bin/update-menus; then update-menus; fi
3947 +EMU=/etc/X11/seyon/seyon-emu
3948 +COLORDEFAULTS=/etc/X11/seyon/Seyon
3949 +MODEMDEFAULTS=/etc/X11/seyon/Seyon-modem
3951 +# Old versions of seyon were configured to use /dev/cua devices, we need
3952 +# to change that to /dev/ttyS now.
3953 +if [ -f $MODEMDEFAULTS ]; then
3954 + if grep -q /dev/cua $MODEMDEFAULTS; then
3955 + echo "Reconfiguring seyon to use /dev/ttyS devices.."
3956 + sed -e 's:/dev/cua:/dev/ttyS:' <$MODEMDEFAULTS > $MODEMDEFAULTS.new
3957 + mv $MODEMDEFAULTS.new $MODEMDEFAULTS
3960 +# In case the .new file is left around by this script dying before, remove it.
3961 +rm -f $MODEMDEFAULTS.new
3963 +if [ ! -f $COLORDEFAULTS -o ! -f $MODEMDEFAULTS ]; then
3965 + # No longer need to worry about colour/mono app-defaults any more; the
3966 + # system will get it right...
3968 + ln -sf /usr/bin/x-terminal-emulator $EMU
3971 + echo "Where is your modem located?"
3972 + echo "(0) /dev/ttyS0 (equivalent to DOS COM1)"
3973 + echo "(1) /dev/ttyS1 (equivalent to DOS COM2)"
3974 + echo "(2) /dev/ttyS2 (equivalent to DOS COM3)"
3975 + echo "(3) /dev/ttyS3 (equivalent to DOS COM4)"
3976 + echo -n "Enter (0/1/2/3) -> "
3980 + echo >> $MODEMDEFAULTS
3981 + echo 'seyon*modems: /dev/ttyS'$PORT >> $MODEMDEFAULTS
3982 + echo "Modem configured for: /dev/ttyS$PORT";;
3983 + *) echo "Modem NOT configured.";;
3986 + echo "*** Important ***"
3987 + echo "Users must be added to the 'dialout' group to allow access to the modem"
3991 --- seyon-2.20c.orig/debian/config
3992 +++ seyon-2.20c/debian/config
3994 +# Edit this file to configure debian/rules to build a package.
3995 +# No modification of debian/rules should be neccessary. (Famous last words!)
3997 +# File by Joey Hess <joeyh@master.debian.org>
3999 +# What is the name of the primary package in this sourcepackage?
4002 +# Parameters to pass to rules file. This can include doc files, or
4003 +# command-line switches.
4004 +docs=1-{BUGREPORT,FAQ,HISTORY,README,SURVEY,TODO}
4005 +examples=phonelist protocols startup
4006 +binfiles=$(package)
4007 +copyright=debian/copyright
4009 +# What file must exist in the current directory if the package is
4010 +# properly unpacked here?
4011 +test_file=$(package).h
4013 +# Does this package build from an Imakefile?
4014 +# If so, uncomment the line below.
4017 +# Does this package build from a Configure script?
4018 +# If so, uncomment the line below and enter the command to run to run the
4019 +# Configure script (ie: "./Configure")
4020 +#use_configure=./Configure
4022 +# What commands to run to build the package?
4023 +define build_command
4027 +# What commands to run to clean up after a build?
4028 +define clean_command
4032 +# List here any files that must be removed during "debian/rules clean"
4033 +# that clean_command doesn't take care of.
4036 +# List here any temporary directories that are used to build multiple-
4037 +# binary packages. These are automatically created and removed.
4040 +# List here any files that should be preserved during a build, and restored
4041 +# to their original state during a clean. For example, if the package comes
4042 +# with both an Imakefile and a Makefile, and xmkmf is run, list the original
4043 +# Makefile here so it will be backed up before it is overwritten my xmkmf.
4044 +preserve_files=Makefile
4046 +# What command to run to install the package into debian/tmp?
4047 +# You might want to edit the package's Makefile and add $(PREFIX)
4048 +# to all the paths it installs files to. or, you can just write
4049 +# your own install commands here instead.
4051 +# Note that debian/* and the files in /usr/share/doc will be installed
4052 +# properly for you, you don't need to do that here.
4054 +define install_command
4055 + $(MAKE) DESTDIR=debian/tmp install
4056 + install -d debian/tmp/etc/X11/seyon
4057 + ln -sf /etc/X11/seyon/seyon-emu debian/tmp/usr/X11R6/bin/seyon-emu
4058 + install -d debian/tmp/usr/X11R6/man/man1
4059 + install -m 644 seyon.man debian/tmp/usr/X11R6/man/man1/seyon.1x
4060 + install -m 644 debian/seyon-emu.man debian/tmp/usr/X11R6/man/man1/seyon-emu.1x
4061 + # Install 1-CHANGES as upstream changelog.
4062 + install -d debian/tmp/usr/share/doc/$(package)
4063 + cp 1-CHANGES debian/tmp/usr/share/doc/$(package)/changelog
4064 + strip --remove-section=.comment --remove-section=.note debian/tmp/usr/X11R6/bin/seyon
4065 + install -d debian/tmp/usr/lib/menu
4066 + install -m 644 debian/menu debian/tmp/usr/lib/menu/seyon
4069 +# After being installed in debian/tmp, everything is chowned to root.root,
4070 +# and chmod g-ws is run on everything. Enter below any chmod commands you
4071 +# need to run to set files to the proper permissions. This is where you
4072 +# can make programs be suid, etc.
4073 +# (Note that these commands will be run as root.)
4075 + chmod 644 debian/tmp/etc/X11/app-defaults/*
4076 + chmod 644 debian/tmp/usr/X11R6/lib/X11/seyon.help
4078 --- seyon-2.20c.orig/debian/prerm
4079 +++ seyon-2.20c/debian/prerm
4085 +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PACKAGE ]; then
4086 + rm -f /usr/doc/$PACKAGE
4088 --- seyon-2.20c.orig/debian/rules
4089 +++ seyon-2.20c/debian/rules
4092 +##############################################################################
4093 +# Generic debian/rules file. Based on:
4095 +#> Sample debian.rules file - for GNU Hello (1.3).
4096 +#> Copyright 1994,1995 by Ian Jackson.
4097 +#> I hereby give you perpetual unlimited permission to copy,
4098 +#> modify and relicense this file, provided that you do not remove
4099 +#> my name from the file itself. (I assert my moral right of
4100 +#> paternity under the Copyright, Designs and Patents Act 1988.)
4102 +# Heavily modified by Joey Hess <jeh22@cornell.edu>
4104 +##############################################################################
4106 +# NOTE: You shouldn't have to edit this file. Edit debian/config instead.
4107 +# If you must edit this file to get your package to build properly, then
4108 +# I have failed. Let me know; mail jeh22@cornell.edu.
4110 +# (Currently not handled: multiple binary packages from 1 source package,
4111 +# and binary-indep rule.)
4113 +# NOTE: This file is designed so it doesn't need to be run as root. For
4114 +# actions that require that the user be root, the root password will be
4115 +# prompted for, if you're not already root.
4117 +##############################################################################
4119 +# Include config file.
4120 +include debian/config
4122 +# Generate a makefile (via configure scriopt or xmkmf).
4124 + ifeq ($(strip $(use_imakefile)),y)
4128 + touch makefile-stamp
4130 +# Preserve some files that may get deleted/overwritten/modified otherwise.
4132 + ifneq ($(strip $(preserve_files)),)
4133 + $(foreach file,$(preserve_files),-cp $(file) $(file).preserved)
4135 + touch preserve-stamp
4137 +build: preserve-stamp makefile-stamp
4142 +clean: preserve-stamp makefile-stamp
4144 + # Do actual cleaning up here.
4147 + -rm -rf *~ debian/*~ debian/files* $(clean_files)
4149 + # Remove Makefile that xmkmf creates.
4150 + ifeq ($(strip $(use_imakefile)),y)
4153 + # If we preserved some files, we need to restore them now.
4154 + ifneq ($(strip $(preserve_files)),)
4155 + $(foreach file,$(preserve_files),-mv -f $(file).preserved $(file))
4157 + -rm -f preserve-stamp makefile-stamp
4159 +# Build architecture-independent files here.
4160 +# (not yet set up to be used)
4161 +binary-indep: build
4164 +# Build architecture-dependent files here.
4168 + install -d debian/tmp debian/tmp/DEBIAN debian/tmp/usr/share/doc/$(package)
4169 + $(install_command)
4170 + # Compress manpages
4171 + -gzip -9v -r debian/tmp/usr/man/ debian/tmp/usr/X11R6/man/
4172 + # Install documentation files, compressed.
4173 + ifneq ($(strip $(docs)),)
4174 + cp $(docs) debian/tmp/usr/share/doc/$(package)
4175 + gzip -9v debian/tmp/usr/share/doc/$(package)/*
4177 + # Install copyright file, don't compress.
4178 + ifneq ($(strip $(copyright)),)
4179 + cp $(copyright) debian/tmp/usr/share/doc/$(package)/copyright
4181 + # Install examples, compressed.
4182 + ifneq ($(strip $(examples)),)
4183 + install -d debian/tmp/usr/share/doc/$(package)/examples
4184 + cp $(examples) debian/tmp/usr/share/doc/$(package)/examples
4185 + gzip -9v debian/tmp/usr/share/doc/$(package)/examples/*
4187 + # Install other debian files if they exist.
4188 + -install -m 644 debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
4189 + -gzip -9v debian/tmp/usr/share/doc/$(package)/changelog.Debian
4190 + -install -m 644 debian/conffiles debian/tmp/DEBIAN/conffiles
4191 + -install -m 755 debian/preinst debian/tmp/DEBIAN/preinst
4192 + -install -m 755 debian/postinst debian/tmp/DEBIAN/postinst
4193 + -install -m 755 debian/prerm debian/tmp/DEBIAN/prerm
4194 + -install -m 755 debian/postrm debian/tmp/DEBIAN/postrm
4195 + # Generate control file.
4196 + dpkg-shlibdeps $(binfiles)
4197 + dpkg-gencontrol -isp
4198 + # Set permissions.
4199 + @[ "`whoami`" != root ] && \
4200 + echo -e "\n ** Enter root password to set file permissions."; \
4201 + debian/rules setperms
4202 + # Actually build the .deb file.
4203 + dpkg --build debian/tmp ..
4205 +# This must be run suid root, it sets the file permissions in debian/tmp
4207 + chown -R root.root debian/tmp
4208 + chmod -R g-ws debian/tmp
4212 + @test -f $(test_file) -a -f debian/rules || (echo -e "\n\
4213 + ** \"$(test_file)\" or \"debian/rules\" does not exist.\n\
4214 + ** Either \"$(package)\" is not unpacked in this directory, or\n\
4215 + ** an incorrect test_file is specified in debian/config.\n" && false)
4218 +# This rm's the debian/tmp directory.
4220 + -rm -rf debian/tmp >/dev/null 2>&1
4221 + @if [ -d debian/tmp ]; then \
4222 + if [ "`whoami`" != root ]; then \
4223 + echo -e "\n ** Enter root password to remove debian/tmp."; \
4225 + rm -rf debian/tmp; \
4229 +binary: binary-indep binary-arch
4230 +.PHONY: clean setperms binary
4231 --- seyon-2.20c.orig/debian/control
4232 +++ seyon-2.20c/debian/control
4237 +Maintainer: Steve McIntyre <93sam@debian.org>
4238 +Standards-Version: 3.2.1.0
4239 +Build-Depends: xlibs-dev, xutils, libxaw-dev, bison
4243 +Depends: ${shlibs:Depends}, xterm | x-terminal-emulator
4244 +Suggests: lrzsz, ckermit
4245 +Description: Full-featured native X11 communications program.
4246 + Seyon is a complete full-featured modem communications package
4247 + for the X Window System. Some of its features are:
4248 + - dialing directory
4249 + - terminal emulation (DEC VT02, Tektronix 4014 and ANSI)
4252 --- seyon-2.20c.orig/debian/menu
4253 +++ seyon-2.20c/debian/menu
4255 +?package(seyon):needs=x11 section="Apps/Net" hints="Terminal" \
4256 + title="Seyon" longtitle="Seyon communications program" \
4258 --- seyon-2.20c.orig/debian/copyright
4259 +++ seyon-2.20c/debian/copyright
4261 +This is a Debian prepackaged version of seyon.
4263 +This package was originally put together by Joey Hess
4264 +<joeyh@master.debian.org>, using sources from:
4266 +ftp://sunsite.unc.edu/pub/Linux/apps/serialcomm/dialout/Seyon-2.14c-tar.gz
4268 +The following copyright applied to the old package:
4270 +======================================================================
4272 + Seyon is Copyright (c) 1992 of Muhammad M. Saggaf. Seyon is not
4273 + public domain. Permission is granted to use and distribute Seyon
4274 + freely for any use and to sell it at any price without reference to
4275 + the copyright owner provided that in all above cases Seyon is intact
4276 + and is not made part of any program either in whole or in part and
4277 + that this copyright notice is included with Seyon. Permission is
4278 + also granted to modify the source as long as the modified source is
4281 +======================================================================
4283 +As of May 1999, Muhammad M. Saggaf has given permission for seyon to
4284 +be released and maintained under GPL (see
4285 +/usr/share/common-licenses/GPL):
4289 +I received your letter today (yes, I know it took a long time, it took a
4290 +trip half-way around the world and then back to my current address in the
4291 +U.S.). I share your view about license for Seyon, I think it is too
4292 +restrictive, especially that I'm not actively maintaining it. The purpose
4293 +behind that restriction was to prevent incompatible versions, really, but I
4294 +don't think it was the correct way of doing that. You have my permission to
4295 +modify the license (e.g. the GPL is just fine) and distribute the package
4296 +with the new license.
4298 +My very best wishes,
4301 + msaggaf@erl.mit.edu
4303 +For now I am the new upstream maintainer as well as the Debian
4304 +maintainer for the swyon package. Upstream sources without the Debian
4305 +patches will be made available shortly from sunsite.unc.edu (now
4306 +better known as metalab.unc.edu), as above.
4307 --- seyon-2.20c.orig/debian/postrm
4308 +++ seyon-2.20c/debian/postrm
4312 +if test -x /usr/bin/update-menus; then update-menus; fi
4314 +XTERM=/etc/X11/seyon/seyon-emu
4315 +COLORDEFAULTS=/etc/X11/seyon/Seyon
4316 +MODEMDEFAULTS=/etc/X11/seyon/Seyon-modem
4318 +if [ x$1 = xpurge ]; then
4319 + rm -f $XTERM $COLORDEFAULTS $MODEMDEFAULTS
4320 + rmdir /etc/X11/seyon /etc/X11 2>/dev/null || true
4322 --- seyon-2.20c.orig/debian/seyon-emu.man
4323 +++ seyon-2.20c/debian/seyon-emu.man
4325 +.TH SEYON 1 \" -*- nroff -*-
4328 +Seyon \- X11 Telecommunications Package.
4337 +\fISeyon-emu\fP is the name of the terminal-emulator program called by
4338 +\fIseyon\fP. This will normally simply be a symbolic link to another
4339 +program (such as \fIxterm\fP or \fIrxvt\fP). Therefore read the manual
4340 +page of the appropriate program for its options.
4343 +rxvt(1), xterm(1), seyon(1)
4345 +This manual page added by Steve McIntyre <stevem@chiark.greenend.org.uk>,
4346 +Debian maintainer of seyon, 14th March 1998.
4348 --- seyon-2.20c.orig/debian/examples
4349 +++ seyon-2.20c/debian/examples
4358 --- seyon-2.20c.orig/debian/conffiles
4359 +++ seyon-2.20c/debian/conffiles
4361 +/etc/X11/app-defaults/Seyon
4362 +/etc/X11/app-defaults/Seyon-color
4363 --- seyon-2.20c.orig/typescript
4364 +++ seyon-2.20c/typescript
4366 +Script started on Thu Feb 24 23:08:45 2000
4367 +hammer:~/debian/seyon/seyon-2.20c$ make clean && make
\r
4369 +rm -f version.h y.tab.* SeParse.c
\r
4370 +rm -f *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut "#"*
\r
4373 +Machine type is i686, OS name is Linux
\r
4374 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o Seyon.o Seyon.c
\r
4375 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeActions.o SeActions.c
\r
4376 +bison -y -d SeParse.y
\r
4377 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeScan.o SeScan.c
\r
4378 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeDial.o SeDial.c
\r
4379 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeErr.o SeErr.c
\r
4380 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeGeneric.o SeGeneric.c
\r
4382 +gcc -c -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -DHELPFILE=\"/usr/X11R6/lib/X11/seyon.help\" SeInit.c
\r
4383 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeIo.o SeIo.c
\r
4384 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeMisc.o SeMisc.c
\r
4385 +mv -f y.tab.c SeParse.c
\r
4386 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeParse.o SeParse.c
\r
4387 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SePort.o SePort.c
\r
4388 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeScript.o SeScript.c
\r
4389 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeSet.o SeSet.c
\r
4390 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeSig.o SeSig.c
\r
4391 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeString.o SeString.c
\r
4392 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeSubs.o SeSubs.c
\r
4393 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeSubsX.o SeSubsX.c
\r
4394 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeSupp.o SeSupp.c
\r
4395 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeTerm.o SeTerm.c
\r
4396 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeTrans.o SeTrans.c
\r
4397 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o SeWin.o SeWin.c
\r
4398 +gcc -O2 -g -Wall -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o MultiList.o MultiList.c
\r
4400 +gcc -o seyon -O2 -g -Wall -L/usr/X11R6/lib Seyon.o SeActions.o SeScan.o SeDial.o SeErr.o SeGeneric.o SeInit.o SeIo.o SeMisc.o SeParse.o SePort.o SeScript.o SeSet.o SeSig.o SeString.o SeSubs.o SeSubsX.o SeSupp.o SeTerm.o SeTrans.o SeWin.o MultiList.o -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
\r
4401 +hammer:~/debian/seyon/seyon-2.20c$
4402 +Script done on Thu Feb 24 23:09:17 2000