Index: cpukit/telnetd/pty.c
===================================================================
--- cpukit/telnetd/pty.c	(revision 081583c6610ded0d1fc13aaffcb123daf260bf1e)
+++ cpukit/telnetd/pty.c	(revision edcb9827dc7f2d30e5cda9ed790b460d49ba9b94)
@@ -113,8 +113,10 @@
 
   if (telnet_pty_inited) {
+#if 0
     if ( rtems_telnetd_maximum_ptys < 5 )
       rtems_telnetd_maximum_ptys = 5;
 
     telnet_ptys = malloc( rtems_telnetd_maximum_ptys * sizeof (pty_t) );
+#endif
     if ( !telnet_ptys ) {
       return NULL;
@@ -122,4 +124,5 @@
       
     for (ndx=0;ndx<rtems_telnetd_maximum_ptys;ndx++) {
+
       if (telnet_ptys[ndx].socket<0) {
         struct timeval t;
@@ -426,6 +429,11 @@
 )
 {
-int ndx;
-rtems_status_code status ;
+  int ndx;
+  rtems_status_code status;
+
+  if ( rtems_telnetd_maximum_ptys < 5 )
+    rtems_telnetd_maximum_ptys = 5;
+
+  telnet_ptys = malloc( rtems_telnetd_maximum_ptys * sizeof (pty_t) );
 
   /* 
@@ -434,13 +442,13 @@
 
   for (ndx=0;ndx<rtems_telnetd_maximum_ptys;ndx++) {
-    telnet_ptys[ndx].devname=(char*)malloc(strlen("/dev/ptyXX")+1);
+    telnet_ptys[ndx].devname = (char*)malloc(strlen("/dev/ptyXX")+1);
     sprintf(telnet_ptys[ndx].devname,"/dev/pty%X",ndx);
-    telnet_ptys[ndx].ttyp=NULL;
-    telnet_ptys[ndx].c_cflag=CS8|B9600;
-    telnet_ptys[ndx].socket=-1;
-    telnet_ptys[ndx].opened=FALSE;
-    telnet_ptys[ndx].sb_ind=0;
-    telnet_ptys[ndx].width=0;
-    telnet_ptys[ndx].height=0;
+    telnet_ptys[ndx].ttyp    =  NULL;
+    telnet_ptys[ndx].c_cflag = CS8|B9600;
+    telnet_ptys[ndx].socket  = -1;
+    telnet_ptys[ndx].opened  = FALSE;
+    telnet_ptys[ndx].sb_ind  = 0;
+    telnet_ptys[ndx].width   = 0;
+    telnet_ptys[ndx].height  = 0;
 
   }
Index: cpukit/telnetd/telnetd.c
===================================================================
--- cpukit/telnetd/telnetd.c	(revision 081583c6610ded0d1fc13aaffcb123daf260bf1e)
+++ cpukit/telnetd/telnetd.c	(revision edcb9827dc7f2d30e5cda9ed790b460d49ba9b94)
@@ -62,12 +62,12 @@
 
 struct shell_args {
-  char	*devname;
-  void	*arg;
-  char	peername[16];
-  char	delete_myself;
+  char *devname;
+  void *arg;
+  char  peername[16];
+  char  delete_myself;
 };
 
 typedef union uni_sa {
-  struct sockaddr_in	sin;
+  struct sockaddr_in sin;
   struct sockaddr     sa;
 } uni_sa;
@@ -76,27 +76,34 @@
 
 static int initialize_telnetd();
-
-void * telnetd_dflt_spawn(const char *name, unsigned priority, unsigned stackSize, void (*fn)(void*), void *fnarg);
+static int telnetd_askForPassword;
+
+void * telnetd_dflt_spawn(
+  const char *name,
+  unsigned priority,
+  unsigned stackSize,
+  void (*fn)(void*),
+  void *fnarg
+);
 
 /***********************************************************/
 rtems_id            telnetd_task_id      =0;
-uint32_t		    telnetd_stack_size   =32000;
+uint32_t            telnetd_stack_size   =32000;
 rtems_task_priority telnetd_task_priority=0;
-int					telnetd_dont_spawn   =0;
-void				(*telnetd_shell)(char *, void*)=0;
-void				*telnetd_shell_arg	 =0;
-void *				(*telnetd_spawn_task)(const char *, unsigned, unsigned, void (*)(void*), void *) = telnetd_dflt_spawn;
+int                 telnetd_dont_spawn   =0;
+void                (*telnetd_shell)(char *, void*)=0;
+void                *telnetd_shell_arg         =0;
+void *              (*telnetd_spawn_task)(
+        const char *, unsigned, unsigned, void (*)(void*), void *) = telnetd_dflt_spawn;
 
 static char *grab_a_Connection(int des_socket, uni_sa *srv, char *peername, int sz)
 {
-char		*rval = 0;
+  char *rval = 0;
 #if 0
-socklen_t	
+  socklen_t size_adr = sizeof(srv->sin);
 #else
-/* 4.6 doesn't have socklen_t */
-uint32_t
-#endif
-      size_adr = sizeof(srv->sin);
-int			acp_sock;
+  /* 4.6 doesn't have socklen_t */
+  uint32_t size_adr = sizeof(srv->sin);
+#endif
+  int acp_sock;
 
   acp_sock = accept(des_socket,&srv->sa,&size_adr);
@@ -146,16 +153,14 @@
 static int sockpeername(int sock, char *buf, int bufsz)
 {
-uni_sa	peer;
+  uni_sa peer;
+  int    rval = sock < 0;
 #if 0
-socklen_t	
+  socklen_t len  = sizeof(peer.sin);
 #else
-/* 4.6 doesn't have socklen_t */
-uint32_t
-#endif
-    len  = sizeof(peer.sin);
-
-int		rval = sock < 0;
-
-  if ( !rval)
+  /* 4.6 doesn't have socklen_t */
+  uint32_t len  = sizeof(peer.sin);
+#endif
+
+  if ( !rval )
     rval = getpeername(sock, &peer.sa, &len);
 
@@ -181,11 +186,11 @@
 rtems_task_telnetd(void *task_argument)
 {
-int					des_socket;
-uni_sa				srv;
-char				*devname;
-char				peername[16];
-int					i=1;
-int					size_adr;
-struct shell_args	*arg;
+  int                des_socket;
+  uni_sa             srv;
+  char              *devname;
+  char               peername[16];
+  int                i=1;
+  int                size_adr;
+  struct shell_args *arg;
 
   if ((des_socket=socket(PF_INET,SOCK_STREAM,0))<0) {
@@ -220,41 +225,42 @@
 
     if ( !devname ) {
-    /* if something went wrong, sleep for some time */
-    sleep(10);
-    continue;
+      /* if something went wrong, sleep for some time */
+      sleep(10);
+      continue;
     }
     if ( telnetd_dont_spawn ) {
-    if ( 0 == check_passwd(peername) )
-      telnetd_shell(devname, telnetd_shell_arg);
+      if ( !telnetd_askForPassword || (0 == check_passwd(peername)) )
+        telnetd_shell(devname, telnetd_shell_arg);
     } else {
-    arg = malloc( sizeof(*arg) );
-
-    arg->devname = devname;
-    arg->arg = telnetd_shell_arg;
-    strncpy(arg->peername, peername, sizeof(arg->peername));
-
-    if ( !telnetd_spawn_task(&devname[5], telnetd_task_priority, telnetd_stack_size, spawned_shell, arg) ) {
-
-      FILE *dummy;
-
-      if ( telnetd_spawn_task != telnetd_dflt_spawn ) {
-        fprintf(stderr,"Telnetd: Unable to spawn child task\n");
+      arg = malloc( sizeof(*arg) );
+
+      arg->devname = devname;
+      arg->arg = telnetd_shell_arg;
+      strncpy(arg->peername, peername, sizeof(arg->peername));
+
+      if ( !telnetd_spawn_task( &devname[5], telnetd_task_priority,
+               telnetd_stack_size, spawned_shell, arg) ) {
+        FILE *dummy;
+
+        if ( telnetd_spawn_task != telnetd_dflt_spawn ) {
+          fprintf(stderr,"Telnetd: Unable to spawn child task\n");
+        }
+
+        /* hmm - the pty driver slot can only be
+         * released by opening and subsequently
+         * closing the PTY - this also closes
+         * the underlying socket. So we mock up
+         * a stream...
+         */
+
+        if ( !(dummy=fopen(devname,"r+")) )
+          perror("Unable to dummy open the pty, losing a slot :-(");
+        release_a_Connection(devname, peername, &dummy, 1);
+        free(arg);
+        sleep(2); /* don't accept connections too fast */
       }
-
-      /* hmm - the pty driver slot can only be
-       * released by opening and subsequently
-       * closing the PTY - this also closes
-       * the underlying socket. So we mock up
-       * a stream...
-       */
-
-      if ( !(dummy=fopen(devname,"r+")) )
-        perror("Unable to dummy open the pty, losing a slot :-(");
-      release_a_Connection(devname, peername, &dummy, 1);
-      free(arg);
-      sleep(2); /* don't accept connections too fast */
-  		}
     }
   } while(1);
+
   /* TODO: how to free the connection semaphore? But then - 
    *       stopping the daemon is probably only needed during
@@ -266,4 +272,5 @@
   telnetd_task_id=0;
 }
+
 /***********************************************************/
 static int initialize_telnetd(void) {
@@ -272,6 +279,7 @@
   if (telnetd_stack_size<=0   ) telnetd_stack_size   =32000;
 
-  if ( !telnetd_spawn_task("TNTD", telnetd_task_priority, RTEMS_MINIMUM_STACK_SIZE, rtems_task_telnetd, 0) ) {
-    return -1;	
+  if ( !telnetd_spawn_task("TNTD", telnetd_task_priority,
+          RTEMS_MINIMUM_STACK_SIZE, rtems_task_telnetd, 0) ) {
+    return -1;
   }
   return 0;
@@ -284,8 +292,9 @@
   int                  dontSpawn,
   size_t               stack,
-  rtems_task_priority  priority
+  rtems_task_priority  priority,
+  int                  askForPassword
 )
 {
-  rtems_status_code	sc;
+  rtems_status_code sc;
 
 #if 0
@@ -309,4 +318,6 @@
     return 1;
   }
+
+  telnetd_askForPassword = askForPassword;
 
   if (cmd)
@@ -318,12 +329,13 @@
   }
   if ( priority < 2 )
-    priority=100;
+    priority = 100;
   telnetd_task_priority = priority;
   telnetd_dont_spawn    = dontSpawn;
 
-  sc=initialize_telnetd();
-        if (sc!=RTEMS_SUCCESSFUL) return sc;
+  sc = initialize_telnetd();
+  if (sc != RTEMS_SUCCESSFUL) return sc;
+
   printf("rtems_telnetd() started with stacksize=%u,priority=%d\n",
-                        (unsigned)telnetd_stack_size,(int)telnetd_task_priority);
+    (unsigned)telnetd_stack_size,(int)telnetd_task_priority);
   return 0;
 }
@@ -333,9 +345,9 @@
 spawned_shell(void *targ)
 {
-rtems_status_code	sc;
-FILE				*nstd[3]={0};
-FILE				*ostd[3]={ stdin, stdout, stderr };
-int					i=0;
-struct shell_args	*arg = targ;
+  rtems_status_code    sc;
+  FILE                *nstd[3]={0};
+  FILE                *ostd[3]={ stdin, stdout, stderr };
+  int                  i=0;
+  struct shell_args  *arg = targ;
 
   sc=rtems_libio_set_private_env();
@@ -366,14 +378,13 @@
   stderr = nstd[2];
 
-
-
-#if 0
-printk("STDOUT is now %x (%x) (FD %i/%i)\n",stdout,nstd[1],fileno(stdout),fileno(nstd[1]));
-printf("hello\n");
-write(fileno(stdout),"hellofd\n",8);
-#endif
+  #if 0
+    printk("STDOUT is now %x (%x) (FD %i/%i)\n",
+           stdout,nstd[1],fileno(stdout),fileno(nstd[1]));
+    printf("hello\n");
+    write(fileno(stdout),"hellofd\n",8);
+  #endif
 
   /* call their routine */
-  if ( 0 == check_passwd(arg->peername) )
+  if ( !telnetd_askForPassword || (0 == check_passwd(arg->peername)) )
     telnetd_shell(arg->devname, arg->arg);
 
@@ -395,7 +406,7 @@
 wrap_delete(rtems_task_argument arg)
 {
-struct wrap_delete_args     *pwa = (struct wrap_delete_args *)arg;
-register void              (*t)(void *) = pwa->t;
-register void               *a   = pwa->a;
+  struct wrap_delete_args     *pwa = (struct wrap_delete_args *)arg;
+  register void              (*t)(void *) = pwa->t;
+  register void               *a   = pwa->a;
 
   /* free argument before calling function (which may never return if
@@ -410,34 +421,34 @@
 telnetd_dflt_spawn(const char *name, unsigned int priority, unsigned int stackSize, void (*fn)(void *), void* fnarg)
 {
-rtems_status_code sc;
-rtems_id          task_id;
-char              nm[4] = {'X','X','X','X' };
-struct wrap_delete_args *pwa = malloc(sizeof(*pwa));
-
-    strncpy(nm, name, 4);
-
-    if ( !pwa ) {
-      perror("Telnetd: no memory\n");
-      return 0;
-    }
-
-    pwa->t = fn;
-    pwa->a = fnarg;
-
-    if ((sc=rtems_task_create(
-        rtems_build_name(nm[0], nm[1], nm[2], nm[3]),
-        (rtems_task_priority)priority,
-        stackSize,
-        RTEMS_DEFAULT_MODES,
-        RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT,
-        &task_id)) ||
-      (sc=rtems_task_start(
-        task_id,
-        wrap_delete,
-        (rtems_task_argument)pwa))) {
-          free(pwa);
-          rtems_error(sc,"Telnetd: spawning task failed");
-          return 0;
-    }
+  rtems_status_code        sc;
+  rtems_id                 task_id;
+  char                     nm[4] = {'X','X','X','X' };
+  struct wrap_delete_args *pwa = malloc(sizeof(*pwa));
+
+  strncpy(nm, name, 4);
+
+  if ( !pwa ) {
+    perror("Telnetd: no memory\n");
+    return 0;
+  }
+
+  pwa->t = fn;
+  pwa->a = fnarg;
+
+  if ((sc=rtems_task_create(
+    rtems_build_name(nm[0], nm[1], nm[2], nm[3]),
+      (rtems_task_priority)priority,
+      stackSize,
+      RTEMS_DEFAULT_MODES,
+      RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT,
+      &task_id)) ||
+    (sc=rtems_task_start(
+      task_id,
+      wrap_delete,
+      (rtems_task_argument)pwa))) {
+        free(pwa);
+        rtems_error(sc,"Telnetd: spawning task failed");
+        return 0;
+  }
   return (void*)task_id;
 }
@@ -445,5 +456,4 @@
 /* convenience routines for CEXP (retrieve stdio descriptors
  * from reent structure)
- *
  */
 #ifdef stdin
Index: cpukit/telnetd/telnetd.h
===================================================================
--- cpukit/telnetd/telnetd.h	(revision 081583c6610ded0d1fc13aaffcb123daf260bf1e)
+++ cpukit/telnetd/telnetd.h	(revision edcb9827dc7f2d30e5cda9ed790b460d49ba9b94)
@@ -21,10 +21,13 @@
  *  Initialize the telnetd subsystem.
  *
- *  cmd        - function which is the "shell" telnetd invokes
- *  arg        - context pointer to cmd
- *  dontSpawn  - TRUE if telnetd takes over this task.
- *               FALSE to create another task for the shell.
- *  stack      - stack size of spawned task 
- *  priority   - initial priority of spawned task
+ *  cmd              - function which is the "shell" telnetd invokes
+ *  arg              - context pointer to cmd
+ *  dontSpawn        - TRUE if telnetd takes over this task.
+ *                     FALSE to create another task for the shell.
+ *  stack            - stack size of spawned task 
+ *  priority         - initial priority of spawned task
+ *  askForPassword   - TRUE if telnetd asks for password
+ *                     FALSE to invoke "cmd" with no password check.
+ *                        This may be OK if "cmd" includes its own check.
  */
 int rtems_telnetd_initialize(
@@ -33,5 +36,6 @@
   int                  dontSpawn,
   size_t               stack,
-  rtems_task_priority  priority
+  rtems_task_priority  priority,
+  int                  askForPassword
 );
 
