Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
c1b9677b
Commit
c1b9677b
authored
11 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Merged 79's rlogin_gate() with telnet_gate().
Added new telgate flag: TG_NOLF.
parent
8432d5c9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sbbs3/sbbs.h
+2
-3
2 additions, 3 deletions
src/sbbs3/sbbs.h
src/sbbs3/sbbsdefs.h
+3
-1
3 additions, 1 deletion
src/sbbs3/sbbsdefs.h
src/sbbs3/telgate.cpp
+25
-15
25 additions, 15 deletions
src/sbbs3/telgate.cpp
with
30 additions
and
19 deletions
src/sbbs3/sbbs.h
+
2
−
3
View file @
c1b9677b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* *
* Copyright 201
2
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 201
3
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* *
* This program is free software; you can redistribute it and/or *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* modify it under the terms of the GNU General Public License *
...
@@ -938,8 +938,7 @@ public:
...
@@ -938,8 +938,7 @@ public:
void
catsyslog
(
int
crash
);
void
catsyslog
(
int
crash
);
/* telgate.cpp */
/* telgate.cpp */
void
telnet_gate
(
char
*
addr
,
ulong
mode
);
// See TG_* for mode bits
void
telnet_gate
(
char
*
addr
,
ulong
mode
,
char
*
name
=
NULL
,
char
*
passwd
=
NULL
);
// See TG_* for mode bits
void
rlogin_gate
(
char
*
addr
,
char
*
alias
,
char
*
pw
,
ulong
mode
);
// See TG_* for mode bits
};
};
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbsdefs.h
+
3
−
1
View file @
c1b9677b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* *
* Copyright 201
2
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 201
3
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* *
* This program is free software; you can redistribute it and/or *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* modify it under the terms of the GNU General Public License *
...
@@ -777,6 +777,8 @@ enum { /* readmail and delmailidx which types */
...
@@ -777,6 +777,8 @@ enum { /* readmail and delmailidx which types */
#define TG_RLOGIN (1<<6)
/* Use BSD RLogin protocol */
#define TG_RLOGIN (1<<6)
/* Use BSD RLogin protocol */
#define TG_NOCHKTIME (1<<7)
/* Don't check time left while gated */
#define TG_NOCHKTIME (1<<7)
/* Don't check time left while gated */
#define TG_NOTERMTYPE (1<<8)
/* Request client "DONT TERM_TYPE" */
#define TG_NOTERMTYPE (1<<8)
/* Request client "DONT TERM_TYPE" */
#define TG_SENDPASS (1<<9)
/* Send password instead of real name (RLogin) */
#define TG_NOLF (1<<10)
/* Do not send line-feeds (opposite of TG_CRLF) */
enum
{
/* Values for 'mode' in listfileinfo */
enum
{
/* Values for 'mode' in listfileinfo */
FI_INFO
/* Just list file information */
FI_INFO
/* Just list file information */
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/telgate.cpp
+
25
−
15
View file @
c1b9677b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* *
* Copyright 201
1
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 201
3
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* *
* This program is free software; you can redistribute it and/or *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* modify it under the terms of the GNU General Public License *
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
#include
"sbbs.h"
#include
"sbbs.h"
#include
"telnet.h"
#include
"telnet.h"
void
sbbs_t
::
telnet_gate
(
char
*
destaddr
,
ulong
mode
)
void
sbbs_t
::
telnet_gate
(
char
*
destaddr
,
ulong
mode
,
char
*
name
,
char
*
passwd
)
{
{
char
*
p
;
char
*
p
;
uchar
buf
[
512
];
uchar
buf
[
512
];
...
@@ -121,9 +121,15 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
...
@@ -121,9 +121,15 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
if
(
mode
&
TG_RLOGIN
)
{
if
(
mode
&
TG_RLOGIN
)
{
p
=
(
char
*
)
buf
;
p
=
(
char
*
)
buf
;
*
(
p
++
)
=
0
;
*
(
p
++
)
=
0
;
p
+=
sprintf
(
p
,
"%s"
,
useron
.
alias
);
p
+=
sprintf
(
p
,
"%s"
,
name
==
NULL
?
useron
.
alias
:
name
);
p
++
;
// Add NULL
p
++
;
// Add NULL
if
(
passwd
!=
NULL
)
p
+=
sprintf
(
p
,
"%s"
,
passwd
);
else
if
(
mode
&
TG_SENDPASS
)
{
p
+=
sprintf
(
p
,
"%s"
,
useron
.
pass
);
p
+=
sprintf
(
p
,
"%s"
,
useron
.
pass
);
}
else
{
p
+=
sprintf
(
p
,
"%s"
,
useron
.
name
);
}
p
++
;
// Add NULL
p
++
;
// Add NULL
p
+=
sprintf
(
p
,
"%s/57600"
,
terminal
);
p
+=
sprintf
(
p
,
"%s/57600"
,
terminal
);
p
++
;
// Add NULL
p
++
;
// Add NULL
...
@@ -205,10 +211,13 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
...
@@ -205,10 +211,13 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
}
}
if
(
mode
&
TG_CRLF
&&
buf
[
rd
-
1
]
==
'\r'
)
if
(
mode
&
TG_CRLF
&&
buf
[
rd
-
1
]
==
'\r'
)
buf
[
rd
++
]
=
'\n'
;
buf
[
rd
++
]
=
'\n'
;
if
(
!
gotline
&&
mode
&
TG_ECHO
)
{
else
if
(
mode
&
TG_NOLF
&&
buf
[
rd
-
1
]
==
'\n'
)
rd
--
;
if
(
!
gotline
&&
(
mode
&
TG_ECHO
)
&&
rd
)
{
RingBufWrite
(
&
outbuf
,
buf
,
rd
);
RingBufWrite
(
&
outbuf
,
buf
,
rd
);
}
}
}
}
if
(
rd
>
0
)
{
for
(
attempts
=
0
;
attempts
<
60
&&
online
;
attempts
++
)
/* added retry loop here, Jan-20-2003 */
for
(
attempts
=
0
;
attempts
<
60
&&
online
;
attempts
++
)
/* added retry loop here, Jan-20-2003 */
{
{
if
((
i
=
sendsocket
(
remote_socket
,(
char
*
)
buf
,
rd
))
>=
0
)
if
((
i
=
sendsocket
(
remote_socket
,(
char
*
)
buf
,
rd
))
>=
0
)
...
@@ -222,6 +231,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
...
@@ -222,6 +231,7 @@ void sbbs_t::telnet_gate(char* destaddr, ulong mode)
break
;
break
;
}
}
}
}
}
rd
=
recv
(
remote_socket
,(
char
*
)
buf
,
sizeof
(
buf
),
0
);
rd
=
recv
(
remote_socket
,(
char
*
)
buf
,
sizeof
(
buf
),
0
);
if
(
rd
<
0
)
{
if
(
rd
<
0
)
{
if
(
ERROR_VALUE
==
EWOULDBLOCK
)
{
if
(
ERROR_VALUE
==
EWOULDBLOCK
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment