flat assembler
Message board for the users of flat assembler.
Index
> Main > Mixed Windows/Linux question. |
Author |
|
cod3b453 25 Sep 2012, 18:32
File permissions are not part of the file data, so this won't be portable. It sounds like you replaced the file instead of creating a new one going from Windows->Linux so it inherited the current permissions.
You can use programs like WinSCP to copy and set permissions. |
|||
25 Sep 2012, 18:32 |
|
JohnFound 25 Sep 2012, 18:55
cod3b453 wrote: It sounds like you replaced the file instead of creating a new one going from Windows->Linux so it inherited the current permissions. No, I am not. The experiment is clean. More, I figured out what actually happens. If the file have "system" attribute set (attrib filename +S) in Windows/DOS, Linux will accept it as an executable file (chmod +x filename). Try it yourself: Compile some ELF executable with FASM in Windows. Make a copy of the executable and then set system attribute for only one of the copies: "attrib filename1 +S", then copy these two copies in Linux FS. You will see, that only the system file has executable permissions set. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
25 Sep 2012, 18:55 |
|
cod3b453 25 Sep 2012, 19:22
Interestingly, copying over Samba to my server actually worked without doing anything, so it must have picked up the fact it was a ELF...
|
|||
25 Sep 2012, 19:22 |
|
JohnFound 25 Sep 2012, 20:01
Try to use FAT32 formatted pen drive.
|
|||
25 Sep 2012, 20:01 |
|
Feryno 26 Sep 2012, 06:27
hi, JohnFound
try to copy a file without executable flag from your Linux partition to USB and then back from USB to Linux and I'm guessing the file obtains the executable flag there is some mask when mounting FAT32 into Linux filesystem and that mask gives the executable flag for every file copied to your USB http://linux.die.net/man/8/mount scroll down to: Mount options for fat and read about: umask |
|||
26 Sep 2012, 06:27 |
|
JohnFound 26 Sep 2012, 12:02
I made some more experiments with these files and the results vary, depending on the software used to transport files.
The trick with the system flag actually works only with CoFS (andLinux) - I believe it is specially implemented this way in order to work more flawlessly with Windows.... |
|||
26 Sep 2012, 12:02 |
|
Feryno 26 Sep 2012, 13:30
if you want to keep original file attributes never copy it directly into different/insufficient filesystem
maybe you could store your Linux file with its attributes (perhaps even with its User ID + Group ID) into tar file and then do the transfer with the tarball archive into different filesystem |
|||
26 Sep 2012, 13:30 |
|
JohnFound 26 Sep 2012, 13:59
Feryno wrote: if you want to keep original file attributes never copy it directly into different/insufficient filesystem It is for distribution purposes. For example, if I have some program, with versions for Linux and for Windows, I can create two packages - one for Windows and one for Linux. (and if the package is big enough it will be the proper solution.) In this case, there is no problems with file permissions. Another approach is make one mixed package, containing binaries for all supported OSes sharing configuration files and other common parts. Then the user simply unpack this package to some directory (possibly on removable drive) and takes portable application able to run on any supported platform. In the case, it seems that after unpacking, the user have to set the permissions for ELF files manually, what is not a big problem, but at least annoying. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
26 Sep 2012, 13:59 |
|
f0dder 01 Oct 2012, 14:14
cod3b453 wrote: Interestingly, copying over Samba to my server actually worked without doing anything, so it must have picked up the fact it was a ELF... _________________ - carpe noctem |
|||
01 Oct 2012, 14:14 |
|
cod3b453 01 Oct 2012, 17:59
Well spotted...clearly another victim in my last round of updates
|
|||
01 Oct 2012, 17:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.