summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>1997-12-03 22:17:34 +0000
committerTom Yu <tlyu@mit.edu>1997-12-03 22:17:34 +0000
commit5429bddbc0b8b4fcbcf0be6e3b7b47c44473c2ec (patch)
tree7fe6093e2fed278194aafe78ab1b5459dc4b1837 /src
parentd8dd78dcce12210a10cc915d1448aa7b717fa4d9 (diff)
downloadkrb5-5429bddbc0b8b4fcbcf0be6e3b7b47c44473c2ec.tar.gz
krb5-5429bddbc0b8b4fcbcf0be6e3b7b47c44473c2ec.tar.xz
krb5-5429bddbc0b8b4fcbcf0be6e3b7b47c44473c2ec.zip
* pty_err.et: Add PTY_OPEN_SLAVE_TOOSHORT error code
* open_slave.c (pty_open_slave): Check to ensure that the slave name is not NULL or zero-length. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10310 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/util/pty/ChangeLog7
-rw-r--r--src/util/pty/open_slave.c2
-rw-r--r--src/util/pty/pty_err.et3
3 files changed, 11 insertions, 1 deletions
diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog
index 6f8540f27..b25dc16e7 100644
--- a/src/util/pty/ChangeLog
+++ b/src/util/pty/ChangeLog
@@ -1,3 +1,10 @@
+Wed Dec 3 17:16:44 1997 Tom Yu <tlyu@mit.edu>
+
+ * pty_err.et: Add PTY_OPEN_SLAVE_TOOSHORT error code.
+
+ * open_slave.c (pty_open_slave): Check to ensure that the slave
+ name is not NULL or zero-length.
+
Tue Oct 28 13:28:54 1997 Ezra Peisach <epeisach@.mit.edu>
* pty-int.h: Do not prototype initialize_pty_error_table as
diff --git a/src/util/pty/open_slave.c b/src/util/pty/open_slave.c
index 05b83b809..7d28ea264 100644
--- a/src/util/pty/open_slave.c
+++ b/src/util/pty/open_slave.c
@@ -55,6 +55,8 @@ long pty_open_slave ( slave, fd)
#endif
+ if (slave == NULL || *slave == '\0')
+ return PTY_OPEN_SLAVE_TOOSHORT;
if (chmod(slave, 0))
return PTY_OPEN_SLAVE_CHMODFAIL;
if ( chown(slave, 0, 0 ) == -1 )
diff --git a/src/util/pty/pty_err.et b/src/util/pty/pty_err.et
index bcdecf4d2..08c126d62 100644
--- a/src/util/pty/pty_err.et
+++ b/src/util/pty/pty_err.et
@@ -21,7 +21,7 @@
error_table pty
- error_code PTY_GETPTY_STREAMS, "Failed to unlock or grant streams pty."
+error_code PTY_GETPTY_STREAMS, "Failed to unlock or grant streams pty."
error_code PTY_GETPTY_FSTAT, "fstat of master pty failed"
@@ -42,3 +42,4 @@ error_code PTY_OPEN_SLAVE_PUSH_FAIL, "Failed to push stream on slave side of pty
error_code PTY_OPEN_SLAVE_REVOKEFAIL, "Failed to revoke slave side of pty"
error_code PTY_UPDATE_UTMP_PROCTYPE_INVALID, "bad process type passed to pty_update_utmp"
+error_code PTY_OPEN_SLAVE_TOOSHORT, "Slave pty name is zero-length"