]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: verify writing to streams was successful
authorKarel Zak <kzak@redhat.com>
Wed, 5 Sep 2012 09:21:07 +0000 (11:21 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 5 Sep 2012 09:21:07 +0000 (11:21 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/su-common.c

index c0bb5289f39c0d34ac4d5258f40ed962ad25366d..65ecc24af765e21a1ae23aded74fb6d39f067f04 100644 (file)
@@ -63,6 +63,7 @@ enum
 #include "nls.h"
 #include "pathnames.h"
 #include "env.h"
+#include "closestream.h"
 
 /* name of the pam configuration files. separate configs for su and su -  */
 #define PAM_SRVNAME_SU "su"
@@ -782,6 +783,7 @@ su_main (int argc, char **argv, int mode)
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
+  atexit(close_stdout);
 
   su_mode = mode;
   fast_startup = false;