Unix Technical Forum

Shouldn't /sbin/nologin send the message to stderr?

This is a discussion on Shouldn't /sbin/nologin send the message to stderr? within the mailing.openbsd.tech forums, part of the OpenBSD category; --> Hi, After a user question about security I noticed that nologin send the errormessage to stdout. Shouldn't /sbin/nologin send ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 08:49 AM
Han Boetes
 
Posts: n/a
Default Shouldn't /sbin/nologin send the message to stderr?

Hi,

After a user question about security I noticed that nologin send
the errormessage to stdout. Shouldn't /sbin/nologin send the
message to stderr? Or if it's really the intention to send the
message to stdout perhaps it would be a good idea to add a small
comment about that to the code.


Index: nologin.c
================================================== =================
RCS file: /cvs/src/sbin/nologin/nologin.c,v
retrieving revision 1.5
diff -u -p -r1.5 nologin.c
--- nologin.c 10 Jul 2003 00:00:58 -0000 1.5
+++ nologin.c 12 May 2005 21:52:41 -0000
@@ -46,12 +46,12 @@ int main(int argc, char *argv[])

nfd = open(_PATH_NOLOGIN_TXT, O_RDONLY);
if (nfd < 0) {
- write(STDOUT_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));
+ write(STDERR_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));
exit (1);
}

while ((nrd = read(nfd, nbuf, sizeof(nbuf))) != -1 && nrd != 0)
- write(STDOUT_FILENO, nbuf, nrd);
+ write(STDERR_FILENO, nbuf, nrd);
close (nfd);

exit (1);




# Han

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com