Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
1.5.0
-
None
-
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise
Qt Installer Framework version :1.5
Description
Purpose of test case:
Create 1 file with root ownership (using addElevatedOperation) and another with the ownership of a normal user (using addOperation)
Note: The target installation location for all the cases is root path ("/") and hence I do get a prompt to type my sudo password.
Case 1:
package.xml:
has <RequiresAdminRights>true</RequiresAdminRights>
installerscript.qs:
has 1 addElevatedOperation for creating a symbolic link file with "root" ownership
has 1 addOperation for creating a normal file with "normal user" ownership
Result: both the files are created with root ownership
Case 2:
Same as case1, except that <RequiresAdminRights>true</RequiresAdminRights> has been removed from package.xml
Result:
I get a warning as below, but result is same as Case 1
Warning: Component com.vendor.product uses addElevatedOperation in the script, but it does not have the needed RequiresAdminRights tag
case 3:
package.xml:
has <RequiresAdminRights>true</RequiresAdminRights>
installerscript.qs:
installer.gainAdminRights() followed by addElevatedOperation for creating a symbolic link file with "root" ownership
installer.dropAdminRights() followed by addOperation for creating a normal file with "normal user" ownership
Result:
Though addElevatedOperation is preceded by an explicit call to installer.gainAdminRights() as well as package.xml having the tag <RequiresAdminRights>true</RequiresAdminRights>, the installer fails with permission denied ad below. Done backup com.vendor.product operation: Execute - arguments: touch, /home/sandeep/rootscript.sh Done perform com.vendor.product operation: Execute - arguments: touch, /home/sandeep/rootscript.sh touch" started, arguments: "/home/sandeep/rootscript.sh Done backup com.vendor.product operation: Execute - arguments: ln, -s, /home/sandeep/rootscript.sh, /usr/bin/rootscriptdummy Done perform com.vendor.product operation: Execute - arguments: ln, -s, /home/sandeep/rootscript.sh, /usr/bin/rootscriptdummy ln" started, arguments: "-s /home/sandeep/rootscript.sh /usr/bin/rootscriptdummy Warning: ln: failed to create symbolic link `/usr/bin/rootscriptdummy': Permission denied Done Operation 'Execute' with arguments: 'ln; -s; /home/sandeep/rootscript.sh; /usr/bin/rootscriptdummy' failed: Execution failed(Unexpected exit code: 1): "ln -s /home/sandeep/rootscript.sh /usr/bin/rootscriptdummy" created warning message box installationErrorWithRetry: 'Installer Error', Error during installation process (com.vendor.product): Execution failed(Unexpected exit code: 1): "ln -s /home/sandeep/rootscript.sh /usr/bin/rootscriptdummy"
More cases:
I even did lot of permutations and combinations of reordering the calls to installer.gainAdminRights() and installer.dropAdminRights(). Enabled and disabled <RequiresAdminRights>true</RequiresAdminRights> but I could not successfully create 1 symbolic link file (inside /usr/bin)with root ownership and 1 file (inisde my home directory)with user ownership.
I am attaching all the different cases I tried.
Note: If anyone has to try them , they need to change the paths in installerscript.qs to point correct paths. Currently they are hard coded to point to my machine.