File maxloginlen.diff of Package screen.18256

--- ./acls.c.orig	2016-03-31 14:29:26.022571495 +0000
+++ ./acls.c	2016-03-31 14:29:29.430564189 +0000
@@ -182,7 +182,7 @@ struct acluser **up;
 #endif
   (*up)->u_Esc = DefaultEsc;
   (*up)->u_MetaEsc = DefaultMetaEsc;
-  strncpy((*up)->u_name, name, 20);
+  strncpy((*up)->u_name, name, MAXLOGINLEN);
   (*up)->u_password = NULL;
   if (pass)
     (*up)->u_password = SaveStr(pass);
--- ./acls.h.orig	2016-03-31 14:29:26.023571504 +0000
+++ ./acls.h	2016-03-31 14:30:54.924377777 +0000
@@ -26,6 +26,12 @@
  ****************************************************************
  */
 
+/*
+ * If you change the value, old screen versions will no longer be able to
+ * attach
+ */
+#define MAXLOGINLEN     256
+
 #ifdef MULTIUSER
 
 /* three known bits: */
@@ -78,7 +84,7 @@ struct plop
 typedef struct acluser
 {
   struct acluser *u_next;		/* continue the main user list */
-  char u_name[20+1];		/* login name how he showed up */
+  char u_name[MAXLOGINLEN+1];		/* login name how he showed up */
   char *u_password;		/* his password (may be NullStr). */
   int  u_checkpassword;		/* nonzero if this u_password is valid */
   int  u_detachwin;		/* the window where he last detached */
--- ./screen.c.orig	2016-03-31 14:29:26.024571510 +0000
+++ ./screen.c	2016-03-31 14:29:29.432564181 +0000
@@ -990,10 +990,10 @@ char **av;
 
   if (home == 0 || *home == '\0')
     home = ppp->pw_dir;
-  if (strlen(LoginName) > 20)
+  if (strlen(LoginName) > MAXLOGINLEN)
     Panic(0, "LoginName too long - sorry.");
 #ifdef MULTIUSER
-  if (multi && strlen(multi) > 20)
+  if (multi && strlen(multi) > MAXLOGINLEN)
     Panic(0, "Screen owner name too long - sorry.");
 #endif
   if (strlen(home) > MAXPATHLEN - 25)
--- ./screen.h.orig	2016-03-31 14:29:26.024571510 +0000
+++ ./screen.h	2016-03-31 14:31:17.780327336 +0000
@@ -208,7 +208,7 @@ struct msg
       create;
       struct
 	{
-	  char auser[20 + 1];	/* username */
+	  char auser[MAXLOGINLEN + 1];	/* username */
 	  int apid;		/* pid of frontend */
 	  int adaptflag;	/* adapt window size? */
 	  int lines, columns;	/* display size */
@@ -222,13 +222,13 @@ struct msg
       attach;
       struct 
 	{
-	  char duser[20 + 1];	/* username */
+	  char duser[MAXLOGINLEN + 1];	/* username */
 	  int dpid;		/* pid of frontend */
 	}
       detach;
       struct 
 	{
-	  char auser[20 + 1];	/* username */
+	  char auser[MAXLOGINLEN + 1];	/* username */
 	  int nargs;
 	  char cmd[MAXPATHLEN];	/* command */
 	  int apid;		/* pid of frontend */
openSUSE Build Service is sponsored by