Blame SOURCES/screen-fix-term.patch

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