aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-27 11:54:59 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-27 11:54:59 +0000
commit5014dada3fa0bb6f6873e28fe6491f0789239cdc (patch)
tree25cc7ed4e457d924131f3e7cdbab1e187a617639 /networking
parent8195d20e36bfeeb30b3424e2635ba4757ec38137 (diff)
downloadbusybox-w32-5014dada3fa0bb6f6873e28fe6491f0789239cdc.tar.gz
busybox-w32-5014dada3fa0bb6f6873e28fe6491f0789239cdc.tar.bz2
busybox-w32-5014dada3fa0bb6f6873e28fe6491f0789239cdc.zip
script: new applet by Pascal Bellard <pascal.bellard AT ads-lu.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/telnetd.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 0bffa9700..05de49e8a 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -153,53 +153,6 @@ remove_iacs(struct tsession *ts, int *pnum_totty)
153} 153}
154 154
155 155
156static int
157getpty(char *line, int size)
158{
159 int p;
160#if ENABLE_FEATURE_DEVPTS
161 p = open("/dev/ptmx", O_RDWR);
162 if (p > 0) {
163 const char *name;
164 grantpt(p);
165 unlockpt(p);
166 name = ptsname(p);
167 if (!name) {
168 bb_perror_msg("ptsname error (is /dev/pts mounted?)");
169 return -1;
170 }
171 safe_strncpy(line, name, size);
172 return p;
173 }
174#else
175 struct stat stb;
176 int i;
177 int j;
178
179 strcpy(line, "/dev/ptyXX");
180
181 for (i = 0; i < 16; i++) {
182 line[8] = "pqrstuvwxyzabcde"[i];
183 line[9] = '0';
184 if (stat(line, &stb) < 0) {
185 continue;
186 }
187 for (j = 0; j < 16; j++) {
188 line[9] = j < 10 ? j + '0' : j - 10 + 'a';
189 if (DEBUG)
190 fprintf(stderr, "Trying to open device: %s\n", line);
191 p = open(line, O_RDWR | O_NOCTTY);
192 if (p >= 0) {
193 line[5] = 't';
194 return p;
195 }
196 }
197 }
198#endif /* FEATURE_DEVPTS */
199 return -1;
200}
201
202
203static struct tsession * 156static struct tsession *
204make_new_session( 157make_new_session(
205 USE_FEATURE_TELNETD_STANDALONE(int sock) 158 USE_FEATURE_TELNETD_STANDALONE(int sock)