Improve the call for root permissions
Discussion started on https:/
Currently, Boot-Repair's desktop file calls the "boot-repair" command.
The "boot-repair" script is very simple: it fills a variable (APPNAME=
The "g2slaunch" script checks if it has been launched with root privileges. If not, it runs $APPNAME with root privileges (gksudo $APPNAME if gksudo is on the system, else gksu, else sudo or su).
You can also check the code here: http://
Remark: OS-Uninstaller does the same (except APPNAME=
This blueprint is to discuss how this could be improved.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- YannUbuntu
Related branches
Related bugs
Sprints
Whiteboard
- Fabrice: If you already have a script that chooses the best 'su' command, why not using it in the desktop file, then? That would be better than having a desktop file that don't run anything because you're missing rights, IMHO.
- Yann: currently, the .desktop calls the "boot-repair" executable, which calls the script that chooses the best "su" command (e.g. it will call "gksudo boot-repair"). Do you know a better way to implement it ?
- Michael: How about creating an explicit boot-repair-wrapper script that chooses the best way to get root permissions?
As an additional precautionary action boot-repair itself could check if it has root permissons and exit otherwise. It would not try to get the permissions itself, however.
The desktop file would call boot-repair-
If you are afraid someone might call boot-repair instead of boot-repair-wrapper because it has the nicer name, you might name them boot-repair (for the wrapper script) and boot-repair-backend or boot-repair-real (for the current boot-repair)
-Yann: i understand your suggestion Michael, it can be easily coded, but it has one drawback: this will increase the code size as the wrapper will have to be coded twice (1 for boot-repair, 1 for os-uninstaller). Is it a problem if boot-repair asks permissions itself instead of via a wrapper? i don't see any difference as the program will exit in both cases (with or without wrapper) if the user grants no permissions.
Other idea: i saw there has been an update here: http://