I just discovered that a couple of files on my system are ELF executables when they should be directories. How do I change a file into a directory? I don't think I've ever run into this one before....
Thanks
mhr CentOS 5.2 w/all updates
Mhr wrote on Tue, 30 Dec 2008 09:57:11 -0800:
I just discovered that a couple of files on my system are ELF executables when they should be directories. How do I change a file into a directory? I don't think I've ever run into this one before....
I think you should really explain that a bit.
Kai
On Tue, Dec 30, 2008 at 10:09 AM, Kai Schaetzl maillists@conactive.com wrote:
Mhr wrote on Tue, 30 Dec 2008 09:57:11 -0800:
I just discovered that a couple of files on my system are ELF executables when they should be directories. How do I change a file into a directory? I don't think I've ever run into this one before....
I think you should really explain that a bit.
Yes, quite.
I save a fair number of web pages (receipts, bill payments, etc.) for what should be obvious reasons.
Usually, these come down as an html file and a directory (of "sub-html" files).
I have two files that correspond to two html files in the right file name format that seem as though they should be the _files directories, but they are ELF files:
[mrichter@swordfish mhrdocs]$ file *_files chv81128_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped chX81125_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped [mrichter@swordfish mhrdocs]$ ll *_files -r--r--r-- 1 mrichter RnD 596460 May 29 2008 chv81128_files -r--r--r-- 1 mrichter RnD 43756 May 29 2008 chX81125_files
These correspond to two html files which do not display correctly (because the files that are supposed to be in those directories are not because the directories appear to be executables. I don't really think I want to try running them....
So, is there a way to change a file into a directory? Or am I crazy?
Thanks.
mhr
On Tue, Dec 30, 2008 at 10:36 AM, MHR mhullrich@gmail.com wrote:
Yes, quite.
I save a fair number of web pages (receipts, bill payments, etc.) for what should be obvious reasons.
Usually, these come down as an html file and a directory (of "sub-html" files).
I have two files that correspond to two html files in the right file name format that seem as though they should be the _files directories, but they are ELF files:
[mrichter@swordfish mhrdocs]$ file *_files chv81128_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped chX81125_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped [mrichter@swordfish mhrdocs]$ ll *_files -r--r--r-- 1 mrichter RnD 596460 May 29 2008 chv81128_files -r--r--r-- 1 mrichter RnD 43756 May 29 2008 chX81125_files
These correspond to two html files which do not display correctly (because the files that are supposed to be in those directories are not because the directories appear to be executables. I don't really think I want to try running them....
So, is there a way to change a file into a directory? Or am I crazy?
Thanks.
mhr
PS: I put them on another machine and ran them as binaries - both terminated with segmentation faults, and gdb shows no backtrace:
#0 0x00000001 in ?? ()
So, . . . ??? :-)
mhr
On Tue, 30 Dec 2008 10:41:12 -0800 MHR wrote:
I save a fair number of web pages (receipts, bill payments, etc.) for what should be obvious reasons.
What are you using to do the saving from?
Usually, these come down as an html file and a directory (of "sub-html" files).
I have two files that correspond to two html files in the right file name format that seem as though they should be the _files directories, but they are ELF files:
What do you see if you view the contents with less?
less chv81128_files
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of MHR Sent: Tuesday, December 30, 2008 1:41 PM To: CentOS mailing list Subject: Re: [CentOS] How to change an executable into a directory
On Tue, Dec 30, 2008 at 10:36 AM, MHR mhullrich@gmail.com wrote:
Yes, quite.
I save a fair number of web pages (receipts, bill payments,
etc.) for
what should be obvious reasons.
Usually, these come down as an html file and a directory
(of "sub-html" files).
I have two files that correspond to two html files in the right file name format that seem as though they should be the _files
directories,
but they are ELF files:
[mrichter@swordfish mhrdocs]$ file *_files chv81128_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped chX81125_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped [mrichter@swordfish mhrdocs]$ ll *_files -r--r--r-- 1 mrichter RnD 596460 May 29 2008 chv81128_files -r--r--r-- 1 mrichter RnD 43756 May 29 2008 chX81125_files
These correspond to two html files which do not display correctly (because the files that are supposed to be in those directories are not because the directories appear to be executables. I
don't really
think I want to try running them....
So, is there a way to change a file into a directory? Or
am I crazy?
Thanks.
mhr
PS: I put them on another machine and ran them as binaries - both terminated with segmentation faults, and gdb shows no backtrace:
#0 0x00000001 in ?? ()
So, . . . ??? :-)
Maybe the file Header is Corrupted or you have the wrong file association with then??? Did you try opening them with a browser exclusivly? Is the directory marked executable? ls -l Maybe they were saved in the wrong format? Just a thought of explanations?
JohnStanley
On Tue, Dec 30, 2008 at 10:54 AM, John jses27@gmail.com wrote:
Maybe the file Header is Corrupted or you have the wrong file association with then???
Possibly, and I don't know how to do that other than a binary edit of the files (which _I_ didn't do...).
Did you try opening them with a browser exclusivly?
I get "The file "chv81128_files" is of type application/octet-stream and SeaMonkey does not know how to handle this file type...."
Is the directory marked executable?
No.
ls -l
This was in my previous post which you quoted - they're -r--r--r.
Maybe they were saved in the wrong format?
Could be, although I have saved hundreds of web pages like this and these are the first two to show up in this bizarre state.
Just a thought of explanations?
Thanks.
mhr
On Tue, 2008-12-30 at 11:02 -0800, MHR wrote:
On Tue, Dec 30, 2008 at 10:54 AM, John jses27@gmail.com wrote:
Maybe the file Header is Corrupted or you have the wrong file association with then???
Possibly, and I don't know how to do that other than a binary edit of the files (which _I_ didn't do...).
Did you try opening them with a browser exclusivly?
I get "The file "chv81128_files" is of type application/octet-stream and SeaMonkey does not know how to handle this file type...."
Is the directory marked executable?
No.
ls -l
This was in my previous post which you quoted - they're -r--r--r.
Maybe they were saved in the wrong format?
Could be, although I have saved hundreds of web pages like this and these are the first two to show up in this bizarre state.
Just a thought of explanations?
You know just another thought I do alot of things under windows and I have had some really funky things happen when saving web pages under it. ASP.Net Pages will do some funky things when saved even as a .htm file on another OS like CentOS. I have that. problem alot. I use firefox exclusively. This also applies to Cold Fusion Markup Pages and Java Web Apps. Believe it or not CSS could be the major culprit to it as CSS code for one site need two different CSS bases to pull the layout from. Another thought gzip compression could be causing it. As in when it gets to the browser it is not expanding all the way.
What kind of wget command are you using?
JohnStanley
On Tue, 2008-12-30 at 11:02 -0800, MHR wrote:
On Tue, Dec 30, 2008 at 10:54 AM, John jses27@gmail.com wrote:
Maybe the file Header is Corrupted or you have the wrong file association with then???
Possibly, and I don't know how to do that other than a binary edit of the files (which _I_ didn't do...).
Did you try opening them with a browser exclusivly?
I get "The file "chv81128_files" is of type application/octet-stream and SeaMonkey does not know how to handle this file type...."
Is the directory marked executable?
No.
ls -l
This was in my previous post which you quoted - they're -r--r--r.
Maybe they were saved in the wrong format?
Could be, although I have saved hundreds of web pages like this and these are the first two to show up in this bizarre state.
Just a thought of explanations?
Mark a another reply because it interests me because I use wget massively to download sites that I don't have time to check out. The file you have could be indeed an ELF file or a Script of some kind. Let me explain: Some webdevelopers like me use scrips so when a browser makes a call to /site1/ it can actually be calling /site2/ and all your getting in return is the exe script that calls the real web application to execute. I have even had when using wget -r it not pulling in the whole site. This same type of thing can be done on ftp servers. Basically it sort of a Redirect script. I sejust you stick it into a Virtual Machine and have at it so then it is isolater from the underlying host os. Also the norobots.txt file can affect wget and how it works.
JohnStanley
On Tue, Dec 30, 2008 at 1:36 PM, MHR mhullrich@gmail.com wrote: <snip>
I save a fair number of web pages (receipts, bill payments, etc.) for what should be obvious reasons.
Usually, these come down as an html file and a directory (of "sub-html" files).
I have two files that correspond to two html files in the right file name format that seem as though they should be the _files directories, but they are ELF files:
[mrichter@swordfish mhrdocs]$ file *_files chv81128_files: ELF 32-bit LSB shared object, Intel >80386, version 1
I sometimes Save web pages also (using Mozilla Firefox) and I have never seen that. I wonder if it has something to do with the actual web pages that were saved, that are in some strange format you didn't notice, when you were at that web site. Interesting that it has the stuff about ELF, LSB, Intel 80386, etc., which certainly looks very strange. Is there any way you can go back to that web site and Save the web page again? GL
On Tue, Dec 30, 2008 at 10:59 AM, Lanny Marcus lmmailinglists@gmail.com wrote:
I sometimes Save web pages also (using Mozilla Firefox) and I have never seen that. I wonder if it has something to do with the actual web pages that were saved, that are in some strange format you didn't notice, when you were at that web site. Interesting that it has the stuff about ELF, LSB, Intel 80386, etc., which certainly looks very strange. Is there any way you can go back to that web site and Save the web page again? GL
Not until the next time I pay those bills! :-)
The other strange thing is that I have several saved pages from that bill pay service, and these aren't even the most recent, but all the others, before and after, came down just fine.
mhr
On Tue, 2008-12-30 at 10:36 -0800, MHR wrote:
On Tue, Dec 30, 2008 at 10:09 AM, Kai Schaetzl maillists@conactive.com wrote:
Mhr wrote on Tue, 30 Dec 2008 09:57:11 -0800:
I just discovered that a couple of files on my system are ELF executables when they should be directories. How do I change a file into a directory? I don't think I've ever run into this one before....
I think you should really explain that a bit.
Yes, quite.
I save a fair number of web pages (receipts, bill payments, etc.) for what should be obvious reasons.
Usually, these come down as an html file and a directory (of "sub-html" files).
I have two files that correspond to two html files in the right file name format that seem as though they should be the _files directories, but they are ELF files:
[mrichter@swordfish mhrdocs]$ file *_files chv81128_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped chX81125_files: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
Since "file" works by examining a few initial bytes/lines, it can be fooled. You might want to examine them by "strings" or, if they really are executables, readelf. This might give a clue as to what went wrong.
I know when I save web pages a related directory is created that contains images and whatnot that are referenced by the page. I presume this is what you expected?
AFAIK there is no way to make a directory out of a file on Linux (unlike real UNIX(TM) which has "standard" i-nodes regardless of file or directory being mapped).
How did it happen? I could only guess that something ran removed the directory and put a file there or something in the save process went awry and made a file, possibly the real files concatenated.
If you can see the structure of the file, maybe some kind of manual edit will let you break out the files.
If there's images of various types in there, I wouldn't bet on it.
[mrichter@swordfish mhrdocs]$ ll *_files -r--r--r-- 1 mrichter RnD 596460 May 29 2008 chv81128_files -r--r--r-- 1 mrichter RnD 43756 May 29 2008 chX81125_files
See what readelf says about those files.
These correspond to two html files which do not display correctly (because the files that are supposed to be in those directories are not because the directories appear to be executables. I don't really think I want to try running them....
So, is there a way to change a file into a directory? Or am I crazy?
Not mutually exclusive are they? ;-)
No way that I know of. The rename, mkdir, manual breakout is the only possible way I can envision ATM.
Thanks.
mhr
<snip sig stuff>
HTH
<snip>
Having read the rest of the posts, maybe you can recover the critical pieces by going to the bill site again. Most that I use allow a payment history display. If what you're looking for is a saved confirmation of you activity, maybe that will do. Many of those I use show the post date and confirmation number and amount. Maybe that will suffice?
Remember to remove/rename those problem files before doing it.
HTH
On Tue, Dec 30, 2008 at 11:15 AM, William L. Maltby CentOS4Bill@triad.rr.com wrote:
<snip>
Having read the rest of the posts, maybe you can recover the critical pieces by going to the bill site again. Most that I use allow a payment history display. If what you're looking for is a saved confirmation of you activity, maybe that will do. Many of those I use show the post date and confirmation number and amount. Maybe that will suffice?
I'll try that.
Remember to remove/rename those problem files before doing it.
But of course!
mhr
On Mon, 05 Jan 2009 08:16:08 -0800 Scott Silva ssilva@sgvwater.com wrote:
So, is there a way to change a file into a directory? Or am I crazy?
Thanks.
mhr
No and Maybe! ;-P
I beg to differ on the first answer: anything can happen given sufficient uncorrected file system errors . ;-)
CM
On Mon, Jan 5, 2009 at 10:59 PM, CM cristim@mail.multinet.ro wrote:
On Mon, 05 Jan 2009 08:16:08 -0800 Scott Silva ssilva@sgvwater.com wrote:
So, is there a way to change a file into a directory? Or am I crazy?
Thanks.
mhr
No and Maybe! ;-P
I beg to differ on the first answer: anything can happen given sufficient uncorrected file system errors . ;-)
Interesting thought - I've fsck'd that partition, but I will do again - thanks.
As for crazy, well, I defer....
mhr