* pty_err.et: Add PTY_OPEN_SLAVE_TOOSHORT error code
authorTom Yu <tlyu@mit.edu>
Wed, 3 Dec 1997 22:17:34 +0000 (22:17 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 3 Dec 1997 22:17:34 +0000 (22:17 +0000)
* 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

src/util/pty/ChangeLog
src/util/pty/open_slave.c
src/util/pty/pty_err.et

index 6f8540f27021b8f58c82df9ed36dcc8732463900..b25dc16e71caa781dbc2237f526f14a5a0fe491d 100644 (file)
@@ -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
index 05b83b8093084f75171d74e7418255d969e60080..7d28ea26498a5031e2209706ed9128ee5cc6f7a4 100644 (file)
@@ -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 ) 
index bcdecf4d2a82432751fbd8d27bb0b7f1cb1ddaf2..08c126d62cef1ffe1c49753ceaf905bce5c6b01b 100644 (file)
@@ -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"