ocaml-opam / opam-depext

Attempt to automate the installation of system packages required by OPAM packages
Other
33 stars 28 forks source link

call su(1) with login argument 'root': 2.0 port #107

Closed rjbou closed 6 years ago

rjbou commented 6 years ago

Port #106 to 2.0 branch


Omission of the login argument in sudo_run_command will make the call to su(1) fail on FreeBSD, NetBSD, DragonFLy, Darwin and any other UNIX where the su(1) executable is not a GNU coreutils (derived) su. Either because the '-c' option before the login argument defines a 'login class' or because the '-c' option is not defined at all.

su root -c 'the command string to be executed'

will pass '-c' to the spawned shell and work on every platform.

fixes ocaml/opam-depext#51 (however newer MacOS installations tend to have no root password set)