Opened 15 years ago

Closed 15 years ago

Last modified 15 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:
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 15 years ago.
Patch to fix the calling of Installers scripts
installerfinishscript.patch (471 bytes ) - added by idefix 15 years ago.
Patch to fix the mount point checks in InstallerFinishScript

Download all attachments as: .zip

Change History (13)

comment:1 by korli, 15 years ago

Resolution: fixed
Status: newclosed

Should be fixed in hrev31532.

comment:2 by idefix, 15 years ago

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.)

by idefix, 15 years ago

Attachment: installer.patch added

Patch to fix the calling of Installers scripts

in reply to:  2 ; comment:3 by anevilyak, 15 years ago

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?

in reply to:  3 comment:4 by idefix, 15 years ago

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 by anevilyak, 15 years ago

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 by stippi, 15 years ago

Resolution: fixed
Status: reopenedclosed

Applied in hrev31607. Thanks a lot!

in reply to:  5 comment:7 by idefix, 15 years ago

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

in reply to:  6 comment:8 by idefix, 15 years ago

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 by idefix, 15 years ago

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. :)

by idefix, 15 years ago

Attachment: installerfinishscript.patch added

Patch to fix the mount point checks in InstallerFinishScript

comment:10 by stippi, 15 years ago

Resolution: fixed
Status: reopenedclosed

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

in reply to:  5 comment:11 by idefix, 15 years ago

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.