1$Id: PORTING,v 1.5 2002/06/26 22:21:21 hbo Exp $
2
3Sudosciptd and sudoshell are written in Perl. They should be
4pretty portable across POSIX implementations. Basically,
5if sudo runs on your platform, then so should sudoshell.
6The main portability issue is the facility in sudoshell
7that starts the daemon if it is not running. This is important
8to ensure no loss of the audit trail, but requires sudoshell
9to know how the daemon should be started on a given platform.
10The code that implements this facility in sudoshell is:
11
12my $initscr;
13if ($^O eq 'solaris'){
14  $PS="ps -ef";
15  $initscr="/etc/init.d/sudoscriptd";
16  $ENV{PATH} .= ':/usr/freeware/bin:/usr/bsd' if $^O eq 'irix';
17} elsif ($^O eq 'linux'){
18  $PS="ps -auxww";
19  $initscr="/etc/init.d/sudoscriptd";
20} elsif($^O eq 'freebsd' || $^O eq 'openbsd') {
21  $PS="ps -aux";
22  $initscr="/usr/local/etc/rc.d/sudoscriptd.sh";
23} else {
24  print <<'EOM';
25Sorry, but your OS is not among the ones I support Currently, that's
26linux, solaris, freebsd and openbsd. That's because those are the ones
27I or other contributors have access to. If you'd like support for your OS,
28either give me a root shell (!) on a representative system running your OS,
29or port it yourself and send me (hbo@egbok.com) the diffs. If system directory
30locations (i.e. /var/log and /var/run) don't have to change, and your system
31has Perl 5 and POSIX,  That shouldn't be too hard. See the PORTING document
32in the distribution for details.
33EOM
34
35  exit;
36}
37
38You also need to be sure that grep, ps and sudo can be
39found in the PATH set by the following line:
40
41	$ENV{PATH}="/bin:/usr/bin:/usr/sbin:/usr/local/bin"; # Give ourselves a safe one.
42
43Later on, the $initscr variable is called using sudo with an argument
44of 'start'. The $PS program is used to look for the running
45sudoscriptd. Implementing a startup file, perhaps borrowed from one of
46the existing ones, setting $PS and $initscr appropriately and adding
47the $^O value for your OS to the above logic should do the trick as
48far as the code is concerned. Please let me know if you do this, and
49send me your [init|rc] script and the diffs to sudoshell so I can roll
50them in to the distribution. I'll also do the OS dependent hacking on
51the Makefile, unless you want to take this on too. I can be reached at
52hbo@egbok.com. There is also a developer's mailing list at
53sudoscript-devel@lists.sourceforge.net. It's GNU Mailman based, so
54you can subscribe from the web page at
55	https://lists.sourceforge.net/lists/listinfo/sudoscript-devel
56
57
58