2 Commits

Author SHA1 Message Date
Jessica McKellar
35e7eb23b3 Increase the maximum allowed TERM length (to 30, in MAXTERMLEN).
This change allows in particular rxvt-unicode-256color users to use
screen, and resolves bug #30880.
2010-11-12 21:04:10 -05:00
Jessica McKellar
c1aa031d93 Increase the maximum username length (to 50, defined in MAX_USERNAME_LEN).
Apply patch
http://www.mail-archive.com/screen-devel@gnu.org/msg00186.html by
Steve Kemp with minor changes. This commit resolves bug #21653.
2010-11-11 21:27:57 -05:00
5 changed files with 21 additions and 10 deletions

View File

@@ -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, MAX_USERNAME_LEN);
(*up)->u_password = NULL;
if (pass)
(*up)->u_password = SaveStr(pass);
@@ -318,8 +318,8 @@ struct acluser **up;
return UserAdd(name, pass, up);
if (!strcmp(name, "nobody")) /* he remains without password */
return -1;
strncpy((*up)->u_password, pass ? pass : "", 20);
(*up)->u_password[20] = '\0';
strncpy((*up)->u_password, pass ? pass : "", MAX_USERNAME_LEN);
(*up)->u_password[MAX_USERNAME_LEN] = '\0';
return 0;
}
#endif

View File

@@ -26,6 +26,13 @@
****************************************************************
*/
/*
* Length of longest username.
*/
#ifndef MAX_USERNAME_LEN
# define MAX_USERNAME_LEN 50
#endif
#ifdef MULTIUSER
/* three known bits: */
@@ -78,7 +85,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[MAX_USERNAME_LEN+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 */

View File

@@ -56,6 +56,10 @@ struct kmap_ext
#endif
#ifndef MAXTERMLEN
#define MAXTERMLEN 30
#endif
struct win; /* forward declaration */
struct display
@@ -73,7 +77,7 @@ struct display
struct win *d_other; /* pointer to other window */
int d_nonblock; /* -1 don't block if obufmax reached */
/* >0: block after nonblock secs */
char d_termname[20 + 1]; /* $TERM */
char d_termname[MAXTERMLEN + 1]; /* $TERM */
char *d_tentry; /* buffer for tgetstr */
char d_tcinited; /* termcap inited flag */
int d_width, d_height; /* width/height of the screen */

View File

@@ -978,7 +978,7 @@ char **av;
if (home == 0 || *home == '\0')
home = ppp->pw_dir;
if (strlen(LoginName) > 20)
if (strlen(LoginName) > MAX_USERNAME_LEN)
Panic(0, "LoginName too long - sorry.");
#ifdef MULTIUSER
if (multi && strlen(multi) > 20)

View File

@@ -207,27 +207,27 @@ struct msg
create;
struct
{
char auser[20 + 1]; /* username */
char auser[MAX_USERNAME_LEN + 1]; /* username */
int apid; /* pid of frontend */
int adaptflag; /* adapt window size? */
int lines, columns; /* display size */
char preselect[20];
int esc; /* his new escape character unless -1 */
int meta_esc; /* his new meta esc character unless -1 */
char envterm[20 + 1]; /* terminal type */
char envterm[MAXTERMLEN + 1]; /* terminal type */
int encoding; /* encoding of display */
int detachfirst; /* whether to detach remote sessions first */
}
attach;
struct
{
char duser[20 + 1]; /* username */
char duser[MAX_USERNAME_LEN + 1]; /* username */
int dpid; /* pid of frontend */
}
detach;
struct
{
char auser[20 + 1]; /* username */
char auser[MAX_USERNAME_LEN + 1]; /* username */
int nargs;
char cmd[MAXPATHLEN]; /* command */
int apid; /* pid of frontend */