From: pmacdona@sanjuan (Peter MacDonald)
Subject: Re: other problems - SLS .98.1 + patches 2-5
Organization: University of Victoria, Victoria B.C. CANADA
Date: Fri, 20 Nov 92 02:01:43 GMT

In article <Bxw87p.Izx@shyguy.lonestar.org> bmyers@shyguy.lonestar.org (bob myers) writes:
>I've just installed patches 2 through 5 on my SLS distribution; let
>me give a quick run down on my hardware:
> 
>Tandy 4800HD (80486sx -20 mhz) laptop, 50 mb hard drive linux partition,
>      10 mb dos 5.0 partition, 4 mb ram (within a week, will be at 8 mb).
>
>I'm seeing the following items now happening:
>
>1) upon boot with LILO, I'm not being asked if I'd like to select any
>   svga modes, but yet the 4 options are displayed and then quickly passed
>   over.  (i.e. no pausing to select the svga mode, but it does display the
>   four offered).
>
>2) when I do a man of anything (and this also follows with some of the
>   other commands/programs), I'm being warned about an old copy of stat()
>   being used, and that I should recompile...but it still continues on
>   with the execution (this is bothersome).
>
>3) when i try to issue a 'w' command, I get the following:
>   'lseek kmem: Unknown error 127469004'
>   this also happens when I try the ps command.

Upgrade to SLS 98.5 and the above will go away.  Read the HISTORY file to see what
you need.  Note that the "rdev" command is expanded to set the video mode to 
do what you say in 1).  That is, preselect the video mode for you.  Use "rdev -h"
to see the help.

>
>4) gnuchess gives a segmentation fault (running in normal mode; not in
>   X386 mode).
>

I don't have "gnuchess", so I haven't seen this.
>any ideas?  i think I might have found one problem; the Makefile in the 
>/usr/src/linux directory had two occurances for specifying the svga
>choice.
>
>-bob
>
>
>
>-- 
>----------------------------------------------------------------------
>Bob Myers                        | Soooo many fields.....
>2479 Deer Run #1305              |
>Lewisville, Tx.  75067           |    Not enough waves....


BTW:  Here is a fixed source for "adduser", which a number of people have
complained about. 

Peter


/* adduser : add a new user account          */
/* Craig Hagan                               */
/*                                           */
/* pardon the kludge..written during         */
/* commercials of star trek tng              */

#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/time.h>
#include <time.h>

#define PASSWD_FILE "/etc/passwd"
/*#define DEBUG*/

char *crypt();

main()
{
  char foo[32],uname[32],person[32],passwd[32],dir[60],shell[60],line[100];
  unsigned int group,uid;
  int bad=0,done=0,correct=0;
  char	salt[2];
  time_t tm;

  FILE *passwd_file;

  while(!correct)
    {
      while(!done)
	{
	  printf("Username to add: ");
	  fgets(uname,sizeof(uname),stdin); uname[strlen(uname)-1] = '\0';
	  printf("[%s]\n",uname);
	  passwd_file=fopen(PASSWD_FILE,"r");
	  while(!feof(passwd_file) && !bad)
	    {
	      fgets(line,100,passwd_file);
	      strcpy(foo,strtok(line,":"));
	      bad=!strcmp(foo,uname);
	    }
	  fclose(passwd_file);
	  
	  done=!bad;
	  
	  if(bad)
	    {
	      printf("That name is in use, choose another.\n");
	      bad=0;
	    }
	}
      
      printf("%s's personal name : ",uname);
      fgets(person,sizeof(person),stdin); person[strlen(person)-1] = '\0';
      
      bad=1;
      while(bad)
	{
	  printf("%s's group number: ",uname);
	  scanf("%d",&group);
	  fgets(foo,sizeof(foo),stdin); foo[strlen(foo)-1] = '\0';

	  bad=group==0;
	  if (group==0)
	    {
	      printf("Give %s superuser privs? [y|n] : ",uname);
	      fgets(foo,sizeof(foo),stdin); foo[strlen(foo)-1] = '\0';
	      bad=((foo[0]!='Y')&&(foo[0]!='y'));
	    }	      
	}

      printf("\n%s's uid : ",uname);
      scanf("%d",&uid);
      
      fgets(foo,sizeof(foo),stdin); foo[strlen(foo)-1] = '\0';

      printf("\n%s's home directory: [/home/%s] : ",uname,uname);
      fgets(dir,sizeof(dir),stdin); dir[strlen(dir)-1] = '\0';
      if (!strcmp(dir,""))
	sprintf(dir,"/home/%s",uname);

      printf("Default dir is [%s] \n",dir);
      
      printf("%s's default shell : [/bin/sh] : ",uname);
      fgets(shell,sizeof(shell),stdin); shell[strlen(shell)-1] = '\0';
      
      if (!strcmp(shell,""))
	sprintf(shell,"/bin/sh");
      printf("Default shell is [%s]\n",shell);
      
      printf("%s's defualt password : [%s] : ",uname,uname);
      fgets(passwd,sizeof(passwd),stdin); passwd[strlen(passwd)-1] = '\0';
      if (!strcmp(passwd,""))
	sprintf(passwd,"%s",uname);

      {
	
	time(&tm);
	salt[0] = (tm & 0x0f) +	'A';
	salt[1] = ((tm & 0xf0) >> 4) + 'a';
	
      }
  
      printf("\n\nCreate user [%s]\n",uname);
      printf("In directory, [%s],\n",dir);
      printf("with [%s] as a default shell,\n",shell);
      printf("and [%s], for a password.\n",passwd);
      printf("\nIs this correct? [y|n] : ");

      fgets(foo,sizeof(foo),stdin); foo[strlen(foo)-1] = '\0';
      done=bad=correct=(foo[0]=='Y'||foo[0]=='y');
      
    }

  printf("Making directory, [%s].\n",dir);
  mkdir(dir,0700);

  passwd_file=fopen(PASSWD_FILE,"a");
  fprintf(passwd_file,"%s:%s:%d:%d:%s:%s:%s\n"
	  ,uname,crypt(passwd, salt),uid,group,person,dir,shell);
  chown(dir,uid,group);


}
  
Newsgroups: comp.os.linux