[19144] in Perl-Users-Digest
Perl-Users Digest, Issue: 1339 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 19 21:10:33 2001
Date: Thu, 19 Jul 2001 18:10:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <995591411-v10-i1339@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 19 Jul 2001 Volume: 10 Number: 1339
Today's topics:
Re: Including flock in code while developing in Windows <bart.lateur@skynet.be>
Insecure dependency in require error? <shah@typhoon.xnet.com>
Re: Insecure dependency in require error? <ilya1@byx.ru>
My actual problem ( was: Re: Printing results of a subr <racso83@bellatlantic.net>
Re: OT: Geek Nostalgia (Tim Hammerquist)
Re: Request for Comments ... ConvertColorspace.pm <mniles@itm.com>
Re: tab sperated line to named hash? <bart.lateur@skynet.be>
Re: Timingout a socket <goldbb2@earthlink.net>
Re: Trouble extracting strings - help needed <cmicallef@playground.net>
Re: Using a Perl module outside from Perl-dir? <iltzu@sci.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Jul 2001 22:09:45 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Including flock in code while developing in Windows for Unix??
Message-Id: <lbmelt4uee3favk681ib3m2hg2s4orrt3e@4ax.com>
Mark Grimshaw wrote:
>
>
>Bart Lateur wrote:
>>
>> Mark Grimshaw wrote:
>>
>> > if(eval "use Fcntl qw(:flock)") # has flock()
>> ...
>> ><snip>
>> >
>> >on WinNT ActiveState, this prints:
>> >no flock:
>> >
>> >with nothing in $@ yet I can lock a filehandle with LOCK_EX... Any idea
>> >what I'm doing wrong?
>>
>> The code you eval doesn't fail, yet it doesn't return a value. Two
>> solutions:
>>
>> - use $@ as the definitive test.
>>
>> eval "use Fcntl qw(:flock)";
>> unless($@) # has flock()
>>
>
>I'm not sure I understand that. I thought $@ would contain something if
>the eval failed in which case, it does NOT have flock() (if I understand
>eval correctly).
That's why I use "unless", which is the inverse of "if". So if the eval
succeeds, "unless($@) { ... }" will execute the block.
However, your test is no good. "use Fcntl ':flock'" only imports the
constatnts, it does NOT barf if flock isn't supported. For that, you
need to try and execute a flock(), which will give a fatal error if
flock() is not supported. Jeff Zucker's attempt to "flock" STDOUT is
such a test.
>> - add a true statement to your eval:
>>
>> if(eval "use Fcntl qw(:flock); 1") # has flock()
>>
>
>Is this simply to force the issue?
Look, if eval() fails, it will return undef. However, it can succeed and
still return undef:
eval "undef"
So a test if eval returns undef, or false, is not good enough.
A "use" statement is such a statement, that in itself doesn't return
anything. So you need an extra statement that returns true. "1" will do.
eval "undef; 1"
will return 1 (and $@ will be empty).
--
Bart.
------------------------------
Date: Thu, 19 Jul 2001 22:34:25 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Insecure dependency in require error?
Message-Id: <9j7n9h$kjr$1@flood.xnet.com>
Folks,
I am writing few perl scripts that update the Db2 database. I am using
DBD/DBI to write the scripts. all the scripts share common set of functions
so I wrote a perl module with DBI calls in it. Everything was working
fine until I started calling the scripts from a SUID C program. I am
getting following error while running the script:
Insecure dependency in require while running setuid at
/s3/gblcode/cob/sec/codedb/CodeDB_COBOL line 19.
Here are few lines of code from the script and module:
---------cut--------Start CodeDB_COBOL script------------cut----
#!/usr/local/bin/perl -w
# Bunch of comments
.
.
.
.
use lib "$ENV{FCICSGBLCODE}/cob/sec/dynlib";
require "codedb_lib.pm"; # This is line 19.
.
.
.
.
.
.
.
---------cut--------End CodeDB_COBOL script------------cut----
---------cut--------Start codedb_lib.pm script------------cut----
# Bunch of comments
.
.
.
.
use DBI;
use DBD::DB2::Constants;
use DBD::DB2;
use Getopt::Std;
#use Data::Dumper;
($ExeName = $0) =~ s:.*/::;
$HostName = `uname -n`;
chomp $HostName;
.
.
.
.
.
.
.
---------cut--------End codedb_lib.pm script------------cut----
I looked at perlsec man page, but was not able to find out how to fix the
problem. How can I find out waht is tainted so I can fix the code. Is there
other documentation about writing secure code/modules.
Thanks.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: 20 Jul 2001 02:47:00 +0400
From: Ilya Martynov <ilya1@byx.ru>
Subject: Re: Insecure dependency in require error?
Message-Id: <87vgkoleor.fsf@abra.ru>
HS> Folks,
HS> I am writing few perl scripts that update the Db2 database. I am using
HS> DBD/DBI to write the scripts. all the scripts share common set of functions
HS> so I wrote a perl module with DBI calls in it. Everything was working
HS> fine until I started calling the scripts from a SUID C program. I am
HS> getting following error while running the script:
HS> Insecure dependency in require while running setuid at
HS> /s3/gblcode/cob/sec/codedb/CodeDB_COBOL line 19.
HS> Here are few lines of code from the script and module:
HS> ---------cut--------Start CodeDB_COBOL script------------cut----
HS> #!/usr/local/bin/perl -w
HS> # Bunch of comments
HS> .
HS> .
HS> .
HS> .
HS> use lib "$ENV{FCICSGBLCODE}/cob/sec/dynlib";
HS> require "codedb_lib.pm"; # This is line 19.
HS> .
HS> .
HS> .
HS> .
HS> .
HS> .
HS> .
HS> ---------cut--------End CodeDB_COBOL script------------cut----
HS> I looked at perlsec man page, but was not able to find out how to fix the
HS> problem. How can I find out waht is tainted so I can fix the code. Is there
HS> other documentation about writing secure code/modules.
Ok - I'm not sure by I suppose that:
$ENV{FCICSGBLCODE} is tainted initially. So line 'use lib
"$ENV{FCICSGBLCODE}/cob/sec/dynlib"' which actually just sets @INC
makes @INC tainted also because it used tained $ENV{FCICSGBLCODE}. So
Perl complains because 'require' uses tainted @INC to find modules.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Thu, 19 Jul 2001 22:31:49 GMT
From: "Racso" <racso83@bellatlantic.net>
Subject: My actual problem ( was: Re: Printing results of a subroutine to a file
Message-Id: <pdJ57.19542$l%.6846831@typhoon2.gnilink.net>
Hello all,
A few days ago, as a last resort, I made a post here for a little help.
I thought I'd water the problem down to keep the post as small as possible,
however, this turned out to be a bad thing. The feedback which I recieved
(and appreciated) was only good for my simple example, and not for my
actual problem. So, if you don't mind, I'll try again, but with the
actual problem this time. I'm *really* sorry for the length of this
post, that is why I watered down my original post in the first place.
Note that some of the advice I recieve is in use now, but weren't
enough to fix whatever is wrong.
~ RaxHTML Subroutine Library / raxhtml.pl ~
I am a small time web developer who has been teaching himself perl for a
while, learning things as I need to.
Since I use a number of perl scripts that generate html, I decided to make
a little library file that contains a series of subroutines for the various
elements of my html design, and it works very well.
~ Page Template Builder / pbt.cgi ~
One day for kicks I made a script that makes use of that library file to
allow me to generate html templates easily for my none dynamic pages.
Essentially it is like a cgi based html editer, though much of the "code" that
I write in the form are subroutine calls instead of actual html. The work gets
written to an executable *.cgi file where I can at an instant view my work, then
go back and make changes if need be. When it is where I want it, I just hit
View --> Source in my browser to get the HTML that the script generates. From
there it is just a matter of pasting it into my favorite html editor and fill
in the finer details by hand.
~ Export to File ~
Though I don't need it, I thought it would be interesting to include an
"export" function to this script, something that can read the generated *.cgi
file, discard the uneeded lines, and then print to a file the actual HTML and
text that the subroutines produce. I thought this would be easy, but it hasn't
been. I've been searching everywhere, and reading this and that, trying to find
something that could at least tell me whether or not this is even possible, let
alone how to do it. I thought searching Deja would turn up posts of similar
problems, though nothing close enough to help has appeared. Just little, barely
relevant odds and ends which I _did_ find uses for in this subroutine.
~ The actual problem ~
The exporting part of this script will write to the desired file the html and
text that was written useing the print function, however, when it comes
to writing to the file what the subroutines produce, it simply won't. I've
tried MANY ways of doing this, the scenario below is the most extreme. Most
of what I have tried, including the solution below DO work when the subroutine
is declared on the actual script, but not when it is imported from a library
file via requre();, in that case, I only end up with errors that the
subroutine being called is undefined (yet the main script that the subroutine
below is from, USES these routines, so I know they are defined, and availble).
~ my plea for help ~
Oh great perl masters, do you know why this is saying my subroutines are
undefined, or perhaps how to keep them defined, or SOMETHING that might
make this work, if it is possible at all?
~ perl makes easy things easy and hard things possible ~
I thought this would make for a nice excersize in problem solving, and
general perl practice as I'm still learning. Most would just give up on it
by now, but I know perl can do this, it has to be able to, and at this point
I'm determined to find out how. After trying all I could think of, and
searching through various perl resources, including the perl docs and Deja,
I've come here as a last resort. By now I'm starting to wonder IF it is
possible to do this, let alone how.
If you made it through this far, I really appreciate it. Below are
relevent excerts of the scripts in question.
=====================================================================
raxhtml.pl
=====================================================================
## This is a tiny example of the subroutines that are in this library
## file. I snipped the longer strings to keep them from wrapping
## wrapping themselves silly.
# 02. Title/Date
sub HTML_title {
print "<table border=\"0\" width=\"100\%\" cellspacing=[snipped..
print "<table border=\"0\" width=\"100\%\" cellpadding=[snipped..
print " <tr>\n";
print " <td>\n";
print " <font class=\"title\">$_[0]</font>\n";
print " </td>\n";
print " <td align=\"right\">\n";
print " <font class=\"bdate\">$_[1]</font>\n";
print " </td>\n";
print " </tr>\n";
print "</table>\n";
print "<table border=\"0\" width=\"100\%\" cellspacing=[snipped..
}
=====================================================================
saved *.cgi file
=====================================================================
## Here are the first few lines of an example of what the the
## Page Template Builder script I mentioned earlier writes. It is from
## such a file as this that I want my export subroutine to work with.
#!/usr/bin/perl
require('/usr/home/hda1/racso.net/cgi-bin/libraries/raxhtml.pl');
&HTML_header;
&HTML_top("Front Page - Racso's Place","Racso's Place","","racso");
&HTML_mtbl;
&HTML_body_1_3;
&HTML_lctable;
&HTML_lcld;
&HTML_lct("Site Areas");
&HTML_lcld;
=====================================================================
The Export Subroutine
=====================================================================
## This is the entire export subroutine in it's current form. It all
## works as I want it to except for the part that is to write what
## the given subroutine call (such as those above) would generate.
##
## Bare in mind that THIS script also imports the library file that
## defines the above sub calls, as it actually uses them in other
## routines.
sub export_file {
#open source file
open(FILE, "$ptb_sys/$xfile") || &ptb_error("Could not open source file for export: $xfile<br>");
@lines = <FILE>; chomp(@lines);
close(FILE);
#discard uneeded lines
@lines = @lines[4..$#lines];
#write file
open(HTML, ">$export_sys/$xhtml") || &ptb_error("Could not export to html: $xhtml<br>");
#change FH
$fh_stdout = select(HTML);
#write lines
foreach $line (@lines) {
## This part works just fine, as well as the stuff above.
if ($line =~ /^print "/) {
$line =~ s/^print "(.*)\\n";/$1/ig;
$line =~ s/\\"/"/ig;
$line =~ s/\\#/\#/ig;
$line =~ s/\\@/\@/ig;
print "$line\n";
## The block below is my problem area, and of coarse the point
## to this routine, to be able to write to a file what a given
## subroutine would generate.
##
## As I said above, this version is the most extreme thing I've
## done yet to get it to execute the named subroutine. Yet still
## it tells me that the subs are undefined. Yet, if I put those
## actual subroutines on this script, rather than importing them,
## the block below will work. However, for practical and common
## sense reasons, that isn't an option.
} elsif ($line =~ /^&.*;/) {
$line =~ s/^&(.*);/$1/ig;
&get_sub_output("$line"); ## this subroutine is shown below
} else {
#if line does not match either of the above, print as is
print "$line\n";
}
}
close(HTML);
#return to defualt FH
select($fh_stdout);
#goto page if successful
print "Location: $export_www/$xhtml\n";
print "Content-type: text/html\n\n";
print "<a href=\" $export_www/$xhtml\">View Exported File</a>\n";
exit;
}
## This is the little subroutine that is called to from the problem
## block above.
sub get_sub_output {
$eval = $_[0];
$output = eval { &$eval; };
$output =~ s/(.*)1$/$1/ig; ## this just gets rid of that pesky "1"
return($output);
}
=====================================================================
Well there you have it, my problem in full. The answer is likey
something braindead stupid, but I've looked, and couldn't find it.
I greatly appreciate your time in reading this oversized post. Any
feed back you can think of, I will be greatful for.
Thanks,
--Racso
Henry D. Archut
------------------------------
Date: Thu, 19 Jul 2001 23:37:20 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: OT: Geek Nostalgia
Message-Id: <slrn9lesf3.o58.tim@vegeta.ath.cx>
Me parece que Mr. Sunray <djberge@uswest.com> dijo:
> Tim Hammerquist wrote:
> > First box:
> > TRS-80 Color Computer w/ ~32K RAM
> > 5 1/4 floppy on an expansion card (God, I felt cool then!)
> > RF signal video output to 12" black and white TV
> > BASIC built-in
>
> Hah! I had a TRS-80 model I with 4K RAM
> with only 3.96 actually available (my dad and I found that out
> the hard way)
> --"Ok, let's shorten that variable name 1 character". ;)
Heh. Ah yes. The memories float my way. =)
Remember having to load applications off an audio cassette?
> > Current PC:
> > Gateway Pentium III 450Mhz
> > 20GB HD with Win98SE (hasn't crashed in the last 6 months)
>
> You clearly don't play enough computer games.
That's why it hasn't crashed. If I never have to use Windows, I never
get tempted to play my games, and the box doesn't crash. =)
> > Oh yeah, and I'm 23. All I can say is, I'm grateful. We've all come a
> > long way. =) Many of us had a lot of fun playing Pong, but I'm grateful
> > I can play Final Fantasy VII now!
>
> The newest games with their 3d rendering are resource PIGS! Try
> playing WWII Online someday. I have a dual p2 400 with 384 mb of
> RAM (win2k pro) and a 16 mb video card that can be brought
> to its knees if too many people are in my virtual area!
Yeah. Voodoo 3 3000 AGP card (16MB as well) is abused by Tomb Raider 4.
I try not to play online games; not because they're "stupid" or
anything, but because they're so G**D*MN addictive. ;)
--
The iMac comes in five colors. Who cares from a technical
standpoint? But they're obviously selling like crazy...
-- Linus Torvalds
------------------------------
Date: Thu, 19 Jul 2001 15:26:24 -0700
From: Melissa Niles <mniles@itm.com>
Subject: Re: Request for Comments ... ConvertColorspace.pm
Message-Id: <3B575E90.CB03643C@itm.com>
> >> The case $K == 1 needs special treatment.
>
> You're right -- it forms a division by zero, otherwise. Since $K == 1
> happens when $R == $G == $B == 0, I believe this is the right solution:
>
> my ($C, $M, $Y) = ($K == 1)
> ? (1, 1, 1)
> : map {(1 - $_ - $K)/(1 - $K)} ($R, $G, $B);
>
> But I don't know the algorithm so you should double-check that, Melissa.
Yes, that's right, if RGB = 0,0,0 then you get a illegal division by
zero
... here's what I'm going by:
RGB -> CMYK
Black=minimum(1-Red,1-Green,1-Blue)
Cyan=(1-Red-Black)/(1-Black)
Magenta=(1-Green-Black)/(1-Black)
Yellow=(1-Blue-Black)/(1-Black)
Of course there's no check here if BLACK ever equals 1.
> > > Out of curiosity, is 254 really the correct denominator
> > > here? Negative $K, and all?
> >
> > there are 255 values for each RGB color, which is 0-254.
>
> Hrm. Now that I actually bother to think about it, I'm with Anno. 24 bit
> color has 8 bits per color channel per pixel. 2**8 = 256, so you should
> have 256 color values from 0..255. You've got an off by one error. :)
OK, this was my 'Duh!' moment. Yes, 256 is correct. Thanks to you both
for seeing
this.
------------------------------
Date: Thu, 19 Jul 2001 22:32:37 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: tab sperated line to named hash?
Message-Id: <aunelt0abt8qa82e42d0mlhd47jdon663a@4ax.com>
Twan Kogels wrote:
>chomp($dataline);
>my @data=split("\t", $dataline);
>
>%forumprop=();
>$forumprop{'forum_title'}=$data[0];
>$forumprop{'bg_header'}=$data[1];
>$forumprop{'tb_normal_tags'}=$data[2];
>$forumprop{'fg_header'}=$data[3];
>$forumprop{'font_name'}=$data[4];
>$forumprop{'font_color'}=$data[5];
>$forumprop{'bg_page'}=$data[6];
>$forumprop{'smiley_extra'}=$data[9];
>...
>$forumprop{'new_only_admin'}=$data[182];
>$forumprop{'flood'}=$data[183];
>$forumprop{'keur'}=$data[184];
Boy that is a long line. Anyway:
@forumprop{qw/forum_title bg_header tb_normal_tags
fg_header font_name
...
new_only_admin flood keur/} = @data;
Note that every field must be a "word", and no holes in the list
allowed.
--
Bart.
------------------------------
Date: Thu, 19 Jul 2001 18:23:56 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Timingout a socket
Message-Id: <3B575DFC.1E85844A@earthlink.net>
Haim Lichaa wrote:
>
> I'm using this perl snipit on a Solaris box running Perl 5.00403
>
> my($s)=IO::Socket::INET->new(
> PeerAddr => $host,
> PeerPort => $port,
> Proto =>'tcp',
> Type => SOCK_STREAM,
> Timeout => $to);
>
> and any $to value has no affect on the Timeout. It remains constat @ ~4mins.
> Any body know why and how I can fix it?
Try upgrading Socket and IO::Socket to the newest versions.
--
The longer a man is wrong, the surer he is that he's right.
------------------------------
Date: Thu, 19 Jul 2001 20:46:43 -0400
From: Chris Micallef <cmicallef@playground.net>
Subject: Re: Trouble extracting strings - help needed
Message-Id: <3B577F73.550CC8F8@playground.net>
Assuming only filenames are double quoted you could create an array using
@SomeArray = split(/"/,$VarForFileContents), then all the odd elements of
the array would be file names. This only works if double quotes are used
exclusively around the file names.
Mark Smith wrote:
> I have a perl script that reads in a file. The contents of this file
> may vary but at several points it contains a filename between double
> quotes. I need to extract every instance of the filename in quotes as
> I need to then process each of these files.
>
> The file would roughly be in this kind of format.
>
> files {
> "somefile.mst",
> "Anotherfile.mst",
> "further-file.mst"
> }
> config {
>
> }
>
> Can anyone help as I can't seem to devise a working method to get just
> the filenames? Also if possible could you mail me directly and
> explain what your method is doing so I will have an understanding.
>
> Once again this file could contains lots of information and I don't
> know the filenames in advance so I need something that will not just
> work with the above but would extract whatever lies between the two
> quotes.
>
> Thanks in advance.
>
> Mark.
------------------------------
Date: 19 Jul 2001 22:11:24 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Using a Perl module outside from Perl-dir?
Message-Id: <995578975.20073@itz.pp.sci.fi>
In article <slrn9lbbg8.df0.tadmc@tadmc26.august.net>, Tad McClellan wrote:
>
>To me "install" means the Usual Four Commands, and I have no
Unfortunately, this particular narrow definition of "install" is very
much jargon, and we can't expect newbies to know or use it.
In any case, said commands are not the only way to install a Perl
module. One might do the necessary steps manually, or, at the other end
of the spectrum, one might use a package manager such as PPM.
These days, I doubt most Perl users have ever typed "make install".
>idea what "having" might mean.
Now you're being deliberately obtuse. Insisting that people use correct
Perl jargon when discussing Perl is one thing, at least when said people
can be expected to know the jargon. But pretending not to understand a
simple English word that has no specific jargon meaning is just silly.
"I _have_ CGI.pm in /usr/lib/perl5/. I did not _install_ it there --
my sysadmin _installed_ it as part of the operating system."
"I also _have_ Diff.pm in ~/Algorithm-Diff-1.10/. I didn't _install_
that either. I just extracted the tarball into my home directory. I
can use it like that, but I really should _install_ it properly."
Did that help, or do I have to start quoting a dictionary? :-)
Incidentally, I do believe Mark interpreted the OP's vague usage of
"install" correctly, and provided the appropriate answer. Trying to
argue that he was confusing the OP is IMO therefore inappropriate. As
for the fact that he was answering a FAQ, that is a completely different
issue that should not be confused with the correctness of the answer
itself.
(The reason *that* is relevant is that you're arguing past each other,
as often happens in these threads. Mark is asking why you think his
answer was misleading, while you've now switched to arguing that the
question should not have been answered at all.)
Could this thread be considered closed, please?
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1339
***************************************