comparison sshpty.c @ 299:740e782679be ucc-axis-hack

Various changes to compile+kind of run on UCC's axis board. Note that fprintf(stdin -> printf( accounts for many of the changes
author Matt Johnston <matt@ucc.asn.au>
date Sat, 25 Mar 2006 12:57:09 +0000
parents 5c6f9d27ea1c
children
comparison
equal deleted inserted replaced
266:e37b160c414c 299:740e782679be
245 /* Releases the tty. Its ownership is returned to root, and permissions to 0666. */ 245 /* Releases the tty. Its ownership is returned to root, and permissions to 0666. */
246 246
247 void 247 void
248 pty_release(const char *tty_name) 248 pty_release(const char *tty_name)
249 { 249 {
250 // matt
251 return;
250 if (chown(tty_name, (uid_t) 0, (gid_t) 0) < 0 252 if (chown(tty_name, (uid_t) 0, (gid_t) 0) < 0
251 && (errno != ENOENT)) { 253 && (errno != ENOENT)) {
252 dropbear_log(LOG_ERR, 254 dropbear_log(LOG_ERR,
253 "chown %.100s 0 0 failed: %.100s", tty_name, strerror(errno)); 255 "chown %.100s 0 0 failed: %.100s", tty_name, strerror(errno));
254 } 256 }
378 if (stat(tty_name, &st)) { 380 if (stat(tty_name, &st)) {
379 dropbear_exit("pty_setowner: stat(%.101s) failed: %.100s", 381 dropbear_exit("pty_setowner: stat(%.101s) failed: %.100s",
380 tty_name, strerror(errno)); 382 tty_name, strerror(errno));
381 } 383 }
382 384
385 #if 0
386 matt
383 if (st.st_uid != pw->pw_uid || st.st_gid != gid) { 387 if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
384 if (chown(tty_name, pw->pw_uid, gid) < 0) { 388 if (chown(tty_name, pw->pw_uid, gid) < 0) {
385 if (errno == EROFS && 389 if (errno == EROFS &&
386 (st.st_uid == pw->pw_uid || st.st_uid == 0)) { 390 (st.st_uid == pw->pw_uid || st.st_uid == 0)) {
387 dropbear_log(LOG_ERR, 391 dropbear_log(LOG_ERR,
407 dropbear_exit("chmod(%.100s, 0%o) failed: %.100s", 411 dropbear_exit("chmod(%.100s, 0%o) failed: %.100s",
408 tty_name, mode, strerror(errno)); 412 tty_name, mode, strerror(errno));
409 } 413 }
410 } 414 }
411 } 415 }
416 #endif
412 } 417 }