[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#5332: possible suggestions for mgetty



Package: mgetty
Version: 0.99.3-1

Would you be willing to consider the following patch to mgetty?  The
first part changes mgetty so that if a null value is specified for 
'login-prompt', no username is read by mgetty, and insted the value of
'default-login' is used for parsing login.config.  This allows mgetty
to be used as a much more general 'inetd for modems' where having
mandatory login parsing done by mgetty is generally unwanted.

The other patch (USE_GETTYDEFS) is more straight-forward.  I
acknowledge the "I suspect some bugs lingering in that code", but
would rather see us find and fix those bugs than just ignore them
(it's been working fine here for several months with moderate usage).
The gettydef functionality is very useful when trying to use mgetty in
'inetd-mode', as terminal settings such as ECHO and ICRNL are
generally inappropriate.

If you like, I'd be happy to submit the first patch directly to the
upstream maintainer, but I figured I'd run it by you first to see what
you thoguht.

diff -ruN mgetty-0.99.3.clameter/conf_mg.c mgetty-0.99.3/conf_mg.c
--- mgetty-0.99.3.clameter/conf_mg.c    Tue Jul  9 03:00:27 1996
+++ mgetty-0.99.3/conf_mg.c     Fri Nov  8 09:45:10 1996
@@ -101,6 +101,7 @@
 #else
        { "login-time", 0, CT_INT, C_EMPTY },
 #endif
+       { "default-login", (p_int)"/Anonymous/", CT_STRING, C_PRESET },
 
        { "fax-id", (p_int)FAX_STATION_ID, CT_STRING, C_PRESET },
        { "fax-server-file", 0, CT_STRING, C_EMPTY },
diff -ruN mgetty-0.99.3.clameter/conf_mg.h mgetty-0.99.3/conf_mg.h
--- mgetty-0.99.3.clameter/conf_mg.h    Tue Jul  9 02:31:21 1996
+++ mgetty-0.99.3/conf_mg.h     Fri Nov  8 09:44:26 1996
@@ -38,6 +38,7 @@
        prompt_waittime,                        /* ms wait before prompting */
        login_prompt,
        login_time,                             /* max. time to log in */
+       default_login,
 
        station_id,                             /* local fax station ID */
        fax_server_file,                        /* fax to send upon poll */
diff -ruN mgetty-0.99.3.clameter/mgetty.c mgetty-0.99.3/mgetty.c
--- mgetty-0.99.3.clameter/mgetty.c     Thu Nov  7 12:27:48 1996
+++ mgetty-0.99.3/mgetty.c      Fri Nov  8 09:57:15 1996
@@ -992,8 +992,14 @@
           cr+nl -> IGNCR, cr -> ICRNL, NL -> 0/ and: cr -> ONLCR, nl -> 0
           for c_oflag */
 
-       if ( getlogname( c_string(login_prompt), &tio, buf, sizeof(buf), 
-                        !c_bool(blocking) ) == -1 ) continue;
+       if (c_string (login_prompt) && (strlen (c_string (login_prompt)) > 0)) {
+         if ( getlogname (c_string(login_prompt), &tio, buf, sizeof(buf), 
+                          !c_bool(blocking) ) == -1 ) {
+           continue;
+         }
+       } else {
+         strncpy (buf, c_string (default_login), MAXLINE);
+       }
 
        /* remove PID file (mgetty is due to exec() login) */
 #ifdef MGETTY_PID_FILE
diff -ruN mgetty-0.99.3.clameter/policy.h mgetty-0.99.3/policy.h
--- mgetty-0.99.3.clameter/policy.h     Fri Nov  8 11:07:40 1996
+++ mgetty-0.99.3/policy.h      Fri Nov  8 11:05:14 1996
@@ -63,11 +63,11 @@
  * I recommend against it, I suspect some bugs lingering in that code
  * (and one doesn't really need it in a normal setup anyway).
  */
-/* #define USE_GETTYDEFS */
+#define USE_GETTYDEFS
 
 /* Name of the "gettydefs" file (used only if USE_GETTYDEFS is set)
  */
-#define GETTYDEFS "/etc/gettydefs"
+#define GETTYDEFS "/etc/mgetty/gettydefs"
 
 /* If no gettydefs "tag" is specified on the command line, use
  * this setting (from GETTYDEFS) as default (only if compiled with

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: