🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
55 messages
55 total messages Page 1 of 2 Started by Bitflogger Fri, 07 Dec 2001 22:28
Page 1 of 2 • 55 total messages
Is there a hack to support paswords that contain spaces?
#55543
Author: Bitflogger
Date: Fri, 07 Dec 2001 22:28
14 lines
1514 bytes
I'm running INN 2.3.2.  I authenticate using passwords that are also used in
mail reading.
A user who has a space in his password can log into mail but not news.
I would like to support a password that begins with a space, contains a
space, or contains
consecutive spaces.  The Argify routine removes white space, so it seems I
need to detect
the AUTHINFO PASS command and handle it differently.  Is there already a
hack for this?

Thanks for your time!


Re: Is there a hack to support paswords that contain spaces?
#55545
Author: Russ Allbery
Date: Fri, 07 Dec 2001 22:56
25 lines
2017 bytes
Bitflogger <eadukers@facstaff.wisc.edu> writes:

> I'm running INN 2.3.2.  I authenticate using passwords that are also
> used in mail reading.  A user who has a space in his password can log
> into mail but not news.  I would like to support a password that begins
> with a space, contains a space, or contains consecutive spaces.

Per the TODO file:

* nnrpd's NNTP command parsing interacts poorly with AUTHINFO and
  passwords containing spaces.  The correct solution isn't clear; check
  with the current NNTP RFC draft and how existing clients handle it?

There isn't really a firm standard for the AUTHINFO commands, but
everything else in NNTP uses a space as a delimiter.  Is there any way
that you can have the user change their password to not include a space?
The NNTP protocol really doesn't handle spaces in command arguments very
well.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55550
Author: Jeremy
Date: Sat, 08 Dec 2001 21:19
14 lines
1329 bytes
Russ Allbery  <rra@stanford.edu> wrote:

> There isn't really a firm standard for the AUTHINFO commands, but
> everything else in NNTP uses a space as a delimiter.  Is there any way
> that you can have the user change their password to not include a space?
> The NNTP protocol really doesn't handle spaces in command arguments very
> well.

Is there any particular reason not to just take anything between
"authinfo pass " and end-of-line as the password, as is?

-- 
Jeremy  |  jeremy@exit109.com
Re: Is there a hack to support paswords that contain spaces?
#55611
Author: Russ Allbery
Date: Sat, 08 Dec 2001 21:40
21 lines
1858 bytes
Jeremy <jeremy@exit109.com> writes:
> Russ Allbery  <rra@stanford.edu> wrote:

>> There isn't really a firm standard for the AUTHINFO commands, but
>> everything else in NNTP uses a space as a delimiter.  Is there any way
>> that you can have the user change their password to not include a
>> space?  The NNTP protocol really doesn't handle spaces in command
>> arguments very well.

> Is there any particular reason not to just take anything between
> "authinfo pass " and end-of-line as the password, as is?

No, except that it won't work with AUTHINFO SIMPLE.  But does anyone use
AUTHINFO SIMPLE any more?

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55551
Author: Andrew - Supernews
Date: Sat, 08 Dec 2001 21:56
21 lines
1797 bytes
In article <ylg06l5r1p.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> Jeremy <jeremy@exit109.com> writes:
>> Is there any particular reason not to just take anything between
>> "authinfo pass " and end-of-line as the password, as is?

the usual reason is that all the other commands can be handled by splitting
the command line into whitespace-separated words before even checking to
see what the command is.

However, I would be particularly wary of allowing _leading_ whitespace,
because that would be incompatible with existing practice.

> No, except that it won't work with AUTHINFO SIMPLE.  But does anyone use
> AUTHINFO SIMPLE any more?

we certainly don't, and no-one's ever asked us for it as far as I know.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: Is there a hack to support paswords that contain spaces?
#55553
Author: Graham Drabble
Date: Sat, 08 Dec 2001 23:14
27 lines
2147 bytes
Russ Allbery <rra@stanford.edu> wrote in
news:ylg06l5r1p.fsf@windlord.stanford.edu: 

> Jeremy <jeremy@exit109.com> writes:
>> Russ Allbery  <rra@stanford.edu> wrote:
> 
>>> There isn't really a firm standard for the AUTHINFO commands,
>>> but everything else in NNTP uses a space as a delimiter.  Is
>>> there any way that you can have the user change their password
>>> to not include a space?  The NNTP protocol really doesn't handle
>>> spaces in command arguments very well.
> 
>> Is there any particular reason not to just take anything between
>> "authinfo pass " and end-of-line as the password, as is?
> 
> No, except that it won't work with AUTHINFO SIMPLE.  But does
> anyone use AUTHINFO SIMPLE any more?

It is valid on the news.cis.dfn.de servers but AUTHINFO USER followed 
by AUTHINFO PASS also works.

-- 
Graham Drabble
If you're interested in what goes on in other groups or want to find 
an interesting group to read then check news.groups.reviews for what 
others have to say or contribute a review for others to read.
Re: Is there a hack to support paswords that contain spaces?
#55556
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 03:11
57 lines
2874 bytes
In article <ylg06l5r1p.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>Jeremy <jeremy@exit109.com> writes:
>
>> Is there any particular reason not to just take anything between
>> "authinfo pass " and end-of-line as the password, as is?
>
>No, except that it won't work with AUTHINFO SIMPLE.

I don't know anything about SIMPLE except what I just googled
for, which found a 1998 version of Stan Barber's draft.  But
given:

    The client must then send the username followed by 
    one or more space characters followed by the
    password. 

I don't see that conflicting with taking the password to be
everything beginning with the first non-whitespace after the
username.  Am I missing something?

If not, then it looks like the patch is pretty easy, I'd be happy
to do it.


Oh wait.  Implementing this for nnrpd could be a bit hairy...

We've only got the already-argified command in scope.  Ho hum.
So that leaves four options, as far as I see.

- forget the whole thing

- glom the rest of the arguments back together with spaces; this
  is an awful hack but in practice should be just dandy[1]

- change the prototype of everything in nnrpd/commands.c to also
  take the original buffer as input; this is pretty awful

- change Argify to special case for authinfo and ignore
  whitespace after the password begins; this is *really* awful


Russ, any thoughts?



[1] I can't imagine anyone ever putting a tab in a password, so
    that leaves consecutive spaces.  Which I guess *could*
    happen, but I'd be awfully surprised.  We're talking mostly
    about naive users, I think, and...I dunno, it just doesn't
    seem very likely.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55557
Author: Russ Allbery
Date: Sun, 09 Dec 2001 04:21
33 lines
2349 bytes
Jeffrey M Vinocur <jeff@litech.org> writes:

> Oh wait.  Implementing this for nnrpd could be a bit hairy...

Heh.  Yes.  That's why it's not been fixed.

I think we have to do one of these:

> - change the prototype of everything in nnrpd/commands.c to also
>   take the original buffer as input; this is pretty awful

> - change Argify to special case for authinfo and ignore
>   whitespace after the password begins; this is *really* awful

The right thing to do is probably to pass every function both the raw
command line and the Argify'd command line in case it needs the raw one;
that way nothing has to be special-cased but there isn't massive code
duplication.  Still kind of ugly, though.

> [1] I can't imagine anyone ever putting a tab in a password, so
>     that leaves consecutive spaces.  Which I guess *could*
>     happen, but I'd be awfully surprised.  We're talking mostly
>     about naive users, I think, and...I dunno, it just doesn't
>     seem very likely.

I can imagine someone using a tab.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55558
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 05:03
38 lines
2309 bytes
In article <ylzo4t2fci.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>Jeffrey M Vinocur <jeff@litech.org> writes:
>
>> Oh wait.  Implementing this for nnrpd could be a bit hairy...
>
>Heh.  Yes.  That's why it's not been fixed.

But my interpretation of the ~spec (in particular, that it's
unambiguous) is right?


>The right thing to do is probably to pass every function both the raw
>command line and the Argify'd command line in case it needs the raw one;
>that way nothing has to be special-cased but there isn't massive code
>duplication.  Still kind of ugly, though.

Yeah.  I don't mind it much, except that it will make big diffs
between the stable and current branches for no good reason.  But
if you're fine with this, I can have a go.


>> [1] I can't imagine anyone ever putting a tab in a password,
>
>I can imagine someone using a tab.

Really?  Any client with a GUI is going to be trapping tab for
moving between fields, and it doesn't seem likely that someone
reading news from a text-only client would do something like
that.

But that method is definitely a hack, so I'm happy to skip it.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55559
Author: Greg Andrews
Date: Sun, 09 Dec 2001 06:59
33 lines
2290 bytes
jeff@litech.org (Jeffrey M. Vinocur) writes:
>
>    The client must then send the username followed by 
>    one or more space characters followed by the
>    password. 
>
>I don't see that conflicting with taking the password to be
>everything beginning with the first non-whitespace after the
>username.  Am I missing something?
>

The general problem with handling separator characters as if
they aren't separator characters is increasing code complexity
in one of the server's more critical code paths.

The server that must parse the command can't have one parser
for the whole NNTP protocol anymore.  Now one parser is used
for most commands, and another for the auth command.  The basic
parsing of protocol commands is more complex, and you risk bug
fixes being applied to one parser and not the other.

Not to mention the slippery slope effect.  Once one command
treats separator chars as non-separator chars, it's very easy
to add another, and another, and...  This tends to multiply
the number of parsers as well.


  -Greg
-- 
+++++ Greg Andrews +++ gerg@panix.com +++++
I have a map of the United States that's actual size
		 -- Steven Wright
Re: Is there a hack to support paswords that contain spaces?
#55560
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 07:38
41 lines
2559 bytes
In article <9uv25f$5g1$1@news.panix.com>, Greg Andrews <gerg@panix.com> wrote:
>jeff@litech.org (Jeffrey M. Vinocur) writes:
>>
>>    The client must then send the username followed by 
>>    one or more space characters followed by the
>>    password. 
>>
>>I don't see that conflicting with taking the password to be
>>everything beginning with the first non-whitespace after the
>>username.  Am I missing something?
>
>The general problem with handling separator characters as if
>they aren't separator characters is increasing code complexity
>in one of the server's more critical code paths.

Ok, sure...my question was really whether I was reading the
spec wrong.  The impression I had before I read the above was
that the correct behavior was not clear.  But it sounds like the
desired behavior is clear (although implementing it may be
complicated).


>The server that must parse the command can't have one parser
>for the whole NNTP protocol anymore.

(Parser!?  Tokenizer, maybe.)  But yes, point.


>Not to mention the slippery slope effect.  Once one command
>treats separator chars as non-separator chars, it's very easy
>to add another, and another, and... 

I guess...but dealing with this has been in TODO for quite a
while, and yet nothing else similar has popped up.  It's not like
we're designing the protocol, here, just implementing it.  


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55562
Author: Curt Welch
Date: Sun, 09 Dec 2001 08:51
18 lines
2007 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Jeffrey M Vinocur <jeff@litech.org> writes:

> The right thing to do is probably to pass every function both the raw
> command line and the Argify'd command line in case it needs the raw one;
> that way nothing has to be special-cased but there isn't massive code
> duplication.  Still kind of ugly, though.

That's how I ended up structuring my code to deal with the problem
of parsing Message-IDs with spaces in them. Diablo at one time (and maybe
still?) was offering articles with commands like:

  TAKETHIS <a very stupid id>

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55561
Author: Curt Welch
Date: Sun, 09 Dec 2001 09:05
64 lines
4044 bytes
jeff@litech.org (Jeffrey M. Vinocur) wrote:
> In article <ylg06l5r1p.fsf@windlord.stanford.edu>,
> Russ Allbery  <rra@stanford.edu> wrote:
> >Jeremy <jeremy@exit109.com> writes:
> >
> >> Is there any particular reason not to just take anything between
> >> "authinfo pass " and end-of-line as the password, as is?
> >
> >No, except that it won't work with AUTHINFO SIMPLE.
>
> I don't know anything about SIMPLE except what I just googled
> for, which found a 1998 version of Stan Barber's draft.  But
> given:
>
>     The client must then send the username followed by
>     one or more space characters followed by the
>     password.
>
> I don't see that conflicting with taking the password to be
> everything beginning with the first non-whitespace after the
> username.  Am I missing something?

The issue is not whether it can be done, but whether it should
be done.

The problem is not with the parser, but with the definition of
the AUTHINFO command.  As defined, it bascially implies that
spaces and other separator characters are not allowed in passwords.

If you wanted to allow those, they should have created a different
standard for passing the data, such as passing it in a hex form
like it's done on the web for example.  Or escaping the special
characters with printable characters like a \s or something.  Anything
to allow you to continue to parse the command like all NNTP commands.

If you change the parser to allow spaces, what are you going to do
with leading and trailing spaces?   How it is now, every server
in the world is probably ignoring them.  There are probably users
right now that their newsreader sending their password with an extra
space at the beginning or the end simply because they typed it wrong
but it worked anyway so they never figured that out.  If their news
server is upgraded to one which allows the space, you will cause
them problems.

Their may well be software out there that's sending an extra space
either before or after the password by mistake, but it works fine
on all news servers anyway.  But if you now treat the space as part
of the password, it will break, and all users using that software will
no longer be able to log in.

If you ignore leading and trailing spaces but allow spaces in the middle
of a password, then you are going to create more confusing down the
road when someone creates a password with trailing spaces but finds
he can't log on to your server.

In short, you will be causing people problems if you change a news server
to allow spaces in the password.  The correct solution is to prevent
users from ever making up passwords with spaces in them in the first
place.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55563
Author: Andrew - Supernews
Date: Sun, 09 Dec 2001 09:12
23 lines
2136 bytes
In article <ylzo4t2fci.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> The right thing to do is probably to pass every function both the raw
> command line and the Argify'd command line in case it needs the raw one;
> that way nothing has to be special-cased but there isn't massive code
> duplication.  Still kind of ugly, though.

You'll find that this is a pain, because you've probably argified the
original command line in place by nulling out the whitespace. (Ok, so I
haven't looked at INN's nnrpd much lately so I'm guessing.)

What I actually do (though I've not actually set this up for AUTHINFO PASS,
mainly because it's never seemed to be an issue before) is have a flag
in the command table which says whether the command needs to be argified;
if not, I just pass the whole argument string as argv[1].

Perhaps an even better solution would be to use a number instead of that
flag, giving the number of words to argify, with any remaining text left
as the last argument.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: Is there a hack to support paswords that contain spaces?
#55564
Author: Aidan Cully
Date: Sun, 09 Dec 2001 13:44
32 lines
2456 bytes
In news.software.nntp, Russ Allbery <rra@stanford.edu> wrote:
> Jeffrey M Vinocur <jeff@litech.org> writes:
> 
> > Oh wait.  Implementing this for nnrpd could be a bit hairy...
> 
> Heh.  Yes.  That's why it's not been fixed.
> 
> I think we have to do one of these:
> 
> > - change the prototype of everything in nnrpd/commands.c to also
> >   take the original buffer as input; this is pretty awful
> 
> > - change Argify to special case for authinfo and ignore
> >   whitespace after the password begins; this is *really* awful
> 
> The right thing to do is probably to pass every function both the raw
> command line and the Argify'd command line in case it needs the raw one;
> that way nothing has to be special-cased but there isn't massive code
> duplication.  Still kind of ugly, though.

How about: only parse the command to select the command function,
and pass two strings to the command function (argv[0], and a pointer
to the first non-whitespace character afterwards, or the trailing
'\0').  Now the command function is responsible for calling Argify.
In the case of AUTHINFO, it just wouldn't.

Won't passing both versiouns of the command line require data
duplication, because Argify() overwrites some of the input string
with nulls?

--aidan
Re: Is there a hack to support paswords that contain spaces?
#55565
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 16:31
39 lines
2557 bytes
In article <slrna16ao4.23i3.andrew+nonews@trinity.supernews.net>,
Andrew - Supernews <andrew@supernews.com> wrote:
>
>You'll find that this is a pain, because you've probably argified the
>original command line in place by nulling out the whitespace.

Nope.  We're nulling out a copy.


>What I actually do (though I've not actually set this up for AUTHINFO PASS,
>mainly because it's never seemed to be an issue before) is have a flag
>in the command table which says whether the command needs to be argified;
>if not, I just pass the whole argument string as argv[1].

The trouble is almost everything, including CMDauthinfo, needs
the argified version (as well).


>Perhaps an even better solution would be to use a number instead of that
>flag, giving the number of words to argify, with any remaining text left
>as the last argument.

Hmm.  That's not bad.  We could still have argify scan the whole
string and return the count of the total number of arguments,
which allows error checking for too few/many.  

I've been wrestling with how, if you get the original buffer
passed in as well, you can find the beginning of everything-else
without running over the string again (which is just yuck).  If
we were sure there was never leading whitespace in the original
buffer, buff[av[i] - av[0]] would do it, which isn't half bad.

But I like your idea better.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55566
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 16:52
81 lines
3993 bytes
In article <20011209040538.266$zf@newsreader.com>,
Curt Welch <curt@kcwc.com> wrote:
>
>The problem is not with the parser, but with the definition of
>the AUTHINFO command.  As defined, it bascially implies that
>spaces and other separator characters are not allowed in passwords.

I'm not seeing this.


>If you wanted to allow those, they should have created a different
>standard for passing the data, such as passing it in a hex form
>like it's done on the web for example.

What, we get to do NNTP over again from scratch?  Like this would
be the only change.


>If you change the parser to allow spaces, what are you going to do
>with leading and trailing spaces?

I read it as the password begins with the first nonwhitespace
following the whitespace marking the end of the previous word,
and extends to the end of the line.  But even if we discard
trailing space too, we'll still be fixing the problem at issue,
which is that in the real world (I've seen it several times)
people do use multi-word passwords and expect them to work.


>How it is now, every server in the world is probably ignoring
>them.

Which is odd.  I notice in some commands INN checks for correct
number of arguments and errors otherwise, and some it doesn't.


>There are probably users right now that their newsreader sending
>their password with an extra space at the beginning or the end
>simply because they typed it wrong but it worked anyway so they
>never figured that out.  If their news server is upgraded to one
>which allows the space, you will cause them problems.

That's possible.  Hopefully they'll react to "invalid password"
by trying to type their password again, and presumably get it
right.  Certainly very few protocols allow leading and trailing
space on passwords.

And it's not like this will come as a surprise to the news admin;
we can document it as part of the upgrade.


>Their may well be software out there that's sending an extra space
>either before or after the password by mistake, but it works fine
>on all news servers anyway.

Hrm.  We've got to at least include intermediate spaces.  Russ?


>If you ignore leading and trailing spaces but allow spaces in the middle
>of a password, then you are going to create more confusing down the
>road when someone creates a password with trailing spaces but finds
>he can't log on to your server.

No more than currently exists, I think.  Anybody perceptive
enough to realize it might be the spaces will be able to debug
either situation.


>The correct solution is to prevent users from ever making up
>passwords with spaces in them in the first place.

How?  They're acceptable in other situations, and people *have*
them.  I've seen it happen several times.  

I agree, but we can't.  So next best thing...


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55567
Author: Curt Welch
Date: Sun, 09 Dec 2001 19:01
28 lines
2392 bytes
jeff@litech.org (Jeffrey M. Vinocur) wrote:
> In article <20011209040538.266$zf@newsreader.com>,
> Curt Welch <curt@kcwc.com> wrote:

> >The correct solution is to prevent users from ever making up
> >passwords with spaces in them in the first place.
>
> How?  They're acceptable in other situations, and people *have*
> them.  I've seen it happen several times.

What software are they using to create the password in the first place?

Why not fix that software so it no longer allows people to create
broken passwords in the first place?

I did just run a quick test on OE and it does allow spaces in passwords
and simply puts the password on the command as you would expect (including
leading and trailing spaces).

Do you know if most other popular newsreaders even allow you to
enter passwords with spaces in them?  If you fix INN and don't fix all
the newsreaders in the world aren't you potentially just makeing the
support problem worse instead of better?

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55568
Author: Russ Allbery
Date: Sun, 09 Dec 2001 20:22
20 lines
1769 bytes
Jeffrey M Vinocur <jeff@litech.org> writes:

> But my interpretation of the ~spec (in particular, that it's
> unambiguous) is right?

I believe so, yes.

> Yeah.  I don't mind it much, except that it will make big diffs between
> the stable and current branches for no good reason.  But if you're fine
> with this, I can have a go.

It is a good reason; it fixes a bug.  :)  And there are already huge diffs
between current and stable, so don't worry about that.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55570
Author: Russ Allbery
Date: Sun, 09 Dec 2001 20:22
19 lines
1892 bytes
Curt Welch <curt@kcwc.com> writes:

> That's how I ended up structuring my code to deal with the problem of
> parsing Message-IDs with spaces in them. Diablo at one time (and maybe
> still?) was offering articles with commands like:

>   TAKETHIS <a very stupid id>

That's a flat-out syntax error, and I don't think INN should do anything
with that except reject it as a syntax error.  Spaces are not allowed in
message IDs; accepting and propagating those articles doesn't do anyone
any favors.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55571
Author: Russ Allbery
Date: Sun, 09 Dec 2001 20:23
26 lines
2192 bytes
Andrew <andrew+nonews@supernews.com> writes:
> Russ Allbery wrote:

>> The right thing to do is probably to pass every function both the raw
>> command line and the Argify'd command line in case it needs the raw
>> one; that way nothing has to be special-cased but there isn't massive
>> code duplication.  Still kind of ugly, though.

> You'll find that this is a pain, because you've probably argified the
> original command line in place by nulling out the whitespace. (Ok, so I
> haven't looked at INN's nnrpd much lately so I'm guessing.)

Hm.  Yeah, good point.

> Perhaps an even better solution would be to use a number instead of that
> flag, giving the number of words to argify, with any remaining text left
> as the last argument.

That may be a better solution.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55572
Author: Russ Allbery
Date: Sun, 09 Dec 2001 20:24
33 lines
2261 bytes
Jeffrey M Vinocur <jeff@litech.org> writes:
> Andrew - Supernews <andrew@supernews.com> wrote:

>> You'll find that this is a pain, because you've probably argified the
>> original command line in place by nulling out the whitespace.

> Nope.  We're nulling out a copy.

On the other hand, not constantly copying the incoming command line may
eventually be a good idea.

> Hmm.  That's not bad.  We could still have argify scan the whole string
> and return the count of the total number of arguments, which allows
> error checking for too few/many.

*nod*

> I've been wrestling with how, if you get the original buffer passed in
> as well, you can find the beginning of everything-else without running
> over the string again (which is just yuck).  If we were sure there was
> never leading whitespace in the original buffer, buff[av[i] - av[0]]
> would do it, which isn't half bad.

> But I like your idea better.

So do I.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55573
Author: Russ Allbery
Date: Sun, 09 Dec 2001 20:26
19 lines
1783 bytes
Jeffrey M Vinocur <jeff@litech.org> writes:
> Curt Welch <curt@kcwc.com> wrote:

>> Their may well be software out there that's sending an extra space
>> either before or after the password by mistake, but it works fine on
>> all news servers anyway.

> Hrm.  We've got to at least include intermediate spaces.  Russ?

I think we should kill leading spaces; that's sort of a protocol issue,
and I doubt it will break many real-world passwords.  I'm agnostic on
trailing spaces.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55574
Author: Russ Allbery
Date: Sun, 09 Dec 2001 20:27
18 lines
1794 bytes
Curt Welch <curt@kcwc.com> writes:

> What software are they using to create the password in the first place?

> Why not fix that software so it no longer allows people to create broken
> passwords in the first place?

Most password programs consider increasing the available character space
for passwords by as much as possible to be a pretty good idea.  Passwords
with spaces in them certainly work for Unix login; why shouldn't they work
for NNTP?

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55575
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 21:34
30 lines
2089 bytes
In article <20011209140125.796$s8@newsreader.com>,
Curt Welch <curt@kcwc.com> wrote:
>
>What software are they using to create the password in the first place?

Pretty much anything.  It's not often that people have dedicated
news passwords; if they're using general system passwords (the
same ones as for dialup, email, etc), they might be set in any
one of a million ways, almost all capable of handling embedded
spaces.


>Why not fix that software so it no longer allows people to create
>broken passwords in the first place?

There's no chance of that; it's random stuff different at every
stie.


>Do you know if most other popular newsreaders even allow you to
>enter passwords with spaces in them?

I haven't tried them, but I think people treat passwords as
opaque strings and just do printf("authinfo pass %s",password) or
equivalent.  

-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55577
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 22:22
19 lines
1664 bytes
In article <ylofl8cf71.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>
>I think we should kill leading spaces; that's sort of a protocol issue,
>and I doubt it will break many real-world passwords.  I'm agnostic on
>trailing spaces.

Agreed on both counts.

Does anyone have an opinion about trailing spaces?  It's
precisely no harder to code one way or the other, but killing the
trailing spaces would require writing in a NUL which we might as
well not do without a reason.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55576
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 22:23
24 lines
1665 bytes
In article <ylbsh8dtzf.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>Jeffrey M Vinocur <jeff@litech.org> writes:
>
>> But my interpretation of the ~spec (in particular, that it's
>> unambiguous) is right?
>
>I believe so, yes.

I guess it implies that we should keep trailing spaces.


>> Yeah.  I don't mind it much, except that it will make big diffs between
>> the stable and current branches for no good reason.  
>
>It is a good reason; it fixes a bug.  :)

Oh, right. :-)


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55578
Author: Curt Welch
Date: Sun, 09 Dec 2001 22:43
39 lines
2977 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Curt Welch <curt@kcwc.com> writes:
>
> > That's how I ended up structuring my code to deal with the problem of
> > parsing Message-IDs with spaces in them. Diablo at one time (and maybe
> > still?) was offering articles with commands like:
>
> >   TAKETHIS <a very stupid id>
>
> That's a flat-out syntax error,

It strikes me as odd that someone would call that a syntax error
yet look on "AUTHINFO PASS two words" as OK.  Clearly a double standard
at work here.

> and I don't think INN should do anything
> with that except reject it as a syntax error.  Spaces are not allowed in
> message IDs; accepting and propagating those articles doesn't do anyone
> any favors.

Right, I agree.  But I wanted to reject the ID with a valid reject code
like "435 Bad Message-ID." for an IHAVE like that instead of with a 500.

And for "TAKETHIS <bad id>", you can't reject the command with a 500
error and then ignore the data that follows.

If you reject it with a 5XX the sending side could make the false
assumption that the problem is not with the message, but with something
else, and re-queue the message for later -- which clearly is not what you
want the sending side to do.

I also wanted to count the reject with the other forms of "Bad ID" and not
as a syntax error for the statistics.  So bogus or not, I had to parse the
line just to make my server handle and log the error correctly.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55579
Author: Jeffrey M. Vinocur
Date: Sun, 09 Dec 2001 22:48
27 lines
1859 bytes
In article <20011209174305.050$xD@newsreader.com>,
Curt Welch <curt@kcwc.com> wrote:
>Russ Allbery <rra@stanford.edu> wrote:
>> Curt Welch <curt@kcwc.com> writes:
>>
>> >   TAKETHIS <a very stupid id>
>>
>> That's a flat-out syntax error,
>
>It strikes me as odd that someone would call that a syntax error
>yet look on "AUTHINFO PASS two words" as OK.  Clearly a double standard
>at work here.

Why?  From the latest USEFOR draft:

    A msg-id MUST NOT contain any SP within any strict-quoted-pair.

That's pretty unambiguous.  Thus if we're splitting on space, we
can expect precisely one parameter to follow TAKETHIS.

But there's nothing correspondingly forbidding for AUTHINFO...


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55580
Author: Curt Welch
Date: Sun, 09 Dec 2001 23:31
81 lines
5092 bytes
jeff@litech.org (Jeffrey M. Vinocur) wrote:
> In article <20011209140125.796$s8@newsreader.com>,
> Curt Welch <curt@kcwc.com> wrote:
> >
> >What software are they using to create the password in the first place?
>
> Pretty much anything.  It's not often that people have dedicated
> news passwords; if they're using general system passwords (the
> same ones as for dialup, email, etc), they might be set in any
> one of a million ways, almost all capable of handling embedded
> spaces.

A million ways?  Yeah, right.

But there are also "millions" of news servers and news clients.  Why
do you think changing the millions of servers and clients is the
"correct" way?  By changing inn to support spaces you are in effect
claiming that all news servers and all news clients should support
spaces as well.

> >Why not fix that software so it no longer allows people to create
> >broken passwords in the first place?
>
> There's no chance of that; it's random stuff different at every
> stie.

And there is a chance of getting all the news clients in the world changed
to support spaces?

Any ISP or organization that is having NNTP support problems because the
users's password don't work that has the power to change INN is just as
likely to have the problem to change they web interface or whatever they
use to allow users to make up the bogus passwords in the first place.

If you change INN, but then some brand-x news reader in use does not
support spaces, then the ISP hasn't solved their problem have they?  But if
they change their web inteface so it rejects passwords with spaces in them,
then the probolem is solved.

Maybe the fact is that most (if not all) already support spaces, and if
that's true, then changing the news servers is not an unworkable solution.

But how many different ways are their for hooking the authentication
code into the database of passwords?  How many of those might crash
if inn trys to pass a password with spaces to it?

I don't know the answers to all these issues.  My only real point is
that if you define AUTHINFO to take all characters after the first
space as the password, then you have violated basic NNTP parsing
rules (RFC 977 section 2.3 paragraph 1) so that makes it a very bad
protocol design and that can lead to complex bugs and support issues down
the road.  But, even if you go with the "bad design" it should be part of
the standard.  The only thing more problematic than a bad design, is an
undocumented bad design.  And I'm not talking about INN documentaiton, I'm
talking about protocol documentation that people who write news clients are
likely to be reading.  i.e., the standards -- which is the root cause of
this problem in the first place since the AUTHINFO system was not probably
designed to deal with spaces.

> >Do you know if most other popular newsreaders even allow you to
> >enter passwords with spaces in them?
>
> I haven't tried them, but I think people treat passwords as
> opaque strings and just do printf("authinfo pass %s",password) or
> equivalent.

Yeah, there's a good chance you are right about that, and if they don't
do something to prevent the password from being entered with spaces,
then there's a good chance that will work.

But if you are going to try and hack in support for spaces, and if all
the password systems that allow spaces to be entered when the password
was creates are likely to allow leading and trailing spaces, why wouldn't
you go ahead and support leading and trailing spaces as well?  If you
are going to hack, why not hack completely?  Do you have some good reason
to belive that a complete hack is more dangerous than a partial hack?

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55581
Author: Jeremy
Date: Sun, 09 Dec 2001 23:48
20 lines
1388 bytes
Curt Welch <curt@kcwc.com> wrote:

>>>   TAKETHIS <a very stupid id>
>>
>> That's a flat-out syntax error,
> 
> It strikes me as odd that someone would call that a syntax error
> yet look on "AUTHINFO PASS two words" as OK.  Clearly a double standard
> at work here.

Not at all, since spaces are forbidden in message-ids but not passwords.

> Right, I agree.  But I wanted to reject the ID with a valid reject code
> like "435 Bad Message-ID." for an IHAVE like that instead of with a 500.

That's a pretty good reason...

-- 
Jeremy  |  jeremy@exit109.com
Re: Is there a hack to support paswords that contain spaces?
#55583
Author: Curt Welch
Date: Sun, 09 Dec 2001 23:54
75 lines
4139 bytes
jeff@litech.org (Jeffrey M. Vinocur) wrote:
> In article <20011209174305.050$xD@newsreader.com>,
> Curt Welch <curt@kcwc.com> wrote:
> >Russ Allbery <rra@stanford.edu> wrote:
> >> Curt Welch <curt@kcwc.com> writes:
> >>
> >> >   TAKETHIS <a very stupid id>
> >>
> >> That's a flat-out syntax error,
> >
> >It strikes me as odd that someone would call that a syntax error
> >yet look on "AUTHINFO PASS two words" as OK.  Clearly a double standard
> >at work here.
>
> Why?  From the latest USEFOR draft:
>
>     A msg-id MUST NOT contain any SP within any strict-quoted-pair.
>
> That's pretty unambiguous.  Thus if we're splitting on space, we
> can expect precisely one parameter to follow TAKETHIS.

Of course.

> But there's nothing correspondingly forbidding for AUTHINFO...

Like shit there isn't.

RFC 977 - Network News Transfer Protocol

2.3.  Commands

   Commands consist of a command word, which in some cases may be
   followed by a parameter.  Commands with parameters must separate the
   parameters from each other and from the command by one or more space
   or tab characters.  Command lines must be complete with all required
   parameters, and may not contain more than one command.

RFC 2980 - Common NNTP Extensions

3.1.1 Original AUTHINFO

   AUTHINFO USER username
   AUTHINFO PASS password

You may not know how to read RFCs, but that cleary defines "password" to
be a command parameter in the RFC 977 context.  If they had intended
the password to be multiple parameters, they whould have discussed
the idea.  They didn't.  It's very clear from the way it's documented
that the orginal authors assumed the password was a "word" and not
a "phrase".  If they wanted the command to support spaces and tabs, they
would have would not have defined it the way they did.  They would have
specified some system for creating a "password" parameter which didn't
viloate the basic RFC 977 rules of command parsing.

If you write an NNTP parser which doesn't parse the command using one or
more spaces or tabs to separate the paramters, you are NOT following the
RFC.

And if a client sends "AUTHINFO PASS two words", it's is just as much
of a syntax error as "IHAVE <bad id>".  You can't stand here and try to
tell me that one is OK and the other is a syntax error just because
they didn't add a sentencs that says "for those of you too stupid to
understand the rfc - spaces and tabs are not allowed in the password
command parameter".

By allowing spaces or tabs in the passwords, you are violating the RFCs.

Maybe this violation (bending) is the best solution to the problem, I'll
admit that. But I will not let you get away with saying the RFCs don't say
it's wrong to do that when they do.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55582
Author: Jeremy
Date: Sun, 09 Dec 2001 23:55
49 lines
2997 bytes
Curt Welch <curt@kcwc.com> wrote:

> But there are also "millions" of news servers and news clients.  Why
> do you think changing the millions of servers and clients is the
> "correct" way?  By changing inn to support spaces you are in effect
> claiming that all news servers and all news clients should support
> spaces as well.

No, not really.  A client that doesn't support spaces in passwords can
go right on using passwords with no spaces; supporting them is not the
same as requiring them.

> And there is a chance of getting all the news clients in the world changed
> to support spaces?

You don't have to change a single one of them, unless I'm really missing
something here.

> If you change INN, but then some brand-x news reader in use does not
> support spaces, then the ISP hasn't solved their problem have they?

I don't understand what support problems could conceivably arise from
this.  If a client didn't support spaces, then it would continue to
work just fine, still not supporting spaces.

The only issue I can even imagine, worst-case, is that a client lets
you put a space in your password which *isn't* supposed to be there,
ie a leading or trailing space you didn't mean to type, and in that
case, the worst possible thing that could happen is that the user would
see a password prompt, re-type his password, and go on his merry way.

> But if they change their web inteface so it rejects passwords with
> spaces in them, then the probolem is solved.

You don't see an *enormous* support problem with suddenly invalidating
users' passwords which have worked forever and which will continue to
work elsewhere?

All you're doing by supporting spaces in NNTP passwords is allowing a
setup where system passwords are used also for NNTP.  To me, that sounds
like something which would *reduce* support load, since users would no
longer need to remember two passwords (or maintain the same password in
two locations, if they choose to use the same password for both -- which
they may not be able to because the syntax requirements are different,
ie, no spaces allowed in NNTP passwords).

-- 
Jeremy  |  jeremy@exit109.com
Re: Is there a hack to support paswords that contain spaces?
#55584
Author: Andrew - Supernews
Date: Mon, 10 Dec 2001 00:09
42 lines
2941 bytes
In article <20011209183112.802$Gb@newsreader.com>, Curt Welch wrote:
> Any ISP or organization that is having NNTP support problems because the
> users's password don't work that has the power to change INN is just as
> likely to have the problem to change they web interface or whatever they
> use to allow users to make up the bogus passwords in the first place.

Umm.

While we don't use INN, we do use our own code and we could, if we had
a good enough reason to, change it to support passwords with spaces.

On the other hand, we do outsource accounts that use RADIUS authentication
(where the customer is supplying the RADIUS server and therefore controlling
the username/password data themselves). We've had (as I recall) one case so
far where a problem arose because of whitespace in an existing password.

So we, at least, are in the position of being able to change the NNTP code
but not being able to control how passwords are set.

> But how many different ways are their for hooking the authentication
> code into the database of passwords?  How many of those might crash
> if inn trys to pass a password with spaces to it?

indeed, there are possible issues here - I can think of a couple of
places in our code that would have to be checked out, in addition to the
actual AUTHINFO command itself.

[...]
> And I'm not talking about INN documentaiton, I'm
> talking about protocol documentation that people who write news clients are
> likely to be reading.  i.e., the standards -- which is the root cause of
> this problem in the first place since the AUTHINFO system was not probably
> designed to deal with spaces.

FWIW, there is no standard for AUTHINFO. (The documentation that does
exist, RFC 2980, is a description of deployed implementations rather than
a standard as such.)

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: Is there a hack to support paswords that contain spaces?
#55586
Author: Russ Allbery
Date: Mon, 10 Dec 2001 01:25
29 lines
2483 bytes
Curt Welch <curt@kcwc.com> writes:

> It strikes me as odd that someone would call that a syntax error yet
> look on "AUTHINFO PASS two words" as OK.  Clearly a double standard at
> work here.

AUTHINFO PASS with a password containing spaces is a syntax error too.
However, there's a difference.

There is nothing valid that one can do with TAKETHIS with a parameter
containing spaces.  Spaces are not permitted in message IDs, therefore any
article containing a message ID with spaces is not a valid netnews
article, therefore even trying to propagate such an article is in
violation of the protocol.

However, there is no standard for passwords, and in fact passwords are
defined outside of the NNTP protocol.  There's nothing saying anywhere
that passwords that can't contain spaces; there's just an encoding error
in the way in which passwords are passed to the server.

So the latter is worth correcting for in the "be liberal in what one
excepts" department for me, whereas the former is not.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55585
Author: Russ Allbery
Date: Mon, 10 Dec 2001 01:26
18 lines
1681 bytes
Jeremy <jeremy@exit109.com> writes:
> Curt Welch <curt@kcwc.com> wrote:

>> Right, I agree.  But I wanted to reject the ID with a valid reject code
>> like "435 Bad Message-ID." for an IHAVE like that instead of with a
>> 500.

> That's a pretty good reason...

Yeah, it is, particularly given the software that explodes on other return
codes from TAKETHIS.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55587
Author: Curt Welch
Date: Mon, 10 Dec 2001 03:34
29 lines
2567 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Curt Welch <curt@kcwc.com> writes:
>
> > What software are they using to create the password in the first place?
>
> > Why not fix that software so it no longer allows people to create
> > broken passwords in the first place?
>
> Most password programs consider increasing the available character space
> for passwords by as much as possible to be a pretty good idea.  Passwords
> with spaces in them certainly work for Unix login; why shouldn't they
> work for NNTP?

It would be good to make them work for NNTP.  Likewise, it would be good to
allow the entire 8 bit character set so people could use ^J and ^M as well
as ^I.  But the "technically" correct way to make them work is to change
the protocol in an intelligent fashion, not with the bailing wire and
bubble gum design being talked about here which has the potential to add
more problems than it removes.

Maybe, because of how most the clients already work, the hack talked about
here would actaully do more good than harm.  But it's questionable if no
one has actaully done the research to find out how most news clients
actually work.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55588
Author: Curt Welch
Date: Mon, 10 Dec 2001 04:13
82 lines
5421 bytes
Jeremy <jeremy@exit109.com> wrote:
> Curt Welch <curt@kcwc.com> wrote:

> > And there is a chance of getting all the news clients in the world
> > changed to support spaces?
>
> You don't have to change a single one of them, unless I'm really missing
> something here.

Yeah, you are missing something.  The reason they are talking about adding
the space support to INN is because it is seen as a "bug" by those sites
which allow spaces in passwords.  Any user that created a password with
a space currently can't access the NNTP server.  That creates support
problems (small as they may be).

If you try to fix this bug by changing INN, but the newsreader the user
is using doesn't allow them to enter their passwords, then you have
fixed nothing.  What you have done is turned a "paswords with spaces
don't work for NNTP" support issue, into a "passwords with spaces sometimes
don't work with NNTP" support problem.  Or the "passwords with spaces works
as long as you don't start or end your password with spaces" type of
problem.

> > But if they change their web inteface so it rejects passwords with
> > spaces in them, then the probolem is solved.
>
> You don't see an *enormous* support problem with suddenly invalidating
> users' passwords which have worked forever and which will continue to
> work elsewhere?

You misunderstood my intent there.  I was talking about
the web interface that's used when users either 1) set up a new account
and select their own password, or 2) change their current password.  It
should just be modified to reject any new passwords which contained spaces.

If the password creating/changing tools were modified to reject any
password with a space in it, then all new accounts would be free of the
NNTP problem.  And over time, the "bug" would vanish.  And to speed the
issue, you can search your password database and send messages to anyone
with a space in their password to let them know that the password doesn't
work for NNTP access, and that they should change it if they ever want to
use the NNTP server.

> All you're doing by supporting spaces in NNTP passwords is allowing a
> setup where system passwords are used also for NNTP.

I can create a Unix password with a ^M in it.  Will their change make
that work?  I can use ^I as well.  How many Windows newsreaders are likely
to let me enter a password like that?  I can add spaces to the front and
rear of the password or even make a password that is simply 10 spaces.
Will that work?

They aren't making the password match unix passwords.  They are just
using an ugly and dangerous hack to get it a little closer to working.

> To me, that sounds
> like something which would *reduce* support load, since users would no
> longer need to remember two passwords (or maintain the same password in
> two locations, if they choose to use the same password for both -- which
> they may not be able to because the syntax requirements are different,
> ie, no spaces allowed in NNTP passwords).

It is likely to reduce the support calls.  But at the same time, it can
create new support problems.  The user calls and says they can't log
in.  The support person trys it and it works fine for her copy of OE and
sends one of those "must be user error" type of messages back to the
user.  The support person has never even heard about this "space" problem
or perhaps had heard about it but was told it was fixed, so when she sees
the user has a space in the password, she doesn't even think to ask the
user to try changing it.  But all along, the real problem was that the
user was using a news reader which removed leading spaces from the password
as entered.  In the end, the user just gives up trying to make NNTP work.

But if you simply change the password creating tools to prevent the user
from using ALL characters which were not supported on NNTP, then you will
completly eliminate all support problems in the future because of
incompatible passwords.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55589
Author: Russ Allbery
Date: Mon, 10 Dec 2001 08:12
27 lines
2218 bytes
Curt Welch <curt@kcwc.com> writes:

> It would be good to make them work for NNTP.  Likewise, it would be good
> to allow the entire 8 bit character set so people could use ^J and ^M as
> well as ^I.

The difference there is that ^J and ^M *don't* work for Unix login, so no
one already uses them.

> But the "technically" correct way to make them work is to change the
> protocol in an intelligent fashion, not with the bailing wire and bubble
> gum design being talked about here which has the potential to add more
> problems than it removes.

I'm all ears.  It's easy enough to add a new AUTHINFO method on the
server.

Actually, never mind, I take that back.  Don't bother; the Right Way To Do
This is to use SASL, and that's where any future authentication work on
NNTP should go.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55590
Author: Jeremy
Date: Mon, 10 Dec 2001 09:05
73 lines
4407 bytes
Curt Welch <curt@kcwc.com> wrote:

> If you try to fix this bug by changing INN, but the newsreader the user
> is using doesn't allow them to enter their passwords, then you have
> fixed nothing.  What you have done is turned a "paswords with spaces
> don't work for NNTP" support issue, into a "passwords with spaces sometimes
> don't work with NNTP" support problem.  Or the "passwords with spaces works
> as long as you don't start or end your password with spaces" type of
> problem.

Honestly, that sounds like much less of a problem, from a support
standpoint.  Yes, I did tech support for far too long, so I think I
have a reasonable basis to make that judgement. :)

This gives you the option, if a user calls asking why his password
doesn't work, of recommending that he might try another newsreader,
in addition to the recommendation that he change his password.  That
is, to me, a good thing, because requiring users to change their
passwords can end up with them writing them on post-its and sticking
them on their monitors.

So, at least you'd have another option available.

> You misunderstood my intent there.  I was talking about
> the web interface that's used when users either 1) set up a new account
> and select their own password, or 2) change their current password.  It
> should just be modified to reject any new passwords which contained spaces.

My position on adding restrictions to the syntax of user passwords is
that it's something that should be avoided.  People are fully capable of
inventing a "good" password, but typically, you can't expect them to be
capable of juggling more than a couple of the things.  If they've already
come up with a "good" password, but when they arrive on your system, it
suddenly isn't valid, there is a significant risk that they are going to
quickly come up with a "bad" password which is easy to remember.  I
consider it better to let them use their usual password, which is probably
more secure then "damn, it doesn't work?  Okay, I'll just stick in my
wife's name."

>> All you're doing by supporting spaces in NNTP passwords is allowing a
>> setup where system passwords are used also for NNTP.
> 
> I can create a Unix password with a ^M in it.

No, you can't, at least not properly.  Manually hashing a string and
sticking it in /etc/passwd doesn't count, because users can't do that.

> They aren't making the password match unix passwords.  They are just
> using an ugly and dangerous hack to get it a little closer to working.

I don't see it as ugly or dangerous; and "closer to working" is better
than "not working", to me at least.

> It is likely to reduce the support calls.  But at the same time, it can
> create new support problems.  The user calls and says they can't log
> in.  The support person trys it and it works fine for her copy of OE and
> sends one of those "must be user error" type of messages back to the
> user.  The support person has never even heard about this "space" problem
> or perhaps had heard about it but was told it was fixed, so when she sees
> the user has a space in the password, she doesn't even think to ask the
> user to try changing it.

Not a bad point.

You know what would be sort of nice?  Being able to authenticate at
connect time via an x509 certificate, but then proceed to not encrypt the
entire rest of the session (to save on resources).  That, of course, is
pie in the sky stuff, as it would require huge client-side changes as
well as server-side ones.

-- 
Jeremy  |  jeremy@exit109.com
Re: Is there a hack to support paswords that contain spaces?
#55592
Author: Andrew - Supernews
Date: Mon, 10 Dec 2001 10:03
14 lines
1754 bytes
In article <ylzo4r1okd.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> Actually, never mind, I take that back.  Don't bother; the Right Way To Do
> This is to use SASL, and that's where any future authentication work on
> NNTP should go.

Unfortunately there is no existing SASL scheme (that I'm aware of) that
supports third-party authentication (i.e. where the server has access to
neither the plaintext nor any pre-encrypted copy of the password, all it
can do is invoke an external authentication mechanism, such as RADIUS).

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: Is there a hack to support paswords that contain spaces?
#55593
Author: Curt Welch
Date: Mon, 10 Dec 2001 16:09
20 lines
2149 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Curt Welch <curt@kcwc.com> writes:
>
> > It would be good to make them work for NNTP.  Likewise, it would be
> > good to allow the entire 8 bit character set so people could use ^J and
> > ^M as well as ^I.
>
> The difference there is that ^J and ^M *don't* work for Unix login, so no
> one already uses them.

On FreeBSD, I was actually able to make ^M work entering it as ^V^M.  And
likewise, the Unix ssh comand line allowed me to login with that password.
My PC SSH client however wouldn't let me log in with that password.

However, I agree, those really aren't important problems.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55595
Author: Curt Welch
Date: Mon, 10 Dec 2001 16:37
32 lines
2874 bytes
Jeremy <jeremy@exit109.com> wrote:
> You know what would be sort of nice?  Being able to authenticate at
> connect time via an x509 certificate, but then proceed to not encrypt the
> entire rest of the session (to save on resources).  That, of course, is
> pie in the sky stuff, as it would require huge client-side changes as
> well as server-side ones.

The simple way to solve the character set issues vs the command parsing
issues is to do something like they did with HTTP where the user name and
password gets base-64 encoded.  You could even hack it into the current
system by using the same AUTHINFO syntax, expect when the password was
base-64 encoded, it could be marked with some magic tokens such as:
?B?Vu6FkkF?B?

Like that, you could even enter the base-64 version of your password into
a client which didn't yet know how to support it so this would give your
tech support people a way of allowing NNTP access without forcing the user
to change their password.  But for most users, and most tech support
people, the "change your password" answer would be better. :)

But changing all the clients in the world to support a new authentication
protocol of course is far from simple which is why the space hack talked
about here is likely to be the only workable soultion to makeing spaces
work.

And if you are going to change the authentication protocol, you would
probably want to go with something much more advanced anyhow.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55594
Author: Greg Andrews
Date: Mon, 10 Dec 2001 18:28
31 lines
2339 bytes
jeff@litech.org (Jeffrey M. Vinocur) writes:
>Greg Andrews <gerg@panix.com> wrote:
>>
>>Not to mention the slippery slope effect.  Once one command
>>treats separator chars as non-separator chars, it's very easy
>>to add another, and another, and... 
>
>I guess...but dealing with this has been in TODO for quite a
>while, and yet nothing else similar has popped up.  It's not like
>we're designing the protocol, here, just implementing it.  
>

Sounds like you're discussing an exception to the protocol's
well-defined tokenizing rules.  It would be more accurate to
say you're breaking the protocol rather than implementing it.

I'm not saying such a thing would be wrong.  Times change, usage
changes, and protocols need to adapt to remain useful.  This may
be a situation where adapting to change is necessary.  I.e. OSes
with different rules for usernames/passwords are joining Usenet.

I wanted to point out that this would be a significant change to
an important piece of the server's code rather than a simple hack
with no side effects.

  -Greg
-- 
+++++ Greg Andrews +++ gerg@panix.com +++++
I have a map of the United States that's actual size
		 -- Steven Wright
Re: Is there a hack to support paswords that contain spaces?
#55596
Author: Kjetil Torgrim Homme
Date: Mon, 10 Dec 2001 19:55
13 lines
1672 bytes
[Jeffrey M. Vinocur]

>   I've been wrestling with how, if you get the original buffer
>   passed in as well, you can find the beginning of everything-else
>   without running over the string again (which is just yuck).

And yet most people set up their server to let Perl run through every
article in many passes ... :-)

-- 
Kjetil T.		abusing standards for the greater good
			http://www.microsoft.com:products@3333866552/
Re: Is there a hack to support paswords that contain spaces?
#55597
Author: Russ Allbery
Date: Mon, 10 Dec 2001 19:58
24 lines
2408 bytes
Andrew <andrew+nonews@supernews.com> writes:
> In article <ylzo4r1okd.fsf@windlord.stanford.edu>, Russ Allbery wrote:

>> Actually, never mind, I take that back.  Don't bother; the Right Way To
>> Do This is to use SASL, and that's where any future authentication work
>> on NNTP should go.

> Unfortunately there is no existing SASL scheme (that I'm aware of) that
> supports third-party authentication (i.e. where the server has access to
> neither the plaintext nor any pre-encrypted copy of the password, all it
> can do is invoke an external authentication mechanism, such as RADIUS).

How is this any different than the case where the server has the password?
The server accepts a clear-text password from the user and checks it via
some black magic, which means using the PLAIN SASL mechanism.  SASL says
thou shalt not use that mechanism unless the channel is encrypted, of
course.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Is there a hack to support paswords that contain spaces?
#55598
Author: Jeffrey M. Vinocur
Date: Mon, 10 Dec 2001 20:00
19 lines
1749 bytes
In article <1ru1uyalzl.fsf@sex.ifi.uio.no>,
Kjetil Torgrim Homme  <kjetilho@haey.ifi.uio.no> wrote:
>[Jeffrey M. Vinocur]
>
>>   I've been wrestling with how, if you get the original buffer
>>   passed in as well, you can find the beginning of everything-else
>>   without running over the string again (which is just yuck).
>
>And yet most people set up their server to let Perl run through every
>article in many passes ... :-)

Oh, not for the cost of walking the array twice, but rather for
the fact that you'd have to effectively duplicate the code for
argify all over again.

-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55599
Author: Curt Welch
Date: Mon, 10 Dec 2001 20:42
30 lines
2523 bytes
jeff@litech.org (Jeffrey M. Vinocur) wrote:
> In article <1ru1uyalzl.fsf@sex.ifi.uio.no>,
> Kjetil Torgrim Homme  <kjetilho@haey.ifi.uio.no> wrote:
> >[Jeffrey M. Vinocur]
> >
> >>   I've been wrestling with how, if you get the original buffer
> >>   passed in as well, you can find the beginning of everything-else
> >>   without running over the string again (which is just yuck).
> >
> >And yet most people set up their server to let Perl run through every
> >article in many passes ... :-)
>
> Oh, not for the cost of walking the array twice, but rather for
> the fact that you'd have to effectively duplicate the code for
> argify all over again.

Just a thought to throw out...

In addition to the argv[] data, you could make the argify routine
return a index into the command line of where each argv[] string
started.  So that way, the code that wants to see everything after
argv[0] could simply start at cmd_line[argoffset[0]+strlen(argv[0])].

That would prevent you from having to duplicate the argify routine (and
risk it not being changed in sync at some point in the future).

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Is there a hack to support paswords that contain spaces?
#55601
Author: Andrew - Supernews
Date: Mon, 10 Dec 2001 20:58
28 lines
2588 bytes
In article <ylu1uyluds.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> Andrew <andrew+nonews@supernews.com> writes:
>> Unfortunately there is no existing SASL scheme (that I'm aware of) that
>> supports third-party authentication (i.e. where the server has access to
>> neither the plaintext nor any pre-encrypted copy of the password, all it
>> can do is invoke an external authentication mechanism, such as RADIUS).
> 
> How is this any different than the case where the server has the password?
> The server accepts a clear-text password from the user and checks it via
> some black magic, which means using the PLAIN SASL mechanism.  SASL says
> thou shalt not use that mechanism unless the channel is encrypted, of
> course.

Well, that's the sticking point, isn't it. Encrypting all the connections
would mean spending mucho $$$ on more CPUs, and once you have an encrypted
channel it doesn't matter much whether you use SASL PLAIN or the existing
AUTHINFO commands.

But the one draft that I've seen so far for SASL in nntp tried to
_require_ that the server support a particular scheme (DIGEST-MD5 or
CRAM-MD5, I forget which), which is simply not an option when doing
third-party auth because the server can't reconstitute the cleartext
password.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: Is there a hack to support paswords that contain spaces?
#55604
Author: Jeffrey M. Vinocur
Date: Mon, 10 Dec 2001 22:43
27 lines
2061 bytes
In article <20011210154233.073$64@newsreader.com>,
Curt Welch <curt@kcwc.com> wrote:
>
>In addition to the argv[] data, you could make the argify routine
>return a index into the command line of where each argv[] string
>started.  So that way, the code that wants to see everything after
>argv[0] could simply start at cmd_line[argoffset[0]+strlen(argv[0])].

Yeah, I was thinking about this.  It's overkill, actually, if
we're willing to depend on the fact that the array is a mutilated
copy of the raw string; the offset for argv[i] in the raw string
is (argv[i] - argv[0] + x), where x is the amount of whitespace
discarded before the beginning of the first argument.

But I like the argify-only-the-first-n-arguments idea better.


>That would prevent you from having to duplicate the argify routine (and
>risk it not being changed in sync at some point in the future).

Yes, that would be bad.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Is there a hack to support paswords that contain spaces?
#55603
Author: Russ Allbery
Date: Mon, 10 Dec 2001 23:07
46 lines
3694 bytes
Andrew <andrew+nonews@supernews.com> writes:
> Russ Allbery wrote:

>> How is this any different than the case where the server has the
>> password?  The server accepts a clear-text password from the user and
>> checks it via some black magic, which means using the PLAIN SASL
>> mechanism.  SASL says thou shalt not use that mechanism unless the
>> channel is encrypted, of course.

> Well, that's the sticking point, isn't it. Encrypting all the
> connections would mean spending mucho $$$ on more CPUs, and once you
> have an encrypted channel it doesn't matter much whether you use SASL
> PLAIN or the existing AUTHINFO commands.

Thou shalt not use SASL PLAIN over unencrypted channels is a SHOULD.
Maybe there's reason to break it.  But this is a problem with all
protocols, not just with NNTP; there has to be *some* way of
authenticating that doesn't involve sending clear-text passwords over the
wire or the authentication mechanism just isn't usable in a lot of
situations.

> But the one draft that I've seen so far for SASL in nntp tried to
> _require_ that the server support a particular scheme (DIGEST-MD5 or
> CRAM-MD5, I forget which), which is simply not an option when doing
> third-party auth because the server can't reconstitute the cleartext
> password.

Well, bear in mind that those sorts of requirements in the standard just
mean that the server software has to be capable of it when compiled the
right way, which is pretty trivial if one uses the Cyrus SASL libraries to
implement SASL.  It doesn't mean that any *particular* server has to be
configured to support that authentication mechanism.

It's pretty much standard for choice of authentication mechanism that many
sites will have site policies restricting the available methods.  For
example, we don't allow any of the basic SASL authentication mechanisms on
our IMAP servers, only KERBEROS_V4 and soon GSSAPI, because that's the
authentication system we use site-wide and there's no way to use CRAM-MD5
or any other digest authentication system in our security environment.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Page 1 of 2 • 55 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads