Ask a Question related to PERL Miscellaneous, Design and Development.
-
Ken A #1
split() matching regular expression question - openwebmail bug...
Openwebmail seems to have a bug in the way it stores and retrieves data,
especially passwords from a file called .pop3book.
In .pop3book there are stored entries for host,port,user,pass,etc.. They
are delimited by @@@.
Here's the line with the problem in openwebmail-main.pl:
my ($pop3host,$pop3port, $pop3user,$pop3passwd, $pop3del,
$enable)=split(/\@\@\@/,$_);
If the user's password ends in a '@' character, the split() causes the @
to be cut off the $pop3passwd and added to the $pop3del variable.
Any way to fix this with a better matching regular expression in the
call to split ?
Otherwise, it seems I have to rewrite every part of openwebmail that
uses the @@@ delimiter and change it to some more sensible (less likely
to conflict with passwords) delimiter. That also would mean changing all
..pop3book files on the server, which isn't a good thing either..
Thanks for any ideas,
Ken A.
Ken A Guest
-
Regular Expression Question
Hello, is it possible to make a regular expression match for the following situation: I have a string, looking like 'foobarbarbar'. I don't... -
Regular expression newbie question
How do I write "not" in regular expression? I am new to reg exp. I want to check the string which does not contain "http://" I wrote ... -
backtracking in regular expression matching
Hi, For the pattern "(((.*)cd)*)*cdcd" and string "ababcdcdcdef", can anyone tell me the detail meachanism of backtracking? This regular... -
Regular Expression Matching
Hello, I am trying to figure out how to match a an email w/in a delimited line. ie: 1, 'John', 'Doe', 'I', 'john.doe@domain.ext' the list... -
[PHP] Regular expression question
well, first off '>' should not be allowed as a value of an attr="" pair anyways. You should convert it to > or < this will solve that problem.... -
Matija Papec #2
Re: split() matching regular expression question - openwebmail bug...
X-Ftn-To: Ken A
Ken A <ken@pacific.net> wrote:You could reverse $_ but then you're vulnerable if some field begins with>my ($pop3host,$pop3port, $pop3user,$pop3passwd, $pop3del,
>$enable)=split(/\@\@\@/,$_);
>
>If the user's password ends in a '@' character, the split() causes the @
>to be cut off the $pop3passwd and added to the $pop3del variable.
>
>Any way to fix this with a better matching regular expression in the
>call to split ?
>
>Otherwise, it seems I have to rewrite every part of openwebmail that
>uses the @@@ delimiter and change it to some more sensible (less likely
>to conflict with passwords) delimiter. That also would mean changing all
>.pop3book files on the server, which isn't a good thing either..
>
>Thanks for any ideas,
'@' :)
--
Matija
Matija Papec Guest
-
Glenn Jackman #3
Re: split() matching regular expression question - openwebmail bug...
Ken A <ken@pacific.net> wrote:
[...]Change the RE to check that the character after the third @ is not an @:> Here's the line with the problem in openwebmail-main.pl:
>
> my ($pop3host,$pop3port, $pop3user,$pop3passwd, $pop3del,
> $enable)=split(/\@\@\@/,$_);
>
> If the user's password ends in a '@' character, the split() causes the @
> to be cut off the $pop3passwd and added to the $pop3del variable.
$str = 'f1@@@f2@@@pass@@@@f4';
@fields = split/\@{3}(?=[^@]|$)/, $str;
--
Glenn Jackman
NCF Sysadmin
[email]glennj@ncf.ca[/email]
Glenn Jackman Guest
-
Glenn Jackman #4
Re: split() matching regular expression question - openwebmail bug...
Ken A <ken@pacific.net> wrote:
[...]Change the RE to check that the character after the third @ is not an @:> Here's the line with the problem in openwebmail-main.pl:
>
> my ($pop3host,$pop3port, $pop3user,$pop3passwd, $pop3del,
> $enable)=split(/\@\@\@/,$_);
>
> If the user's password ends in a '@' character, the split() causes the @
> to be cut off the $pop3passwd and added to the $pop3del variable.
$str = 'f1@@@f2@@@pass@@@@f4';
@fields = split /\@{3}(?!@)/, $str;
--
Glenn Jackman
NCF Sysadmin
[email]glennj@ncf.ca[/email]
Glenn Jackman Guest
-
Andreas Kahari #5
Re: split() matching regular expression question - openwebmail bug...
In article <vm1iqi4pcfed5a@corp.supernews.com>, Ken A wrote:
[cut]> Openwebmail seems to have a bug in the way it stores and retrieves data,
> especially passwords from a file called .pop3book.
>
> In .pop3book there are stored entries for host,port,user,pass,etc.. They
> are delimited by @@@.
>
> Here's the line with the problem in openwebmail-main.pl:
>
> my ($pop3host,$pop3port, $pop3user,$pop3passwd, $pop3del,
> $enable)=split(/\@\@\@/,$_);
>
> If the user's password ends in a '@' character, the split() causes the @
> to be cut off the $pop3passwd and added to the $pop3del variable.
IMHO, the best way to fix this is to store the passwords
encrypted, just like the passwords in /etc/passwd on a Unix
system. Use a cipher that does not generate '@' characters.
If that's too involved, store them as strings consisting of the
3-digit ASCII codes, or something.
If that's too involved, change the regex to /@@@(?=[^@])/, but
this assumes that $pop3del won't ever start with '@'. Look for
"zero-width positive look-ahead assertion" in the perlre manual.
Cheers,
Andreas
--
Andreas Kähäri
Andreas Kahari Guest
-
Bart van den Burg #6
Re: split() matching regular expression question - openwebmail bug...
"Ken A" <ken@pacific.net> wrote in message
news:vm1iqi4pcfed5a@corp.supernews.com...You could also use \t (tab) as a delimiter. I use it myself often, without> Openwebmail seems to have a bug in the way it stores and retrieves data,
> especially passwords from a file called .pop3book.
>
> In .pop3book there are stored entries for host,port,user,pass,etc.. They
> are delimited by @@@.
>
> Here's the line with the problem in openwebmail-main.pl:
>
> my ($pop3host,$pop3port, $pop3user,$pop3passwd, $pop3del,
> $enable)=split(/\@\@\@/,$_);
>
> If the user's password ends in a '@' character, the split() causes the @
> to be cut off the $pop3passwd and added to the $pop3del variable.
>
> Any way to fix this with a better matching regular expression in the
> call to split ?
>
> Otherwise, it seems I have to rewrite every part of openwebmail that
> uses the @@@ delimiter and change it to some more sensible (less likely
> to conflict with passwords) delimiter. That also would mean changing all
> .pop3book files on the server, which isn't a good thing either..
>
> Thanks for any ideas,
> Ken A.
>
>
>
any problems.
Bart
Bart van den Burg Guest
-
Andreas Kahari #7
Re: split() matching regular expression question - openwebmail bug...
In article <bjqm07$5ic$1@reader11.wxs.nl>, Bart van den Burg wrote:
[cut]>
> "Ken A" <ken@pacific.net> wrote in message
> news:vm1iqi4pcfed5a@corp.supernews.com...[cut]>> If the user's password ends in a '@' character, the split() causes the @
>> to be cut off the $pop3passwd and added to the $pop3del variable.
>>
>> Any way to fix this with a better matching regular expression in the
>> call to split ?What if I decide to use a tab at the end of my password?>
> You could also use \t (tab) as a delimiter. I use it myself often, without
> any problems.
(assuming it still makes a valid password) You've just replaced
the trouble character with another trouble character.
--
Andreas Kähäri
Andreas Kahari Guest
-
Bart van den Burg #8
Re: split() matching regular expression question - openwebmail bug...
"Andreas Kahari" <ak+usenet@freeshell.org> wrote in message
news:slrnbm1n7j.ncd.ak+usenet@vinland.freeshell.or g...@> In article <bjqm07$5ic$1@reader11.wxs.nl>, Bart van den Burg wrote:> [cut]> >
> > "Ken A" <ken@pacific.net> wrote in message
> > news:vm1iqi4pcfed5a@corp.supernews.com...> >> If the user's password ends in a '@' character, the split() causes thewithout> [cut]> >> to be cut off the $pop3passwd and added to the $pop3del variable.
> >>
> >> Any way to fix this with a better matching regular expression in the
> >> call to split ?> >
> > You could also use \t (tab) as a delimiter. I use it myself often,Because that's hard to do if it's in a web environment, cause if you press>> > any problems.
> What if I decide to use a tab at the end of my password?
> (assuming it still makes a valid password) You've just replaced
> the trouble character with another trouble character.
[tab], you'll go to the next input box. Ok, you could go and copy/paste one,
but would you really wanna do that everytime you wanna login there?
Bart
Bart van den Burg Guest
-
Andreas Kahari #9
Re: split() matching regular expression question - openwebmail bug...
In article <bjqmsu$6nd$1@reader11.wxs.nl>, Bart van den Burg wrote:
[cut]>
> "Andreas Kahari" <ak+usenet@freeshell.org> wrote in message
> news:slrnbm1n7j.ncd.ak+usenet@vinland.freeshell.or g...>> In article <bjqm07$5ic$1@reader11.wxs.nl>, Bart van den Burg wrote:>> [cut]>> >
>> > "Ken A" <ken@pacific.net> wrote in message
>> > news:vm1iqi4pcfed5a@corp.supernews.com...>> >> If the user's password ends in a '@' character, the split() causes the[cut]>> >> Any way to fix this with a better matching regular expression in the
>> >> call to split ?Point taken, kinda'. Are you sure it's not as simple as typing> without>> > You could also use \t (tab) as a delimiter. I use it myself often,>>>>> > any problems.
>> What if I decide to use a tab at the end of my password?
>> (assuming it still makes a valid password) You've just replaced
>> the trouble character with another trouble character.
> Because that's hard to do if it's in a web environment, cause if you press
> [tab], you'll go to the next input box. Ok, you could go and copy/paste one,
> but would you really wanna do that everytime you wanna login there?
<shift><tab> or something similar in one browser or another?
My point is that you should try to come up with a solid solution
to the problem, not a quick workaround that might prove to be
just as faulty as the original solution. Especially since this
involves passwords giving access to personal information.
In this particular case, I would opt for an encoding of the
passwords that ensures that no character or substring in the
encoded password collides with a record separator. Encryption
would be even better.
--
Andreas Kähäri
Andreas Kahari Guest
-
Abigail #10
Re: split() matching regular expression question - openwebmail bug...
Bart van den Burg (bart-news@NOSPAMtvreclames.nl) wrote on MMMDCLXIII
September MCMXCIII in <URL:news:bjqmsu$6nd$1@reader11.wxs.nl>:
&&
&& Because that's hard to do if it's in a web environment, cause if you press
&& [tab], you'll go to the next input box. Ok, you could go and copy/paste one,
&& but would you really wanna do that everytime you wanna login there?
Don't make the newbie mistake of "if it works on my browser, it will
work anywhere". While tabs might go to the next field in some browsers,
it won't in others. And yet another set of browsers allow tabs to be
escaped.
Not that this has anything to do at all with Perl.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
Abigail Guest



Reply With Quote

