]> granicus.if.org Git - linux-pam/blobdiff - modules/pam_filter/upperLOWER/upperLOWER.c
Relevant BUGIDs: none
[linux-pam] / modules / pam_filter / upperLOWER / upperLOWER.c
index e750e877b61c57d04e50e3111f595cd96c903e34..5aa0e2c084bce408af3c1917034863aec0ee77b9 100644 (file)
@@ -7,7 +7,7 @@
  * it serves no purpose other than to annoy the user...
  */
 
-#include <security/_pam_aconf.h>
+#include "config.h"
 
 #ifdef MEMORY_DEBUG
 # undef exit
@@ -21,6 +21,9 @@
 #include <unistd.h>
 
 #include <security/pam_filter.h>
+#include <security/pam_modules.h>
+#include <security/_pam_macros.h>
+#include <security/_pam_modutil.h>
 
 /* ---------------------------------------------------------------- */
 
@@ -109,27 +112,27 @@ int main(int argc, char **argv)
          /* application errors */
 
          if ( FD_ISSET(APPERR_FILENO,&readers) ) {
-              int got = read(APPERR_FILENO, buffer, BUFSIZ);
+              int got = _pammodutil_read(APPERR_FILENO, buffer, BUFSIZ);
               if (got <= 0) {
                    break;
               } else {
                    /* translate to give to real terminal */
                    if (before_user != NULL)
                         before_user(buffer, got);
-                   if ( write(STDERR_FILENO, buffer, got) != got ) {
+                   if (_pammodutil_write(STDERR_FILENO, buffer, got) != got ) {
                         log_this(LOG_WARNING,"couldn't write %d bytes?!",got);
                         break;
                    }
               }
          } else if ( FD_ISSET(APPOUT_FILENO,&readers) ) {    /* app output */
-              int got = read(APPOUT_FILENO, buffer, BUFSIZ);
+              int got = _pammodutil_read(APPOUT_FILENO, buffer, BUFSIZ);
               if (got <= 0) {
                    break;
               } else {
                    /* translate to give to real terminal */
                    if (before_user != NULL)
                         before_user(buffer, got);
-                   if ( write(STDOUT_FILENO, buffer, got) != got ) {
+                   if (_pammodutil_write(STDOUT_FILENO, buffer, got) != got ) {
                         log_this(LOG_WARNING,"couldn't write %d bytes!?",got);
                         break;
                    }
@@ -137,7 +140,7 @@ int main(int argc, char **argv)
          }
 
          if ( FD_ISSET(STDIN_FILENO, &readers) ) {  /* user input */
-              int got = read(STDIN_FILENO, buffer, BUFSIZ);
+              int got = _pammodutil_read(STDIN_FILENO, buffer, BUFSIZ);
               if (got < 0) {
                    log_this(LOG_WARNING,"user input junked");
                    break;
@@ -145,7 +148,7 @@ int main(int argc, char **argv)
                    /* translate to give to application */
                    if (before_app != NULL)
                         before_app(buffer, got);
-                   if ( write(APPIN_FILENO, buffer, got) != got ) {
+                   if (_pammodutil_write(APPIN_FILENO, buffer, got) != got ) {
                         log_this(LOG_WARNING,"couldn't pass %d bytes!?",got);
                         break;
                    }