]>
Commit | Line | Data |
---|---|---|
86ec8038 AM |
1 | Description: Patch to allow usernames longer than 20 characters. |
2 | Source: http://www.mail-archive.com/screen-devel@gnu.org/msg00186.html | |
3 | Author: Steve Kemp | |
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 | |
7 | ||
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 | |
12 | @@ -39,6 +39,13 @@ | |
13 | #endif | |
14 | ||
15 | /* | |
16 | + * Length of longest username. | |
17 | + */ | |
18 | +#ifndef MAX_USERNAME_LEN | |
19 | +# define MAX_USERNAME_LEN 50 | |
20 | +#endif | |
21 | + | |
22 | +/* | |
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 | |
26 | Index: screen/acls.c | |
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 | |
30 | @@ -182,7 +182,7 @@ | |
31 | #endif | |
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; | |
37 | if (pass) | |
38 | (*up)->u_password = SaveStr(pass); | |
39 | @@ -318,8 +318,8 @@ | |
40 | return UserAdd(name, pass, up); | |
41 | if (!strcmp(name, "nobody")) /* he remains without password */ | |
42 | return -1; | |
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'; | |
47 | return 0; | |
48 | } | |
49 | #endif | |
50 | Index: screen/acls.h | |
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 | |
54 | @@ -78,7 +78,7 @@ | |
55 | typedef struct acluser | |
56 | { | |
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 | |
67 | @@ -997,7 +997,7 @@ | |
68 | ||
69 | if (home == 0 || *home == '\0') | |
70 | home = ppp->pw_dir; | |
71 | - if (strlen(LoginName) > 20) | |
72 | + if (strlen(LoginName) > MAX_USERNAME_LEN) | |
73 | Panic(0, "LoginName too long - sorry."); | |
74 | #ifdef MULTIUSER | |
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 | |
80 | @@ -207,7 +207,7 @@ | |
81 | create; | |
82 | struct | |
83 | { | |
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 */ | |
89 | @@ -221,13 +221,13 @@ | |
90 | attach; | |
91 | struct | |
92 | { | |
93 | - char duser[20 + 1]; /* username */ | |
94 | + char duser[MAX_USERNAME_LEN + 1]; /* username */ | |
95 | int dpid; /* pid of frontend */ | |
96 | } | |
97 | detach; | |
98 | struct | |
99 | { | |
100 | - char auser[20 + 1]; /* username */ | |
101 | + char auser[MAX_USERNAME_LEN + 1]; /* username */ | |
102 | int nargs; | |
103 | char cmd[MAXPATHLEN]; /* command */ | |
104 | int apid; /* pid of frontend */ |