IzPack

Run-privileged forces GUI installation even if automated install is requested

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Incomplete
  • Affects Version/s: 4.3.1
  • Fix Version/s: 4.3.3, 5.0
  • Component/s: Installer
  • Labels:
    None
  • Environment:
    Mac OSX
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

If:
1. an installer is created with the run-privileged tag
2. and the installer is launched with an administrative user that is currently unprivileged
3. the installer is launched with an XML passed as parameter in order to perform an automatic install

Then:
1. the installer launches sees it needs privilege escalation
2. the installer prepares a ProcessBuilder that will invoke the native executable run-with-privileges-on-osx
3. the ProcessBuilder is constructed BUT the parameter that was passed with the XML file is ignored
4. the run-with-privileges-on-osx launches the installer again, with the correct privileges BUT without the XML argument
5. the installer runs in full GUI mode

I solved the problem by doing the following:
1. In the Installer class, before creating the AutomatedInstaller object, I store the argument in a system property => System.setProperty("izpack.cmdline_argument", args[0]);
2. In the PrivilegedRunner class, in the method relaunchWithElevatedRights() I read the system property and use it to complete the command line that is used in the ProcessBuilder.

Attached you can find the patch.
However I don't recommend using it... It's a quick hack and things should probably be done in a different way.

Activity

Hide
Julien Ponge added a comment -

The patch does not apply cleanly.

Show
Julien Ponge added a comment - The patch does not apply cleanly.
Hide
Manuel Padilha added a comment -

The patch is trivial, you'll understand what it does just by opening it in a text editor.
And, as stated above, it's a quick hack with possible caveats. A better solution should be provided by someone with insight on the architecture of izpack installer.

However, I'm willing to try and generate another patch if you tell me why it's failing to apply.

Show
Manuel Padilha added a comment - The patch is trivial, you'll understand what it does just by opening it in a text editor. And, as stated above, it's a quick hack with possible caveats. A better solution should be provided by someone with insight on the architecture of izpack installer. However, I'm willing to try and generate another patch if you tell me why it's failing to apply.
Hide
Maksim Sorokin added a comment -

Is this issue fixed? I can still reproduce this issue in IzPack 4.3.3 on Windows 7.

Show
Maksim Sorokin added a comment - Is this issue fixed? I can still reproduce this issue in IzPack 4.3.3 on Windows 7.
Hide
Julien Ponge added a comment -

No, the patch was incomplete...

Show
Julien Ponge added a comment - No, the patch was incomplete...
Hide
Maksim Sorokin added a comment -

Can we reopen this issue?

Show
Maksim Sorokin added a comment - Can we reopen this issue?
Hide
Julien Ponge added a comment -

Only if you come up with a patch that I can apply

Show
Julien Ponge added a comment - Only if you come up with a patch that I can apply
Hide
Maksim Sorokin added a comment -

Can you elaborate more on why Manuel's patch is incomplete? Is there another, cleaner way to do that?

I am asking because I am not sure, if I should try it out out and test on different operating systems.

Show
Maksim Sorokin added a comment - Can you elaborate more on why Manuel's patch is incomplete? Is there another, cleaner way to do that? I am asking because I am not sure, if I should try it out out and test on different operating systems.
Hide
Julien Ponge added a comment -

I simply could not apply it to either master of 4.3 Git branches.

It's probably not complicated to edit the files according to what the patch says, but like most projects do, we tend to classify as 'incomplete' an issue where the patch simply does not apply on top of the SCM that we have.

This is not to be pedantic.

Show
Julien Ponge added a comment - I simply could not apply it to either master of 4.3 Git branches. It's probably not complicated to edit the files according to what the patch says, but like most projects do, we tend to classify as 'incomplete' an issue where the patch simply does not apply on top of the SCM that we have. This is not to be pedantic.
Hide
Manuel Padilha added a comment -

sorry about that.
i wont be able to rebuild the patch for at least a few more days, so if anyone wishes to do so, please do
the changes introduced are trivial albeit ugly.

Show
Manuel Padilha added a comment - sorry about that. i wont be able to rebuild the patch for at least a few more days, so if anyone wishes to do so, please do the changes introduced are trivial albeit ugly.
Hide
Maksim Sorokin added a comment -

Ok, now I understand.

Preliminary testing shows, that this patch works. I am going to test that tomorrow in different scenarios (we have pretty complicated chains of installers) to verify that it is truly working correctly.

As far as I see you have a lot of changes in code in IzPack 5. So I think, I will not look at the code until it is released. But I could provide you with a patch for 4.3.4 version. Just tell me in what format you want to get it.

Show
Maksim Sorokin added a comment - Ok, now I understand. Preliminary testing shows, that this patch works. I am going to test that tomorrow in different scenarios (we have pretty complicated chains of installers) to verify that it is truly working correctly. As far as I see you have a lot of changes in code in IzPack 5. So I think, I will not look at the code until it is released. But I could provide you with a patch for 4.3.4 version. Just tell me in what format you want to get it.
Hide
Julien Ponge added a comment -

A Git-friendly patch would be just fine!

Show
Julien Ponge added a comment - A Git-friendly patch would be just fine!

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: