Blame SOURCES/screen-fix-term.patch

c18ec5
diff --git a/src/acls.c b/src/acls.c
c18ec5
index 3f40541..e5a32a4 100644
c18ec5
--- a/src/acls.c
c18ec5
+++ b/src/acls.c
c18ec5
@@ -182,7 +182,7 @@ struct acluser **up;
c18ec5
 #endif
c18ec5
   (*up)->u_Esc = DefaultEsc;
c18ec5
   (*up)->u_MetaEsc = DefaultMetaEsc;
c18ec5
-  strncpy((*up)->u_name, name, 20);
c18ec5
+  strncpy((*up)->u_name, name, MAXLOGINLEN);
c18ec5
   (*up)->u_password = NULL;
c18ec5
   if (pass)
c18ec5
     (*up)->u_password = SaveStr(pass);
c18ec5
@@ -318,8 +318,8 @@ struct acluser **up;
c18ec5
     return UserAdd(name, pass, up);
c18ec5
   if (!strcmp(name, "nobody"))		/* he remains without password */
c18ec5
     return -1;
c18ec5
-  strncpy((*up)->u_password, pass ? pass : "", 20);
c18ec5
-  (*up)->u_password[20] = '\0';
c18ec5
+  strncpy((*up)->u_password, pass ? pass : "", MAXLOGINLEN);
c18ec5
+  (*up)->u_password[MAXLOGINLEN] = '\0';
c18ec5
   return 0;
c18ec5
 }
c18ec5
 #endif
c18ec5
diff --git a/src/acls.h b/src/acls.h
c18ec5
index 907e953..42c7c18 100644
c18ec5
--- a/src/acls.h
c18ec5
+++ b/src/acls.h
c18ec5
@@ -78,7 +78,7 @@ struct plop
c18ec5
 typedef struct acluser
c18ec5
 {
c18ec5
   struct acluser *u_next;		/* continue the main user list */
c18ec5
-  char u_name[20+1];		/* login name how he showed up */
c18ec5
+  char u_name[MAXLOGINLEN + 1];		/* login name how he showed up */
c18ec5
   char *u_password;		/* his password (may be NullStr). */
c18ec5
   int  u_checkpassword;		/* nonzero if this u_password is valid */
c18ec5
   int  u_detachwin;		/* the window where he last detached */
c18ec5
diff --git a/src/comm.c b/src/comm.c
c18ec5
index 5f4af8a..7705fcb 100644
c18ec5
--- a/src/comm.c
c18ec5
+++ b/src/comm.c
c18ec5
@@ -36,6 +36,7 @@
c18ec5
  */
c18ec5
 
c18ec5
 #include "config.h"
c18ec5
+#include "os.h"
c18ec5
 #include "acls.h"
c18ec5
 #include "comm.h"
c18ec5
 
c18ec5
diff --git a/src/display.h b/src/display.h
c18ec5
index b1ab748..a433e6d 100644
c18ec5
--- a/src/display.h
c18ec5
+++ b/src/display.h
c18ec5
@@ -73,7 +73,7 @@ struct display
c18ec5
   struct win *d_other;		/* pointer to other window */
c18ec5
   int   d_nonblock;		/* -1 don't block if obufmax reached */
c18ec5
 				/* >0: block after nonblock secs */
c18ec5
-  char  d_termname[40 + 1];	/* $TERM */
c18ec5
+  char  d_termname[MAXTERMLEN + 1];	/* $TERM */
c18ec5
   char	*d_tentry;		/* buffer for tgetstr */
c18ec5
   char	d_tcinited;		/* termcap inited flag */
c18ec5
   int	d_width, d_height;	/* width/height of the screen */
c18ec5
diff --git a/src/os.h b/src/os.h
c18ec5
index 5c17c83..bc71c97 100644
c18ec5
--- a/src/os.h
c18ec5
+++ b/src/os.h
c18ec5
@@ -521,3 +521,8 @@ typedef struct fd_set { int fds_bits[1]; } fd_set;
c18ec5
  */
c18ec5
 #define IOSIZE		4096
c18ec5
 
c18ec5
+/* Changing those you won't be able to attach to your old sessions
c18ec5
+ * when changing those values in official tree don't forget to bump
c18ec5
+ * MSG_VERSION */
c18ec5
+#define MAXTERMLEN  50
c18ec5
+#define MAXLOGINLEN 256
c18ec5
diff --git a/src/process.c b/src/process.c
c18ec5
index 7817ac8..a3c2e3d 100644
c18ec5
--- a/src/process.c
c18ec5
+++ b/src/process.c
c18ec5
@@ -2649,9 +2649,9 @@ int key;
c18ec5
       s = NULL;
c18ec5
       if (ParseSaveStr(act, &s))
c18ec5
 	break;
c18ec5
-      if (strlen(s) >= 20)
c18ec5
+      if (strlen(s) >= MAXTERMLEN)
c18ec5
 	{
c18ec5
-	  OutputMsg(0, "%s: term: argument too long ( < 20)", rc_name);
c18ec5
+     OutputMsg(0, "%s: term: argument too long ( < %d)", rc_name, MAXTERMLEN);
c18ec5
 	  free(s);
c18ec5
 	  break;
c18ec5
 	}
c18ec5
diff --git a/src/screen.c b/src/screen.c
c18ec5
index cd0c71b..7a21762 100644
c18ec5
--- a/src/screen.c
c18ec5
+++ b/src/screen.c
c18ec5
@@ -995,10 +995,10 @@ char **av;
c18ec5
 
c18ec5
   if (home == 0 || *home == '\0')
c18ec5
     home = ppp->pw_dir;
c18ec5
-  if (strlen(LoginName) > 20)
c18ec5
+  if (strlen(LoginName) > MAXLOGINLEN)
c18ec5
     Panic(0, "LoginName too long - sorry.");
c18ec5
 #ifdef MULTIUSER
c18ec5
-  if (multi && strlen(multi) > 20)
c18ec5
+  if (multi && strlen(multi) > MAXLOGINLEN)
c18ec5
     Panic(0, "Screen owner name too long - sorry.");
c18ec5
 #endif
c18ec5
   if (strlen(home) > MAXPATHLEN - 25)
c18ec5
diff --git a/src/screen.h b/src/screen.h
c18ec5
index 1a388e3..30ecefb 100644
c18ec5
--- a/src/screen.h
c18ec5
+++ b/src/screen.h
c18ec5
@@ -202,32 +202,32 @@ struct msg
c18ec5
 	  int nargs;
c18ec5
 	  char line[MAXPATHLEN];
c18ec5
 	  char dir[MAXPATHLEN];
c18ec5
-	  char screenterm[20];	/* is screen really "screen" ? */
c18ec5
+     char screenterm[MAXTERMLEN];	/* is screen really "screen" ? */
c18ec5
 	}
c18ec5
       create;
c18ec5
       struct
c18ec5
 	{
c18ec5
-	  char auser[20 + 1];	/* username */
c18ec5
+     char auser[MAXLOGINLEN + 1];	/* username */
c18ec5
 	  int apid;		/* pid of frontend */
c18ec5
 	  int adaptflag;	/* adapt window size? */
c18ec5
 	  int lines, columns;	/* display size */
c18ec5
 	  char preselect[20];
c18ec5
 	  int esc;		/* his new escape character unless -1 */
c18ec5
 	  int meta_esc;		/* his new meta esc character unless -1 */
c18ec5
-	  char envterm[40 + 1];	/* terminal type */
c18ec5
+     char envterm[MAXTERMLEN + 1];	/* terminal type */
c18ec5
 	  int encoding;		/* encoding of display */
c18ec5
 	  int detachfirst;      /* whether to detach remote sessions first */
c18ec5
 	}
c18ec5
       attach;
c18ec5
       struct 
c18ec5
 	{
c18ec5
-	  char duser[20 + 1];	/* username */
c18ec5
+     char duser[MAXLOGINLEN + 1];	/* username */
c18ec5
 	  int dpid;		/* pid of frontend */
c18ec5
 	}
c18ec5
       detach;
c18ec5
       struct 
c18ec5
 	{
c18ec5
-	  char auser[20 + 1];	/* username */
c18ec5
+     char auser[MAXLOGINLEN + 1];	/* username */
c18ec5
 	  int nargs;
c18ec5
 	  char cmd[MAXPATHLEN];	/* command */
c18ec5
 	  int apid;		/* pid of frontend */
c18ec5
diff --git a/src/socket.c b/src/socket.c
c18ec5
index 1f04284..32c5047 100644
c18ec5
--- a/src/socket.c
c18ec5
+++ b/src/socket.c
c18ec5
@@ -1528,7 +1528,7 @@ static void PasswordProcessInput __P((char *, int));
c18ec5
 
c18ec5
 struct pwdata {
c18ec5
   int l;
c18ec5
-  char buf[20 + 1];
c18ec5
+  char buf[MAXLOGINLEN + 1];
c18ec5
   struct msg m;
c18ec5
 };
c18ec5