Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4063 closed bug (fixed)

Installer calls its scripts without escaping the mount point

Reported by: idefix Owned by: korli
Priority: normal Milestone: R1
Component: Applications/Installer Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Installer calls InstallerInitScript and InstallerFinishScript without escaping the mount point, causing the scripts to fail when the name of the volume has special characters (like a space or parentheses):

/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `/bin/sh /boot/system/boot/InstallerInitScript /installer(test)'
ignoring 'var'.
343371756 bytes to read in 9358 files
ignoring 'var'.
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `/bin/sh /boot/system/boot/InstallerFinishScript /installer(test)'
327.46 MB written (0.96 MB/s)

Consequently, the volume isn't made bootable.

Attachments (2)

installer.patch (772 bytes) - added by idefix 10 years ago.
Patch to fix the calling of Installers scripts
installerfinishscript.patch (471 bytes) - added by idefix 10 years ago.
Patch to fix the mount point checks in InstallerFinishScript

Download all attachments as: .zip

Change History (13)

comment:1 Changed 10 years ago by korli

Resolution: fixed
Status: newclosed

Should be fixed in hrev31532.

comment:2 Changed 10 years ago by idefix

Resolution: fixed
Status: closedreopened

Unfortunately, it is not, because the error is in the code that's calling the scripts.

I've made a patch that should fix this bug, but I'm not sure it's the preferred way.
(Note: I've not been able to test this patch, because of a build problem I'm experiencing.)

Changed 10 years ago by idefix

Attachment: installer.patch added

Patch to fix the calling of Installers scripts

comment:3 in reply to:  2 ; Changed 10 years ago by anevilyak

Replying to idefix:

(Note: I've not been able to test this patch, because of a build problem I'm experiencing.)

That actually looks like your copy of gensyscallinfos.cpp is corrupt. Can you try deleting src/tools/gensyscalls/gensyscallinfos.cpp and re-svn upping it?

comment:4 in reply to:  3 Changed 10 years ago by idefix

Replying to anevilyak:

That actually looks like your copy of gensyscallinfos.cpp is corrupt. Can you try deleting src/tools/gensyscalls/gensyscallinfos.cpp and re-svn upping it?

Unfortunately, that didn't help:

/Build/Haiku> rm src/tools/gensyscalls/gensyscallinfos.cpp 
/Build/Haiku> svn update src/tools/gensyscalls/
Restored 'src/tools/gensyscalls/gensyscallinfos.cpp'
At revision 31604.
/Build/Haiku> cd src/apps/installer/
/Build/Haiku/src/apps/installer> jam -q
...patience...
...patience...
...patience...
...patience...
...patience...
...patience...
...patience...
...found 7410 target(s)...
...updating 642 target(s)...
C++ ../../../generated/objects/haiku_host/x86/release/tools/gensyscalls/gensyscallinfos.o 
Link ../../../generated/objects/haiku_host/x86/release/tools/gensyscalls/gensyscallinfos 
Chmod1 ../../../generated/objects/haiku_host/x86/release/tools/gensyscalls/gensyscallinfos 
GenSyscallInfos1 ../../../generated/objects/haiku/x86/common/tools/gensyscalls/gensyscalls_infos.cpp 
Unexpected end of input.

../../../generated/objects/haiku_host/x86/release/tools/gensyscalls/gensyscallinfos ../../../generated/objects/haiku/x86/common/tools/gensyscalls/syscalls.h.pp.parsable ../../../generated/objects/haiku/x86/common/tools/gensyscalls/gensyscalls_infos.cpp

...failed GenSyscallInfos1 ../../../generated/objects/haiku/x86/common/tools/gensyscalls/gensyscalls_infos.cpp ...
...skipped <src!tools!gensyscalls>gensyscalls_infos.o for lack of <src!tools!gensyscalls>gensyscalls_infos.cpp...
...skipped gensyscalls for lack of <src!tools!gensyscalls>gensyscalls_infos.o...
...skipped <syscalls>syscalls.S.inc for lack of gensyscalls...
...skipped <src!system!libroot!os>syscalls.o for lack of <syscalls>syscalls.S.inc...
...skipped os_main.o for lack of <src!system!libroot!os>syscalls.o...
...skipped libroot.so for lack of os_main.o...
...skipped libbe.so for lack of libroot.so...
...skipped Installer for lack of libbe.so...
...failed updating 1 target(s)...
...skipped 8 target(s)...
...updated 2 target(s)...
/Build/Haiku/src/apps/installer> 

Maybe the gensyscallinfos.cpp-file inside the .svn-folder is corrupt?
I will try to remove the whole gensyscalls-folder and let svn update it with a fresh copy from the server.

comment:5 Changed 10 years ago by anevilyak

That folder just contains the tool and rules for it. It generates a few files on the fly by using output from others such as headers/private/system/syscalls.h. It's possible one of its input files is corrupt somewhere as well...are you building on Haiku itself by any chance? If so, you may have hit one of the BFS problems and might want to run checkfs.

comment:6 Changed 10 years ago by stippi

Resolution: fixed
Status: reopenedclosed

Applied in hrev31607. Thanks a lot!

comment:7 in reply to:  5 Changed 10 years ago by idefix

Replying to anevilyak:

[...]are you building on Haiku itself by any chance? If so, you may have hit one of the BFS problems and might want to run checkfs.

Yes, I'm building on Haiku.
One of the first things I do when I hit an error like that is run checkfs, but it couldn't find anything:

~> checkfs /Build/
checked 108537 nodes, 0 blocks not allocated, 0 blocks already set, 0 blocks could be freed
        files           86679
        directories     21858
        attributes      0
        attr. dirs      0
        indices         0

comment:8 in reply to:  6 Changed 10 years ago by idefix

Replying to stippi:

Applied in hrev31607. Thanks a lot!

Thanks!
If I can't get my build problem fixed, I'll test this change when a new VMware image has been created.

comment:9 Changed 10 years ago by idefix

Resolution: fixed
Status: closedreopened

I have tested it with hrev31610 and I hate to tell you, but we're not there yet.
Fortunately, I have created a patch that will fix this bug for good. :)

Changed 10 years ago by idefix

Attachment: installerfinishscript.patch added

Patch to fix the mount point checks in InstallerFinishScript

comment:10 Changed 10 years ago by stippi

Resolution: fixed
Status: reopenedclosed

Ok, thanks a lot, applied in hrev31620. Again, I have not tested it myself, but I presume you have. :-)

comment:11 in reply to:  5 Changed 10 years ago by idefix

Replying to anevilyak:

That folder just contains the tool and rules for it. It generates a few files on the fly by using output from others such as headers/private/system/syscalls.h. It's possible one of its input files is corrupt somewhere as well...are you building on Haiku itself by any chance? If so, you may have hit one of the BFS problems and might want to run checkfs.

Well, I have done a complete checkout of Haiku's sourcefiles, but it still errors at the same point...

I'm beginning to suspect the build-environment (Haiku under VMware), but I have no other environment to build Haiku on.

Note: See TracTickets for help on using tickets.