OS-SCO-OpenSource-sudo

From KRayWiki
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/dist $ 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="${HOME}/src/sudo/dist/usr/local" --sysconfdir="${HOME}/src/sudo/dist/etc" $ make

Snapshot the file system before `make install`.

$ su root -c "find / | sort >../sudo-1.6.9p23.before.files"

Install sudo to dist folder.

$ su root -c "make install"

Snapshot the file system after `make install`.

$ su root -c "find / | sort >../sudo-1.6.9p23.after.files"

Review the installed file list:

$ cd .. $ su chown `who am i` ../sudo-1.6.9p23.*.files $ diff ../sudo-1.6.9p23.before.files ../sudo-1.6.9p23.after.files $ find ../dist -type f

After verifying ../dist content agrees with the difference analysis (no files installed outside of the dist folder), build sudo using actual system paths.

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

As desired, create an archive of the essential files by installing and archiving all the pertinent files.

$ su root -c "make install" $ cd .. $ su root -c "tar -cAf sudo-1.6.9p23-sco507-bin.tar `( find dist -type f -exec echo -n '{} ' \; ; echo ) | sed -e 's/dist//g'`" $ su root -c "chown `id -un` sudo-1.6.9p23-sco507.tar" $ tar -itf sudo-1.6.9p23-sco507-bin.tar $ gzip sudo-1.6.9p23-sco507-bin.tar

Attempt creation of a .pkg distribution file.

$ cd ${HOME}/src/sudo $ mkdir -p pkg $ pkgproto `( find dist -type f -exec echo -n '{} ' \; ; echo ) | sed -e 's/dist//g'` >pkg/prototype $ cd pkg $ 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-20180705 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 $ chmod 744 pkgmk.sh $ cat pkgmk.sh
eval `grep "^PKG=" ./pkginfo` eval `grep "^VERSION=" ./pkginfo` echo echo "Specify 'root' password to make '/var/spool/pkg/${PKG}'." echo su root -c "pkgmk -o" echo echo "Specify 'root' password to make '/var/spool/pkg/${PKG}-${VERSION}.pkg'." echo su root -c "pkgtrans -o -s /var/spool/pkg ${PKG}-${VERSION}-sco507.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 root -c "./pkgmk.sh"

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

$ cd ~/src/sudo/sudo-1.6.9p23 $ 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 ...

Apparently, the binary distribution support is in process of being removed from the project, so identify the most recent and applicable revisions of the missing project resources.

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 ../sudo-1.6.9p23-sco507-bindist.tar.gz

Create a source distribution tarball.

$ cd ~/src/sudo/sudo-1.6.9p23 $ make dist $ cd .. $ mv sudo-1.6.9p23.tar.gz sudo-1.6.9p23-sco507-dist.tar.gz