[Pw_forum] kubuntu+gfortran+configure+make all=no executables

Paul M. Grant w2agz at pacbell.net
Thu Oct 25 03:20:56 CEST 2007


Axel, thanks for the dialog.  Naively I thought dot-slash first replied only
to executing bash scripts, not executables.  Between this note and the last,
I sent an "mea culpa" to all...you'll find it amusing I hope!

Paul M. Grant, PhD
Principal, W2AGZ Technologies
Visiting Scholar, Applied Physics, Stanford University
EPRI Science Fellow (Retired)
IBM Research Staff Member Emeritus
w2agz at pacbell.net
http://www.w2agz.com
 
 


-----Original Message-----
From: pw_forum-bounces at pwscf.org [mailto:pw_forum-bounces at pwscf.org] On
Behalf Of Axel Kohlmeyer
Sent: Wednesday, October 24, 2007 12:44 PM
To: PWSCF Forum
Subject: Re: [Pw_forum] kubuntu+gfortran+configure+make all=no executables

On Wed, 24 Oct 2007, Paul M. Grant wrote:

PG> Axel, just before opening your note, I was able to run example01!  
PG> This shows you how little I understand bash and pathing (that's 
PG> what's it called in DOS...and OS/2 Warp) in Linux.  I then went to 
PG> my /home and typed in the full path to pw.x and it ran...well, sort
of...no input, of course.

a-ha. you are just another 'victim' of the 'dot-first' strategy in dos (and
related OS'es). if you do not use an absolute path, the current working
directory is search for a matching executable first. on unix/linux machines,
this is considered a security risk.
say, some bad co-user of your machine finds a way to have you cd into one of
his directories and that directory contains an executable called 'ls'. now
you are likely to type ls to see what is in this directory, but with the
'dot-first' strategy, you would execute the local ls and not the one in the
system path. and that local 'ls' can be modified to installa trojan and/or
keylogger into your account and then all your passwords can be looked up.
this is all the more dangerous when it happens to a root user. now if you do
not have the current working directory (or '.') in your path, you are
safe(r) from that problem, but you have to type './pw.x'
instead of 'pw.x'. you can emulate  the DOS-like behavior by changing your
path, e.g. with export PATH=.:${PATH}, but that can be very confusing. an
acceptable compromise would be to set 'export PATH=${PATH}:.' in which local
directories are examined _after_ the system directories.

PG> 
PG> Thanks, and I'll now read the rest of your note!

don't know whether there is much else to learn. i think with your comment,
you have found an explanation (and also demonstrated to me that graphical
file managers are inferior to the command line in 99% of the cases. ;-) ).

cheers,
   axel.

PG> 
PG> Paul M. Grant, PhD
PG> Principal, W2AGZ Technologies
PG> Visiting Scholar, Applied Physics, Stanford University EPRI Science 
PG> Fellow (Retired) IBM Research Staff Member Emeritus 
PG> w2agz at pacbell.net http://www.w2agz.com
PG>  
PG>  
PG> 
PG> -----Original Message-----
PG> From: pw_forum-bounces at pwscf.org [mailto:pw_forum-bounces at pwscf.org] On
PG> Behalf Of Axel Kohlmeyer
PG> Sent: Wednesday, October 24, 2007 11:57 AM
PG> To: Paul M. Grant
PG> Cc: pw_forum at pwscf.org
PG> Subject: Re: [Pw_forum] kubuntu+gfortran+configure+make all=no
executables
PG> 
PG> On Wed, 24 Oct 2007, Paul M. Grant wrote:
PG> 
PG> hi paul,
PG> 
PG> PG> First of all, thanks to Baris, Joerg and Paolo for getting back so
PG> fast.you
PG> PG> guys are great.  
PG> 
PG> yep. they are. it is nice to see a forum, where there are
PG> many people answering questions and not just one or two. ;-)
PG> 
PG> [...]
PG> 
PG> PG> I'm in a directory ~/espresso-3.2.3/bin console window, and when I
type
PG> "ls
PG> PG> -lsh pw.x" I get
PG> PG> 
PG> PG>  
PG> PG> 
PG> PG> 0 lrwxrwxrwx 1 pmpgrant pmpgrant 10 2007-10-23 23:09 pw.x ->
../PW/pw.x
PG> PG> 
PG> 
PG> ok. this is the way QE works. you have a collection of so-called
PG> symbolic links in the bin directory pointing to the corresponding 
PG> executables. compared to windows a symbolic link is like those
PG> .lnk files, i.e. an entry in a directory the redirects elsewhere.
PG> only that in the linux/unix case it is most transparent.
PG> 
PG> PG> Now there is no pw.x in PW (only holds .o and .f90 files) and I
think
PG> what
PG> PG> this is saying that Linux thinks the pw.x in ~/bin is a "0-byte
link" to
PG> an
PG> PG> executable "somewhere."
PG> 
PG> are you sure of that? 
PG> 
PG> PG> Yet when I open ~/bin in Dolphin (the new KDE file manager), the
Details
PG> PG> view shows that the file pw.x is 2.7 MB in size!  At the bottom of
the
PG> 
PG> that means, that the symbolic link is actually pointing somewhere.
PG> you can verify this very easily by doing: file bin/pw.x
PG> this will tell you whether the link works or is 'broken'.
PG> 
PG> PG> window, Dophin reports (I wish screenshots could be sent to the
forum)
PG> "pw.x
PG> PG> -> ../PW/pw.x Executable File (Link)"  It's as if the Linux "Link
Editor
PG> PG> (that's old IBM jargon.what's it called here? make.x?)" got confused
and
PG> PG> assigned a link attribute to what is really an executable binary
file.
PG> The
PG> PG> same pattern holds true for all the QE .x files to be found in
~/bin.
PG> I'll
PG> PG> bet if the "l" attribute can be removed, I'll have an executable
(how
PG> can I
PG> PG> do this.chmod?).
PG> 
PG> nope this attribute cannot be removed and it is not an artefact of the 
PG> linker (its name is ld, btw). a symbolic link, like a directory, a fifo,
PG> a socket or a device node is a special filesystem entry with special
PG> semantics and those cannot be changed with chmod. if the linker fails
PG> it usually deletes the resulting partial object, or (and this is what
PG> might have happened) it will leave a file without executable 
PG> permissions. 
PG> 
PG> PG> 
PG> PG> Thanks again, and I will get back with details on the problems
PG> installing
PG> PG> Intel compiler is having with Ubuntu 7.10 which I think is a bug in
the
PG> PG> former.
PG> 
PG> it is actually about as likely, that ubuntu 7.10 is using a very new
PG> glibc that introduces yet another quirkiness which results in 
PG> backward incompabibility of binaries. it would not be the first time.
PG> 
PG> please note, that the intel compilers (which version are you using btw)
PG> are only verified on a subset of linux machines, and particularly 
PG> putting it on a new release is always risky. there may be some changes
PG> in libraries, and/or linker that are not handled by the linker/runtime
PG> of the intel compilers.
PG> 
PG> cheers,
PG>   axel.
PG> 
PG> PG> 
PG> PG>  
PG> PG> 
PG> PG> -Paul
PG> PG> 
PG> PG>  
PG> PG> 
PG> PG> Paul M. Grant, PhD
PG> PG> 
PG> PG> Principal, W2AGZ Technologies
PG> PG> 
PG> PG> Visiting Scholar, Applied Physics, Stanford University
PG> PG> 
PG> PG> EPRI Science Fellow (Retired)
PG> PG> 
PG> PG> IBM Research Staff Member Emeritus
PG> PG> 
PG> PG>  <mailto:w2agz at pacbell.net> w2agz at pacbell.net
PG> PG> 
PG> PG>  <http://www.w2agz.com/> http://www.w2agz.com
PG> PG> 
PG> PG>  
PG> PG> 
PG> PG>  
PG> PG> 
PG> PG>  
PG> PG> 
PG> PG> 
PG> 
PG> 

-- 
=======================================================================
Axel Kohlmeyer   akohlmey at cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.




More information about the users mailing list