|
|
974c97 |
diff --git a/src/acls.c b/src/acls.c
|
|
|
974c97 |
index 3f40541..e5a32a4 100644
|
|
|
974c97 |
--- a/src/acls.c
|
|
|
974c97 |
+++ b/src/acls.c
|
|
|
974c97 |
@@ -182,7 +182,7 @@ struct acluser **up;
|
|
|
974c97 |
#endif
|
|
|
974c97 |
(*up)->u_Esc = DefaultEsc;
|
|
|
974c97 |
(*up)->u_MetaEsc = DefaultMetaEsc;
|
|
|
974c97 |
- strncpy((*up)->u_name, name, 20);
|
|
|
974c97 |
+ strncpy((*up)->u_name, name, MAXLOGINLEN);
|
|
|
974c97 |
(*up)->u_password = NULL;
|
|
|
974c97 |
if (pass)
|
|
|
974c97 |
(*up)->u_password = SaveStr(pass);
|
|
|
974c97 |
@@ -318,8 +318,8 @@ struct acluser **up;
|
|
|
974c97 |
return UserAdd(name, pass, up);
|
|
|
974c97 |
if (!strcmp(name, "nobody")) /* he remains without password */
|
|
|
974c97 |
return -1;
|
|
|
974c97 |
- strncpy((*up)->u_password, pass ? pass : "", 20);
|
|
|
974c97 |
- (*up)->u_password[20] = '\0';
|
|
|
974c97 |
+ strncpy((*up)->u_password, pass ? pass : "", MAXLOGINLEN);
|
|
|
974c97 |
+ (*up)->u_password[MAXLOGINLEN] = '\0';
|
|
|
974c97 |
return 0;
|
|
|
974c97 |
}
|
|
|
974c97 |
#endif
|
|
|
974c97 |
diff --git a/src/acls.h b/src/acls.h
|
|
|
974c97 |
index 907e953..42c7c18 100644
|
|
|
974c97 |
--- a/src/acls.h
|
|
|
974c97 |
+++ b/src/acls.h
|
|
|
974c97 |
@@ -78,7 +78,7 @@ struct plop
|
|
|
974c97 |
typedef struct acluser
|
|
|
974c97 |
{
|
|
|
974c97 |
struct acluser *u_next; /* continue the main user list */
|
|
|
974c97 |
- char u_name[20+1]; /* login name how he showed up */
|
|
|
974c97 |
+ char u_name[MAXLOGINLEN + 1]; /* login name how he showed up */
|
|
|
974c97 |
char *u_password; /* his password (may be NullStr). */
|
|
|
974c97 |
int u_checkpassword; /* nonzero if this u_password is valid */
|
|
|
974c97 |
int u_detachwin; /* the window where he last detached */
|
|
|
974c97 |
diff --git a/src/comm.c b/src/comm.c
|
|
|
974c97 |
index 5f4af8a..7705fcb 100644
|
|
|
974c97 |
--- a/src/comm.c
|
|
|
974c97 |
+++ b/src/comm.c
|
|
|
974c97 |
@@ -36,6 +36,7 @@
|
|
|
974c97 |
*/
|
|
|
974c97 |
|
|
|
974c97 |
#include "config.h"
|
|
|
974c97 |
+#include "os.h"
|
|
|
974c97 |
#include "acls.h"
|
|
|
974c97 |
#include "comm.h"
|
|
|
974c97 |
|
|
|
974c97 |
diff --git a/src/display.h b/src/display.h
|
|
|
974c97 |
index b1ab748..a433e6d 100644
|
|
|
974c97 |
--- a/src/display.h
|
|
|
974c97 |
+++ b/src/display.h
|
|
|
974c97 |
@@ -73,7 +73,7 @@ struct display
|
|
|
974c97 |
struct win *d_other; /* pointer to other window */
|
|
|
974c97 |
int d_nonblock; /* -1 don't block if obufmax reached */
|
|
|
974c97 |
/* >0: block after nonblock secs */
|
|
|
974c97 |
- char d_termname[40 + 1]; /* $TERM */
|
|
|
974c97 |
+ char d_termname[MAXTERMLEN + 1]; /* $TERM */
|
|
|
974c97 |
char *d_tentry; /* buffer for tgetstr */
|
|
|
974c97 |
char d_tcinited; /* termcap inited flag */
|
|
|
974c97 |
int d_width, d_height; /* width/height of the screen */
|
|
|
974c97 |
diff --git a/src/os.h b/src/os.h
|
|
|
974c97 |
index 5c17c83..bc71c97 100644
|
|
|
974c97 |
--- a/src/os.h
|
|
|
974c97 |
+++ b/src/os.h
|
|
|
974c97 |
@@ -521,3 +521,8 @@ typedef struct fd_set { int fds_bits[1]; } fd_set;
|
|
|
974c97 |
*/
|
|
|
974c97 |
#define IOSIZE 4096
|
|
|
974c97 |
|
|
|
974c97 |
+/* Changing those you won't be able to attach to your old sessions
|
|
|
974c97 |
+ * when changing those values in official tree don't forget to bump
|
|
|
974c97 |
+ * MSG_VERSION */
|
|
|
974c97 |
+#define MAXTERMLEN 50
|
|
|
974c97 |
+#define MAXLOGINLEN 256
|
|
|
974c97 |
diff --git a/src/process.c b/src/process.c
|
|
|
974c97 |
index 7817ac8..a3c2e3d 100644
|
|
|
974c97 |
--- a/src/process.c
|
|
|
974c97 |
+++ b/src/process.c
|
|
|
974c97 |
@@ -2649,9 +2649,9 @@ int key;
|
|
|
974c97 |
s = NULL;
|
|
|
974c97 |
if (ParseSaveStr(act, &s))
|
|
|
974c97 |
break;
|
|
|
974c97 |
- if (strlen(s) >= 20)
|
|
|
974c97 |
+ if (strlen(s) >= MAXTERMLEN)
|
|
|
974c97 |
{
|
|
|
974c97 |
- OutputMsg(0, "%s: term: argument too long ( < 20)", rc_name);
|
|
|
974c97 |
+ OutputMsg(0, "%s: term: argument too long ( < %d)", rc_name, MAXTERMLEN);
|
|
|
974c97 |
free(s);
|
|
|
974c97 |
break;
|
|
|
974c97 |
}
|
|
|
974c97 |
diff --git a/src/screen.c b/src/screen.c
|
|
|
974c97 |
index cd0c71b..7a21762 100644
|
|
|
974c97 |
--- a/src/screen.c
|
|
|
974c97 |
+++ b/src/screen.c
|
|
|
974c97 |
@@ -995,10 +995,10 @@ char **av;
|
|
|
974c97 |
|
|
|
974c97 |
if (home == 0 || *home == '\0')
|
|
|
974c97 |
home = ppp->pw_dir;
|
|
|
974c97 |
- if (strlen(LoginName) > 20)
|
|
|
974c97 |
+ if (strlen(LoginName) > MAXLOGINLEN)
|
|
|
974c97 |
Panic(0, "LoginName too long - sorry.");
|
|
|
974c97 |
#ifdef MULTIUSER
|
|
|
974c97 |
- if (multi && strlen(multi) > 20)
|
|
|
974c97 |
+ if (multi && strlen(multi) > MAXLOGINLEN)
|
|
|
974c97 |
Panic(0, "Screen owner name too long - sorry.");
|
|
|
974c97 |
#endif
|
|
|
974c97 |
if (strlen(home) > MAXPATHLEN - 25)
|
|
|
974c97 |
diff --git a/src/screen.h b/src/screen.h
|
|
|
974c97 |
index 1a388e3..30ecefb 100644
|
|
|
974c97 |
--- a/src/screen.h
|
|
|
974c97 |
+++ b/src/screen.h
|
|
|
974c97 |
@@ -202,32 +202,32 @@ struct msg
|
|
|
974c97 |
int nargs;
|
|
|
974c97 |
char line[MAXPATHLEN];
|
|
|
974c97 |
char dir[MAXPATHLEN];
|
|
|
974c97 |
- char screenterm[20]; /* is screen really "screen" ? */
|
|
|
974c97 |
+ char screenterm[MAXTERMLEN]; /* is screen really "screen" ? */
|
|
|
974c97 |
}
|
|
|
974c97 |
create;
|
|
|
974c97 |
struct
|
|
|
974c97 |
{
|
|
|
974c97 |
- char auser[20 + 1]; /* username */
|
|
|
974c97 |
+ char auser[MAXLOGINLEN + 1]; /* username */
|
|
|
974c97 |
int apid; /* pid of frontend */
|
|
|
974c97 |
int adaptflag; /* adapt window size? */
|
|
|
974c97 |
int lines, columns; /* display size */
|
|
|
974c97 |
char preselect[20];
|
|
|
974c97 |
int esc; /* his new escape character unless -1 */
|
|
|
974c97 |
int meta_esc; /* his new meta esc character unless -1 */
|
|
|
974c97 |
- char envterm[40 + 1]; /* terminal type */
|
|
|
974c97 |
+ char envterm[MAXTERMLEN + 1]; /* terminal type */
|
|
|
974c97 |
int encoding; /* encoding of display */
|
|
|
974c97 |
int detachfirst; /* whether to detach remote sessions first */
|
|
|
974c97 |
}
|
|
|
974c97 |
attach;
|
|
|
974c97 |
struct
|
|
|
974c97 |
{
|
|
|
974c97 |
- char duser[20 + 1]; /* username */
|
|
|
974c97 |
+ char duser[MAXLOGINLEN + 1]; /* username */
|
|
|
974c97 |
int dpid; /* pid of frontend */
|
|
|
974c97 |
}
|
|
|
974c97 |
detach;
|
|
|
974c97 |
struct
|
|
|
974c97 |
{
|
|
|
974c97 |
- char auser[20 + 1]; /* username */
|
|
|
974c97 |
+ char auser[MAXLOGINLEN + 1]; /* username */
|
|
|
974c97 |
int nargs;
|
|
|
974c97 |
char cmd[MAXPATHLEN]; /* command */
|
|
|
974c97 |
int apid; /* pid of frontend */
|
|
|
974c97 |
diff --git a/src/socket.c b/src/socket.c
|
|
|
974c97 |
index 1f04284..32c5047 100644
|
|
|
974c97 |
--- a/src/socket.c
|
|
|
974c97 |
+++ b/src/socket.c
|
|
|
974c97 |
@@ -1528,7 +1528,7 @@ static void PasswordProcessInput __P((char *, int));
|
|
|
974c97 |
|
|
|
974c97 |
struct pwdata {
|
|
|
974c97 |
int l;
|
|
|
974c97 |
- char buf[20 + 1];
|
|
|
974c97 |
+ char buf[MAXLOGINLEN + 1];
|
|
|
974c97 |
struct msg m;
|
|
|
974c97 |
};
|
|
|
974c97 |
|