OS-SCO-OpenSource-sudo

From KRayWiki
Revision as of 22:44, 3 July 2018 by Krb (talk | contribs) (Split the last section for more clarity.)
Jump to navigation Jump to search

sudo for SCO OpenServer 5.0.7

See Also: 
OS-SCO-OpenSource
OS-SCO


Summary

  • sudo releases 1.7.* and 1.8.* seem to not compile as of 2018/07/02.
    Additional effort is required to find a way to resolve the build issues.
  • sudo 1.6.9p23 is the last of the 1.6.x series; the build "just worked", though creation of a .pkg file required a minor change.

Procedure

Create a workspace.

$ mkdir -p ~/src/sudo $ cd ~/src/sudo

Download and unpack a source release from one of the download mirrors.

$ curl -O http://www.netgull.com/sudo/OLD/sudo-1.6.9p23.tar.gz $ gunzip sudo-1.6.9p23.tar.gz $ tar -xf sudo-1.6.9p23.tar $ cd sudo-1.6.9p23

Build the project

$ CC= CFLAGS="-static" ./configure -C --prefix="/usr/local" $ make

Snapshot the file system before `make install`.

$ find / | sort >../sudo-1.6.9p23.before.files

Install sudo.

$ su csdi -c "make install"

Snapshot the file system after `make install`.

$ find / | sort >../sudo-1.6.9p23.after.files

Review the installed file list

$ cd .. $ diff -u sudo-1.6.9p23.before.files sudo-1.6.9p23.after.files

As desired, create an archive of the essential files.

$ cd / $ su csdi -c "( echo etc/sudoers; echo usr/local/share/man/man1m/sudoedit.1m; echo usr/local/share/man/man1m/sudo.1m; echo usr/local/share/man/man1m/visudo.1m; echo usr/local/share/man/man4/sudoers.4; echo usr/local/bin/sudoedit; echo usr/local/bin/sudo; echo usr/local/sbin/visudo; echo usr/local/libexec/sudo_noexec.so; ) | cpio -ocvB >${HOME}/src/sudo/sudo-1.6.9p23-sco507.cpio"

Attempt creation of a .pkg distribution file.

$ cd ${HOME}/src/sudo $ mkdir pkg $ cd pkg $ su csdi -c "pkgproto etc/sudoers usr/local/share/man/man1m/sudoedit.1m \ usr/local/share/man/man1m/sudo.1m usr/local/share/man/man1m/visudo.1m \ usr/local/share/man/man4/sudoers.4 usr/local/bin/sudoedit \ usr/local/bin/sudo usr/local/sbin/visudo \ usr/local/libexec/sudo_noexec.so >prototype" $ vim prototype $ cat prototype
!srcdir=../sudo-1.6.9p23 !bindir=$srcdir !libdir=$srcdir/.libs !mandir=$srcdir i pkginfo e sudo /etc/sudoers=$srcdir/sudoers 0440 root root f sudo share/man/man1m/sudoedit.1m=$mandir/sudo.man 0444 root root l sudo share/man/man1m/sudo.1m=share/man/man1m/sudoedit.1m f sudo share/man/man1m/visudo.1m=$mandir/visudo.man 0444 root root f sudo share/man/man4/sudoers.4=$mandir/sudoers.man 0444 root root f sudo bin/sudoedit=$bindir/sudo 4111 root root l sudo bin/sudo=bin/sudoedit f sudo sbin/visudo=$bindir/visudo 0111 root root f sudo libexec/sudo_noexec.so=$libdir/sudo_noexec.so 0755 root root
$ vim pkginfo $ cat pkginfo
PKG=sudo VERSION=1.6.9p23 PSTAMP=SYSTEMSDESIGNUSA.COM-20180629 NAME=sudo, sudoedit -- execute a command as another user DESC=sudo allows a permitted user to execute a command as the superuser or another user, as specified by security policy. ARCH=i386 BASEDIR=/usr/local VENDOR=https://www.sudo.ws/ COPYRIGHT=https://www.sudo.ws/license.html EMAIL=kevinb@systemsdesignusa.com CATEGORY=utilities CLASSES="sudo" ORDER="sudo" MAXINST=1
$ vim pkgmk.sh $ cat pkgmk.sh
eval `grep "^PKG=" ./pkginfo` eval `grep "^VERSION=" ./pkginfo` echo echo "Specify 'csdi' password to make '/var/spool/pkg/${PKG}'." echo su csdi -c "pkgmk -o" echo echo "Specify 'csdi' password to make '/var/spool/pkg/${PKG}-${VERSION}.pkg'." echo su csdi -c "pkgtrans -o -s /var/spool/pkg ${PKG}-${VERSION}.pkg sudo" echo echo "Install example:" echo " su root -c 'pkgadd ${PKG}'" echo " To install on another machine, copy ${PKG}-${VERSION}.pkg to" echo " its /var/spool/pkg first." echo echo "See Also:" echo " http://osr507doc.sco.com/en/topics/PackagSWApps.html" echo " man -a pkginfo" echo " man pkgparam" echo " man pkgproto" echo " man pkgtrans" echo " man protoype" echo " man pkgadd" echo " man pkgask" echo " man pkgchk" echo " man pkgrm" echo " man pkgmk" echo

Create the .pkg distributable file.

$ su csdi -c "pkgmk -o"

Attempt to create a binary distribution tarball using the project Makefile:

$ make bindist ... + cp ./INSTALL.binary tmp.i386+SCO_SV_3.2/sudo-1.6.9p23/INSTALL cp: cannot access ./INSTALL.binary: No such file or directory (error 2) + sh ./config.status --file=Makefile.binary config.status: error: cannot find input file: Makefile.binary.in ...

Obtain the missing project resources. Apparently the binary distribution support is in process of being removed from the project. The required files are:

Download the missing files and incorporate them into the project.

$ cd ~/src/sudo $ curl -ko Makefile.binary.in \ https://www.sudo.ws/repos/sudo/raw-file/7aafc44a4a80/Makefile.binary.in $ curl -ko Makefile.binary.in \ https://www.sudo.ws/repos/sudo/raw-file/fe5532ce4375/INSTALL.binary $ cd sudo-1.6.9p23 $ cp ../*.binary.* .

Create the binary distribution tarball.

$ make bindist $ mv sudo-1.6.9p23-i386+SCO_SV_3.2.tar.gz ..