Re: your mail

This is a discussion on Re: your mail within the OpenSSH Development forums, part of the Networking and Network Related category; > Why change this? For optimization and clarity, since read_data_file() is done uselessly in some cases because the program just ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-02-2005
Cornel Izbasa
 
Posts: n/a
Default Re: your mail

> Why change this?

For optimization and clarity, since read_data_file() is done uselessly in
some cases because the program just prints out usage and ends.

-- current
read_data_file()
if(!sanity_check_that_doesn_t_need_the_data())
exit()
use_data()

as opposed to

++ proposed
if(!sanity_check())
exit()
read_data_file()
use_data()

>
> On Wed, 2 Nov 2005, Cornel Izbasa wrote:
>
> > Hello,
> >
> > I've noticed that ssh always opens /etc/passwd
> > on my Linux box before parsing command line options, and so the file is
> > opened even if the user is afterward presented with the usage and the
> > program ends.
> > So, this snippet in OpenSSH-4.2p1,
> > ssh.c: 219
> > /* Get user data. */
> > pw = getpwuid(original_real_uid);
> > if (!pw) {
> > logit("You don't exist, go away!");
> > exit(1);
> > }
> > /* Take a copy of the returned structure. */
> > pw = pwcopy(pw);
> >
> > should probably be moved after options scanning, for example at
> > ssh: 515, after:
> > /* Check that we got a host name. */
> > if (!host)
> > usage();
> >
> > I tested this and nothing seems to be broken by it. I can submit a patch
> > if it is wanted.
> >
> > Cornel
> >
> > _______________________________________________
> > openssh-unix-dev mailing list
> > openssh-unix-dev@mindrot.org
> > http://www.mindrot.org/mailman/listi...enssh-unix-dev
> >

>


_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://www.mindrot.org/mailman/listi...enssh-unix-dev
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:47 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0