mirror of
https://git.savannah.gnu.org/git/screen.git
synced 2026-02-17 21:02:31 +02:00
Compare commits
2 Commits
v.4.3.0
...
jesstess-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35e7eb23b3 | ||
|
|
c1aa031d93 |
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user