1 Description: Patch to allow usernames longer than 20 characters.
2 Source: http://www.mail-archive.com/screen-devel@gnu.org/msg00186.html
4 Upstream-Bug: http://savannah.gnu.org/bugs/?21653
5 Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560231
6 Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/screen/+bug/582153
8 Index: screen/acconfig.h
9 ===================================================================
10 --- screen.orig/acconfig.h 2011-10-08 21:20:48.000000000 +0200
11 +++ screen/acconfig.h 2011-10-08 21:20:57.000000000 +0200
16 + * Length of longest username.
18 +#ifndef MAX_USERNAME_LEN
19 +# define MAX_USERNAME_LEN 50
23 * Define SOCKDIR to be the directory to contain the named sockets
24 * screen creates. This should be in a common subdirectory, such as
25 * /usr/local or /tmp. It makes things a little more secure if you
27 ===================================================================
28 --- screen.orig/acls.c 2011-10-08 21:20:48.000000000 +0200
29 +++ screen/acls.c 2011-10-08 21:20:57.000000000 +0200
32 (*up)->u_Esc = DefaultEsc;
33 (*up)->u_MetaEsc = DefaultMetaEsc;
34 - strncpy((*up)->u_name, name, 20);
35 + strncpy((*up)->u_name, name, MAX_USERNAME_LEN);
36 (*up)->u_password = NULL;
38 (*up)->u_password = SaveStr(pass);
40 return UserAdd(name, pass, up);
41 if (!strcmp(name, "nobody")) /* he remains without password */
43 - strncpy((*up)->u_password, pass ? pass : "", 20);
44 - (*up)->u_password[20] = '\0';
45 + strncpy((*up)->u_password, pass ? pass : "", MAX_USERNAME_LEN);
46 + (*up)->u_password[MAX_USERNAME_LEN] = '\0';
51 ===================================================================
52 --- screen.orig/acls.h 2011-10-08 21:20:48.000000000 +0200
53 +++ screen/acls.h 2011-10-08 21:20:57.000000000 +0200
55 typedef struct acluser
57 struct acluser *u_next; /* continue the main user list */
58 - char u_name[20+1]; /* login name how he showed up */
59 + char u_name[MAX_USERNAME_LEN+1]; /* login name how he showed up */
60 char *u_password; /* his password (may be NullStr). */
61 int u_checkpassword; /* nonzero if this u_password is valid */
62 int u_detachwin; /* the window where he last detached */
63 Index: screen/screen.c
64 ===================================================================
65 --- screen.orig/screen.c 2011-10-08 21:20:56.000000000 +0200
66 +++ screen/screen.c 2011-10-08 21:20:57.000000000 +0200
69 if (home == 0 || *home == '\0')
71 - if (strlen(LoginName) > 20)
72 + if (strlen(LoginName) > MAX_USERNAME_LEN)
73 Panic(0, "LoginName too long - sorry.");
75 if (multi && strlen(multi) > 20)
76 Index: screen/screen.h
77 ===================================================================
78 --- screen.orig/screen.h 2011-10-08 21:20:48.000000000 +0200
79 +++ screen/screen.h 2011-10-08 21:20:57.000000000 +0200
84 - char auser[20 + 1]; /* username */
85 + char auser[MAX_USERNAME_LEN + 1]; /* username */
86 int apid; /* pid of frontend */
87 int adaptflag; /* adapt window size? */
88 int lines, columns; /* display size */
93 - char duser[20 + 1]; /* username */
94 + char duser[MAX_USERNAME_LEN + 1]; /* username */
95 int dpid; /* pid of frontend */
100 - char auser[20 + 1]; /* username */
101 + char auser[MAX_USERNAME_LEN + 1]; /* username */
103 char cmd[MAXPATHLEN]; /* command */
104 int apid; /* pid of frontend */