Annotation of embedaddon/sudo/doc/fixman.sh, revision 1.1
1.1 ! misho 1: #!/bin/sh
! 2:
! 3: OUTFILE="$1"
! 4: rm -f "$OUTFILE"
! 5: > "$OUTFILE"
! 6:
! 7: # HP-UX friendly header/footer for all man pages
! 8: if [ X"`uname 2>&1`" = X"HP-UX" ]; then
! 9: cat >>"$OUTFILE" <<-'EOF'
! 10: s/^\.TH \("[^"]*"\) \("[^"]*"\) "\([^"]*\)" "\([^"]*\)" \("[^"]*"\)/.TH \1 \2\
! 11: .ds )H \4\
! 12: .ds ]W \3/
! 13: EOF
! 14: fi
! 15:
! 16: # Page specific hacks
! 17: case "$OUTFILE" in
! 18: sudo.man.sed)
! 19: # Replace "0 minutes" with "unlimited"
! 20: cat >>"$OUTFILE" <<-'EOF'
! 21: /^\\fR0\\fR$/ {
! 22: N
! 23: s/^\\fR0\\fR\nminutes\.$/unlimited./
! 24: }
! 25: EOF
! 26:
! 27: # BSD auth
! 28: if [ X"$BAMAN" != X"1" ]; then
! 29: cat >>"$OUTFILE" <<-'EOF'
! 30: /^\[\\fB\\-a\\fR\\ \\fIauth_type\\fR/d
! 31: /^\\fB\\-a\\fR \\fItype\\fR$/,/^\.TP 12n$/ {
! 32: /^\.PD$/!d
! 33: }
! 34: EOF
! 35: fi
! 36:
! 37: # BSD login class
! 38: if [ X"$LCMAN" != X"1" ]; then
! 39: cat >>"$OUTFILE" <<-'EOF'
! 40: /^\[\\fB\\-c\\fR\\ \\fIclass\\fR/d
! 41: /^\\fB\\-c\\fR \\fIclass\\fR$/,/^\.TP 12n$/ {
! 42: /^\.PD$/!d
! 43: }
! 44: /^login_cap(3),$/d
! 45: /^BSD login class$/ {
! 46: N
! 47: N
! 48: /^BSD login class\n\.TP 4n\n\\fBo\\fR$/d
! 49: }
! 50: EOF
! 51: fi
! 52:
! 53: # SELinux
! 54: if [ X"$SEMAN" != X"1" ]; then
! 55: cat >>"$OUTFILE" <<-'EOF'
! 56: /^\[\\fB\\-[rt]\\fR\\ \\fI[rt][oy][lp]e\\fR/d
! 57: /^\\fB\\-[rt]\\fR \\fI[rt][oy][lp]e\\fR$/,/^\.TP 12n$/ {
! 58: /^\.PD$/!d
! 59: }
! 60: /^SELinux role and type$/ {
! 61: N
! 62: N
! 63: /^SELinux role and type\n\.TP 4n\n\\fBo\\fR$/d
! 64: }
! 65: EOF
! 66: fi
! 67:
! 68: # Solaris privileges
! 69: if [ X"$PSMAN" != X"1" ]; then
! 70: cat >>"$OUTFILE" <<-'EOF'
! 71: /^Solaris project$/ {
! 72: N
! 73: N
! 74: N
! 75: N
! 76: N
! 77: /^Solaris project\n\.TP 4n\n\\fBo\\fR\nSolaris privileges\n\.TP 4n\n\\fBo\\fR$/d
! 78: }
! 79: EOF
! 80: fi
! 81: ;;
! 82: sudoers.man.sed)
! 83: # Subsections to remove (SELinux and Solaris are adjacent)
! 84: RM_SS=
! 85: if [ X"$PSMAN" != X"1" ]; then
! 86: if [ X"$SEMAN" != X"1" ]; then
! 87: RM_SS='/^\.SS "SELinux_Spec"/,/^\.SS "[^S]/{;/^\.SS "[^S][^o][^l]/!d;};'
! 88: else
! 89: RM_SS='/^\.SS "Solaris_Priv_Spec"/,/^\.SS/{;/^\.SS "[^S][^o][^l]/!d;};'
! 90: fi
! 91: elif [ X"$SEMAN" != X"1" ]; then
! 92: RM_SS='/^\.SS "SELinux_Spec"/,/^\.SS/{;/^\.SS "[^S][^E][^L]/!d;};'
! 93: fi
! 94: if [ -n "$RM_SS" ]; then
! 95: cat >>"$OUTFILE" <<-EOF
! 96: $RM_SS
! 97: EOF
! 98: fi
! 99:
! 100: # BSD login class
! 101: if [ X"$LCMAN" != X"1" ]; then
! 102: cat >>"$OUTFILE" <<-EOF
! 103: /^On BSD systems/,/\.$/ {
! 104: d
! 105: }
! 106: /^use_loginclass$/,/^\.TP 18n$/ {
! 107: /^\.PD$/!d
! 108: }
! 109: EOF
! 110: fi
! 111:
! 112: # Solaris PrivSpec
! 113: if [ X"$PSMAN" != X"1" ]; then
! 114: cat >>"$OUTFILE" <<-EOF
! 115: s/Solaris_Priv_Spec? //
! 116: /^Solaris_Priv_Spec ::=/ {
! 117: N
! 118: d
! 119: }
! 120: /^l*i*m*i*t*privs$/,/^\.TP 18n$/ {
! 121: /^\.PD$/!d
! 122: }
! 123: /^On Solaris 10/,/^\.[sP][pP]/ {
! 124: d
! 125: }
! 126: EOF
! 127: fi
! 128:
! 129: # SELinux
! 130: if [ X"$SEMAN" != X"1" ]; then
! 131: cat >>"$OUTFILE" <<-EOF
! 132: s/SELinux_Spec? //
! 133: /^SELinux_Spec ::=/ {
! 134: N
! 135: d
! 136: }
! 137: /^[rt][oy][lp]e$/,/^\.TP 18n$/ {
! 138: /^\.PD$/!d
! 139: }
! 140: EOF
! 141: fi
! 142: ;;
! 143: esac
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>