├── debian ├── source │ ├── format │ └── options ├── patches │ └── series ├── watch ├── control ├── copyright ├── rules └── changelog ├── macICKeys.h ├── configure.in ├── macICGlue.v ├── cmulocal ├── init_automake.m4 ├── find-func.m4 ├── find-func-no-libs.m4 ├── c-fpic.m4 ├── c-attribute.m4 ├── pthreads.m4 ├── nana.m4 ├── bsd_sockets.m4 ├── libtoolhack.m4 ├── com_err.m4 ├── db.m4 ├── libwrap.m4 ├── COPYING ├── ucdsnmp.m4 ├── openssl.m4 ├── common.m4 ├── agentx.m4 ├── cyrus.m4 ├── find-func-no-libs2.m4 ├── util.m4 ├── sasl.m4 ├── libloguse.m4 ├── librestrict.m4 ├── ipv6.m4 ├── mips-abi.m4 ├── README.andrew ├── libpcap.m4 ├── libXau.m4 ├── arx.m4 ├── libssl.m4 ├── com_err_link.m4 ├── kafs.m4 ├── libcyrus.m4 ├── nadine.m4 ├── kerberos_v5.m4 ├── libnet.m4 ├── heimdal.m4 ├── telnet.m4 ├── tcl.m4 └── berkdb.m4 ├── Changes ├── README.md ├── flake.lock ├── mkinstalldirs ├── Makefile.am ├── flake.nix ├── version.h ├── xmalloc.h ├── common.h ├── xmalloc.c ├── md5.h ├── part.h ├── magic.c ├── unixpk.man ├── strcasecmp.c ├── unixunpk.c ├── macICTypes.h ├── getopt.c ├── unixunpk.man ├── macnfile.c ├── codes.c ├── macmpack.h ├── README.mac ├── macICAPI.h ├── install-sh ├── missing └── macndlog.c /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- 1 | 01-legacy.patch 2 | -------------------------------------------------------------------------------- /debian/source/options: -------------------------------------------------------------------------------- 1 | compression = "bzip2" 2 | compression-level = 9 3 | -------------------------------------------------------------------------------- /macICKeys.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/league/mpack/HEAD/macICKeys.h -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=2 2 | ftp://ftp.andrew.cmu.edu/pub/mpack/mpack-([0-9.]+).tar.gz 3 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | AC_INIT(common.h) 2 | AM_INIT_AUTOMAKE(mpack,1.6) 3 | AC_PROG_CC 4 | 5 | CMU_SOCKETS 6 | 7 | AC_CHECK_FUNCS([strchr]) 8 | AC_REPLACE_FUNCS([strcasecmp getopt]) 9 | 10 | AC_OUTPUT([Makefile]) 11 | -------------------------------------------------------------------------------- /macICGlue.v: -------------------------------------------------------------------------------- 1 | ICCStart 2 | ICCStop 3 | ICStart 4 | ICStop 5 | ICFindConfigFile 6 | ICSpecifyConfigFile 7 | ICGetSeed 8 | ICBegin 9 | ICGetPref 10 | ICSetPref 11 | ICCountPref 12 | ICGetIndPref 13 | ICDeletePref 14 | ICEnd 15 | ICDefaultFileName 16 | ICGetComponentInstance 17 | -------------------------------------------------------------------------------- /cmulocal/init_automake.m4: -------------------------------------------------------------------------------- 1 | dnl init_automake.m4--cmulocal automake setup macro 2 | dnl Rob Earhart 3 | dnl $Id: init_automake.m4,v 1.3 2002/05/25 19:57:42 leg Exp $ 4 | 5 | AC_DEFUN(CMU_INIT_AUTOMAKE, [ 6 | AC_REQUIRE([AM_INIT_AUTOMAKE]) 7 | ACLOCAL="$ACLOCAL -I \$(top_srcdir)/cmulocal" 8 | ]) 9 | -------------------------------------------------------------------------------- /cmulocal/find-func.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: find-func.m4,v 1.1 2001/04/04 17:58:30 shadow Exp $ 2 | dnl 3 | dnl AC_FIND_FUNC(func, libraries, includes, arguments) 4 | AC_DEFUN(AC_FIND_FUNC, [ 5 | AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4]) 6 | if test -n "$LIB_$1"; then 7 | LIBS="$LIB_$1 $LIBS" 8 | fi 9 | ]) 10 | -------------------------------------------------------------------------------- /cmulocal/find-func-no-libs.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: find-func-no-libs.m4,v 1.1 2001/04/04 17:58:30 shadow Exp $ 2 | dnl 3 | dnl 4 | dnl Look for function in any of the specified libraries 5 | dnl 6 | 7 | dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args) 8 | AC_DEFUN(AC_FIND_FUNC_NO_LIBS, [ 9 | AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])]) 10 | -------------------------------------------------------------------------------- /Changes: -------------------------------------------------------------------------------- 1 | 1.6 -- Jul 21 2003 2 | Use automake and a little bit of autoconf 3 | 4 | convert K&R declarations/definitions to ANSI 5 | 6 | Fixed buffer overflow in getParam and getDispositionFilename (debian patch) 7 | Fixed possible crash in ParseContent (debian patch) 8 | 9 | fix typo in getDispositionFilename (from Steve Friedl) 10 | 11 | use system strcasecmp and getopt where possible. 12 | 13 | use O_EXCL where available when creating files. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Customized version of `munpack` 3 | 4 | When the attachment's suggested filename has spaces or other 5 | undesirable characters, munpack replaces them with `'X'`. 6 | `ThisXisXugly`, and I'd prefer to let the user specify a replacement 7 | character. Here is a patch that adds an option `[-r character]` so 8 | that `munpack -r-` would produce `This-is-better`. The default is 9 | still `'X'`, so as not to disrupt any expectations. The manual page 10 | and usage string have been updated accordingly. 11 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1650647313, 6 | "narHash": "sha256-6ghnNPXDlG6/tXeIFdbP0cGnik6TGNwc615hhG9dpl4=", 7 | "path": "/nix/store/q3cwqz88h0lgcczcqny9rgzsj6dff6lk-source", 8 | "rev": "a318a09a96a38382fe61a7f85d03ea6e25c46c56", 9 | "type": "path" 10 | }, 11 | "original": { 12 | "id": "nixpkgs", 13 | "type": "indirect" 14 | } 15 | }, 16 | "root": { 17 | "inputs": { 18 | "nixpkgs": "nixpkgs" 19 | } 20 | } 21 | }, 22 | "root": "root", 23 | "version": 7 24 | } 25 | -------------------------------------------------------------------------------- /cmulocal/c-fpic.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl $Id: c-fpic.m4,v 1.1 2003/06/13 15:08:41 rjs3 Exp $ 3 | dnl 4 | 5 | dnl 6 | dnl Test for -fPIC 7 | dnl 8 | 9 | AC_DEFUN(CMU_C_FPIC, [ 10 | AC_MSG_CHECKING(if compiler supports -fPIC) 11 | AC_CACHE_VAL(ac_cv_fpic, [ 12 | save_CFLAGS=$CFLAGS 13 | CFLAGS="${CFLAGS} -fPIC" 14 | AC_TRY_COMPILE([ 15 | #include 16 | ], 17 | [ 18 | static void 19 | foo(void) 20 | { 21 | exit(1); 22 | } 23 | ], 24 | ac_cv_fpic=yes, 25 | ac_cv_fpic=no) 26 | CFLAGS=$save_CFLAGS 27 | ]) 28 | if test "$ac_cv_fpic" = "yes"; then 29 | FPIC_CFLAGS="-fPIC" 30 | else 31 | FPIC_CFLAGS="" 32 | fi 33 | AC_MSG_RESULT($ac_cv_fpic) 34 | ]) 35 | 36 | -------------------------------------------------------------------------------- /cmulocal/c-attribute.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl $Id: c-attribute.m4,v 1.2 2000/02/23 06:49:00 leg Exp $ 3 | dnl 4 | 5 | dnl 6 | dnl Test for __attribute__ 7 | dnl 8 | 9 | AC_DEFUN(CMU_C___ATTRIBUTE__, [ 10 | AC_MSG_CHECKING(for __attribute__) 11 | AC_CACHE_VAL(ac_cv___attribute__, [ 12 | AC_TRY_COMPILE([ 13 | #include 14 | ], 15 | [ 16 | static void foo(void) __attribute__ ((noreturn)); 17 | 18 | static void 19 | foo(void) 20 | { 21 | exit(1); 22 | } 23 | ], 24 | ac_cv___attribute__=yes, 25 | ac_cv___attribute__=no)]) 26 | if test "$ac_cv___attribute__" = "yes"; then 27 | AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) 28 | fi 29 | AC_MSG_RESULT($ac_cv___attribute__) 30 | ]) 31 | 32 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: mpack 2 | Section: mail 3 | Priority: optional 4 | Maintainer: Anibal Monsalve Salazar 5 | Standards-Version: 3.9.2 6 | Homepage: ftp://ftp.andrew.cmu.edu/pub/mpack/ 7 | 8 | Package: mpack 9 | Architecture: any 10 | Depends: ${shlibs:Depends}, ${misc:Depends} 11 | Suggests: mail-transport-agent, inews 12 | Description: tools for encoding/decoding MIME messages 13 | Mpack and munpack are utilities for encoding and decoding 14 | (respectively) binary files in MIME (Multipurpose Internet 15 | Mail Extensions) format mail messages. For compatibility 16 | with older forms of transferring binary files, the munpack 17 | program can also decode messages in split-uuencoded format. 18 | -------------------------------------------------------------------------------- /cmulocal/pthreads.m4: -------------------------------------------------------------------------------- 1 | dnl pthreads.m4--pthreads setup macro 2 | dnl Rob Earhart 3 | dnl $Id: pthreads.m4,v 1.10 2002/05/25 19:57:42 leg Exp $ 4 | 5 | AC_DEFUN(CMU_PTHREADS, [ 6 | AC_REQUIRE([AC_CANONICAL_HOST]) 7 | cmu_save_LIBS="$LIBS" 8 | AC_CHECK_LIB(pthread, pthread_create,LIB_PTHREAD="-lpthread", 9 | AC_CHECK_LIB(c_r, pthread_create,LIB_PTHREAD="-lc_r", 10 | AC_ERROR([Can't compile without pthreads]))) 11 | LIBS="$cmu_save_LIBS" 12 | AC_SUBST(LIB_PTHREAD) 13 | AC_DEFINE(_REENTRANT) 14 | case "$host_os" in 15 | solaris2*) 16 | AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) 17 | AC_DEFINE(__EXTENSIONS__) 18 | ;; 19 | irix6*) 20 | AC_DEFINE(_SGI_REENTRANT_FUNCTIONS) 21 | ;; 22 | esac 23 | ]) 24 | -------------------------------------------------------------------------------- /cmulocal/nana.m4: -------------------------------------------------------------------------------- 1 | dnl nana.m4--nana macro 2 | dnl Rob Earhart 3 | dnl $Id: nana.m4,v 1.4 2002/08/15 22:24:02 ken3 Exp $ 4 | 5 | AC_DEFUN(CMU_NANA, [ 6 | AC_REQUIRE([AC_PROG_CC]) 7 | AC_ARG_WITH(nana, [[ --with-nana use NANA [yes] ]],,with_nana=yes) 8 | if test "$GCC" != yes; then 9 | with_nana=no 10 | elif test "$with_nana" = yes; then 11 | AC_CHECK_PROGS(NANA, nana, :) 12 | if test "$NANA" = ":"; then 13 | with_nana=no 14 | else 15 | AC_CHECK_HEADER(nana.h, 16 | AC_CHECK_LIB(nana, nana_error,,with_nana=no), 17 | with_nana=no) 18 | fi 19 | else 20 | with_nana=no 21 | fi 22 | AC_MSG_CHECKING([whether to use NANA]) 23 | AC_MSG_RESULT($with_nana) 24 | if test "$with_nana" != yes; then 25 | AC_DEFINE(WITHOUT_NANA) 26 | fi 27 | ]) 28 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /cmulocal/bsd_sockets.m4: -------------------------------------------------------------------------------- 1 | dnl bsd_sockets.m4--which socket libraries do we need? 2 | dnl Derrick Brashear 3 | dnl from Zephyr 4 | dnl $Id: bsd_sockets.m4,v 1.8 2002/05/25 19:57:41 leg Exp $ 5 | 6 | dnl Hacked on by Rob Earhart to not just toss stuff in LIBS 7 | dnl It now puts everything required for sockets into LIB_SOCKET 8 | 9 | AC_DEFUN(CMU_SOCKETS, [ 10 | save_LIBS="$LIBS" 11 | LIB_SOCKET="" 12 | AC_CHECK_FUNC(connect, :, 13 | AC_CHECK_LIB(nsl, gethostbyname, 14 | LIB_SOCKET="-lnsl $LIB_SOCKET") 15 | AC_CHECK_LIB(socket, connect, 16 | LIB_SOCKET="-lsocket $LIB_SOCKET") 17 | ) 18 | LIBS="$LIB_SOCKET $save_LIBS" 19 | AC_CHECK_FUNC(res_search, :, 20 | AC_CHECK_LIB(resolv, res_search, 21 | LIB_SOCKET="-lresolv $LIB_SOCKET") 22 | ) 23 | LIBS="$LIB_SOCKET $save_LIBS" 24 | AC_CHECK_FUNCS(dn_expand dns_lookup) 25 | LIBS="$save_LIBS" 26 | AC_SUBST(LIB_SOCKET) 27 | ]) 28 | -------------------------------------------------------------------------------- /cmulocal/libtoolhack.m4: -------------------------------------------------------------------------------- 1 | dnl libtoolhack.m4--hack to make libtool behave better 2 | dnl Rob Earhart 3 | dnl $Id: libtoolhack.m4,v 1.3 2002/05/25 19:57:42 leg Exp $ 4 | 5 | dnl Libtool tries to compile an empty file to see whether it can build 6 | dnl shared libraries, and treats *any* warning as a problem. 7 | dnl Solaris's and HP's cc complains about the empty file. So we hack 8 | dnl the CFLAGS to make cc not complain. 9 | 10 | AC_DEFUN(CMU_PROG_LIBTOOL, [ 11 | AC_REQUIRE([AC_PROG_CC]) 12 | if test "$ac_cv_prog_gcc" = no; then 13 | case "$host_os" in 14 | solaris2*) 15 | save_cflags="${CFLAGS}" 16 | CFLAGS="-erroff=E_EMPTY_TRANSLATION_UNIT ${CFLAGS}" 17 | ;; 18 | hpux*) 19 | save_cflags="${CFLAGS}" 20 | CFLAGS="-w" 21 | ;; 22 | esac 23 | fi 24 | 25 | AM_PROG_LIBTOOL 26 | 27 | if test "$ac_cv_prog_gcc" = no; then 28 | case "$host_os" in 29 | solaris2*|hpux*) 30 | CFLAGS="${save_cflags}" 31 | esac 32 | fi 33 | ]) 34 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | ACLOCAL=aclocal -I $(srcdir)/cmulocal 3 | 4 | bin_PROGRAMS=mpack munpack 5 | 6 | mpack_SOURCES=unixpk.c encode.c codes.c magic.c unixos.c xmalloc.c \ 7 | md5c.c 8 | mpack_LDADD=@LIBOBJS@ @LIB_SOCKET@ 9 | 10 | munpack_SOURCES=unixunpk.c decode.c uudecode.c codes.c unixos.c \ 11 | part.c xmalloc.c md5c.c 12 | 13 | munpack_LDADD=@LIBOBJS@ @LIB_SOCKET@ 14 | 15 | noinst_HEADERS=common.h md5.h part.h version.h xmalloc.h 16 | man_MANS=mpack.1 munpack.1 17 | 18 | BUILT_SOURCES=mpack.1 munpack.1 19 | 20 | mpack.1: unixpk.man 21 | cp $? $@ 22 | munpack.1: unixunpk.man 23 | cp $? $@ 24 | 25 | EXTRA_DIST=README.mac macICKeys.h macmpack.c macndlog.c macntcp.c \ 26 | macproj.hqx README.unix macICTypes.h macmpack.h macnfile.c macnte.c \ 27 | macrsrc.hqx macICAPI.h macbhex.c macnapp.c macninit.c macos.c \ 28 | mkreadme.pl macICGlue.v macfile.c macnapp.h macnsmtp.c macpcstr.c \ 29 | unixpk.man unixunpk.man cmulocal Changes 30 | 31 | -------------------------------------------------------------------------------- /cmulocal/com_err.m4: -------------------------------------------------------------------------------- 1 | dnl com_err.m4--com_err detection macro 2 | dnl Rob Earhart 3 | dnl $Id: com_err.m4,v 1.5 2002/05/25 19:57:41 leg Exp $ 4 | 5 | AC_DEFUN(CMU_COMERR, [ 6 | cmu_need_compile_et=no 7 | AC_CHECK_PROGS(COMPILE_ET, compile_et, no) 8 | if test "$COMPILE_ET" = no; then 9 | COMPILE_ET="\$(top_builddir)/com_err/compile_et" 10 | cmu_need_to_compile_com_err=yes 11 | fi 12 | AC_CHECK_HEADER(com_err.h,,CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/com_err") 13 | cmu_save_LIBS="$LIBS" 14 | AC_CHECK_LIB(com_err, com_err, 15 | LIB_COMERR="-lcom_err", 16 | LDFLAGS="$LDFLAGS -L`pwd`/com_err" 17 | LIB_COMERR="\$(top_builddir)/com_err/libcom_err.la" 18 | cmu_need_to_compile_com_err=yes) 19 | AC_SUBST(LIB_COMERR) 20 | LIBS="$cmu_save_LIBS" 21 | AC_MSG_CHECKING(whether we need to compile com_err) 22 | if test "$cmu_need_to_compile_com_err" = yes; then 23 | AC_MSG_RESULT(yes) 24 | AC_CONFIG_SUBDIRS(com_err) 25 | else 26 | AC_MSG_RESULT(no) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /cmulocal/db.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: db.m4,v 1.1 2001/04/04 17:58:30 shadow Exp $ 2 | dnl 3 | dnl tests for various db libraries 4 | dnl 5 | AC_DEFUN([rk_DB],[berkeley_db=db 6 | AC_ARG_WITH(berkeley-db, 7 | [ --without-berkeley-db if you don't want berkeley db],[ 8 | if test "$withval" = no; then 9 | berkeley_db="" 10 | fi 11 | ]) 12 | if test "$berkeley_db"; then 13 | AC_CHECK_HEADERS([ \ 14 | db.h \ 15 | db_185.h \ 16 | ]) 17 | fi 18 | 19 | AC_FIND_FUNC_NO_LIBS2(dbopen, $berkeley_db, [ 20 | #include 21 | #if defined(HAVE_DB_185_H) 22 | #include 23 | #elif defined(HAVE_DB_H) 24 | #include 25 | #endif 26 | ],[NULL, 0, 0, 0, NULL]) 27 | 28 | AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm) 29 | AC_FIND_FUNC_NO_LIBS(db_create, $berkeley_db) 30 | 31 | DBLIB="$LIB_dbopen" 32 | if test "$LIB_dbopen" != "$LIB_db_create"; then 33 | DBLIB="$DBLIB $LIB_db_create" 34 | fi 35 | if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then 36 | DBLIB="$DBLIB $LIB_dbm_firstkey" 37 | fi 38 | AC_SUBST(DBLIB)dnl 39 | 40 | ]) 41 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Utilities for encoding and decoding binary files in MIME"; 3 | 4 | outputs = { self, nixpkgs, ... }: 5 | let 6 | eachSystem = nixpkgs.lib.genAttrs [ 7 | "x86_64-linux" 8 | "x86_64-darwin" 9 | "aarch64-darwin" 10 | ]; 11 | in { 12 | overlays.mpack-replacement-char = final: _prev: { 13 | mpack = final.stdenv.mkDerivation { 14 | pname = "mpack"; 15 | version = "1.6"; 16 | src = ./.; 17 | buildInputs = with final; [ autoconf automake ]; 18 | preConfigure = "autoreconf -i -I cmulocal"; 19 | }; 20 | }; 21 | 22 | packages = eachSystem (system: { 23 | mpack = (import nixpkgs { 24 | inherit system; 25 | overlays = [ self.overlays.mpack-replacement-char ]; 26 | }).mpack; 27 | }); 28 | 29 | apps = eachSystem (system: { 30 | munpack.type = "app"; 31 | munpack.program = "${self.packages.${system}.mpack}/bin/munpack"; 32 | }); 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /cmulocal/libwrap.m4: -------------------------------------------------------------------------------- 1 | dnl libwrap.m4 --- do we have libwrap, the access control library? 2 | dnl $Id: libwrap.m4,v 1.6 2002/08/21 15:03:19 rjs3 Exp $ 3 | 4 | AC_DEFUN(CMU_LIBWRAP, [ 5 | AC_REQUIRE([CMU_SOCKETS]) 6 | AC_ARG_WITH(libwrap, 7 | [ --with-libwrap=DIR use libwrap (rooted in DIR) [yes] ], 8 | with_libwrap=$withval, with_libwrap=yes) 9 | if test "$with_libwrap" != no; then 10 | if test -d "$with_libwrap"; then 11 | CPPFLAGS="$CPPFLAGS -I${with_libwrap}/include" 12 | LDFLAGS="$LDFLAGS -L${with_libwrap}/lib" 13 | fi 14 | cmu_save_LIBS="$LIBS" 15 | AC_CHECK_LIB(wrap, request_init, [ 16 | AC_CHECK_HEADER(tcpd.h,, with_libwrap=no)], 17 | with_libwrap=no, ${LIB_SOCKET}) 18 | LIBS="$cmu_save_LIBS" 19 | fi 20 | AC_MSG_CHECKING(libwrap support) 21 | AC_MSG_RESULT($with_libwrap) 22 | LIB_WRAP="" 23 | if test "$with_libwrap" != no; then 24 | AC_DEFINE(HAVE_LIBWRAP) 25 | LIB_WRAP="-lwrap" 26 | AC_CHECK_LIB(nsl, yp_get_default_domain, LIB_WRAP="${LIB_WRAP} -lnsl") 27 | fi 28 | AC_SUBST(LIB_WRAP) 29 | ]) 30 | -------------------------------------------------------------------------------- /cmulocal/COPYING: -------------------------------------------------------------------------------- 1 | Copyright 1998 by Carnegie Mellon University 2 | 3 | All Rights Reserved 4 | 5 | Permission to use, copy, modify, and distribute this software and its 6 | documentation for any purpose and without fee is hereby granted, 7 | provided that the above copyright notice appear in all copies and that 8 | both that copyright notice and this permission notice appear in 9 | supporting documentation, and that the name of Carnegie Mellon University 10 | not be used in advertising or publicity pertaining to distribution of the 11 | software without specific, written prior permission. 12 | 13 | CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 14 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, 15 | IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY SPECIAL, 16 | INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 17 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 18 | OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 19 | PERFORMANCE OF THIS SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /cmulocal/ucdsnmp.m4: -------------------------------------------------------------------------------- 1 | dnl look for the ucdsnmp libraries 2 | dnl $Id: ucdsnmp.m4,v 1.5 2002/08/21 15:03:19 rjs3 Exp $ 3 | 4 | AC_DEFUN(CMU_UCDSNMP, [ 5 | AC_REQUIRE([CMU_SOCKETS]) 6 | AC_ARG_WITH(ucdsnmp, 7 | [ --with-ucdsnmp=DIR use ucd snmp (rooted in DIR) [yes] ], 8 | with_ucdsnmp=$withval, with_ucdsnmp=yes) 9 | if test "$with_ucdsnmp" != no; then 10 | if test -d "$with_ucdsnmp"; then 11 | CPPFLAGS="$CPPFLAGS -I${with_ucdsnmp}/include" 12 | LDFLAGS="$LDFLAGS -L${with_ucdsnmp}/lib" 13 | fi 14 | cmu_save_LIBS="$LIBS" 15 | AC_CHECK_LIB(snmp, sprint_objid, [ 16 | AC_CHECK_HEADER(ucd-snmp/version.h,, with_ucdsnmp=no)], 17 | with_ucdsnmp=no, ${LIB_SOCKET}) 18 | LIBS="$cmu_save_LIBS" 19 | fi 20 | AC_MSG_CHECKING(UCD SNMP libraries) 21 | AC_MSG_RESULT($with_ucdsnmp) 22 | LIB_UCDSNMP="" 23 | if test "$with_ucdsnmp" != no; then 24 | AC_DEFINE(HAVE_UCDSNMP) 25 | LIB_UCDSNMP="-lucdagent -lucdmibs -lsnmp" 26 | AC_CHECK_LIB(rpm, rpmdbOpen, 27 | LIB_UCDSNMP="${LIB_UCDSNMP} -lrpm -lpopt",,-lpopt) 28 | fi 29 | AC_SUBST(LIB_UCDSNMP) 30 | ]) 31 | -------------------------------------------------------------------------------- /cmulocal/openssl.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl macros for configure.in to detect openssl 3 | dnl $Id: openssl.m4,v 1.6 2003/02/13 16:55:54 rjs3 Exp $ 4 | dnl 5 | 6 | AC_DEFUN(CMU_HAVE_OPENSSL, [ 7 | AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH], 8 | with_openssl=$withval, with_openssl="yes") 9 | 10 | save_CPPFLAGS=$CPPFLAGS 11 | save_LDFLAGS=$LDFLAGS 12 | 13 | if test -d $with_openssl; then 14 | CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include" 15 | LDFLAGS="${LDFLAGS} -L${with_openssl}/lib" 16 | fi 17 | 18 | case "$with_openssl" in 19 | no) 20 | with_openssl="no";; 21 | *) 22 | dnl if openssl has been compiled with the rsaref2 libraries, 23 | dnl we need to include the rsaref libraries in the crypto check 24 | LIB_RSAREF="" 25 | AC_CHECK_LIB(rsaref, RSAPublicEncrypt, 26 | LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes, 27 | cmu_have_rsaref=no) 28 | 29 | AC_CHECK_HEADER(openssl/evp.h, [ 30 | AC_CHECK_LIB(crypto, EVP_DigestInit, 31 | with_openssl="yes", 32 | with_openssl="no", $LIB_RSAREF)], 33 | with_openssl=no) 34 | ;; 35 | esac 36 | 37 | if test "$with_openssl" != "no"; then 38 | AC_DEFINE(HAVE_OPENSSL) 39 | else 40 | CPPFLAGS=$save_CPPFLAGS 41 | LDFLAGS=$save_LDFLAGS 42 | fi 43 | ]) -------------------------------------------------------------------------------- /cmulocal/common.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: common.m4,v 1.10 2002/08/15 00:11:10 cg2v Exp $ 2 | 3 | AC_DEFUN(CMU_TEST_LIBPATH, [ 4 | changequote(<<, >>) 5 | define(<>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>)) 6 | changequote([, ]) 7 | if test "$CMU_AC_CV_FOUND" = "yes"; then 8 | if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl"; then 9 | CMU_AC_CV_FOUND=no 10 | fi 11 | fi 12 | ]) 13 | 14 | AC_DEFUN(CMU_TEST_INCPATH, [ 15 | changequote(<<, >>) 16 | define(<>, translit(ac_cv_found_$2_inc, [ *], [_p])) 17 | changequote([, ]) 18 | if test "$CMU_AC_CV_FOUND" = "yes"; then 19 | if test \! -r "$1/$2.h"; then 20 | CMU_AC_CV_FOUND=no 21 | fi 22 | fi 23 | ]) 24 | 25 | dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 26 | AC_DEFUN(CMU_CHECK_HEADER_NOCACHE, 27 | [dnl Do the transliteration at runtime so arg 1 can be a shell variable. 28 | ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` 29 | AC_MSG_CHECKING([for $1]) 30 | AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes", 31 | eval "ac_cv_header_$ac_safe=no") 32 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 33 | AC_MSG_RESULT(yes) 34 | ifelse([$2], , :, [$2]) 35 | else 36 | AC_MSG_RESULT(no) 37 | ifelse([$3], , , [$3 38 | ])dnl 39 | fi 40 | ]) 41 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | #define MPACK_VERSION "1.6" 26 | -------------------------------------------------------------------------------- /xmalloc.h: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | extern char *xmalloc(int size); 26 | extern char *xrealloc(char *ptr, int size); 27 | extern char *strsave(char *str); 28 | -------------------------------------------------------------------------------- /cmulocal/agentx.m4: -------------------------------------------------------------------------------- 1 | dnl agentx.m4--detect agentx libraries 2 | dnl copied from x-unixrc 3 | dnl Tim Martin 4 | dnl $Id: agentx.m4,v 1.4 2002/05/25 19:57:41 leg Exp $ 5 | 6 | AC_DEFUN(CMU_AGENTX, [ 7 | 8 | dnl 9 | dnl CMU AgentX 10 | dnl 11 | AC_MSG_CHECKING([for AgentX]) 12 | AC_ARG_WITH(agentx, [ --with-agentx CMU AgentX libraries located in (val)], AGENTX_DIR="$withval", AGENTX_DIR=no) 13 | 14 | found_agentx="no" 15 | 16 | if test "${AGENTX_DIR}" != "no" && 17 | test -f $AGENTX_DIR/lib${ABILIBDIR}/libagentx.a && 18 | test -f $AGENTX_DIR/include/agentx.h; then 19 | AGENTX_DIR="$AGENTX_DIR" 20 | found_agentx="yes" 21 | elif test -d /usr/local && 22 | test -f /usr/local/lib${ABILIBDIR}/libagentx.a && 23 | test -f /usr/local/include/agentx.h; then 24 | AGENTX_DIR="/usr/local" 25 | found_agentx="yes" 26 | 27 | elif test -d /usr/ng && 28 | test -f /usr/ng/lib${ABILIBDIR}/libagentx.a && 29 | test -f /usr/ng/include/agentx.h; then 30 | AGENTX_DIR="/usr/ng" 31 | found_agentx="yes" 32 | fi 33 | 34 | if test "$found_agentx" = "no"; then 35 | AC_MSG_WARN([Could not locate AgentX Libraries! http://www.net.cmu.edu/groups/netdev/agentx/]) 36 | else 37 | LIB_AGENTX="-L$AGENTX_DIR/lib${ABILIBDIR} -lagentx" 38 | AC_SUBST(LIB_AGENTX) 39 | AGENTXFLAGS="-I$AGENTX_DIR/include" 40 | AC_SUBST(AGENTXFLAGS) 41 | AC_MSG_RESULT([found $AGENTX_DIR/lib${ABILIBDIR}/libagentx.a]) 42 | fi 43 | 44 | 45 | 46 | ]) 47 | -------------------------------------------------------------------------------- /cmulocal/cyrus.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Additional macros for configure.in packaged up for easier theft. 3 | dnl $Id: cyrus.m4,v 1.3 2002/05/25 19:57:42 leg Exp $ 4 | dnl tjs@andrew.cmu.edu 6-may-1998 5 | dnl 6 | 7 | dnl It would be good if ANDREW_ADD_LIBPATH could detect if something was 8 | dnl already there and not redundantly add it if it is. 9 | 10 | dnl add -L(arg), and possibly (runpath switch)(arg), to LDFLAGS 11 | dnl (so the runpath for shared libraries is set). 12 | AC_DEFUN(CMU_ADD_LIBPATH, [ 13 | # this is CMU ADD LIBPATH 14 | if test "$andrew_runpath_switch" = "none" ; then 15 | LDFLAGS="-L$1 ${LDFLAGS}" 16 | else 17 | LDFLAGS="-L$1 $andrew_runpath_switch$1 ${LDFLAGS}" 18 | fi 19 | ]) 20 | 21 | dnl add -L(1st arg), and possibly (runpath switch)(1st arg), to (2nd arg) 22 | dnl (so the runpath for shared libraries is set). 23 | AC_DEFUN(CMU_ADD_LIBPATH_TO, [ 24 | # this is CMU ADD LIBPATH TO 25 | if test "$andrew_runpath_switch" = "none" ; then 26 | $2="-L$1 ${$2}" 27 | else 28 | $2="-L$1 ${$2} $andrew_runpath_switch$1" 29 | fi 30 | ]) 31 | 32 | dnl runpath initialization 33 | AC_DEFUN(CMU_GUESS_RUNPATH_SWITCH, [ 34 | # CMU GUESS RUNPATH SWITCH 35 | AC_CACHE_CHECK(for runpath switch, andrew_runpath_switch, [ 36 | # first, try -R 37 | SAVE_LDFLAGS="${LDFLAGS}" 38 | LDFLAGS="-R /usr/lib" 39 | AC_TRY_LINK([],[],[andrew_runpath_switch="-R"], [ 40 | LDFLAGS="-Wl,-rpath,/usr/lib" 41 | AC_TRY_LINK([],[],[andrew_runpath_switch="-Wl,-rpath,"], 42 | [andrew_runpath_switch="none"]) 43 | ]) 44 | LDFLAGS="${SAVE_LDFLAGS}" 45 | ])]) 46 | -------------------------------------------------------------------------------- /cmulocal/find-func-no-libs2.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: find-func-no-libs2.m4,v 1.1 2001/04/04 17:58:30 shadow Exp $ 2 | dnl 3 | dnl 4 | dnl Look for function in any of the specified libraries 5 | dnl 6 | 7 | dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args) 8 | AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [ 9 | 10 | AC_MSG_CHECKING([for $1]) 11 | AC_CACHE_VAL(ac_cv_funclib_$1, 12 | [ 13 | if eval "test \"\$ac_cv_func_$1\" != yes" ; then 14 | ac_save_LIBS="$LIBS" 15 | for ac_lib in $2; do 16 | if test -n "$ac_lib"; then 17 | ac_lib="-l$ac_lib" 18 | else 19 | ac_lib="" 20 | fi 21 | LIBS="$6 $ac_lib $5 $ac_save_LIBS" 22 | AC_TRY_LINK([$3],[$1($4)],eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break) 23 | done 24 | eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}" 25 | LIBS="$ac_save_LIBS" 26 | fi 27 | ]) 28 | 29 | eval "ac_res=\$ac_cv_funclib_$1" 30 | 31 | if false; then 32 | AC_CHECK_FUNCS($1) 33 | dnl AC_CHECK_LIBS($2, foo) 34 | fi 35 | # $1 36 | ac_tr_func=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` 37 | ac_tr_lib=HAVE_LIB_`echo $ac_res |sed 's/-l//' | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` 38 | eval "LIB_$1=$ac_res" 39 | 40 | case "$ac_res" in 41 | yes) 42 | eval "ac_cv_func_$1=yes" 43 | eval "LIB_$1=" 44 | AC_DEFINE_UNQUOTED($ac_tr_func) 45 | AC_MSG_RESULT([yes]) 46 | ;; 47 | no) 48 | eval "ac_cv_func_$1=no" 49 | eval "LIB_$1=" 50 | AC_MSG_RESULT([no]) 51 | ;; 52 | *) 53 | eval "ac_cv_func_$1=yes" 54 | eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes" 55 | AC_DEFINE_UNQUOTED($ac_tr_func) 56 | AC_DEFINE_UNQUOTED($ac_tr_lib) 57 | AC_MSG_RESULT([yes, in $ac_res]) 58 | ;; 59 | esac 60 | AC_SUBST(LIB_$1) 61 | ]) 62 | -------------------------------------------------------------------------------- /common.h: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifdef __riscos 27 | #define TEMPFILENAME "TempDesc" 28 | #else 29 | #define TEMPFILENAME "tempdesc.txt" 30 | #endif 31 | 32 | #if defined(unix) && !defined(remove) 33 | #define remove unlink 34 | #endif 35 | 36 | typedef char **params; 37 | 38 | /* Flags for os_newtypedfile */ 39 | #define FILE_BINARY 0x1 /* File should be opened in binary mode */ 40 | #define FILE_INAPPLEDOUBLE 0x2 /* File was inside multipart/appledouble */ 41 | 42 | 43 | #ifndef HAVE_STRCHR 44 | #define strchr index 45 | #define strrchr rindex 46 | #endif 47 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This is the Debian GNU/Linux prepackaged version of mpack and munpack, 2 | utilities for encoding and decoding binary files in MIME format 3 | messages. 4 | 5 | This version of the package was made by Richard Braakman 6 | , from the source archive 7 | 8 | ftp://ftp.andrew.cmu.edu/pub/mpack/mpack-1.6.tar.gz 9 | 10 | Earlier versions were maintained by Robert Leslie . 11 | 12 | Mpack is distributed under the following license: 13 | 14 | (C) Copyright 1993,1994 by Carnegie Mellon University 15 | All Rights Reserved. 16 | 17 | Permission to use, copy, modify, distribute, and sell this software 18 | and its documentation for any purpose is hereby granted without fee, 19 | provided that the above copyright notice appear in all copies and that 20 | both that copyright notice and this permission notice appear in 21 | supporting documentation, and that the name of Carnegie Mellon 22 | University not be used in advertising or publicity pertaining to 23 | distribution of the software without specific, written prior 24 | permission. Carnegie Mellon University makes no representations about 25 | the suitability of this software for any purpose. It is provided "as 26 | is" without express or implied warranty. 27 | 28 | CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 29 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 30 | AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 31 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 32 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 33 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 34 | OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 35 | SOFTWARE. 36 | 37 | Portions of this software are derived from code written by Bell 38 | Communications Research, Inc. (Bellcore) and by RSA Data Security, 39 | Inc. and bear similar copyrights and disclaimers of warranty. 40 | 41 | -------------------------------------------------------------------------------- /xmalloc.c: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | #include 26 | #include 27 | #include 28 | 29 | char *xmalloc (int size) 30 | { 31 | char *ret; 32 | 33 | if ((ret = malloc((unsigned) size))) 34 | return ret; 35 | 36 | fprintf(stderr, "Memory exhausted\n"); 37 | exit(1); 38 | } 39 | 40 | 41 | char *xrealloc (char *ptr, int size) 42 | { 43 | char *ret; 44 | 45 | /* xrealloc (NULL, size) behaves like xmalloc (size), as in ANSI C */ 46 | if ((ret = !ptr ? malloc ((unsigned) size) : realloc (ptr, (unsigned) size))) 47 | return ret; 48 | 49 | fprintf(stderr, "Memory exhausted\n"); 50 | exit(1); 51 | } 52 | 53 | char *strsave(char *str) 54 | { 55 | char *p = xmalloc(strlen(str)+1); 56 | strcpy(p, str); 57 | return p; 58 | } 59 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | DEBDIR = debian/tmp/DEBIAN 4 | BINDIR = debian/tmp/usr/bin 5 | MANDIR = debian/tmp/usr/share/man 6 | DOCDIR = debian/tmp/usr/share/doc/mpack 7 | 8 | ifeq (,$(findstring noopt,${DEB_BUILD_OPTIONS})) 9 | OPT = -O2 10 | endif 11 | #ifeq (,$(findstring nostrip,${DEB_BUILD_OPTIONS})) 12 | # STRIP = -s 13 | #endif 14 | 15 | STRIP = strip --remove-section=.comment --remove-section=.note 16 | 17 | export DEB_HOST ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 18 | export DEB_BUILD ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 19 | 20 | build: build-arch build-indep 21 | build-arch: build-stamp 22 | build-indep: build-stamp 23 | build-stamp: 24 | test -f debian/rules 25 | ./configure --prefix=/usr --build ${DEB_BUILD} --host ${DEB_BUILD} 26 | make CFLAGS="${OPT} -g -Wall" 27 | touch build 28 | 29 | clean: 30 | test -f debian/rules 31 | -rm -f build 32 | [ ! -f Makefile ] || $(MAKE) clean 33 | -rm -f debian/*~ core 34 | -rm -f config.log config.cache config.status Makefile 35 | -rm -f mpack.1 munpack.1 36 | -rm -rf debian/tmp debian/files* debian/substvars 37 | 38 | binary-indep: 39 | 40 | binary-arch: build 41 | test root = "`whoami`" 42 | test -f debian/rules 43 | -rm -rf debian/tmp 44 | # programs 45 | install -d ${BINDIR} 46 | # install ${STRIP} -m 755 mpack ${BINDIR} 47 | # install ${STRIP} -m 755 munpack ${BINDIR} 48 | ${STRIP} mpack 49 | ${STRIP} munpack 50 | install -m 755 mpack ${BINDIR} 51 | install -m 755 munpack ${BINDIR} 52 | # manpages 53 | install -d ${MANDIR}/man1 54 | install -p -m 644 unixpk.man ${MANDIR}/man1/mpack.1 55 | install -p -m 644 unixunpk.man ${MANDIR}/man1/munpack.1 56 | gzip -9 ${MANDIR}/man1/*.1 57 | # documentation 58 | install -d ${DOCDIR} 59 | install -p -m 644 README.unix ${DOCDIR} 60 | install -p -m 644 debian/changelog ${DOCDIR}/changelog.Debian 61 | gzip -9 ${DOCDIR}/* 62 | install -p -m 644 debian/copyright ${DOCDIR} 63 | # control files 64 | install -d ${DEBDIR} 65 | dpkg-shlibdeps ${BINDIR}/* 66 | dpkg-gencontrol -isp 67 | dpkg-deb -Zbzip2 -z9 --build debian/tmp .. 68 | 69 | binary: binary-indep binary-arch 70 | 71 | .PHONY: binary binary-arch binary-indep clean 72 | -------------------------------------------------------------------------------- /md5.h: -------------------------------------------------------------------------------- 1 | /* MD5.H - header file for MD5C.C 2 | */ 3 | 4 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 5 | rights reserved. 6 | 7 | License to copy and use this software is granted provided that it 8 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 9 | Algorithm" in all material mentioning or referencing this software 10 | or this function. 11 | 12 | License is also granted to make and use derivative works provided 13 | that such works are identified as "derived from the RSA Data 14 | Security, Inc. MD5 Message-Digest Algorithm" in all material 15 | mentioning or referencing the derived work. 16 | 17 | RSA Data Security, Inc. makes no representations concerning either 18 | the merchantability of this software or the suitability of this 19 | software for any particular purpose. It is provided "as is" 20 | without express or implied warranty of any kind. 21 | These notices must be retained in any copies of any part of this 22 | documentation and/or software. 23 | */ 24 | 25 | /* GLOBAL.H - RSAREF types and constants 26 | */ 27 | 28 | /* PROTOTYPES should be set to one if and only if the compiler supports 29 | function argument prototyping. 30 | The following makes PROTOTYPES default to 0 if it has not already 31 | been defined with C compiler flags. 32 | */ 33 | #ifndef PROTOTYPES 34 | #define PROTOTYPES 0 35 | #endif 36 | 37 | #include 38 | 39 | /* POINTER defines a generic pointer type */ 40 | typedef unsigned char *POINTER; 41 | 42 | /* UINT2 defines a two byte word */ 43 | typedef uint16_t UINT2; 44 | 45 | /* UINT4 defines a four byte word */ 46 | typedef uint32_t UINT4; 47 | 48 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 49 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 50 | returns an empty list. 51 | */ 52 | #if PROTOTYPES 53 | #define PROTO_LIST(list) list 54 | #else 55 | #define PROTO_LIST(list) () 56 | #endif 57 | 58 | /* MD5 context. */ 59 | typedef struct { 60 | UINT4 state[4]; /* state (ABCD) */ 61 | UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 62 | unsigned char buffer[64]; /* input buffer */ 63 | } MD5_CTX; 64 | 65 | void MD5Init PROTO_LIST ((MD5_CTX *)); 66 | void MD5Update PROTO_LIST 67 | ((MD5_CTX *, unsigned char *, unsigned int)); 68 | void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); 69 | 70 | -------------------------------------------------------------------------------- /part.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Read MIME body-part, stopping on boundaries. 3 | */ 4 | /* (C) Copyright 1994 by Carnegie Mellon University 5 | * All Rights Reserved. 6 | * 7 | * Permission to use, copy, modify, distribute, and sell this software 8 | * and its documentation for any purpose is hereby granted without 9 | * fee, provided that the above copyright notice appear in all copies 10 | * and that both that copyright notice and this permission notice 11 | * appear in supporting documentation, and that the name of Carnegie 12 | * Mellon University not be used in advertising or publicity 13 | * pertaining to distribution of the software without specific, 14 | * written prior permission. Carnegie Mellon University makes no 15 | * representations about the suitability of this software for any 16 | * purpose. It is provided "as is" without express or implied 17 | * warranty. 18 | * 19 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 20 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 21 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 22 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 23 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 24 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 25 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 26 | * SOFTWARE. 27 | */ 28 | 29 | /* Max length of a MIME "boundary", per RFC 1521 */ 30 | #define PART_MAX_BOUNDARY_LEN 70 31 | 32 | /* Structure describing an input file from which we read MIME */ 33 | struct part { 34 | /* Input file */ 35 | FILE *infile; 36 | 37 | /* Input buffer */ 38 | unsigned char *buf; 39 | int buf_alloc; 40 | unsigned char *ptr; 41 | int cnt; 42 | 43 | /* Boundary information */ 44 | char (*boundary)[PART_MAX_BOUNDARY_LEN+1]; 45 | int *boundary_length; 46 | int boundary_alloc; 47 | int boundary_num; 48 | int boundary_seen; /* Index of boundary last seen, or 49 | * boundary_num if no pending boundary 50 | */ 51 | }; 52 | 53 | #define part_getc(s) (((s)->cnt-- > 0 && (s)->ptr[0] != '\n') ? (int)*(s)->ptr++ : part_fill(s)) 54 | 55 | #define part_ungetc(c, s) ((s)->cnt++, ((s)->boundary_seen = (s)->boundary_num), (*--(s)->ptr = (c))) 56 | 57 | extern struct part *part_init(FILE *infile); 58 | extern char *part_gets(char *s, int n, struct part *part); 59 | 60 | -------------------------------------------------------------------------------- /cmulocal/util.m4: -------------------------------------------------------------------------------- 1 | dnl util.m4--robutil macro 2 | dnl Rob Earhart 3 | dnl $Id: util.m4,v 1.9 2002/05/25 19:57:43 leg Exp $ 4 | 5 | dnl robutil is a collection of stuff I (Rob Earhart) have found useful 6 | dnl to have around when writing code; it's the stuff I wind up rewriting 7 | dnl every time I start a project. This does the autoconf setup 8 | dnl necessary for it. 9 | 10 | dnl This is a helper macro, here because there're times when I 11 | dnl want to know if a type exists or not, but don't want to define 12 | dnl it to something else (the way AC_CHECK_TYPE does). 13 | 14 | AC_DEFUN(CMU_CHECK_TYPE_EXISTS, [ 15 | changequote(<<, >>) 16 | define(<>, translit(CMU_HAVE_$1, [a-z *], [A-Z_P])) 17 | define(<>, translit(cmu_cv_type_$1, [ *], [_p])) 18 | changequote([, ]) 19 | AC_REQUIRE([AC_HEADER_STDC]) 20 | AC_MSG_CHECKING(for $1) 21 | AC_CACHE_VAL(CMU_CV_NAME, [ 22 | AC_EGREP_CPP([$1[[^a-zA-Z_0-9]]], [ 23 | #include 24 | #if STDC_HEADERS 25 | #include 26 | #include 27 | #endif 28 | ], CMU_CV_NAME=yes, CMU_CV_NAME=no)]) 29 | AC_MSG_RESULT($CMU_CV_NAME) 30 | if test $CMU_CV_NAME = yes; then 31 | AC_DEFINE(CMU_TYPE_NAME) 32 | fi 33 | ]) 34 | 35 | AC_DEFUN(CMU_UTIL, [ 36 | AC_REQUIRE([AC_PROG_CC]) 37 | AC_REQUIRE([AM_PROG_CC_STDC]) 38 | AC_REQUIRE([AC_PROG_RANLIB]) 39 | AC_REQUIRE([CMU_NANA]) 40 | AC_REQUIRE([CMU_COMERR]) 41 | AC_REQUIRE([AC_HEADER_STDC]) 42 | AC_REQUIRE([AC_TYPE_MODE_T]) 43 | AC_REQUIRE([AC_C_CONST]) 44 | AC_CHECK_HEADERS(sys/sysmacros.h) 45 | AC_CHECK_HEADER(inttypes.h, AC_DEFINE(HAVE_INTTYPES_H), 46 | CMU_CHECK_TYPE_EXISTS(int8_t) 47 | CMU_CHECK_TYPE_EXISTS(uint8_t) 48 | CMU_CHECK_TYPE_EXISTS(u_int8_t) 49 | CMU_CHECK_TYPE_EXISTS(int16_t) 50 | CMU_CHECK_TYPE_EXISTS(uint16_t) 51 | CMU_CHECK_TYPE_EXISTS(u_int16_t) 52 | CMU_CHECK_TYPE_EXISTS(int32_t) 53 | CMU_CHECK_TYPE_EXISTS(uint32_t) 54 | CMU_CHECK_TYPE_EXISTS(u_int32_t) 55 | ) 56 | dnl I'm not sure why autoconf gets so annoyed when these 57 | dnl are embedded as part of the inttypes check, but, whatever, 58 | dnl this works. 59 | if test "$ac_cv_header_inttypes_h" = no; then 60 | AC_CHECK_SIZEOF(short) 61 | AC_CHECK_SIZEOF(int) 62 | AC_CHECK_SIZEOF(long) 63 | fi 64 | 65 | AC_CHECK_TYPE(ssize_t, signed) 66 | THREADED_UTIL_OBJECTS="" 67 | AC_SUBST(THREADED_UTIL_OBJECTS) 68 | ]) 69 | 70 | AC_DEFUN(CMU_THREAD_UTIL, [ 71 | AC_REQUIRE([CMU_UTIL]) 72 | THREADED_UTIL_OBJECTS="refcache.o rselock.o" 73 | ]) 74 | -------------------------------------------------------------------------------- /cmulocal/sasl.m4: -------------------------------------------------------------------------------- 1 | dnl sasl.m4--sasl libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH sasl and Arla 4 | dnl $Id: sasl.m4,v 1.21 2002/12/21 18:44:25 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_SASL_INC_WHERE1, [ 7 | saved_CPPFLAGS=$CPPFLAGS 8 | CPPFLAGS="$saved_CPPFLAGS -I$1" 9 | CMU_CHECK_HEADER_NOCACHE(sasl.h, 10 | ac_cv_found_sasl_inc=yes, 11 | ac_cv_found_sasl_inc=no) 12 | CPPFLAGS=$saved_CPPFLAGS 13 | ]) 14 | 15 | AC_DEFUN(CMU_SASL_INC_WHERE, [ 16 | for i in $1; do 17 | CMU_SASL_INC_WHERE1($i) 18 | CMU_TEST_INCPATH($i, sasl) 19 | if test "$ac_cv_found_sasl_inc" = "yes"; then 20 | ac_cv_sasl_where_inc=$i 21 | break 22 | fi 23 | done 24 | ]) 25 | 26 | AC_DEFUN(CMU_SASL_LIB_WHERE1, [ 27 | saved_LIBS=$LIBS 28 | LIBS="$saved_LIBS -L$1 -lsasl" 29 | AC_TRY_LINK(, 30 | [sasl_getprop();], 31 | [ac_cv_found_sasl_lib=yes], 32 | ac_cv_found_sasl_lib=no) 33 | LIBS=$saved_LIBS 34 | ]) 35 | 36 | AC_DEFUN(CMU_SASL_LIB_WHERE, [ 37 | for i in $1; do 38 | CMU_SASL_LIB_WHERE1($i) 39 | dnl deal with false positives from implicit link paths 40 | CMU_TEST_LIBPATH($i, sasl) 41 | if test "$ac_cv_found_sasl_lib" = "yes" ; then 42 | ac_cv_sasl_where_lib=$i 43 | break 44 | fi 45 | done 46 | ]) 47 | 48 | AC_DEFUN(CMU_SASL, [ 49 | AC_ARG_WITH(sasl, 50 | [ --with-sasl=DIR Compile with libsasl in ], 51 | with_sasl="$withval", 52 | with_sasl="yes") 53 | 54 | SASLFLAGS="" 55 | LIB_SASL="" 56 | 57 | cmu_saved_CPPFLAGS=$CPPFLAGS 58 | cmu_saved_LDFLAGS=$LDFLAGS 59 | cmu_saved_LIBS=$LIBS 60 | if test -d ${with_sasl}; then 61 | ac_cv_sasl_where_lib=${with_sasl}/lib 62 | ac_cv_sasl_where_inc=${with_sasl}/include 63 | 64 | SASLFLAGS="-I$ac_cv_sasl_where_inc" 65 | LIB_SASL="-L$ac_cv_sasl_where_lib" 66 | CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}" 67 | LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}" 68 | fi 69 | 70 | AC_CHECK_HEADER(sasl.h, 71 | AC_CHECK_LIB(sasl, sasl_getprop, 72 | ac_cv_found_sasl=yes, 73 | ac_cv_found_sasl=no), ac_cv_found_sasl=no) 74 | 75 | LIBS="$cmu_saved_LIBS" 76 | LDFLAGS="$cmu_saved_LDFLAGS" 77 | CPPFLAGS="$cmu_saved_CPPFLAGS" 78 | if test "$ac_cv_found_sasl" = yes; then 79 | LIB_SASL="$LIB_SASL -lsasl" 80 | else 81 | LIB_SASL="" 82 | SASLFLAGS="" 83 | fi 84 | AC_SUBST(LIB_SASL) 85 | AC_SUBST(SASLFLAGS) 86 | ]) 87 | 88 | AC_DEFUN(CMU_SASL_REQUIRED, 89 | [AC_REQUIRE([CMU_SASL]) 90 | if test "$ac_cv_found_sasl" != "yes"; then 91 | AC_ERROR([Cannot continue without libsasl. 92 | Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.]) 93 | fi]) 94 | -------------------------------------------------------------------------------- /cmulocal/libloguse.m4: -------------------------------------------------------------------------------- 1 | dnl libloguse.m4--LOGUSE libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH krb and Arla 4 | dnl $Id: libloguse.m4,v 1.4 2002/12/21 18:44:24 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_LOGUSE_LIB_WHERE1, [ 7 | saved_LIBS=$LIBS 8 | LIBS="$saved_LIBS -L$1 -lloguse" 9 | AC_TRY_LINK(, 10 | [loguse("","","");], 11 | [ac_cv_found_loguse_lib=yes], 12 | ac_cv_found_loguse_lib=no) 13 | LIBS=$saved_LIBS 14 | ]) 15 | 16 | AC_DEFUN(CMU_LOGUSE_LIB_WHERE, [ 17 | for i in $1; do 18 | AC_MSG_CHECKING(for loguse library in $i) 19 | CMU_LOGUSE_LIB_WHERE1($i) 20 | CMU_TEST_LIBPATH($i, loguse) 21 | if test "$ac_cv_found_loguse_lib" = "yes" ; then 22 | ac_cv_loguse_where_lib=$i 23 | AC_MSG_RESULT(found) 24 | break 25 | else 26 | AC_MSG_RESULT(no found) 27 | fi 28 | done 29 | ]) 30 | 31 | AC_DEFUN(CMU_LOGUSE, [ 32 | AC_REQUIRE([CMU_SOCKETS]) 33 | AC_ARG_WITH(loguse, 34 | [ --with-loguse=PREFIX Compile with LOGUSE support], 35 | [if test "X$with_loguse" = "X"; then 36 | with_loguse=yes 37 | fi]) 38 | 39 | if test "X$with_loguse" != "X"; then 40 | if test "$with_loguse" != "yes"; then 41 | ac_cv_loguse_where_lib=$with_loguse/lib 42 | fi 43 | fi 44 | 45 | if test "X$with_loguse_lib" != "X"; then 46 | ac_cv_loguse_where_lib=$with_loguse_lib 47 | fi 48 | if test "X$ac_cv_loguse_where_lib" = "X"; then 49 | CMU_LOGUSE_LIB_WHERE(/usr/lib /usr/local/lib) 50 | fi 51 | 52 | AC_MSG_CHECKING(whether to include loguse) 53 | if test "X$ac_cv_loguse_where_lib" = "X"; then 54 | ac_cv_found_loguse=no 55 | AC_MSG_RESULT(no) 56 | else 57 | ac_cv_found_loguse=yes 58 | AC_DEFINE(HAVE_LOGUSE) 59 | AC_MSG_RESULT(yes) 60 | LOGUSE_LIB_DIR=$ac_cv_loguse_where_lib 61 | LOGUSE_LIB_FLAGS="-L${LOGUSE_LIB_DIR} -lloguse" 62 | if test "X$RPATH" = "X"; then 63 | RPATH="" 64 | fi 65 | case "${host}" in 66 | *-*-linux*) 67 | if test "X$RPATH" = "X"; then 68 | RPATH="-Wl,-rpath,${LOGUSE_LIB_DIR}" 69 | else 70 | RPATH="${RPATH}:${LOGUSE_LIB_DIR}" 71 | fi 72 | ;; 73 | *-*-hpux*) 74 | if test "X$RPATH" = "X"; then 75 | RPATH="-Wl,+b${LOGUSE_LIB_DIR}" 76 | else 77 | RPATH="${RPATH}:${LOGUSE_LIB_DIR}" 78 | fi 79 | ;; 80 | *-*-irix*) 81 | if test "X$RPATH" = "X"; then 82 | RPATH="-Wl,-rpath,${LOGUSE_LIB_DIR}" 83 | else 84 | RPATH="${RPATH}:${LOGUSE_LIB_DIR}" 85 | fi 86 | ;; 87 | *-*-solaris2*) 88 | if test "$ac_cv_prog_gcc" = yes; then 89 | if test "X$RPATH" = "X"; then 90 | RPATH="-Wl,-R${LOGUSE_LIB_DIR}" 91 | else 92 | RPATH="${RPATH}:${LOGUSE_LIB_DIR}" 93 | fi 94 | else 95 | RPATH="${RPATH} -R${LOGUSE_LIB_DIR}" 96 | fi 97 | ;; 98 | esac 99 | AC_SUBST(RPATH) 100 | fi 101 | ]) 102 | 103 | -------------------------------------------------------------------------------- /magic.c: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | #include 26 | #include 27 | 28 | /* Description of the various file formats and their magic numbers */ 29 | struct magic { 30 | char *name; /* Name of the file format */ 31 | char *num; /* The magic number */ 32 | int len; /* Length of same (0 means strlen(magicnum)) */ 33 | }; 34 | 35 | /* The magic numbers of the file formats we know about */ 36 | static struct magic magic[] = { 37 | { "image/gif", "GIF", 0 }, 38 | { "image/jpeg", "\377\330\377", 0 }, 39 | { "video/mpeg", "\0\0\001\263", 4 }, 40 | { "application/postscript", "%!", 0 }, 41 | }; 42 | static int num_magic = (sizeof(magic)/sizeof(magic[0])); 43 | static char *default_type = "application/octet-stream"; 44 | 45 | /* The longest magic number */ 46 | static int max_magiclen = 0; 47 | 48 | /* 49 | * Determins the format of the file "inputf". The name 50 | * of the file format (or NULL on error) is returned. 51 | */ 52 | char *magic_look(FILE *infile) 53 | { 54 | int i, j; 55 | char buf[80]; 56 | int numread = 0; 57 | 58 | if (max_magiclen == 0) { 59 | for (i=0; i max_magiclen) max_magiclen = magic[i].len; 62 | } 63 | } 64 | 65 | numread = fread(buf, 1, max_magiclen, infile); 66 | rewind(infile); 67 | 68 | for (i=0; i= magic[i].len) { 70 | for (j=0; j 55 | #include ], 56 | [struct sockaddr_storage ss; int i = ss.ss_family;], 57 | [ipv6_cv_ss_family=yes], [ipv6_cv_ss_family=no])])dnl 58 | if test $ipv6_cv_ss_family = yes; then 59 | ifelse([$1], , AC_DEFINE(HAVE_SS_FAMILY), [$1]) 60 | else 61 | ifelse([$2], , :, [$2]) 62 | fi 63 | AC_MSG_RESULT($ipv6_cv_ss_family)]) 64 | 65 | 66 | dnl whether you have sa_len in struct sockaddr 67 | AC_DEFUN(IPv6_CHECK_SA_LEN, [ 68 | AC_MSG_CHECKING([whether you have sa_len in struct sockaddr]) 69 | AC_CACHE_VAL(ipv6_cv_sa_len, [dnl 70 | AC_TRY_COMPILE([#include 71 | #include ], 72 | [struct sockaddr sa; int i = sa.sa_len;], 73 | [ipv6_cv_sa_len=yes], [ipv6_cv_sa_len=no])])dnl 74 | if test $ipv6_cv_sa_len = yes; then 75 | ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN), [$1]) 76 | else 77 | ifelse([$2], , :, [$2]) 78 | fi 79 | AC_MSG_RESULT($ipv6_cv_sa_len)]) 80 | 81 | 82 | dnl See whether sys/socket.h has socklen_t 83 | AC_DEFUN(IPv6_CHECK_SOCKLEN_T, [ 84 | AC_MSG_CHECKING(for socklen_t) 85 | AC_CACHE_VAL(ipv6_cv_socklen_t, [dnl 86 | AC_TRY_LINK([#include 87 | #include ], 88 | [socklen_t len = 0;], 89 | [ipv6_cv_socklen_t=yes], [ipv6_cv_socklen_t=no])])dnl 90 | if test $ipv6_cv_socklen_t = yes; then 91 | ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T), [$1]) 92 | else 93 | ifelse([$2], , :, [$2]) 94 | fi 95 | AC_MSG_RESULT($ipv6_cv_socklen_t)]) 96 | 97 | -------------------------------------------------------------------------------- /cmulocal/mips-abi.m4: -------------------------------------------------------------------------------- 1 | dnl mips-abi.m4--Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext 2 | dnl to some value 3 | dnl Derrick Brashear 4 | dnl from KTH krb (from CMU) 5 | dnl $Id: mips-abi.m4,v 1.4 2002/05/25 19:57:42 leg Exp $ 6 | 7 | AC_DEFUN(AC_MIPS_ABI, [ 8 | AC_ARG_WITH(mips_abi, 9 | [ --with-mips-abi=abi ABI to use for IRIX (32, n32, or 64)]) 10 | 11 | case "$host_os" in 12 | irix*) 13 | with_mips_abi="${with_mips_abi:-yes}" 14 | if test -n "$GCC"; then 15 | 16 | # GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select 17 | # which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs. 18 | # 19 | # Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old 20 | # GCC and revert back to O32. The same goes if O32 is asked for - old 21 | # GCCs doesn't like the -mabi option, and new GCCs can't output O32. 22 | # 23 | # Don't you just love *all* the different SGI ABIs? 24 | 25 | case "${with_mips_abi}" in 26 | 32|o32) abi='-mabi=32'; abilibdirext='' ;; 27 | n32|yes) abi='-mabi=n32'; abilibdirext='32' ;; 28 | 64) abi='-mabi=64'; abilibdirext='64' ;; 29 | no) abi=''; abilibdirext='';; 30 | *) AC_ERROR("Invalid ABI specified") ;; 31 | esac 32 | if test -n "$abi" ; then 33 | ac_foo=krb_cv_gcc_`echo $abi | tr =- __` 34 | dnl 35 | dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to 36 | dnl AC_MSG_RESULT 37 | dnl 38 | AC_MSG_CHECKING([if $CC supports the $abi option]) 39 | AC_CACHE_VAL($ac_foo, [ 40 | save_CFLAGS="$CFLAGS" 41 | CFLAGS="$CFLAGS $abi" 42 | AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no) 43 | CFLAGS="$save_CFLAGS" 44 | ]) 45 | ac_res=`eval echo \\\$$ac_foo` 46 | AC_MSG_RESULT($ac_res) 47 | if test $ac_res = no; then 48 | # Try to figure out why that failed... 49 | case $abi in 50 | -mabi=32) 51 | save_CFLAGS="$CFLAGS" 52 | CFLAGS="$CFLAGS -mabi=n32" 53 | AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no) 54 | CLAGS="$save_CFLAGS" 55 | if test $ac_res = yes; then 56 | # New GCC 57 | AC_ERROR([$CC does not support the $with_mips_abi ABI]) 58 | fi 59 | # Old GCC 60 | abi='' 61 | abilibdirext='' 62 | ;; 63 | -mabi=n32|-mabi=64) 64 | if test $with_mips_abi = yes; then 65 | # Old GCC, default to O32 66 | abi='' 67 | abilibdirext='' 68 | else 69 | # Some broken GCC 70 | AC_ERROR([$CC does not support the $with_mips_abi ABI]) 71 | fi 72 | ;; 73 | esac 74 | fi #if test $ac_res = no; then 75 | fi #if test -n "$abi" ; then 76 | else 77 | case "${with_mips_abi}" in 78 | 32|o32) abi='-32'; abilibdirext='' ;; 79 | n32|yes) abi='-n32'; abilibdirext='32' ;; 80 | 64) abi='-64'; abilibdirext='64' ;; 81 | no) abi=''; abilibdirext='';; 82 | *) AC_ERROR("Invalid ABI specified") ;; 83 | esac 84 | fi #if test -n "$GCC"; then 85 | ;; 86 | esac 87 | 88 | dnl And then we munge variables to make things work 89 | CFLAGS="${CFLAGS} $abi" 90 | libdir=`echo $libdir | sed 's,/*$,$abilibdirext,'` 91 | LDFLAGS=`echo $LDFLAGS | sed -e "s,/lib$,/lib$abilibdirext," -e "s,\\\(/lib[^a-zA-Z]\\\),\\\1$abilibdirext,g"` 92 | 93 | ]) 94 | -------------------------------------------------------------------------------- /unixpk.man: -------------------------------------------------------------------------------- 1 | .TH MPACK 1 2 | .SH NAME 3 | mpack \- pack a file in MIME format 4 | .SH SYNOPSIS 5 | .B mpack 6 | [ 7 | .B \-a 8 | ] 9 | [ 10 | .B \-s 11 | .I subject 12 | ] 13 | [ 14 | .B \-d 15 | .I descriptionfile 16 | ] 17 | [ 18 | .B \-m 19 | .I maxsize 20 | ] 21 | [ 22 | .B \-c 23 | .I content-type 24 | ] 25 | .I file 26 | .I "address \&..." 27 | .br 28 | .B mpack 29 | [ 30 | .B \-a 31 | ] 32 | [ 33 | .B \-s 34 | .I subject 35 | ] 36 | [ 37 | .B \-d 38 | .I descriptionfile 39 | ] 40 | [ 41 | .B \-m 42 | .I maxsize 43 | ] 44 | [ 45 | .B \-c 46 | .I content-type 47 | ] 48 | .B \-o 49 | .I outputfile 50 | .I file 51 | .br 52 | .B mpack 53 | [ 54 | .B \-a 55 | ] 56 | [ 57 | .B \-s 58 | .I subject 59 | ] 60 | [ 61 | .B \-d 62 | .I descriptionfile 63 | ] 64 | [ 65 | .B \-m 66 | .I maxsize 67 | ] 68 | [ 69 | .B \-c 70 | .I content-type 71 | ] 72 | .B \-n 73 | .I newsgroups 74 | .I file 75 | .SH DESCRIPTION 76 | The 77 | .I mpack 78 | program encodes the 79 | the named file in one or more MIME messages. 80 | The resulting messages are mailed to one or more recipients, 81 | written to a named file or set of files, or posted to a set of 82 | newsgroups. 83 | .PP 84 | .SH OPTIONS 85 | .TP 86 | .BI \-a 87 | Set the Content-Disposition to attachment. If \-a is not used 88 | the Content-Disposition is inline. 89 | .TP 90 | .BI \-s " subject" 91 | Set the 92 | .B Subject 93 | header field to 94 | .IR Subject . 95 | By default, 96 | .B mpack 97 | will prompt for the contents of the subject header. 98 | .TP 99 | .BI \-d " descriptionfile 100 | Include the contents of the file 101 | .I descriptionfile 102 | in an introductory section at the beginning of the first 103 | generated message. 104 | .TP 105 | .BI \-m " maxsize" 106 | Split the message (if necessary) into partial messages, each not 107 | exceeding 108 | .I maxsize 109 | characters. The default limit is the value of the 110 | .B SPLITSIZE 111 | environment variable, or no limit if the environment variable 112 | does not exist. 113 | Specifying a 114 | .I maxsize 115 | of 0 means there is no limit to the size of the generated message. 116 | .TP 117 | .BI \-c " content-type" 118 | Label the included file as being of MIME type 119 | .IR content-type , 120 | which must be a subtype of 121 | .BR application , 122 | .BR audio , 123 | .BR image , 124 | or 125 | .BR video . 126 | If this switch is not given, 127 | .B mpack 128 | examines the file to determine its type. 129 | .TP 130 | .BI \-o " outputfile" 131 | Write the generated message to the file 132 | .IR outputfile . 133 | If the message has to be split, the partial messages will instead be 134 | written to the files 135 | .IR outputfile .01, 136 | .IR outputfile .02, 137 | etc. 138 | .TP 139 | .BI \-n " newsgroups" 140 | Post the generated message(s) to the comma-separated netnews 141 | .IR newsgroups . 142 | .TP 143 | .I file 144 | Encode the named 145 | .IR file . 146 | .TP 147 | .I "address \&..." 148 | Mail the generated messages to the specified addresses. 149 | .SH ENVIRONMENT 150 | .TP 151 | .B TMPDIR 152 | Directory to store temporary files. Default is /var/tmp. 153 | .TP 154 | .B SPLITSIZE 155 | Default value of the -m switch. 156 | -------------------------------------------------------------------------------- /cmulocal/README.andrew: -------------------------------------------------------------------------------- 1 | This is a collection of autoconf macros which've been written by 2 | various people at CMU. To use it, use "aclocal -I cmulocal" (after 3 | the first time, automake should automatically use the -I cmulocal, if 4 | you've called CMU_INIT_AUTOMAKE in configure.in). 5 | 6 | CMU_INIT_AUTOMAKE 7 | If you use automake, you should call this after AM_INIT_AUTOMAKE. 8 | It adds "-I cmulocal" to the aclocal command line, so that when 9 | automake runs aclocal, aclocal'll continue to pick up these macros. 10 | 11 | CMU_ADD_LIBPATH 12 | Add -L(arg), and possibly -R(arg) (or whatever the runpath is) to 13 | LDFLAGS. 14 | 15 | CMU_ADD_LIBPATH_TO 16 | Likewise to above, except adds it to the specified variable (arg 2). 17 | 18 | CMU_GUESS_RUNPATH_SWITCH 19 | Attempts to guess what the runpath switch is (-R or whatever). 20 | 21 | CMU_COMERR 22 | Requires that com_err exist in the collection (at CMU, do this by 23 | running "cvs checkout com_err", and adding com_err to DIST_SUBDIRS 24 | in your Makefile.am). 25 | 26 | It sets the output variable COMPILE_ET to the compile_et program to 27 | use, and adds the appropriate paths to LDFLAGS and CPPFLAGS. 28 | 29 | It does *not* add -lcom_err to LIBS (this would cause later library 30 | checks to fail if com_err needs to be built), so Makefiles need to 31 | explicitly add -lcom_err (which, after all, should always exist as 32 | long as the com_err compile doesn't blow up). Makefiles should do 33 | this by using LIB_COMERR, which will substitute to the appropriate 34 | magic to use to grab the library. (This may involve a libtool archive; 35 | you should be using libtool to link your program if you distribute 36 | libraries with it that the program may link against). 37 | 38 | Note that com_err will only be compiled if the configure script 39 | can't find compile_et or libcom_err; if the system already has them, 40 | the configure script will use the system installation (although, due 41 | to some autoconf wonkiness, com_err will still be configured; it just 42 | won't show up in the @subdirs@ expansion). 43 | 44 | CMU_NANA 45 | Adds --with-nana, set by default; if set, attempts to link against 46 | libnana. If not set, or if libnana is unavailable, or if we're not 47 | using gcc, it defines WITHOUT_NANA. 48 | 49 | CMU_PROG_LIBTOOL 50 | Just like AM_PROG_LIBTOOL, except it performs a couple little hacks 51 | to make sure that things don't break on picky vendor compilers 52 | which whine about empty translation units. 53 | 54 | CMU_PTHREADS 55 | This attempts to link against libpthread (failing if it can't be found), 56 | and attempts to do any system-specific setup required for thread 57 | support (for example, most things want _REENTRANT to be defined, 58 | but Solaris wants _POSIX_PTHREAD_SEMANTICS and __EXTENSIONS__, IRIX 59 | wants to see _SGI_REENTRANT_FUNCTIONS, etc). 60 | 61 | CMU_SASL 62 | This tries to find a SASL library, and calls AC_SUBST on LIB_SASL 63 | if it finds one, or tells the user to go ftp it if it doesn't exist. 64 | 65 | Provides --with-sasldir. 66 | 67 | CMU_KRB4 68 | This attempts to find Kerberos 4 libraries and set up CFLAGS and LIBS 69 | appropriately. It also updates and substitutes RPATH for shared library 70 | stuff. 71 | 72 | -------------------------------------------------------------------------------- /strcasecmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * String manipulation routines 3 | */ 4 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 5 | * All Rights Reserved. 6 | * 7 | * Permission to use, copy, modify, distribute, and sell this software 8 | * and its documentation for any purpose is hereby granted without 9 | * fee, provided that the above copyright notice appear in all copies 10 | * and that both that copyright notice and this permission notice 11 | * appear in supporting documentation, and that the name of Carnegie 12 | * Mellon University not be used in advertising or publicity 13 | * pertaining to distribution of the software without specific, 14 | * written prior permission. Carnegie Mellon University makes no 15 | * representations about the suitability of this software for any 16 | * purpose. It is provided "as is" without express or implied 17 | * warranty. 18 | * 19 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 20 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 21 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 22 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 23 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 24 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 25 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 26 | * SOFTWARE. 27 | */ 28 | 29 | #include 30 | 31 | static unsigned char upcase[256] = { 32 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 33 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34 | ' ','!','"','#','$','%','&', 39,'(',')','*','+',',','-','.','/', 35 | '0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?', 36 | '@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O', 37 | 'P','Q','R','S','T','U','V','W','X','Y','Z','[', 92,']','^','_', 38 | '`','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O', 39 | 'P','Q','R','S','T','U','V','W','X','Y','Z','{','|','}','~',127, 40 | 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, 41 | 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, 42 | 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, 43 | 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, 44 | 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, 45 | 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, 46 | 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, 47 | 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255}; 48 | 49 | #define UPC(x) (upcase[(unsigned char)(x)]) 50 | 51 | /* 52 | * Same as strcmp, but case-insensitive. 53 | */ 54 | int 55 | strcasecmp(register char *s1, register char *s2) 56 | { 57 | register char c1; 58 | while ((c1 = *s1) && UPC(c1) == UPC(*s2)) { 59 | s1++; 60 | s2++; 61 | } 62 | return UPC(c1) - UPC(*s2); 63 | } 64 | 65 | /* 66 | * Same as strncmp, but case-insensitive. 67 | */ 68 | int 69 | strncasecmp(register char *s1, register char *s2, int n) 70 | { 71 | register char c1; 72 | while (n-- && (c1 = *s1) && UPC(c1) == UPC(*s2)) { 73 | s1++; 74 | s2++; 75 | } 76 | if (n == -1) return 0; 77 | return UPC(c1) - UPC(*s2); 78 | } 79 | 80 | -------------------------------------------------------------------------------- /unixunpk.c: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include "version.h" 30 | #include "part.h" 31 | 32 | extern int overwrite_files; 33 | extern int didchat; 34 | extern char replacement_char; 35 | int quiet; 36 | 37 | void usage(void); 38 | int handleMessage(struct part *inpart, char *defaultContentType, 39 | int inAppleDouble, int extractText); 40 | 41 | int main(int argc, char **argv) 42 | { 43 | int opt; 44 | FILE *file; 45 | int extractText = 0; 46 | 47 | while ((opt = getopt(argc, argv, "qftr:C:")) != EOF) { 48 | switch (opt) { 49 | case 'f': 50 | overwrite_files = 1; 51 | break; 52 | 53 | case 'q': 54 | quiet = 1; 55 | break; 56 | 57 | case 't': 58 | extractText = 1; 59 | break; 60 | 61 | case 'r': 62 | replacement_char = optarg[0]; 63 | break; 64 | 65 | case 'C': 66 | if (chdir(optarg)) { 67 | perror(optarg); 68 | exit(1); 69 | } 70 | break; 71 | 72 | default: 73 | usage(); 74 | } 75 | } 76 | 77 | if (optind == argc) { 78 | fprintf(stderr, "munpack: reading from standard input\n"); 79 | didchat = 0; 80 | handleMessage(part_init(stdin), "text/plain", 0, extractText); 81 | if (!didchat) { 82 | fprintf(stdout, 83 | "Did not find anything to unpack from standard input\n"); 84 | } 85 | exit(0); 86 | } 87 | 88 | while (argv[optind]) { 89 | file = fopen(argv[optind], "r"); 90 | if (!file) { 91 | perror(argv[optind]); 92 | } 93 | else { 94 | didchat = 0; 95 | handleMessage(part_init(file), "text/plain", 0, extractText); 96 | fclose(file); 97 | if (!didchat) { 98 | fprintf(stdout, 99 | "Did not find anything to unpack from %s\n", 100 | argv[optind]); 101 | } 102 | } 103 | optind++; 104 | } 105 | exit(0); 106 | } 107 | 108 | void usage(void) { 109 | fprintf(stderr, "munpack version %s\n", MPACK_VERSION); 110 | fprintf(stderr, "usage: munpack [-f] [-q] [-t] [-r character] [-C directory] [files...]\n"); 111 | exit(1); 112 | } 113 | 114 | void warn(char *s) 115 | { 116 | fprintf(stderr, "munpack: warning: %s\n", s); 117 | } 118 | 119 | void chat(char *s) 120 | { 121 | didchat = 1; 122 | if (!quiet) fprintf(stdout, "%s\n", s); 123 | } 124 | -------------------------------------------------------------------------------- /macICTypes.h: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | /* 26 | The canonical Internet Config interface is defined in Pascal. These headers have 27 | not been thoroughly tested. If there is a conflict between these headers and the 28 | Pascal interfaces, the Pascal should take precedence. 29 | */ 30 | 31 | /* ///////////////////////////////////////////////////////////////////////////////// */ 32 | 33 | #ifndef __ICTYPES__ 34 | #define __ICTYPES__ 35 | 36 | #ifndef __TYPES__ 37 | #include 38 | #endif 39 | 40 | /* ///////////////////////////////////////////////////////////////////////////////// */ 41 | 42 | #if defined(powerc) || defined (__powerc) 43 | #pragma options align=mac68k 44 | #endif 45 | 46 | enum { 47 | icPrefNotFoundErr = -666, /* preference not found (duh!) */ 48 | icPermErr = -667, /* cannot set preference */ 49 | icPrefDataErr = -668, /* problem with preference data */ 50 | icInternalErr = -669, /* hmm, this is not good */ 51 | icTruncatedErr = -670, /* more data was present than was returned */ 52 | icNoMoreWritersErr = -671 /* you cannot begin a write session because someone else is already doing it */ 53 | }; 54 | 55 | enum { 56 | ICattr_no_change = 0xFFFFFFFFL, /* supply this to ICSetPref to tell it not to change the attributes */ 57 | ICattr_locked_bit = 0, /* bits in the preference attributes */ 58 | ICattr_locked_mask = 0x00000001L /* masks for the above */ 59 | }; 60 | 61 | #define ICfiletype 'ICAp' 62 | #define ICcreator 'ICAp' 63 | 64 | #define ICdefault_file_name "\pInternet Preferences" /* default file name, for internal use, overridden by a component resource */ 65 | 66 | enum { 67 | ICdefault_file_name_ID = 1024 /* ID of resource in component file */ 68 | }; 69 | 70 | struct ICDirSpec { /* a record that specifies a folder */ 71 | short vRefNum; 72 | long dirID; 73 | }; 74 | typedef struct ICDirSpec ICDirSpec; 75 | 76 | typedef ICDirSpec ICDirSpecArray[4]; /* an array of the above */ 77 | typedef ICDirSpecArray *ICDirSpecArrayPtr; /* a pointer to that array */ 78 | 79 | typedef long ICAttr; /* type for preference attributes */ 80 | typedef long ICError; /* type for error codes */ 81 | typedef Ptr ICInstance; /* opaque type for preference reference */ 82 | enum { 83 | icNoPerm = 0, 84 | icReadOnlyPerm = 1, 85 | icReadWritePerm = 2 86 | }; 87 | typedef unsigned char ICPerm; 88 | 89 | #if defined(powerc) || defined(__powerc) 90 | #pragma options align=reset 91 | #endif 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /getopt.c: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | #include 26 | 27 | #ifdef __OS2__ 28 | # include 29 | #endif 30 | 31 | #if defined(__MSDOS__) || defined(__OS2__) 32 | #define ERR(s, c) \ 33 | if (opterr) { \ 34 | char buff[3]; \ 35 | buff[0] = c; buff[1] = '\r'; buff[2] = '\n'; \ 36 | (void)write(2, av[0], strlen(av[0])); \ 37 | (void)write(2, s, strlen(s)); \ 38 | (void)write(2, buff, 3); \ 39 | } 40 | #else /* __MSDOS__ */ 41 | #define ERR(s, c) \ 42 | if (opterr) { \ 43 | char buff[2]; \ 44 | buff[0] = c; buff[1] = '\n'; \ 45 | (void)write(2, av[0], strlen(av[0])); \ 46 | (void)write(2, s, strlen(s)); \ 47 | (void)write(2, buff, 2); \ 48 | } 49 | #endif 50 | 51 | int opterr = 1; 52 | int optind = 1; 53 | int optopt; 54 | char *optarg; 55 | 56 | 57 | /* 58 | ** Return options and their values from the command line. 59 | ** This comes from the AT&T public-domain getopt published in mod.sources 60 | ** (i.e., comp.sources.unix before the great Usenet renaming). 61 | */ 62 | int 63 | getopt(int ac, char **av, char *opts) 64 | { 65 | extern char *strchr(const char *, int); 66 | static int i = 1; 67 | char *p; 68 | 69 | /* Move to next value from argv? */ 70 | if (i == 1) { 71 | if (optind >= ac || 72 | #if defined(__MSDOS__) || defined(__OS2__) 73 | (av[optind][0] != '-' && av[optind][0] != '/') 74 | #else 75 | av[optind][0] != '-' 76 | #endif 77 | || av[optind][1] == '\0') 78 | return EOF; 79 | if (strcmp(av[optind], "--") == 0) { 80 | optind++; 81 | return EOF; 82 | } 83 | } 84 | 85 | /* Get next option character. */ 86 | if ((optopt = av[optind][i]) == ':' 87 | || (p = strchr(opts, optopt)) == NULL) { 88 | ERR(": illegal option -- ", optopt); 89 | if (av[optind][++i] == '\0') { 90 | optind++; 91 | i = 1; 92 | } 93 | return '?'; 94 | } 95 | 96 | /* Snarf argument? */ 97 | if (*++p == ':') { 98 | if (av[optind][i + 1] != '\0') 99 | optarg = &av[optind++][i + 1]; 100 | else { 101 | if (++optind >= ac) { 102 | ERR(": option requires an argument -- ", optopt); 103 | i = 1; 104 | return '?'; 105 | } 106 | optarg = av[optind++]; 107 | } 108 | i = 1; 109 | } 110 | else { 111 | if (av[optind][++i] == '\0') { 112 | i = 1; 113 | optind++; 114 | } 115 | optarg = NULL; 116 | } 117 | 118 | return optopt; 119 | } 120 | -------------------------------------------------------------------------------- /cmulocal/libpcap.m4: -------------------------------------------------------------------------------- 1 | dnl libpcap.m4--PCAP libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH krb and Arla 4 | dnl $Id: libpcap.m4,v 1.7 2002/12/21 18:44:24 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_PCAP_INC_WHERE1, [ 7 | ac_cv_found_pcap_inc=no 8 | if test -f "$1/pcap.h" ; then 9 | ac_cv_found_pcap_inc=yes 10 | fi 11 | ]) 12 | 13 | AC_DEFUN(CMU_PCAP_INC_WHERE, [ 14 | for i in $1; do 15 | AC_MSG_CHECKING(for pcap header in $i) 16 | CMU_PCAP_INC_WHERE1($i) 17 | if test "$ac_cv_found_pcap_inc" = "yes"; then 18 | ac_cv_pcap_where_inc=$i 19 | AC_MSG_RESULT(found) 20 | break 21 | else 22 | AC_MSG_RESULT(no found) 23 | fi 24 | done 25 | ]) 26 | 27 | AC_DEFUN(CMU_PCAP_LIB_WHERE1, [ 28 | saved_LIBS=$LIBS 29 | LIBS="$saved_LIBS -L$1 -lpcap" 30 | AC_TRY_LINK(, 31 | [pcap_lookupdev("");], 32 | [ac_cv_found_pcap_lib=yes], 33 | ac_cv_found_pcap_lib=no) 34 | LIBS=$saved_LIBS 35 | ]) 36 | 37 | AC_DEFUN(CMU_PCAP_LIB_WHERE, [ 38 | for i in $1; do 39 | AC_MSG_CHECKING(for pcap library in $i) 40 | CMU_PCAP_LIB_WHERE1($i) 41 | CMU_TEST_LIBPATH($i, pcap) 42 | if test "$ac_cv_found_pcap_lib" = "yes" ; then 43 | ac_cv_pcap_where_lib=$i 44 | AC_MSG_RESULT(found) 45 | break 46 | else 47 | AC_MSG_RESULT(no found) 48 | fi 49 | done 50 | ]) 51 | 52 | AC_DEFUN(CMU_PCAP, [ 53 | AC_ARG_WITH(pcap, 54 | [ --with-pcap=PREFIX Compile with PCAP support], 55 | [if test "X$with_pcap" = "X"; then 56 | with_pcap=yes 57 | fi]) 58 | AC_ARG_WITH(pcap-lib, 59 | [ --with-pcap-lib=dir use pcap libraries in dir], 60 | [if test "$withval" = "yes" -o "$withval" = "no"; then 61 | AC_MSG_ERROR([No argument for --with-pcap-lib]) 62 | fi]) 63 | AC_ARG_WITH(pcap-include, 64 | [ --with-pcap-include=dir use pcap headers in dir], 65 | [if test "$withval" = "yes" -o "$withval" = "no"; then 66 | AC_MSG_ERROR([No argument for --with-pcap-include]) 67 | fi]) 68 | 69 | if test "X$with_pcap" != "X"; then 70 | if test "$with_pcap" != "yes"; then 71 | ac_cv_pcap_where_lib=$with_pcap/lib 72 | ac_cv_pcap_where_inc=$with_pcap/include 73 | fi 74 | fi 75 | 76 | if test "X$with_pcap_lib" != "X"; then 77 | ac_cv_pcap_where_lib=$with_pcap_lib 78 | fi 79 | if test "X$ac_cv_pcap_where_lib" = "X"; then 80 | CMU_PCAP_LIB_WHERE(/usr/ng/lib /usr/lib /usr/local/lib) 81 | fi 82 | 83 | if test "X$with_pcap_include" != "X"; then 84 | ac_cv_pcap_where_inc=$with_pcap_include 85 | fi 86 | if test "X$ac_cv_pcap_where_inc" = "X"; then 87 | CMU_PCAP_INC_WHERE(/usr/ng/include /usr/include /usr/local/include) 88 | fi 89 | 90 | AC_MSG_CHECKING(whether to include pcap) 91 | if test "X$ac_cv_pcap_where_lib" = "X" -a "X$ac_cv_pcap_where_inc" = "X"; then 92 | ac_cv_found_pcap=no 93 | AC_MSG_RESULT(no) 94 | else 95 | ac_cv_found_pcap=yes 96 | AC_MSG_RESULT(yes) 97 | PCAP_INC_DIR=$ac_cv_pcap_where_inc 98 | PCAP_LIB_DIR=$ac_cv_pcap_where_lib 99 | PCAP_INC_FLAGS="-I${PCAP_INC_DIR}" 100 | PCAP_LIB_FLAGS="-L${PCAP_LIB_DIR} -lpcap" 101 | if test "X$RPATH" = "X"; then 102 | RPATH="" 103 | fi 104 | case "${host}" in 105 | *-*-linux*) 106 | if test "X$RPATH" = "X"; then 107 | RPATH="-Wl,-rpath,${PCAP_LIB_DIR}" 108 | else 109 | RPATH="${RPATH}:${PCAP_LIB_DIR}" 110 | fi 111 | ;; 112 | *-*-hpux*) 113 | if test "X$RPATH" = "X"; then 114 | RPATH="-Wl,+b${PCAP_LIB_DIR}" 115 | else 116 | RPATH="${RPATH}:${PCAP_LIB_DIR}" 117 | fi 118 | ;; 119 | *-*-irix*) 120 | if test "X$RPATH" = "X"; then 121 | RPATH="-Wl,-rpath,${PCAP_LIB_DIR}" 122 | else 123 | RPATH="${RPATH}:${PCAP_LIB_DIR}" 124 | fi 125 | ;; 126 | *-*-solaris2*) 127 | if test "$ac_cv_prog_gcc" = yes; then 128 | if test "X$RPATH" = "X"; then 129 | RPATH="-Wl,-R${PCAP_LIB_DIR}" 130 | else 131 | RPATH="${RPATH}:${PCAP_LIB_DIR}" 132 | fi 133 | else 134 | RPATH="${RPATH} -R${PCAP_LIB_DIR}" 135 | fi 136 | ;; 137 | esac 138 | AC_SUBST(RPATH) 139 | fi 140 | ]) 141 | 142 | -------------------------------------------------------------------------------- /unixunpk.man: -------------------------------------------------------------------------------- 1 | .TH MUNPACK 1 2 | .SH NAME 3 | munpack \- unpack messages in MIME or split-uuencode format 4 | .SH SYNOPSIS 5 | .B munpack 6 | [ 7 | .B \-f 8 | ] 9 | [ 10 | .B \-q 11 | ] 12 | [ 13 | .B \-t 14 | ] 15 | [ 16 | .B \-r 17 | .I character 18 | ] 19 | [ 20 | .B \-C 21 | .I directory 22 | ] 23 | [ 24 | .I "filename \&..." 25 | ] 26 | .SH DESCRIPTION 27 | The 28 | .I munpack 29 | program reads each RFC-822 message 30 | .I filename 31 | and writes all non-text MIME parts or split-uuencoded files as files. 32 | If no filename argument is given, 33 | .B munpack 34 | reads from standard input. 35 | .LP 36 | If the message suggests a file name to use for the imbedded part, that 37 | name is cleaned of potential problem characters and used for the 38 | output file. If the suggested filename includes subdirectories, they 39 | will be created as necessary. 40 | If the message does not suggest a file name, the names 41 | "part1", "part2", etc are used in sequence. 42 | .LP 43 | If the imbedded part was preceded with textual information, that 44 | information is also written to a file. The file is named the same as 45 | the imbedded part, with any filename extension replaced with ".desc". 46 | .SH OPTIONS 47 | .TP 48 | .B \-f 49 | Force overwriting of existing files. If a message suggests a file 50 | name of an existing file, the file will be overwritten. Without this 51 | flag, 52 | .B 53 | munpack 54 | appends ".1", ".2", etc to find a nonexistent file. 55 | .TP 56 | .B \-q 57 | Be quiet. Suppresses messages about saving partial messages and about 58 | messages with no interesting information. 59 | .TP 60 | .B \-t 61 | Also write the text MIME parts of multipart messages as files. By 62 | default, text parts that do not have a filename parameter do not get 63 | unpacked. This option effectively disables the ".desc" file feature 64 | for MIME messages. 65 | .TP 66 | .BI \-r " character" 67 | If the suggested filename contains invalid characters, they are 68 | replaced with this character. The default replacement character is 69 | "X". 70 | .TP 71 | .BI \-C " directory" 72 | Change the current directory to 73 | .I directory 74 | before reading any files. This is useful when invoking 75 | .B munpack 76 | from a mail or news reader. 77 | .SH "DECODING MIME" 78 | .LP 79 | To decode a MIME message, first save it to a text file. If possible, 80 | save it with all headers included. 81 | .I Munpack 82 | can decode some MIME files 83 | when the headers are missing or incomplete, other files it cannot 84 | decode without having the information in the headers. In general, 85 | messages which have a statement at the beginning that they are in MIME 86 | format can be decoded without the headers. Messages which have been 87 | split into multiple parts generally require all headers in order to be 88 | reassembled and decoded. 89 | .LP 90 | Some LAN-based mail systems and some mail providers (including America 91 | Online, as of the writing of this document) place the mail headers at 92 | the bottom of the message, instead of at the top of the message. If 93 | you are having problems decoding a MIME message on such a system, you 94 | need to convert the mail back into the standard format by removing the 95 | system's nonstandard headers and moving the standard Internet headers 96 | at the top of the message (separated from the message body with a 97 | blank line). 98 | .LP 99 | There must be exactly one message per file. 100 | .I Munpack 101 | cannot deal with 102 | multiple messages in a single file, to decode things correctly it must 103 | know when one message ends and the next one begins. 104 | .LP 105 | To decode a message, run the command: 106 | .IP 107 | .IB munpack " file" 108 | .LP 109 | where "file" is the name of the file containing the message. More than 110 | one filename may be specified, 111 | .I munpack 112 | will try to decode the message in 113 | each file. For more information on ways to run 114 | .IR munpack , 115 | see the section "OPTIONS" above. 116 | .SH ENVIRONMENT 117 | .TP 118 | .B TMPDIR 119 | Directory to store temporary files. Default is /var/tmp. 120 | .SH FILES 121 | .TP 122 | .B $TMPDIR/m-prts-$USER/ 123 | Directory used to store partial messages awaiting reassembly. 124 | -------------------------------------------------------------------------------- /macnfile.c: -------------------------------------------------------------------------------- 1 | /* macnfile.c -- standard file operations for nifty application library 2 | */ 3 | /* (C) Copyright 1995 by Carnegie Mellon University 4 | * All Rights Reserved. 5 | * 6 | * Permission to use, copy, modify, distribute, and sell this software 7 | * and its documentation for any purpose is hereby granted without 8 | * fee, provided that the above copyright notice appear in all copies 9 | * and that both that copyright notice and this permission notice 10 | * appear in supporting documentation, and that the name of Carnegie 11 | * Mellon University not be used in advertising or publicity 12 | * pertaining to distribution of the software without specific, 13 | * written prior permission. Carnegie Mellon University makes no 14 | * representations about the suitability of this software for any 15 | * purpose. It is provided "as is" without express or implied 16 | * warranty. 17 | * 18 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 19 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 20 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 21 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 22 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 23 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 24 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 25 | * SOFTWARE. 26 | */ 27 | /* (C) Copyright 1990-1995 by Christopher J. Newman 28 | * All Rights Reserved. 29 | * 30 | * Permission to use, copy, modify, distribute, and sell this software and its 31 | * documentation for any purpose is hereby granted without fee, provided that 32 | * the above copyright notice appear in all copies and that both that 33 | * copyright notice and this permission notice appear in supporting 34 | * documentation, and that the name of Christopher J. Newman not be used in 35 | * advertising or publicity pertaining to distribution of the software without 36 | * specific, written prior permission. Christopher J. Newman makes no 37 | * representations about the suitability of this software for any purpose. It 38 | * is provided "as is" without express or implied warranty. 39 | * 40 | * CHRISTOPHER J. NEWMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 41 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 42 | * SHALL CHRISTOPHER J. NEWMAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR 43 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 44 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 45 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 46 | * OF THIS SOFTWARE. 47 | * 48 | * Author: Christopher J. Newman 49 | * Message: This is a nifty program. 50 | */ 51 | 52 | #include 53 | #include "macnapp.h" 54 | 55 | /* copy SFReply to StandardFileReply 56 | */ 57 | static void sftostd(SFReply *rep, StandardFileReply *reply) 58 | { 59 | long procid = 0; 60 | 61 | if ((reply->sfGood = rep->good) == true) { 62 | reply->sfReplacing = false; 63 | reply->sfType = rep->fType; 64 | memcpy((void *) reply->sfFile.name, rep->fName, *rep->fName + 1); 65 | reply->sfFile.parID = 0; 66 | reply->sfFile.vRefNum = rep->vRefNum; 67 | GetWDInfo(rep->vRefNum, &reply->sfFile.vRefNum, &reply->sfFile.parID, &procid); 68 | } 69 | } 70 | 71 | /* get a file to save 72 | */ 73 | void NAputFile(Str255 prompt, Str255 initfname, StandardFileReply *reply) 74 | { 75 | SFReply rep; 76 | Point where; 77 | 78 | if (NAgestaltBits & NA_HASSTDFILE) { 79 | StandardPutFile(prompt, initfname, reply); 80 | } else { 81 | where.h = where.v = 0; 82 | SFPutFile(where, prompt, initfname, nil, &rep); 83 | sftostd(&rep, reply); 84 | } 85 | } 86 | 87 | /* get a file to open 88 | */ 89 | void NAgetFile(FileFilterProcPtr filter, short numtypes, 90 | SFTypeList types, StandardFileReply *reply) 91 | { 92 | Point p; 93 | SFReply rep; 94 | 95 | if (NAgestaltBits & NA_HASSTDFILE) { 96 | StandardGetFile(filter, numtypes, types, reply); 97 | } else { 98 | p.h = p.v = 0; 99 | SFGetFile(p, NULL, (ProcPtr) filter, numtypes, types, 0, &rep); 100 | sftostd(&rep, reply); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /cmulocal/libXau.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: libXau.m4,v 1.3 2002/12/21 18:44:24 cg2v Exp $ 2 | 3 | AC_DEFUN(CMU_XAU_INC_WHERE1, [ 4 | saved_CPPFLAGS=$CPPFLAGS 5 | CPPFLAGS="$saved_CPPFLAGS -I$1" 6 | AC_TRY_COMPILE([ 7 | #include 8 | ], 9 | [Xauth foo;], 10 | ac_cv_found_Xau_inc=yes, 11 | ac_cv_found_Xau_inc=no) 12 | CPPFLAGS=$saved_CPPFLAGS 13 | ]) 14 | 15 | AC_DEFUN(CMU_XAU_INC_WHERE, [ 16 | for i in $1; do 17 | AC_MSG_CHECKING(for Xau headers in $i) 18 | CMU_XAU_INC_WHERE1($i) 19 | CMU_TEST_INCPATH($i, X11/Xauth) 20 | if test "$ac_cv_found_Xau_inc" = "yes"; then 21 | ac_cv_Xau_where_inc=$i 22 | AC_MSG_RESULT(found) 23 | break 24 | else 25 | AC_MSG_RESULT(not found) 26 | fi 27 | done 28 | ]) 29 | 30 | AC_DEFUN(CMU_XAU_LIB_WHERE1, [ 31 | saved_LIBS=$LIBS 32 | LIBS="$saved_LIBS -L$1 -lXau $LIB_SOCKET" 33 | AC_TRY_LINK(, 34 | [XauDisposeAuth();], 35 | [ac_cv_found_Xau_lib=yes], 36 | ac_cv_found_Xau_lib=no) 37 | LIBS=$saved_LIBS 38 | ]) 39 | 40 | AC_DEFUN(CMU_XAU_LIB_WHERE, [ 41 | for i in $1; do 42 | AC_MSG_CHECKING(for Xau libraries in $i) 43 | CMU_XAU_LIB_WHERE1($i) 44 | dnl deal with false positives from implicit link paths 45 | CMU_TEST_LIBPATH($i, Xau) 46 | if test "$ac_cv_found_Xau_lib" = "yes" ; then 47 | ac_cv_Xau_where_lib=$i 48 | AC_MSG_RESULT(found) 49 | break 50 | else 51 | AC_MSG_RESULT(not found) 52 | fi 53 | done 54 | ]) 55 | 56 | AC_DEFUN(CMU_XAU, [ 57 | AC_REQUIRE([CMU_SOCKETS]) 58 | AC_ARG_WITH(Xau, 59 | [ --with-Xau=PREFIX Compile with Xau support], 60 | [if test "X$with_Xau" = "X"; then 61 | with_Xau=yes 62 | fi]) 63 | AC_ARG_WITH(Xau-lib, 64 | [ --with-Xau-lib=dir use Xau libraries in dir], 65 | [if test "$withval" = "yes" -o "$withval" = "no"; then 66 | AC_MSG_ERROR([No argument for --with-Xau-lib]) 67 | fi]) 68 | AC_ARG_WITH(Xau-include, 69 | [ --with-Xau-include=dir use Xau headers in dir], 70 | [if test "$withval" = "yes" -o "$withval" = "no"; then 71 | AC_MSG_ERROR([No argument for --with-Xau-include]) 72 | fi]) 73 | 74 | if test "X$with_Xau" != "X"; then 75 | if test "$with_Xau" != "yes"; then 76 | ac_cv_Xau_where_lib=$with_Xau/lib 77 | ac_cv_Xau_where_inc=$with_Xau/include 78 | fi 79 | fi 80 | 81 | if test "X$with_Xau_lib" != "X"; then 82 | ac_cv_Xau_where_lib=$with_Xau_lib 83 | fi 84 | if test "X$ac_cv_Xau_where_lib" = "X"; then 85 | CMU_XAU_LIB_WHERE(/usr/X11R6/lib /usr/local/lib /usr/openwin/lib) 86 | fi 87 | 88 | if test "X$with_Xau_include" != "X"; then 89 | ac_cv_Xau_where_inc=$with_Xau_include 90 | fi 91 | if test "X$ac_cv_Xau_where_inc" = "X"; then 92 | CMU_XAU_INC_WHERE(/usr/X11R6/include /usr/local/include /usr/openwin/include) 93 | fi 94 | 95 | AC_MSG_CHECKING(whether to include Xau) 96 | if test "X$ac_cv_Xau_where_lib" = "X" -a "X$ac_cv_Xau_where_inc" = "X"; then 97 | ac_cv_found_Xau=no 98 | AC_MSG_RESULT(no) 99 | else 100 | ac_cv_found_Xau=yes 101 | AC_MSG_RESULT(yes) 102 | XAU_INC_DIR=$ac_cv_Xau_where_inc 103 | XAU_LIB_DIR=$ac_cv_Xau_where_lib 104 | XAU_INC_FLAGS="-I${XAU_INC_DIR}" 105 | XAU_LIB_FLAGS="-L${XAU_LIB_DIR} -lXau" 106 | if test "X$RPATH" = "X"; then 107 | RPATH="" 108 | fi 109 | case "${host}" in 110 | *-*-linux*) 111 | if test "X$RPATH" = "X"; then 112 | RPATH="-Wl,-rpath,${XAU_LIB_DIR}" 113 | else 114 | RPATH="${RPATH}:${XAU_LIB_DIR}" 115 | fi 116 | ;; 117 | *-*-hpux*) 118 | if test "X$RPATH" = "X"; then 119 | RPATH="-Wl,+b${XAU_LIB_DIR}" 120 | else 121 | RPATH="${RPATH}:${XAU_LIB_DIR}" 122 | fi 123 | ;; 124 | *-*-irix*) 125 | if test "X$RPATH" = "X"; then 126 | RPATH="-Wl,-rpath,${XAU_LIB_DIR}" 127 | else 128 | RPATH="${RPATH}:${XAU_LIB_DIR}" 129 | fi 130 | ;; 131 | *-*-solaris2*) 132 | if test "$ac_cv_prog_gcc" = yes; then 133 | if test "X$RPATH" = "X"; then 134 | RPATH="-Wl,-R${XAU_LIB_DIR}" 135 | else 136 | RPATH="${RPATH}:${XAU_LIB_DIR}" 137 | fi 138 | else 139 | RPATH="${RPATH} -R${XAU_LIB_DIR}" 140 | fi 141 | ;; 142 | esac 143 | AC_SUBST(RPATH) 144 | fi 145 | ]) 146 | 147 | -------------------------------------------------------------------------------- /cmulocal/arx.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: arx.m4,v 1.4 2002/12/21 18:44:24 cg2v Exp $ 2 | 3 | AC_DEFUN(CMU_ARX_INC_WHERE1, [ 4 | saved_CPPFLAGS=$CPPFLAGS 5 | CPPFLAGS="$saved_CPPFLAGS -I$1" 6 | AC_TRY_COMPILE([#include ], 7 | [arx_context *foo;], 8 | ac_cv_found_arx_inc=yes, 9 | ac_cv_found_arx_inc=no) 10 | CPPFLAGS=$saved_CPPFLAGS 11 | ]) 12 | 13 | AC_DEFUN(CMU_ARX_INC_WHERE, [ 14 | for i in $1; do 15 | AC_MSG_CHECKING(for arx headers in $i) 16 | CMU_ARX_INC_WHERE1($i) 17 | CMU_TEST_INCPATH($i, arx) 18 | if test "$ac_cv_found_arx_inc" = "yes"; then 19 | ac_cv_arx_where_inc=$i 20 | AC_MSG_RESULT(found) 21 | break 22 | else 23 | AC_MSG_RESULT(not found) 24 | fi 25 | done 26 | ]) 27 | 28 | # 29 | # Test for lib files 30 | # 31 | 32 | AC_DEFUN(CMU_ARX_LIB_WHERE1, [ 33 | AC_REQUIRE([CMU_AFS]) 34 | AC_REQUIRE([CMU_KRB4]) 35 | saved_LIBS=$LIBS 36 | LIBS="$saved_LIBS -L$1 -larx $AFS_LIB_FLAGS $AFS_CLIENT_LIBS $KRB_LIB_FLAGS $LIB_SOCKET" 37 | AC_TRY_LINK(, 38 | [arx_Init();], 39 | [ac_cv_found_arx_lib=yes], 40 | ac_cv_found_arx_lib=no) 41 | LIBS=$saved_LIBS 42 | ]) 43 | 44 | AC_DEFUN(CMU_ARX_LIB_WHERE, [ 45 | for i in $1; do 46 | AC_MSG_CHECKING(for arx libraries in $i) 47 | CMU_ARX_LIB_WHERE1($i) 48 | CMU_TEST_LIBPATH($i, arx) 49 | if test "$ac_cv_found_arx_lib" = "yes" ; then 50 | ac_cv_arx_where_lib=$i 51 | AC_MSG_RESULT(found) 52 | break 53 | else 54 | AC_MSG_RESULT(not found) 55 | fi 56 | done 57 | ]) 58 | 59 | AC_DEFUN(CMU_USE_ARX, [ 60 | AC_ARG_WITH(arx, 61 | [ --with-arx=PREFIX Compile with arx support], 62 | [if test "X$with_arx" = "X"; then 63 | with_arx=yes 64 | fi]) 65 | AC_ARG_WITH(arx-lib, 66 | [ --with-arx-lib=dir use arx libraries in dir], 67 | [if test "$withval" = "yes" -o "$withval" = "no"; then 68 | AC_MSG_ERROR([No argument for --with-arx-lib]) 69 | fi]) 70 | AC_ARG_WITH(arx-include, 71 | [ --with-arx-include=dir use arx headers in dir], 72 | [if test "$withval" = "yes" -o "$withval" = "no"; then 73 | AC_MSG_ERROR([No argument for --with-arx-include]) 74 | fi]) 75 | 76 | if test "X$with_arx" != "X"; then 77 | if test "$with_arx" != "yes"; then 78 | ac_cv_arx_where_lib=$with_arx/lib 79 | ac_cv_arx_where_inc=$with_arx/include 80 | fi 81 | fi 82 | 83 | if test "X$with_arx_lib" != "X"; then 84 | ac_cv_arx_where_lib=$with_arx_lib 85 | fi 86 | if test "X$ac_cv_arx_where_lib" = "X"; then 87 | CMU_ARX_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib) 88 | fi 89 | 90 | if test "X$with_arx_include" != "X"; then 91 | ac_cv_arx_where_inc=$with_arx_include 92 | fi 93 | if test "X$ac_cv_arx_where_inc" = "X"; then 94 | CMU_ARX_INC_WHERE(/usr/athena/include /usr/local/include) 95 | fi 96 | 97 | AC_MSG_CHECKING(whether to include arx) 98 | if test "X$ac_cv_arx_where_lib" = "X" -o "X$ac_cv_arx_where_inc" = "X"; then 99 | ac_cv_found_arx=no 100 | AC_MSG_RESULT(no) 101 | else 102 | ac_cv_found_arx=yes 103 | AC_MSG_RESULT(yes) 104 | ARX_INC_DIR=$ac_cv_arx_where_inc 105 | ARX_LIB_DIR=$ac_cv_arx_where_lib 106 | ARX_INC_FLAGS="-I${ARX_INC_DIR}" 107 | ARX_LIB_FLAGS="-L${ARX_LIB_DIR} -larx" 108 | ARX_LD_FLAGS="-L${ARX_LIB_DIR}" 109 | dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally 110 | dnl Allow makefile substitutions.... 111 | AC_SUBST(ARX_INC_FLAGS) 112 | AC_SUBST(ARX_LIB_FLAGS) 113 | AC_SUBST(ARX_LD_FLAGS) 114 | if test "X$RPATH" = "X"; then 115 | RPATH="" 116 | fi 117 | case "${host}" in 118 | *-*-linux*) 119 | if test "X$RPATH" = "X"; then 120 | RPATH="-Wl,-rpath,${ARX_LIB_DIR}" 121 | else 122 | RPATH="${RPATH}:${ARX_LIB_DIR}" 123 | fi 124 | ;; 125 | *-*-hpux*) 126 | if test "X$RPATH" = "X"; then 127 | RPATH="-Wl,+b${ARX_LIB_DIR}" 128 | else 129 | RPATH="${RPATH}:${ARX_LIB_DIR}" 130 | fi 131 | ;; 132 | *-*-irix*) 133 | if test "X$RPATH" = "X"; then 134 | RPATH="-Wl,-rpath,${ARX_LIB_DIR}" 135 | else 136 | RPATH="${RPATH}:${ARX_LIB_DIR}" 137 | fi 138 | ;; 139 | *-*-solaris2*) 140 | if test "$ac_cv_prog_gcc" = yes; then 141 | if test "X$RPATH" = "X"; then 142 | RPATH="-Wl,-R${ARX_LIB_DIR}" 143 | else 144 | RPATH="${RPATH}:${ARX_LIB_DIR}" 145 | fi 146 | else 147 | RPATH="${RPATH} -R${ARX_LIB_DIR}" 148 | fi 149 | ;; 150 | esac 151 | AC_SUBST(RPATH) 152 | fi 153 | ]) 154 | 155 | -------------------------------------------------------------------------------- /cmulocal/libssl.m4: -------------------------------------------------------------------------------- 1 | dnl libssl.m4--Ssl libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH kafs and Arla 4 | dnl $Id: libssl.m4,v 1.8 2002/12/21 18:44:25 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_LIBSSL_INC_WHERE1, [ 7 | saved_CPPFLAGS=$CPPFLAGS 8 | CPPFLAGS="$saved_CPPFLAGS -I$1" 9 | CMU_CHECK_HEADER_NOCACHE(openssl/ssl.h, 10 | ac_cv_found_libssl_inc=yes, 11 | ac_cv_found_libssl_inc=no) 12 | CPPFLAGS=$saved_CPPFLAGS 13 | ]) 14 | 15 | AC_DEFUN(CMU_LIBSSL_INC_WHERE, [ 16 | for i in $1; do 17 | AC_MSG_CHECKING(for libssl headers in $i) 18 | CMU_LIBSSL_INC_WHERE1($i) 19 | CMU_TEST_INCPATH($i, ssl) 20 | if test "$ac_cv_found_libssl_inc" = "yes"; then 21 | ac_cv_libssl_where_inc=$i 22 | AC_MSG_RESULT(found) 23 | break 24 | else 25 | AC_MSG_RESULT(not found) 26 | fi 27 | done 28 | ]) 29 | 30 | AC_DEFUN(CMU_LIBSSL_LIB_WHERE1, [ 31 | saved_LIBS=$LIBS 32 | LIBS="$saved_LIBS -L$1 -lssl -lcrypto $LIB_SOCKET" 33 | AC_TRY_LINK(, 34 | [SSL_write();], 35 | [ac_cv_found_ssl_lib=yes], 36 | ac_cv_found_ssl_lib=no) 37 | LIBS=$saved_LIBS 38 | ]) 39 | 40 | AC_DEFUN(CMU_LIBSSL_LIB_WHERE, [ 41 | for i in $1; do 42 | AC_MSG_CHECKING(for libssl libraries in $i) 43 | CMU_LIBSSL_LIB_WHERE1($i) 44 | dnl deal with false positives from implicit link paths 45 | CMU_TEST_LIBPATH($i, ssl) 46 | if test "$ac_cv_found_ssl_lib" = "yes" ; then 47 | ac_cv_libssl_where_lib=$i 48 | AC_MSG_RESULT(found) 49 | break 50 | else 51 | AC_MSG_RESULT(not found) 52 | fi 53 | done 54 | ]) 55 | 56 | AC_DEFUN(CMU_LIBSSL, [ 57 | AC_REQUIRE([CMU_SOCKETS]) 58 | AC_ARG_WITH(libssl, 59 | [ --with-libssl=PREFIX Compile with Libssl support], 60 | [if test "X$with_libssl" = "X"; then 61 | with_libssl=yes 62 | fi]) 63 | AC_ARG_WITH(libssl-lib, 64 | [ --with-libssl-lib=dir use libssl libraries in dir], 65 | [if test "$withval" = "yes" -o "$withval" = "no"; then 66 | AC_MSG_ERROR([No argument for --with-libssl-lib]) 67 | fi]) 68 | AC_ARG_WITH(libssl-include, 69 | [ --with-libssl-include=dir use libssl headers in dir], 70 | [if test "$withval" = "yes" -o "$withval" = "no"; then 71 | AC_MSG_ERROR([No argument for --with-libssl-include]) 72 | fi]) 73 | 74 | if test "X$with_libssl" != "X"; then 75 | if test "$with_libssl" != "yes" -a "$with_libssl" != no; then 76 | ac_cv_libssl_where_lib=$with_libssl/lib 77 | ac_cv_libssl_where_inc=$with_libssl/include 78 | fi 79 | fi 80 | 81 | if test "$with_libssl" != "no"; then 82 | if test "X$with_libssl_lib" != "X"; then 83 | ac_cv_libssl_where_lib=$with_libssl_lib 84 | fi 85 | if test "X$ac_cv_libssl_where_lib" = "X"; then 86 | CMU_LIBSSL_LIB_WHERE(/usr/local/lib/openssl /usr/lib/openssl /usr/local/lib /usr/lib) 87 | fi 88 | 89 | if test "X$with_libssl_include" != "X"; then 90 | ac_cv_libssl_where_inc=$with_libssl_include 91 | fi 92 | if test "X$ac_cv_libssl_where_inc" = "X"; then 93 | CMU_LIBSSL_INC_WHERE(/usr/local/include /usr/include) 94 | fi 95 | fi 96 | 97 | AC_MSG_CHECKING(whether to include libssl) 98 | if test "X$ac_cv_libssl_where_lib" = "X" -a "X$ac_cv_libssl_where_inc" = "X"; then 99 | ac_cv_found_libssl=no 100 | AC_MSG_RESULT(no) 101 | else 102 | ac_cv_found_libssl=yes 103 | AC_MSG_RESULT(yes) 104 | LIBSSL_INC_DIR=$ac_cv_libssl_where_inc 105 | LIBSSL_LIB_DIR=$ac_cv_libssl_where_lib 106 | LIBSSL_INC_FLAGS="-I${LIBSSL_INC_DIR}" 107 | LIBSSL_LIB_FLAGS="-L${LIBSSL_LIB_DIR} -lssl -lcrypto" 108 | if test "X$RPATH" = "X"; then 109 | RPATH="" 110 | fi 111 | case "${host}" in 112 | *-*-linux*) 113 | if test "X$RPATH" = "X"; then 114 | RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}" 115 | else 116 | RPATH="${RPATH}:${LIBSSL_LIB_DIR}" 117 | fi 118 | ;; 119 | *-*-hpux*) 120 | if test "X$RPATH" = "X"; then 121 | RPATH="-Wl,+b${LIBSSL_LIB_DIR}" 122 | else 123 | RPATH="${RPATH}:${LIBSSL_LIB_DIR}" 124 | fi 125 | ;; 126 | *-*-irix*) 127 | if test "X$RPATH" = "X"; then 128 | RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}" 129 | else 130 | RPATH="${RPATH}:${LIBSSL_LIB_DIR}" 131 | fi 132 | ;; 133 | *-*-solaris2*) 134 | if test "$ac_cv_prog_gcc" = yes; then 135 | if test "X$RPATH" = "X"; then 136 | RPATH="-Wl,-R${LIBSSL_LIB_DIR}" 137 | else 138 | RPATH="${RPATH}:${LIBSSL_LIB_DIR}" 139 | fi 140 | else 141 | RPATH="${RPATH} -R${LIBSSL_LIB_DIR}" 142 | fi 143 | ;; 144 | esac 145 | AC_SUBST(RPATH) 146 | fi 147 | AC_SUBST(LIBSSL_INC_DIR) 148 | AC_SUBST(LIBSSL_LIB_DIR) 149 | AC_SUBST(LIBSSL_INC_FLAGS) 150 | AC_SUBST(LIBSSL_LIB_FLAGS) 151 | ]) 152 | 153 | -------------------------------------------------------------------------------- /cmulocal/com_err_link.m4: -------------------------------------------------------------------------------- 1 | dnl damnit, i don't want to figure out if I need to build an integral com_err 2 | dnl library with the collection, I just want to know where it's installed, 3 | dnl so don't bitch, Rob... 4 | dnl Derrick Brashear 5 | dnl $Id: com_err_link.m4,v 1.6 2002/12/21 18:44:24 cg2v Exp $ 6 | 7 | 8 | AC_DEFUN(CMU_COMERR_INC_WHERE1, [ 9 | saved_CPPFLAGS=$CPPFLAGS 10 | CPPFLAGS="$saved_CPPFLAGS -I$1" 11 | AC_TRY_COMPILE([#include ], 12 | [int foo;], 13 | ac_cv_found_com_err_inc=yes, 14 | ac_cv_found_com_err_inc=no) 15 | CPPFLAGS=$saved_CPPFLAGS 16 | ]) 17 | 18 | AC_DEFUN(CMU_COMERR_INC_WHERE, [ 19 | for i in $1; do 20 | AC_MSG_CHECKING(for com_err headers in $i) 21 | CMU_COMERR_INC_WHERE1($i) 22 | CMU_TEST_INCPATH($i, com_err) 23 | if test "$ac_cv_found_com_err_inc" = "yes"; then 24 | ac_cv_comerr_where_inc=$i 25 | AC_MSG_RESULT(found) 26 | break 27 | else 28 | AC_MSG_RESULT(not found) 29 | fi 30 | done 31 | ]) 32 | 33 | # 34 | # Test for lib files 35 | # 36 | 37 | AC_DEFUN(CMU_COMERR_LIB_WHERE1, [ 38 | saved_LIBS=$LIBS 39 | LIBS="$saved_LIBS -L$1 -lcom_err" 40 | AC_TRY_LINK(, 41 | [com_err();], 42 | [ac_cv_found_com_err_lib=yes], 43 | ac_cv_found_com_err_lib=no) 44 | LIBS=$saved_LIBS 45 | ]) 46 | 47 | AC_DEFUN(CMU_COMERR_LIB_WHERE, [ 48 | for i in $1; do 49 | AC_MSG_CHECKING(for com_err libraries in $i) 50 | CMU_COMERR_LIB_WHERE1($i) 51 | CMU_TEST_LIBPATH($i, com_err) 52 | if test "$ac_cv_found_com_err_lib" = "yes" ; then 53 | ac_cv_comerr_where_lib=$i 54 | AC_MSG_RESULT(found) 55 | break 56 | else 57 | AC_MSG_RESULT(not found) 58 | fi 59 | done 60 | ]) 61 | 62 | AC_DEFUN(CMU_USE_COMERR, [ 63 | AC_ARG_WITH(comerr, 64 | [ --with-comerr=PREFIX Compile with com_err support], 65 | [if test "X$with_comerr" = "X"; then 66 | with_comerr=yes 67 | fi]) 68 | AC_ARG_WITH(comerr-lib, 69 | [ --with-comerr-lib=dir use com_err libraries in dir], 70 | [if test "$withval" = "yes" -o "$withval" = "no"; then 71 | AC_MSG_ERROR([No argument for --with-comerr-lib]) 72 | fi]) 73 | AC_ARG_WITH(comerr-include, 74 | [ --with-comerr-include=dir use com_err headers in dir], 75 | [if test "$withval" = "yes" -o "$withval" = "no"; then 76 | AC_MSG_ERROR([No argument for --with-comerr-include]) 77 | fi]) 78 | 79 | if test "X$with_comerr" != "X"; then 80 | if test "$with_comerr" != "yes"; then 81 | ac_cv_comerr_where_lib=$with_comerr/lib 82 | ac_cv_comerr_where_inc=$with_comerr/include 83 | fi 84 | fi 85 | 86 | if test "X$with_comerr_lib" != "X"; then 87 | ac_cv_comerr_where_lib=$with_comerr_lib 88 | fi 89 | if test "X$ac_cv_comerr_where_lib" = "X"; then 90 | CMU_COMERR_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib) 91 | fi 92 | 93 | if test "X$with_comerr_include" != "X"; then 94 | ac_cv_comerr_where_inc=$with_comerr_include 95 | fi 96 | if test "X$ac_cv_comerr_where_inc" = "X"; then 97 | CMU_COMERR_INC_WHERE(/usr/athena/include /usr/local/include) 98 | fi 99 | 100 | AC_MSG_CHECKING(whether to include com_err) 101 | if test "X$ac_cv_comerr_where_lib" = "X" -a "X$ac_cv_comerr_where_inc" = "X"; then 102 | ac_cv_found_com_err=no 103 | AC_MSG_RESULT(no) 104 | else 105 | ac_cv_found_com_err=yes 106 | AC_MSG_RESULT(yes) 107 | COMERR_INC_DIR=$ac_cv_comerr_where_inc 108 | COMERR_LIB_DIR=$ac_cv_comerr_where_lib 109 | COMERR_INC_FLAGS="-I${COMERR_INC_DIR}" 110 | COMERR_LIB_FLAGS="-L${COMERR_LIB_DIR} -lcom_err" 111 | dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally 112 | dnl Allow makefile substitutions.... 113 | AC_SUBST(COMERR_INC_FLAGS) 114 | AC_SUBST(COMERR_LIB_FLAGS) 115 | if test "X$RPATH" = "X"; then 116 | RPATH="" 117 | fi 118 | case "${host}" in 119 | *-*-linux*) 120 | if test "X$RPATH" = "X"; then 121 | RPATH="-Wl,-rpath,${COMERR_LIB_DIR}" 122 | else 123 | RPATH="${RPATH}:${COMERR_LIB_DIR}" 124 | fi 125 | ;; 126 | *-*-hpux*) 127 | if test "X$RPATH" = "X"; then 128 | RPATH="-Wl,+b${COMERR_LIB_DIR}" 129 | else 130 | RPATH="${RPATH}:${COMERR_LIB_DIR}" 131 | fi 132 | ;; 133 | *-*-irix*) 134 | if test "X$RPATH" = "X"; then 135 | RPATH="-Wl,-rpath,${COMERR_LIB_DIR}" 136 | else 137 | RPATH="${RPATH}:${COMERR_LIB_DIR}" 138 | fi 139 | ;; 140 | *-*-solaris2*) 141 | if test "$ac_cv_prog_gcc" = yes; then 142 | if test "X$RPATH" = "X"; then 143 | RPATH="-Wl,-R${COMERR_LIB_DIR}" 144 | else 145 | RPATH="${RPATH}:${COMERR_LIB_DIR}" 146 | fi 147 | else 148 | RPATH="${RPATH} -R${COMERR_LIB_DIR}" 149 | fi 150 | ;; 151 | esac 152 | AC_SUBST(RPATH) 153 | fi 154 | ]) 155 | 156 | -------------------------------------------------------------------------------- /cmulocal/kafs.m4: -------------------------------------------------------------------------------- 1 | dnl kerberos_v4.m4--Kafs libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH kafs and Arla 4 | dnl $Id: kafs.m4,v 1.5 2002/12/21 18:44:24 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_KAFS_INC_WHERE1, [ 7 | saved_CPPFLAGS=$CPPFLAGS 8 | CPPFLAGS="$saved_CPPFLAGS -I$1" 9 | AC_TRY_COMPILE([ 10 | #include 11 | #include 12 | #include 13 | ], 14 | [struct ClearToken foo;], 15 | ac_cv_found_kafs_inc=yes, 16 | ac_cv_found_kafs_inc=no) 17 | if test "$ac_cv_found_kafs_inc" = "no"; then 18 | CPPFLAGS="$saved_CPPFLAGS -I$1 -I$1/kerberosIV" 19 | AC_TRY_COMPILE([ 20 | #include 21 | #include 22 | #include 23 | ], 24 | [struct ClearToken foo;], 25 | [ac_cv_found_kafs_inc=yes], 26 | ac_cv_found_kafs_inc=no) 27 | fi 28 | CPPFLAGS=$saved_CPPFLAGS 29 | ]) 30 | 31 | AC_DEFUN(CMU_KAFS_INC_WHERE, [ 32 | for i in $1; do 33 | AC_MSG_CHECKING(for kafs headers in $i) 34 | CMU_KAFS_INC_WHERE1($i) 35 | CMU_TEST_INCPATH($i, kafs) 36 | if test "$ac_cv_found_kafs_inc" = "yes"; then 37 | ac_cv_kafs_where_inc=$i 38 | AC_MSG_RESULT(found) 39 | break 40 | else 41 | AC_MSG_RESULT(not found) 42 | fi 43 | done 44 | ]) 45 | 46 | AC_DEFUN(CMU_KAFS_LIB_WHERE1, [ 47 | saved_LIBS=$LIBS 48 | LIBS="$saved_LIBS -L$1 -lkafs $KRB_LIB_FLAGS $KRB5_LIB_FLAGS" 49 | AC_TRY_LINK(, 50 | [krb_afslog();], 51 | [ac_cv_found_kafs_lib=yes], 52 | ac_cv_found_kafs_lib=no) 53 | LIBS=$saved_LIBS 54 | ]) 55 | 56 | AC_DEFUN(CMU_KAFS_LIB_WHERE, [ 57 | for i in $1; do 58 | AC_MSG_CHECKING(for kafs libraries in $i) 59 | CMU_KAFS_LIB_WHERE1($i) 60 | dnl deal with false positives from implicit link paths 61 | CMU_TEST_LIBPATH($i, kafs) 62 | if test "$ac_cv_found_kafs_lib" = "yes" ; then 63 | ac_cv_kafs_where_lib=$i 64 | AC_MSG_RESULT(found) 65 | break 66 | else 67 | AC_MSG_RESULT(not found) 68 | fi 69 | done 70 | ]) 71 | 72 | AC_DEFUN(CMU_KAFS, [ 73 | AC_REQUIRE([CMU_SOCKETS]) 74 | AC_REQUIRE([CMU_KRB4]) 75 | AC_REQUIRE([CMU_KRB5]) 76 | AC_ARG_WITH(kafs, 77 | [ --with-kafs=PREFIX Compile with Kafs support], 78 | [if test "X$with_kafs" = "X"; then 79 | with_kafs=yes 80 | fi]) 81 | AC_ARG_WITH(kafs-lib, 82 | [ --with-kafs-lib=dir use kafs libraries in dir], 83 | [if test "$withval" = "yes" -o "$withval" = "no"; then 84 | AC_MSG_ERROR([No argument for --with-kafs-lib]) 85 | fi]) 86 | AC_ARG_WITH(kafs-include, 87 | [ --with-kafs-include=dir use kafs headers in dir], 88 | [if test "$withval" = "yes" -o "$withval" = "no"; then 89 | AC_MSG_ERROR([No argument for --with-kafs-include]) 90 | fi]) 91 | 92 | if test "X$with_kafs" != "X"; then 93 | if test "$with_kafs" != "yes" -a "$with_kafs" != no; then 94 | ac_cv_kafs_where_lib=$with_kafs/lib 95 | ac_cv_kafs_where_inc=$with_kafs/include 96 | fi 97 | fi 98 | 99 | if test "$with_kafs" != "no"; then 100 | if test "X$with_kafs_lib" != "X"; then 101 | ac_cv_kafs_where_lib=$with_kafs_lib 102 | fi 103 | if test "X$ac_cv_kafs_where_lib" = "X"; then 104 | CMU_KAFS_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib) 105 | fi 106 | 107 | if test "X$with_kafs_include" != "X"; then 108 | ac_cv_kafs_where_inc=$with_kafs_include 109 | fi 110 | if test "X$ac_cv_kafs_where_inc" = "X"; then 111 | CMU_KAFS_INC_WHERE(/usr/athena/include /usr/include/kerberosIV /usr/local/include /usr/include/kerberos) 112 | fi 113 | fi 114 | 115 | AC_MSG_CHECKING(whether to include kafs) 116 | if test "X$ac_cv_kafs_where_lib" = "X" -a "X$ac_cv_kafs_where_inc" = "X"; then 117 | ac_cv_found_kafs=no 118 | AC_MSG_RESULT(no) 119 | else 120 | ac_cv_found_kafs=yes 121 | AC_MSG_RESULT(yes) 122 | KAFS_INC_DIR=$ac_cv_kafs_where_inc 123 | KAFS_LIB_DIR=$ac_cv_kafs_where_lib 124 | KAFS_INC_FLAGS="-I${KAFS_INC_DIR}" 125 | KAFS_LIB_FLAGS="-L${KAFS_LIB_DIR} -lkafs" 126 | if test "X$RPATH" = "X"; then 127 | RPATH="" 128 | fi 129 | case "${host}" in 130 | *-*-linux*) 131 | if test "X$RPATH" = "X"; then 132 | RPATH="-Wl,-rpath,${KAFS_LIB_DIR}" 133 | else 134 | RPATH="${RPATH}:${KAFS_LIB_DIR}" 135 | fi 136 | ;; 137 | *-*-hpux*) 138 | if test "X$RPATH" = "X"; then 139 | RPATH="-Wl,+b${KAFS_LIB_DIR}" 140 | else 141 | RPATH="${RPATH}:${KAFS_LIB_DIR}" 142 | fi 143 | ;; 144 | *-*-irix*) 145 | if test "X$RPATH" = "X"; then 146 | RPATH="-Wl,-rpath,${KAFS_LIB_DIR}" 147 | else 148 | RPATH="${RPATH}:${KAFS_LIB_DIR}" 149 | fi 150 | ;; 151 | *-*-solaris2*) 152 | if test "$ac_cv_prog_gcc" = yes; then 153 | if test "X$RPATH" = "X"; then 154 | RPATH="-Wl,-R${KAFS_LIB_DIR}" 155 | else 156 | RPATH="${RPATH}:${KAFS_LIB_DIR}" 157 | fi 158 | else 159 | RPATH="${RPATH} -R${KAFS_LIB_DIR}" 160 | fi 161 | ;; 162 | esac 163 | AC_SUBST(RPATH) 164 | fi 165 | ]) 166 | 167 | -------------------------------------------------------------------------------- /cmulocal/libcyrus.m4: -------------------------------------------------------------------------------- 1 | dnl libcyrus.m4--Cyrus libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH kafs and Arla 4 | dnl $Id: libcyrus.m4,v 1.18 2002/12/21 18:44:24 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_LIBCYRUS_INC_WHERE1, [ 7 | saved_CPPFLAGS=$CPPFLAGS 8 | CPPFLAGS="$saved_CPPFLAGS -I$1 $SASLFLAGS" 9 | CMU_CHECK_HEADER_NOCACHE(cyrus/imclient.h, 10 | ac_cv_found_cyrus_inc=yes, 11 | ac_cv_found_cyrus_inc=no) 12 | CPPFLAGS=$saved_CPPFLAGS 13 | ]) 14 | 15 | AC_DEFUN(CMU_LIBCYRUS_INC_WHERE, [ 16 | for i in $1; do 17 | AC_MSG_CHECKING(for libcyrus headers in $i) 18 | CMU_LIBCYRUS_INC_WHERE1($i) 19 | CMU_TEST_INCPATH($i, imclient) 20 | if test "$ac_cv_found_cyrus_inc" = "yes"; then 21 | ac_cv_cyrus_where_inc=$i 22 | AC_MSG_RESULT(found) 23 | break 24 | else 25 | AC_MSG_RESULT(not found) 26 | fi 27 | done 28 | ]) 29 | 30 | AC_DEFUN(CMU_LIBCYRUS_LIB_WHERE1, [ 31 | saved_LIBS=$LIBS 32 | LIBS="$saved_LIBS -L$1 -lcyrus ${LIB_SASL} ${LIBSSL_LIB_FLAGS} ${LIB_SOCKET}" 33 | AC_TRY_LINK([void fatal(){}], 34 | [imclient_authenticate();], 35 | [ac_cv_found_cyrus_lib=yes], 36 | ac_cv_found_cyrus_lib=no) 37 | LIBS=$saved_LIBS 38 | ]) 39 | 40 | AC_DEFUN(CMU_LIBCYRUS_LIB_WHERE, [ 41 | for i in $1; do 42 | AC_MSG_CHECKING(for libcyrus libraries in $i) 43 | CMU_LIBCYRUS_LIB_WHERE1($i) 44 | dnl deal with false positives from implicit link paths 45 | CMU_TEST_LIBPATH($i, cyrus) 46 | if test "$ac_cv_found_cyrus_lib" = "yes" ; then 47 | ac_cv_cyrus_where_lib=$i 48 | AC_MSG_RESULT(found) 49 | break 50 | else 51 | AC_MSG_RESULT(not found) 52 | fi 53 | done 54 | ]) 55 | 56 | AC_DEFUN(CMU_LIBCYRUS, [ 57 | AC_REQUIRE([CMU_SOCKETS]) 58 | AC_REQUIRE([CMU_SASL2]) 59 | AC_REQUIRE([CMU_LIBSSL]) 60 | AC_ARG_WITH(libcyrus, 61 | [ --with-libcyrus=PREFIX Compile with Libcyrus support], 62 | [if test "X$with_libcyrus" = "X"; then 63 | with_libcyrus=yes 64 | fi]) 65 | AC_ARG_WITH(libcyrus-lib, 66 | [ --with-libcyrus-lib=dir use libcyrus libraries in dir], 67 | [if test "$withval" = "yes" -o "$withval" = "no"; then 68 | AC_MSG_ERROR([No argument for --with-libcyrus-lib]) 69 | fi]) 70 | AC_ARG_WITH(libcyrus-include, 71 | [ --with-libcyrus-include=dir use libcyrus headers in dir], 72 | [if test "$withval" = "yes" -o "$withval" = "no"; then 73 | AC_MSG_ERROR([No argument for --with-libcyrus-include]) 74 | fi]) 75 | 76 | if test "X$with_libcyrus" != "X"; then 77 | if test "$with_libcyrus" != "yes" -a "$with_libcyrus" != no; then 78 | ac_cv_cyrus_where_lib=$with_libcyrus/lib 79 | ac_cv_cyrus_where_inc=$with_libcyrus/include 80 | fi 81 | fi 82 | 83 | if test "$with_libcyrus" != "no"; then 84 | if test "X$with_libcyrus_lib" != "X"; then 85 | ac_cv_cyrus_where_lib=$with_libcyrus_lib 86 | fi 87 | if test "X$ac_cv_cyrus_where_lib" = "X"; then 88 | CMU_LIBCYRUS_LIB_WHERE(/usr/cyrus/lib /usr/local/lib /usr/lib) 89 | fi 90 | 91 | if test "X$with_libcyrus_include" != "X"; then 92 | ac_cv_cyrus_where_inc=$with_libcyrus_include 93 | fi 94 | if test "X$ac_cv_cyrus_where_inc" = "X"; then 95 | CMU_LIBCYRUS_INC_WHERE(/usr/cyrus/include /usr/local/include /usr/local/include/cyrus /usr/include/cyrus) 96 | fi 97 | fi 98 | 99 | AC_MSG_CHECKING(whether to include libcyrus) 100 | if test "X$ac_cv_cyrus_where_lib" = "X" -o "X$ac_cv_cyrus_where_inc" = "X"; then 101 | ac_cv_found_cyrus=no 102 | AC_MSG_RESULT(no) 103 | else 104 | ac_cv_found_cyrus=yes 105 | AC_MSG_RESULT(yes) 106 | LIBCYRUS_INC_DIR=$ac_cv_cyrus_where_inc 107 | LIBCYRUS_LIB_DIR=$ac_cv_cyrus_where_lib 108 | LIBCYRUS_INC_FLAGS="-I${LIBCYRUS_INC_DIR}" 109 | LIBCYRUS_LIB_FLAGS="-L${LIBCYRUS_LIB_DIR} -lcyrus" 110 | if test "X$RPATH" = "X"; then 111 | RPATH="" 112 | fi 113 | case "${host}" in 114 | *-*-linux*) 115 | if test "X$RPATH" = "X"; then 116 | RPATH="-Wl,-rpath,${LIBCYRUS_LIB_DIR}" 117 | else 118 | RPATH="${RPATH}:${LIBCYRUS_LIB_DIR}" 119 | fi 120 | ;; 121 | *-*-hpux*) 122 | if test "X$RPATH" = "X"; then 123 | RPATH="-Wl,+b${LIBCYRUS_LIB_DIR}" 124 | else 125 | RPATH="${RPATH}:${LIBCYRUS_LIB_DIR}" 126 | fi 127 | ;; 128 | *-*-irix*) 129 | if test "X$RPATH" = "X"; then 130 | RPATH="-Wl,-rpath,${LIBCYRUS_LIB_DIR}" 131 | else 132 | RPATH="${RPATH}:${LIBCYRUS_LIB_DIR}" 133 | fi 134 | ;; 135 | *-*-solaris2*) 136 | if test "$ac_cv_prog_gcc" = yes; then 137 | if test "X$RPATH" = "X"; then 138 | RPATH="-Wl,-R${LIBCYRUS_LIB_DIR}" 139 | else 140 | RPATH="${RPATH}:${LIBCYRUS_LIB_DIR}" 141 | fi 142 | else 143 | RPATH="${RPATH} -R${LIBCYRUS_LIB_DIR}" 144 | fi 145 | ;; 146 | esac 147 | AC_SUBST(RPATH) 148 | fi 149 | AC_SUBST(LIBCYRUS_INC_DIR) 150 | AC_SUBST(LIBCYRUS_LIB_DIR) 151 | AC_SUBST(LIBCYRUS_INC_FLAGS) 152 | AC_SUBST(LIBCYRUS_LIB_FLAGS) 153 | ]) 154 | 155 | -------------------------------------------------------------------------------- /codes.c: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1993,1994 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | /* 26 | Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore) 27 | 28 | Permission to use, copy, modify, and distribute this material 29 | for any purpose and without fee is hereby granted, provided 30 | that the above copyright notice and this permission notice 31 | appear in all copies, and that the name of Bellcore not be 32 | used in advertising or publicity pertaining to this 33 | material without the specific, prior written permission 34 | of an authorized representative of Bellcore. BELLCORE 35 | MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 36 | OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS", 37 | WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. */ 38 | #include 39 | #include 40 | #include 41 | #include "xmalloc.h" 42 | #include "md5.h" 43 | 44 | void output64chunk(int c1, int c2, int c3, int pads, FILE *outfile); 45 | static char basis_64[] = 46 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 47 | 48 | int to64(FILE *infile, FILE *outfile, long int limit) 49 | { 50 | int c1, c2, c3, ct=0, written=0; 51 | 52 | if (limit && limit < 73) return 1; 53 | 54 | while ((c1 = getc(infile)) != EOF) { 55 | c2 = getc(infile); 56 | if (c2 == EOF) { 57 | output64chunk(c1, 0, 0, 2, outfile); 58 | } else { 59 | c3 = getc(infile); 60 | if (c3 == EOF) { 61 | output64chunk(c1, c2, 0, 1, outfile); 62 | } else { 63 | output64chunk(c1, c2, c3, 0, outfile); 64 | } 65 | } 66 | ct += 4; 67 | if (ct > 71) { 68 | putc('\n', outfile); 69 | if (limit) { 70 | limit -= ct + 1; 71 | if (limit < 73) return 1; 72 | } 73 | written += 73; 74 | ct = 0; 75 | } 76 | } 77 | if (ct) { 78 | putc('\n', outfile); 79 | ct++; 80 | } 81 | return written + ct; 82 | } 83 | 84 | void output64chunk(int c1, int c2, int c3, int pads, FILE *outfile) 85 | { 86 | putc(basis_64[c1>>2], outfile); 87 | putc(basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)], outfile); 88 | if (pads == 2) { 89 | putc('=', outfile); 90 | putc('=', outfile); 91 | } else if (pads) { 92 | putc(basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)], outfile); 93 | putc('=', outfile); 94 | } else { 95 | putc(basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)], outfile); 96 | putc(basis_64[c3 & 0x3F], outfile); 97 | } 98 | } 99 | 100 | char *md5contextTo64(MD5_CTX *context) 101 | { 102 | unsigned char digest[18]; 103 | char encodedDigest[25]; 104 | int i; 105 | char *p; 106 | 107 | MD5Final(digest, context); 108 | digest[sizeof(digest)-1] = digest[sizeof(digest)-2] = 0; 109 | 110 | p = encodedDigest; 111 | for (i=0; i < sizeof(digest); i+=3) { 112 | *p++ = basis_64[digest[i]>>2]; 113 | *p++ = basis_64[((digest[i] & 0x3)<<4) | ((digest[i+1] & 0xF0)>>4)]; 114 | *p++ = basis_64[((digest[i+1] & 0xF)<<2) | ((digest[i+2] & 0xC0)>>6)]; 115 | *p++ = basis_64[digest[i+2] & 0x3F]; 116 | } 117 | *p-- = '\0'; 118 | *p-- = '='; 119 | *p-- = '='; 120 | return strsave(encodedDigest); 121 | } 122 | 123 | char *md5digest(FILE *infile, long int *len) 124 | { 125 | MD5_CTX context; 126 | char buf[1000]; 127 | long length = 0; 128 | int nbytes; 129 | 130 | MD5Init(&context); 131 | while ((nbytes = fread(buf, 1, sizeof(buf), infile))) { 132 | length += nbytes; 133 | MD5Update(&context, buf, nbytes); 134 | } 135 | rewind(infile); 136 | if (len) *len = length; 137 | return md5contextTo64(&context); 138 | } 139 | -------------------------------------------------------------------------------- /cmulocal/nadine.m4: -------------------------------------------------------------------------------- 1 | dnl nadine.m4--The nadine event library 2 | dnl Derrick Brashear 3 | dnl from KTH kafs and Arla 4 | dnl $Id: nadine.m4,v 1.5 2002/12/21 18:44:25 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_NADINE_INC_WHERE1, [ 7 | saved_CPPFLAGS=$CPPFLAGS 8 | CPPFLAGS="$saved_CPPFLAGS -I$1" 9 | CMU_CHECK_HEADER_NOCACHE(libevent/libevent.h, 10 | ac_cv_found_event_inc=yes, 11 | ac_cv_found_event_inc=no) 12 | CPPFLAGS=$saved_CPPFLAGS 13 | ]) 14 | 15 | AC_DEFUN(CMU_NADINE_INC_WHERE, [ 16 | for i in $1; do 17 | AC_MSG_CHECKING(for nadine headers in $i) 18 | CMU_NADINE_INC_WHERE1($i) 19 | dnl CMU_TEST_INCPATH($i, ssl) 20 | dnl CMU_TEST_INCPATH isn't very versatile 21 | if test "$ac_cv_found_event_inc" = "yes"; then 22 | if test \! -f $i/libevent/libevent.h ; then 23 | ac_cv_found_event_inc=no 24 | fi 25 | fi 26 | if test "$ac_cv_found_event_inc" = "yes"; then 27 | ac_cv_event_where_inc=$i 28 | AC_MSG_RESULT(found) 29 | break 30 | else 31 | AC_MSG_RESULT(not found) 32 | fi 33 | done 34 | ]) 35 | 36 | AC_DEFUN(CMU_NADINE_LIB_WHERE1, [ 37 | saved_LIBS=$LIBS 38 | LIBS="$saved_LIBS -L$1 -levent" 39 | AC_TRY_LINK(, 40 | [libevent_Initialize();], 41 | [ac_cv_found_event_lib=yes], 42 | ac_cv_found_event_lib=no) 43 | LIBS=$saved_LIBS 44 | ]) 45 | 46 | AC_DEFUN(CMU_NADINE_LIB_WHERE, [ 47 | for i in $1; do 48 | AC_MSG_CHECKING(for event libraries in $i) 49 | CMU_NADINE_LIB_WHERE1($i) 50 | dnl deal with false positives from implicit link paths 51 | CMU_TEST_LIBPATH($i, event) 52 | if test "$ac_cv_found_event_lib" = "yes" ; then 53 | ac_cv_event_where_lib=$i 54 | AC_MSG_RESULT(found) 55 | break 56 | else 57 | AC_MSG_RESULT(not found) 58 | fi 59 | done 60 | ]) 61 | 62 | AC_DEFUN(CMU_NADINE, [ 63 | AC_REQUIRE([CMU_SOCKETS]) 64 | AC_ARG_WITH(nadine, 65 | [ --with-nadine=PREFIX Compile with nadine libevent support], 66 | [if test "X$with_nadine" = "X"; then 67 | with_nadine=yes 68 | fi]) 69 | AC_ARG_WITH(nadine-lib, 70 | [ --with-nadine-lib=dir use nadine libraries in dir], 71 | [if test "$withval" = "yes" -o "$withval" = "no"; then 72 | AC_MSG_ERROR([No argument for --with-nadine-lib]) 73 | fi]) 74 | AC_ARG_WITH(nadine-include, 75 | [ --with-nadine-include=dir use nadine headers in dir], 76 | [if test "$withval" = "yes" -o "$withval" = "no"; then 77 | AC_MSG_ERROR([No argument for --with-nadine-include]) 78 | fi]) 79 | 80 | if test "$with_ucdsnmp" = "no" ; then 81 | AC_MSG_WARN([Nadine requires UCD SNMP. Disabling Nadine support]) 82 | with_nadine=no 83 | with_nadine_lib=no 84 | with_nadine_include=no 85 | fi 86 | if test "X$with_nadine" != "X"; then 87 | if test "$with_nadine" != "yes" -a "$with_nadine" != no; then 88 | ac_cv_event_where_lib=$with_nadine/lib 89 | ac_cv_event_where_inc=$with_nadine/include 90 | fi 91 | fi 92 | 93 | if test "$with_nadine" != "no"; then 94 | if test "X$with_nadine_lib" != "X"; then 95 | ac_cv_event_where_lib=$with_nadine_lib 96 | fi 97 | if test "X$ac_cv_event_where_lib" = "X"; then 98 | CMU_NADINE_LIB_WHERE(/usr/local/lib /usr/ng/lib /usr/lib) 99 | fi 100 | 101 | if test "X$with_nadine_include" != "X"; then 102 | ac_cv_event_where_inc=$with_nadine_include 103 | fi 104 | if test "X$ac_cv_event_where_inc" = "X"; then 105 | CMU_NADINE_INC_WHERE(/usr/local/include /usr/ng/include /usr/include) 106 | fi 107 | fi 108 | 109 | AC_MSG_CHECKING(whether to include nadine) 110 | if test "X$ac_cv_event_where_lib" = "X" -a "X$ac_cv_event_where_inc" = "X"; then 111 | ac_cv_found_event=no 112 | AC_MSG_RESULT(no) 113 | else 114 | ac_cv_found_event=yes 115 | AC_MSG_RESULT(yes) 116 | NADINE_INC_DIR=$ac_cv_event_where_inc 117 | NADINE_LIB_DIR=$ac_cv_event_where_lib 118 | NADINE_INC_FLAGS="-I${NADINE_INC_DIR}" 119 | NADINE_LIB_FLAGS="-L${NADINE_LIB_DIR} -levent" 120 | if test "X$RPATH" = "X"; then 121 | RPATH="" 122 | fi 123 | case "${host}" in 124 | *-*-linux*) 125 | if test "X$RPATH" = "X"; then 126 | RPATH="-Wl,-rpath,${NADINE_LIB_DIR}" 127 | else 128 | RPATH="${RPATH}:${NADINE_LIB_DIR}" 129 | fi 130 | ;; 131 | *-*-hpux*) 132 | if test "X$RPATH" = "X"; then 133 | RPATH="-Wl,+b${NADINE_LIB_DIR}" 134 | else 135 | RPATH="${RPATH}:${NADINE_LIB_DIR}" 136 | fi 137 | ;; 138 | *-*-irix*) 139 | if test "X$RPATH" = "X"; then 140 | RPATH="-Wl,-rpath,${NADINE_LIB_DIR}" 141 | else 142 | RPATH="${RPATH}:${NADINE_LIB_DIR}" 143 | fi 144 | ;; 145 | *-*-solaris2*) 146 | if test "$ac_cv_prog_gcc" = yes; then 147 | if test "X$RPATH" = "X"; then 148 | RPATH="-Wl,-R${NADINE_LIB_DIR}" 149 | else 150 | RPATH="${RPATH}:${NADINE_LIB_DIR}" 151 | fi 152 | else 153 | RPATH="${RPATH} -R${NADINE_LIB_DIR}" 154 | fi 155 | ;; 156 | esac 157 | AC_SUBST(RPATH) 158 | fi 159 | AC_SUBST(NADINE_INC_DIR) 160 | AC_SUBST(NADINE_LIB_DIR) 161 | AC_SUBST(NADINE_INC_FLAGS) 162 | AC_SUBST(NADINE_LIB_FLAGS) 163 | ]) 164 | 165 | -------------------------------------------------------------------------------- /macmpack.h: -------------------------------------------------------------------------------- 1 | /* macmpack.h -- resources for mac interface to mpack 2 | */ 3 | /* (C) Copyright 1995 by Carnegie Mellon University 4 | * All Rights Reserved. 5 | * 6 | * Permission to use, copy, modify, distribute, and sell this software 7 | * and its documentation for any purpose is hereby granted without 8 | * fee, provided that the above copyright notice appear in all copies 9 | * and that both that copyright notice and this permission notice 10 | * appear in supporting documentation, and that the name of Carnegie 11 | * Mellon University not be used in advertising or publicity 12 | * pertaining to distribution of the software without specific, 13 | * written prior permission. Carnegie Mellon University makes no 14 | * representations about the suitability of this software for any 15 | * purpose. It is provided "as is" without express or implied 16 | * warranty. 17 | * 18 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 19 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 20 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 21 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 22 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 23 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 24 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 25 | * SOFTWARE. 26 | */ 27 | /* (C) Copyright 1993-1995 by Christopher J. Newman 28 | * All Rights Reserved. 29 | * 30 | * Permission to use, copy, modify, distribute, and sell this software and its 31 | * documentation for any purpose is hereby granted without fee, provided that 32 | * the above copyright notice appear in all copies and that both that 33 | * copyright notice and this permission notice appear in supporting 34 | * documentation, and that the name of Christopher J. Newman not be used in 35 | * advertising or publicity pertaining to distribution of the software without 36 | * specific, written prior permission. Christopher J. Newman makes no 37 | * representations about the suitability of this software for any purpose. It 38 | * is provided "as is" without express or implied warranty. 39 | * 40 | * CHRISTOPHER J. NEWMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 41 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 42 | * SHALL CHRISTOPHER J. NEWMAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR 43 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 44 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 45 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 46 | * OF THIS SOFTWARE. 47 | */ 48 | 49 | #define progDLOG 128 50 | #define decodeDLOG 129 51 | #define warnALRT 131 52 | #define errorALRT 133 53 | #define prefsDLOG 134 54 | #define dstatDLOG 135 55 | #define sendDLOG 136 56 | 57 | #define prefsID 128 58 | #define IDnaID 1000 59 | 60 | #define mainMBAR 128 61 | 62 | #define textWIND 128 63 | #define helpWIND 129 64 | 65 | #define helpTEXT 128 66 | #define helpSTYL 128 67 | 68 | /* file menu */ 69 | #define iEncode 1 70 | #define iDecode 2 71 | #define iInsert 3 72 | #define iClose 4 73 | #define iPrefs 6 74 | #define iQuit 8 75 | 76 | /* help menu */ 77 | #define iHelp 1 78 | 79 | /* progress dialog items */ 80 | #define iWorkText 1 81 | #define iProgress 3 82 | 83 | /* decode dialog items */ 84 | #define iAdd 3 85 | #define iRemove 4 86 | #define iFileList 5 87 | #define iFileScroll 6 88 | 89 | /* replace alert */ 90 | #define iNewname 1 91 | #define iReplace 2 92 | 93 | /* preferences dialog */ 94 | #define iHost 3 95 | #define iAuto 6 96 | #define iData 7 97 | #define iSingle 8 98 | #define iDouble 9 99 | #define iTextEncode 10 100 | #define iQuitFinish 11 101 | #define iEmailAddr 12 102 | #define iMailServer 15 103 | #define iSet 16 104 | 105 | /* decode status dialog */ 106 | #define iStatus 2 107 | #define iStatScroll 3 108 | 109 | /* encode/send dialog */ 110 | #define iSubj 4 111 | #define iEmail 5 112 | #define iSavefile 6 113 | #define iEmailto 7 114 | #define iLimit 8 115 | #define iPartLimit 9 116 | #define iBar 11 117 | #define iDescEdit 3 118 | 119 | /* mpack prefs folder */ 120 | extern struct pref_folder { 121 | short refnum; 122 | FSSpec fspec; 123 | unsigned char prefs[257]; 124 | } *pfolder; 125 | 126 | /* mpack preferences */ 127 | extern struct mpack_preferences { 128 | short encoding; 129 | short extract_text; 130 | short quit_finished; 131 | short reserved[4]; 132 | char internet_host[2]; /* C string */ 133 | } **mpack_prefs; 134 | 135 | /* encodings */ 136 | #define EN_AUTO 0 137 | #define EN_DATA 1 138 | #define EN_DOUBLE 2 139 | #define EN_SINGLE 3 140 | 141 | /* shared routines */ 142 | FILE *Macopen(FILE *, Str255, short, long, short, short, SignedByte); 143 | void maccleanup(void); 144 | void MapTypeCreator(char *, OSType); 145 | 146 | /* used for chatting */ 147 | void statrefresh(void); 148 | void stattext(Str255, unsigned char); 149 | extern short didchat; 150 | 151 | /* buffer for copy operations */ 152 | #define COPY_BUFSIZE 1024 153 | extern char copy_buf[COPY_BUFSIZE]; 154 | 155 | /* watch cursor */ 156 | extern Cursor watch; 157 | -------------------------------------------------------------------------------- /cmulocal/kerberos_v5.m4: -------------------------------------------------------------------------------- 1 | dnl kerberos_v5.m4--Kerberos 5 libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH krb and Arla 4 | dnl $Id: kerberos_v5.m4,v 1.6 2002/12/21 18:44:24 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_KRB5_INC_WHERE1, [ 7 | saved_CPPFLAGS=$CPPFLAGS 8 | CPPFLAGS="$saved_CPPFLAGS -I$1" 9 | AC_TRY_COMPILE([#include ], 10 | [krb5_keyblock foo;], 11 | ac_cv_found_krb5_inc=yes, 12 | ac_cv_found_krb5_inc=no) 13 | CPPFLAGS=$saved_CPPFLAGS 14 | ]) 15 | 16 | AC_DEFUN(CMU_KRB5_INC_WHERE, [ 17 | for i in $1; do 18 | AC_MSG_CHECKING(for krb5 headers in $i) 19 | CMU_KRB5_INC_WHERE1($i) 20 | CMU_TEST_INCPATH($i, krb5) 21 | if test "$ac_cv_found_krb5_inc" = "yes"; then 22 | ac_cv_krb5_where_inc=$i 23 | AC_MSG_RESULT(found) 24 | break 25 | else 26 | AC_MSG_RESULT(not found) 27 | fi 28 | done 29 | ]) 30 | 31 | # 32 | # Test for kerberos lib files 33 | # 34 | 35 | AC_DEFUN(CMU_KRB5_LIB_WHERE1, [ 36 | saved_LIBS=$LIBS 37 | LIBS="$saved_LIBS -L$1 -lkrb5 -lk5crypto" 38 | AC_TRY_LINK(, 39 | [krb5_get_in_tkt();], 40 | [ac_cv_found_krb5_lib=yes], 41 | ac_cv_found_krb5_lib=no) 42 | LIBS=$saved_LIBS 43 | ]) 44 | 45 | AC_DEFUN(CMU_KRB5_HLIB_WHERE1, [ 46 | saved_LIBS=$LIBS 47 | LIBS="$saved_LIBS -L$1 -lkrb5 -ldes -lasn1" 48 | AC_TRY_LINK(, 49 | [krb5_get_in_tkt();], 50 | [ac_cv_found_krb5_lib=yes], 51 | ac_cv_found_krb5_lib=no) 52 | LIBS=$saved_LIBS 53 | ]) 54 | 55 | AC_DEFUN(CMU_KRB5_LIB_WHERE, [ 56 | for i in $1; do 57 | AC_MSG_CHECKING(for krb5 libraries in $i) 58 | CMU_KRB5_LIB_WHERE1($i) 59 | CMU_TEST_LIBPATH($i, krb5) 60 | if test "$ac_cv_found_krb5_lib" = "yes" ; then 61 | ac_cv_krb5_where_lib=$i 62 | AC_MSG_RESULT(found) 63 | break 64 | else 65 | AC_MSG_RESULT(not found) 66 | fi 67 | done 68 | ]) 69 | 70 | AC_DEFUN(CMU_KRB5_HLIB_WHERE, [ 71 | for i in $1; do 72 | AC_MSG_CHECKING(for heimdal krb5 libraries in $i) 73 | CMU_KRB5_HLIB_WHERE1($i) 74 | CMU_TEST_LIBPATH($i, krb5) 75 | if test "$ac_cv_found_krb5_lib" = "yes" ; then 76 | ac_cv_krb5_where_hlib=$i 77 | AC_MSG_RESULT(found) 78 | break 79 | else 80 | AC_MSG_RESULT(not found) 81 | fi 82 | done 83 | ]) 84 | 85 | AC_DEFUN(CMU_KRB5, [ 86 | AC_REQUIRE([CMU_SOCKETS]) 87 | AC_REQUIRE([CMU_USE_COMERR]) 88 | AC_ARG_WITH(krb5, 89 | [ --with-krb5=PREFIX Compile with Kerberos 5 support], 90 | [if test "X$with_krb5" = "X"; then 91 | with_krb5=yes 92 | fi]) 93 | AC_ARG_WITH(krb5-lib, 94 | [ --with-krb5-lib=dir use kerberos 5 libraries in dir], 95 | [if test "$withval" = "yes" -o "$withval" = "no"; then 96 | AC_MSG_ERROR([No argument for --with-krb5-lib]) 97 | fi]) 98 | AC_ARG_WITH(krb5-include, 99 | [ --with-krb5-include=dir use kerberos 5 headers in dir], 100 | [if test "$withval" = "yes" -o "$withval" = "no"; then 101 | AC_MSG_ERROR([No argument for --with-krb5-include]) 102 | fi]) 103 | 104 | if test "X$with_krb5" != "X"; then 105 | if test "$with_krb5" != "yes" -a "$with_krb5" != "no"; then 106 | ac_cv_krb5_where_lib=$with_krb5/lib 107 | ac_cv_krb5_where_inc=$with_krb5/include 108 | fi 109 | fi 110 | 111 | if test "$with_krb5" != "no"; then 112 | if test "X$with_krb5_lib" != "X"; then 113 | ac_cv_krb5_where_lib=$with_krb5_lib 114 | fi 115 | if test "X$ac_cv_krb5_where_lib" = "X"; then 116 | CMU_KRB5_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib) 117 | fi 118 | if test "X$ac_cv_krb5_where_lib" = "X"; then 119 | CMU_KRB5_HLIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib) 120 | fi 121 | 122 | if test "X$with_krb5_include" != "X"; then 123 | ac_cv_krb5_where_inc=$with_krb5_include 124 | fi 125 | if test "X$ac_cv_krb5_where_inc" = "X"; then 126 | CMU_KRB5_INC_WHERE(/usr/athena/include /usr/include/kerberos /usr/local/include /usr/include) 127 | fi 128 | fi 129 | 130 | AC_MSG_CHECKING(whether to include kerberos 5) 131 | if test "X$ac_cv_krb5_where_lib" = "X" -a "X$ac_cv_krb5_where_hlib" = "X" -o "X$ac_cv_krb5_where_inc" = "X"; then 132 | ac_cv_found_krb5=no 133 | AC_MSG_RESULT(no) 134 | else 135 | ac_cv_found_krb5=yes 136 | AC_MSG_RESULT(yes) 137 | KRB5_INC_DIR=$ac_cv_krb5_where_inc 138 | if test "X$ac_cv_krb5_where_hlib" = "X"; then 139 | KRB5_LIB_DIR=$ac_cv_krb5_where_lib 140 | KRB5_LIB_FLAGS="-L${KRB5_LIB_DIR} -lkrb5 -lk5crypto" 141 | else 142 | KRB5_LIB_DIR=$ac_cv_krb5_where_hlib 143 | KRB5_LIB_FLAGS="-L${KRB5_LIB_DIR} -lkrb5 -ldes -lasn1" 144 | AC_DEFINE(HEIMDAL,,[we found heimdal krb5 and not MIT krb5]) 145 | fi 146 | KRB5_INC_FLAGS="-I${KRB5_INC_DIR}" 147 | AC_SUBST(KRB5_INC_FLAGS) 148 | AC_SUBST(KRB5_LIB_FLAGS) 149 | AC_DEFINE(KRB5,,[Use Kerberos 5. (maybe find what needs this and nuke it)]) 150 | if test "X$RPATH" = "X"; then 151 | RPATH="" 152 | fi 153 | case "${host}" in 154 | *-*-linux*) 155 | if test "X$RPATH" = "X"; then 156 | RPATH="-Wl,-rpath,${KRB5_LIB_DIR}" 157 | else 158 | RPATH="${RPATH}:${KRB5_LIB_DIR}" 159 | fi 160 | ;; 161 | *-*-hpux*) 162 | if test "X$RPATH" = "X"; then 163 | RPATH="-Wl,+b${KRB5_LIB_DIR}" 164 | else 165 | RPATH="${RPATH}:${KRB5_LIB_DIR}" 166 | fi 167 | ;; 168 | *-*-irix*) 169 | if test "X$RPATH" = "X"; then 170 | RPATH="-Wl,-rpath,${KRB5_LIB_DIR}" 171 | else 172 | RPATH="${RPATH}:${KRB5_LIB_DIR}" 173 | fi 174 | ;; 175 | *-*-solaris2*) 176 | if test "$ac_cv_prog_gcc" = yes; then 177 | if test "X$RPATH" = "X"; then 178 | RPATH="-Wl,-R${KRB5_LIB_DIR}" 179 | else 180 | RPATH="${RPATH}:${KRB5_LIB_DIR}" 181 | fi 182 | else 183 | RPATH="${RPATH} -R${KRB5_LIB_DIR}" 184 | fi 185 | ;; 186 | esac 187 | AC_SUBST(RPATH) 188 | fi 189 | ]) 190 | 191 | -------------------------------------------------------------------------------- /cmulocal/libnet.m4: -------------------------------------------------------------------------------- 1 | dnl libnet.m4--libnet and includes 2 | dnl Derrick Brashear 3 | dnl from KTH krb and Arla 4 | dnl $Id: libnet.m4,v 1.6 2002/12/21 18:44:24 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_LIBNET_CFG_WHERE1, [ 7 | ac_cv_found_libnet_bin=no 8 | if test -f "$1/libnet-config" ; then 9 | ac_cv_found_libnet_cfg=yes 10 | fi 11 | ]) 12 | 13 | AC_DEFUN(CMU_LIBNET_CFG_WHERE, [ 14 | for i in $1; do 15 | AC_MSG_CHECKING(for libnet config in $i) 16 | CMU_LIBNET_CFG_WHERE1($i) 17 | if test "$ac_cv_found_libnet_cfg" = "yes"; then 18 | ac_cv_libnet_where_cfg=$i 19 | AC_MSG_RESULT(found) 20 | break 21 | else 22 | AC_MSG_RESULT(not found) 23 | fi 24 | done 25 | ]) 26 | 27 | AC_DEFUN(CMU_LIBNET_INC_WHERE1, [ 28 | ac_cv_found_libnet_inc=no 29 | if test -f "$1/libnet.h" ; then 30 | ac_cv_found_libnet_inc=yes 31 | fi 32 | ]) 33 | 34 | AC_DEFUN(CMU_LIBNET_INC_WHERE, [ 35 | for i in $1; do 36 | AC_MSG_CHECKING(for libnet header in $i) 37 | CMU_LIBNET_INC_WHERE1($i) 38 | if test "$ac_cv_found_libnet_inc" = "yes"; then 39 | ac_cv_libnet_where_inc=$i 40 | AC_MSG_RESULT(found) 41 | break 42 | else 43 | AC_MSG_RESULT(not found) 44 | fi 45 | done 46 | ]) 47 | 48 | AC_DEFUN(CMU_LIBNET_LIB_WHERE1, [ 49 | saved_LIBS=$LIBS 50 | LIBS="$saved_LIBS -L$1 -lnet" 51 | AC_TRY_LINK(, 52 | [open_link_interface("","");], 53 | [ac_cv_found_libnet_lib=yes], 54 | AC_TRY_LINK(, 55 | [libnet_open_link_interface("","");], 56 | [ 57 | CMU_LIBNET_CFLAGS_ADD="-DNEW_LIBNET_INTERFACE" 58 | ac_cv_found_libnet_lib=yes 59 | ], 60 | ac_cv_found_libnet_lib=no) 61 | ) 62 | LIBS=$saved_LIBS 63 | ]) 64 | 65 | AC_DEFUN(CMU_LIBNET_LIB_WHERE, [ 66 | for i in $1; do 67 | AC_MSG_CHECKING(for libnet library in $i) 68 | CMU_LIBNET_LIB_WHERE1($i) 69 | CMU_TEST_LIBPATH($i, net) 70 | if test "$ac_cv_found_libnet_lib" = "yes" ; then 71 | ac_cv_libnet_where_lib=$i 72 | AC_MSG_RESULT(found) 73 | break 74 | else 75 | AC_MSG_RESULT(not found) 76 | fi 77 | done 78 | ]) 79 | 80 | AC_DEFUN(CMU_LIBNET, [ 81 | AC_ARG_WITH(libnet, 82 | [ --with-libnet=PREFIX Compile with LIBNET support], 83 | [if test "X$with_libnet" = "X"; then 84 | with_libnet=yes 85 | fi]) 86 | AC_ARG_WITH(libnet-config, 87 | [ --with-libnet-config=dir use libnet config program in dir], 88 | [if test "$withval" = "yes" -o "$withval" = "no"; then 89 | AC_MSG_ERROR([No argument for --with-libnet-config]) 90 | fi]) 91 | AC_ARG_WITH(libnet-lib, 92 | [ --with-libnet-lib=dir use libnet libraries in dir], 93 | [if test "$withval" = "yes" -o "$withval" = "no"; then 94 | AC_MSG_ERROR([No argument for --with-libnet-lib]) 95 | fi]) 96 | AC_ARG_WITH(libnet-include, 97 | [ --with-libnet-include=dir use libnet headers in dir], 98 | [if test "$withval" = "yes" -o "$withval" = "no"; then 99 | AC_MSG_ERROR([No argument for --with-libnet-include]) 100 | fi]) 101 | 102 | if test "X$with_libnet" != "X"; then 103 | if test "$with_libnet" != "yes"; then 104 | if test -f "$with_libnet/libnet-config"; then 105 | ac_cv_libnet_where_cfg=$with_libnet 106 | else 107 | ac_cv_libnet_where_cfg=$with_libnet/bin 108 | fi 109 | ac_cv_libnet_where_lib=$with_libnet/lib 110 | ac_cv_libnet_where_inc=$with_libnet/include 111 | fi 112 | fi 113 | 114 | if test "X$with_libnet_cfg" != "X"; then 115 | ac_cv_libnet_where_cfg=$with_libnet_cfg 116 | fi 117 | if test "X$ac_cv_libnet_where_cfg" = "X"; then 118 | CMU_LIBNET_CFG_WHERE(/usr/ng/bin /usr/bin /usr/local/bin) 119 | fi 120 | 121 | if test "X$with_libnet_lib" != "X"; then 122 | ac_cv_libnet_where_lib=$with_libnet_lib 123 | fi 124 | if test "X$ac_cv_libnet_where_lib" = "X"; then 125 | CMU_LIBNET_LIB_WHERE(/usr/ng/lib /usr/lib /usr/local/lib) 126 | fi 127 | 128 | if test "X$with_libnet_include" != "X"; then 129 | ac_cv_libnet_where_inc=$with_libnet_include 130 | fi 131 | if test "X$ac_cv_libnet_where_inc" = "X"; then 132 | CMU_LIBNET_INC_WHERE(/usr/ng/include /usr/include /usr/local/include) 133 | fi 134 | 135 | AC_MSG_CHECKING(whether to include libnet) 136 | if test "X$ac_cv_libnet_where_lib" = "X" -o "X$ac_cv_libnet_where_inc" = "X" -o "X$ac_cv_libnet_where_cfg" = "X"; then 137 | ac_cv_found_libnet=no 138 | AC_MSG_RESULT(no) 139 | else 140 | ac_cv_found_libnet=yes 141 | AC_MSG_RESULT(yes) 142 | LIBNET_CONFIG=$ac_cv_libnet_where_cfg/libnet-config 143 | LIBNET_INC_DIR=$ac_cv_libnet_where_inc 144 | LIBNET_LIB_DIR=$ac_cv_libnet_where_lib 145 | 146 | LIBNET_CFLAGS="`$LIBNET_CONFIG --cflags` ${CMU_LIBNET_CFLAGS_ADD}" 147 | LIBNET_DEF_FLAGS="`$LIBNET_CONFIG --defines`" 148 | LIBNET_INC_FLAGS="-I${LIBNET_INC_DIR}" 149 | LIBNET_LIB_FLAGS="-L${LIBNET_LIB_DIR} `${LIBNET_CONFIG} --libs`" 150 | 151 | if test "X$RPATH" = "X"; then 152 | RPATH="" 153 | fi 154 | case "${host}" in 155 | *-*-linux*) 156 | if test "X$RPATH" = "X"; then 157 | RPATH="-Wl,-rpath,${LIBNET_LIB_DIR}" 158 | else 159 | RPATH="${RPATH}:${LIBNET_LIB_DIR}" 160 | fi 161 | ;; 162 | *-*-hpux*) 163 | if test "X$RPATH" = "X"; then 164 | RPATH="-Wl,+b${LIBNET_LIB_DIR}" 165 | else 166 | RPATH="${RPATH}:${LIBNET_LIB_DIR}" 167 | fi 168 | ;; 169 | *-*-irix*) 170 | if test "X$RPATH" = "X"; then 171 | RPATH="-Wl,-rpath,${LIBNET_LIB_DIR}" 172 | else 173 | RPATH="${RPATH}:${LIBNET_LIB_DIR}" 174 | fi 175 | ;; 176 | *-*-solaris2*) 177 | if test "$ac_cv_prog_gcc" = yes; then 178 | if test "X$RPATH" = "X"; then 179 | RPATH="-Wl,-R${LIBNET_LIB_DIR}" 180 | else 181 | RPATH="${RPATH}:${LIBNET_LIB_DIR}" 182 | fi 183 | else 184 | RPATH="${RPATH} -R${LIBNET_LIB_DIR}" 185 | fi 186 | ;; 187 | esac 188 | AC_SUBST(RPATH) 189 | fi 190 | ]) 191 | 192 | -------------------------------------------------------------------------------- /cmulocal/heimdal.m4: -------------------------------------------------------------------------------- 1 | dnl kerberos_v5.m4--Kerberos 5 libraries and includes 2 | dnl Derrick Brashear 3 | dnl from KTH krb and Arla 4 | dnl $Id: heimdal.m4,v 1.6 2002/12/21 18:44:24 cg2v Exp $ 5 | 6 | AC_DEFUN(CMU_LIBHEIMDAL_INC_WHERE1, [ 7 | saved_CPPFLAGS=$CPPFLAGS 8 | CPPFLAGS="$saved_CPPFLAGS -I$1" 9 | AC_TRY_COMPILE([#include ], 10 | [krb5_keyblock foo;], 11 | ac_cv_found_libheimdal_inc=yes, 12 | ac_cv_found_libheimdal_inc=no) 13 | CPPFLAGS=$saved_CPPFLAGS 14 | ]) 15 | 16 | AC_DEFUN(CMU_LIBHEIMDAL_INC_WHERE, [ 17 | for i in $1; do 18 | AC_MSG_CHECKING(for heimdal headers in $i) 19 | CMU_LIBHEIMDAL_INC_WHERE1($i) 20 | CMU_TEST_INCPATH($i, krb5) 21 | if test "$ac_cv_found_libheimdal_inc" = "yes"; then 22 | ac_cv_libheimdal_where_inc=$i 23 | AC_MSG_RESULT(found) 24 | break 25 | else 26 | AC_MSG_RESULT(not found) 27 | fi 28 | done 29 | ]) 30 | 31 | # 32 | # Test for kerberos lib files 33 | # 34 | 35 | AC_DEFUN(CMU_LIBHEIMDAL_LIB_WHERE1, [ 36 | saved_LIBS=$LIBS 37 | LIBS="$saved_LIBS -L$1 -lkadm5clnt -lkrb5 -lasn1 -lkadm5clnt -lroken -lresolv" 38 | AC_TRY_LINK(, 39 | [krb5_get_in_tkt();], 40 | [ac_cv_found_libheimdal_lib=yes], 41 | ac_cv_found_libheimdal_lib=no) 42 | LIBS=$saved_LIBS 43 | ]) 44 | 45 | AC_DEFUN(CMU_LIBHEIMDAL_LIB_WHERE, [ 46 | for i in $1; do 47 | AC_MSG_CHECKING(for heimdal libraries in $i) 48 | CMU_LIBHEIMDAL_LIB_WHERE1($i) 49 | CMU_TEST_LIBPATH($i, krb5) 50 | if test "$ac_cv_found_libheimdal_lib" = "yes" ; then 51 | ac_cv_libheimdal_where_lib=$i 52 | AC_MSG_RESULT(found) 53 | break 54 | else 55 | AC_MSG_RESULT(not found) 56 | fi 57 | done 58 | ]) 59 | 60 | AC_DEFUN(CMU_LIBHEIMDAL, [ 61 | AC_REQUIRE([CMU_SOCKETS]) 62 | AC_REQUIRE([CMU_USE_COMERR]) 63 | AC_REQUIRE([CMU_LIBSSL]) 64 | AC_ARG_WITH(LIBHEIMDAL, 65 | [ --with-libheimdal=PREFIX Compile with Heimdal support], 66 | [if test "X$with_libheimdal" = "X"; then 67 | with_libheimdal=yes 68 | fi]) 69 | AC_ARG_WITH(libheimdal-lib, 70 | [ --with-libheimdal-lib=dir use heimdal libraries in dir], 71 | [if test "$withval" = "yes" -o "$withval" = "no"; then 72 | AC_MSG_ERROR([No argument for --with-libheimdal-lib]) 73 | fi]) 74 | AC_ARG_WITH(libheimdal-include, 75 | [ --with-libheimdal-include=dir use heimdal headers in dir], 76 | [if test "$withval" = "yes" -o "$withval" = "no"; then 77 | AC_MSG_ERROR([No argument for --with-libheimdal-include]) 78 | fi]) 79 | 80 | if test "X$with_libheimdal" != "X"; then 81 | if test "$with_libheimdal" != "yes" -a "$with_libheimdal" != "no"; then 82 | ac_cv_libheimdal_where_lib=$with_libheimdal/lib 83 | ac_cv_libheimdal_where_inc=$with_libheimdal/include 84 | fi 85 | fi 86 | 87 | if test "$with_libheimdal" != "no"; then 88 | if test "X$with_libheimdal_lib" != "X"; then 89 | ac_cv_libheimdal_where_lib=$with_libheimdal_lib 90 | fi 91 | if test "X$ac_cv_libheimdal_where_lib" = "X"; then 92 | CMU_LIBHEIMDAL_LIB_WHERE(/usr/athena/lib /usr/lib /usr/heimdal/lib /usr/local/lib) 93 | fi 94 | 95 | if test "X$with_libheimdal_include" != "X"; then 96 | ac_cv_libheimdal_where_inc=$with_libheimdal_include 97 | fi 98 | if test "X$ac_cv_libheimdal_where_inc" = "X"; then 99 | CMU_LIBHEIMDAL_INC_WHERE(/usr/athena/include /usr/heimdal/include /usr/local/include) 100 | fi 101 | fi 102 | 103 | AC_MSG_CHECKING([if libdes is needed]) 104 | AC_TRY_LINK([],[des_quad_cksum();],HEIM_DES_LIB="",HEIM_DES_LIB="maybe") 105 | if test "X$HEIM_DES_LIB" != "X"; then 106 | LIBS="$cmu_save_LIBS -ldes" 107 | AC_TRY_LINK([], [des_quad_cksum();],HEIM_DES_LIB="yes") 108 | if test "X$HEIM_DES_LIB" = "Xyes"; then 109 | AC_MSG_RESULT([yes]) 110 | HEIM_LIBDES="-ldes" 111 | HEIM_LIBDESA="${LIBHEIMDAL_LIB_DIR}/libdes.a" 112 | else 113 | LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS" 114 | AC_TRY_LINK([], 115 | [des_quad_cksum();],HEIM_DES_LIB="libcrypto") 116 | if test "X$HEIM_DES_LIB" = "Xlibcrypto"; then 117 | AC_MSG_RESULT([libcrypto]) 118 | HEIM_LIBDES="$LIBSSL_LIB_FLAGS" 119 | HEIM_LIBDESA="$LIBSSL_LIB_FLAGS" 120 | else 121 | AC_MSG_RESULT([unknown]) 122 | AC_MSG_ERROR([Could not use -ldes]) 123 | fi 124 | fi 125 | else 126 | AC_MSG_RESULT([no]) 127 | fi 128 | 129 | AC_MSG_CHECKING(whether to include heimdal) 130 | if test "X$ac_cv_libheimdal_where_lib" = "X" -a "X$ac_cv_libheimdal_where_inc" = "X"; then 131 | ac_cv_found_libheimdal=no 132 | AC_MSG_RESULT(no) 133 | else 134 | ac_cv_found_libheimdal=yes 135 | AC_MSG_RESULT(yes) 136 | LIBHEIMDAL_INC_DIR=$ac_cv_libheimdal_where_inc 137 | LIBHEIMDAL_LIB_DIR=$ac_cv_libheimdal_where_lib 138 | LIBHEIMDAL_INC_FLAGS="-I${LIBHEIMDAL_INC_DIR}" 139 | LIBHEIMDAL_LIB_FLAGS="-L${LIBHEIMDAL_LIB_DIR} -lkadm5clnt -lkrb5 -lasn1 ${HEIM_LIBDES} -lroken -lresolv" 140 | AC_SUBST(LIBHEIMDAL_INC_FLAGS) 141 | AC_SUBST(LIBHEIMDAL_LIB_FLAGS) 142 | if test "X$RPATH" = "X"; then 143 | RPATH="" 144 | fi 145 | case "${host}" in 146 | *-*-linux*) 147 | if test "X$RPATH" = "X"; then 148 | RPATH="-Wl,-rpath,${LIBHEIMDAL_LIB_DIR}" 149 | else 150 | RPATH="${RPATH}:${LIBHEIMDAL_LIB_DIR}" 151 | fi 152 | ;; 153 | *-*-hpux*) 154 | if test "X$RPATH" = "X"; then 155 | RPATH="-Wl,+b${LIBHEIMDAL_LIB_DIR}" 156 | else 157 | RPATH="${RPATH}:${LIBHEIMDAL_LIB_DIR}" 158 | fi 159 | ;; 160 | *-*-irix*) 161 | if test "X$RPATH" = "X"; then 162 | RPATH="-Wl,-rpath,${LIBHEIMDAL_LIB_DIR}" 163 | else 164 | RPATH="${RPATH}:${LIBHEIMDAL_LIB_DIR}" 165 | fi 166 | ;; 167 | *-*-solaris2*) 168 | if test "$ac_cv_prog_gcc" = yes; then 169 | if test "X$RPATH" = "X"; then 170 | RPATH="-Wl,-R${LIBHEIMDAL_LIB_DIR}" 171 | else 172 | RPATH="${RPATH}:${LIBHEIMDAL_LIB_DIR}" 173 | fi 174 | else 175 | RPATH="${RPATH} -R${LIBHEIMDAL_LIB_DIR}" 176 | fi 177 | ;; 178 | esac 179 | AC_SUBST(RPATH) 180 | fi 181 | ]) 182 | 183 | -------------------------------------------------------------------------------- /cmulocal/telnet.m4: -------------------------------------------------------------------------------- 1 | dnl telnet.m4--telnet special macros 2 | dnl Derrick Brashear 3 | dnl $Id: telnet.m4,v 1.11 2002/05/25 19:57:42 leg Exp $ 4 | 5 | AC_DEFUN(CMU_TELNET_WHICH_TERM, [ 6 | AC_CHECK_LIB(termlib, setupterm, [ 7 | AC_DEFINE(HAVE_SETUPTERM) 8 | AC_CHECK_LIB(c, setupterm, TCLIB="/usr/ccs/lib/libtermlib.a",TCLIB="-ltermlib","/usr/ccs/lib/libtermlib.a") 9 | ], TCLIB="-ltermcap") 10 | ]) 11 | 12 | AC_DEFUN(CMU_TELNET_CC_T, 13 | [ 14 | AC_MSG_CHECKING(for cc_t definition) 15 | AC_CACHE_VAL(cmu_cv_cc_t_definition, [ 16 | AC_TRY_COMPILE( 17 | [ 18 | #ifdef HAVE_SYS_TERMIOS_H 19 | #include 20 | #else 21 | #ifdef HAVE_SYS_TERMIO_H 22 | #include 23 | #endif 24 | #endif 25 | ], 26 | [cc_t ffoo;], 27 | cmu_cv_cc_t_definition=yes, 28 | cmu_cv_cc_t_definition=no) 29 | ]) 30 | if test "$cmu_cv_cc_t_definition" = "no"; then 31 | AC_DEFINE(NO_CC_T) 32 | fi 33 | AC_MSG_RESULT($cmu_cv_cc_t_definition) 34 | ]) 35 | 36 | AC_DEFUN(CMU_STREAMS, [ 37 | if test "$ac_cv_header_sys_stropts_h" = "yes" -o "$ac_cv_header_stropts_h" = "yes"; then 38 | AC_DEFINE(HAVE_STREAMS)dnl 39 | fi 40 | ]) 41 | 42 | AC_DEFUN(CMU_TERMIO_MODEL, [ 43 | if test "$ac_cv_header_sys_termio_h" = "yes" -o "$ac_cv_header_sys_termios_h" = "yes"; then 44 | AC_DEFINE(USE_TERMIO)dnl 45 | if test "$ac_cv_header_sys_termios_h" = "no"; then 46 | AC_DEFINE(SYSV_TERMIO)dnl 47 | fi 48 | fi 49 | ]) 50 | 51 | AC_DEFUN(CMU_TELNET_DES_STRING_TO_KEY_PROTO, [ 52 | AC_MSG_CHECKING(for des_string_to_key prototype) 53 | AC_CACHE_VAL(cmu_cv_des_string_to_key_proto, [ 54 | AC_TRY_COMPILE( 55 | [#include 56 | typedef unsigned char Block[8]; 57 | int des_string_to_key(char *, Block);], 58 | [int foo = des_string_to_key(NULL, NULL);], 59 | cmu_cv_des_string_to_key_proto=no, 60 | cmu_cv_des_string_to_key_proto=yes) 61 | ]) 62 | if test "$cmu_cv_des_string_to_key_proto" = yes; then 63 | AC_DEFINE(HAVE_DES_STRING_TO_KEY_PROTO)dnl 64 | fi 65 | AC_MSG_RESULT($cmu_cv_des_string_to_key_proto) 66 | ]) 67 | 68 | AC_DEFUN(CMU_TELNET_DES_KEY_SCHED_PROTO, [ 69 | AC_MSG_CHECKING(for des_key_sched prototype) 70 | AC_CACHE_VAL(cmu_cv_des_key_sched_proto, [ 71 | AC_TRY_COMPILE( 72 | [ 73 | #include 74 | char des_key_sched(int foo, int bar, int baz); 75 | ], 76 | [des_key_sched(NULL, NULL);], 77 | cmu_cv_des_key_sched_proto=no, 78 | cmu_cv_des_key_sched_proto=yes) 79 | ]) 80 | if test "$cmu_cv_des_key_sched_proto" = yes; then 81 | AC_DEFINE(HAVE_DES_KEY_SCHED_PROTO)dnl 82 | fi 83 | AC_MSG_RESULT($cmu_cv_des_key_sched_proto) 84 | ]) 85 | 86 | AC_DEFUN(CMU_TELNET_DES_SET_RANDOM_GENERATOR_SEED_PROTO, [ 87 | AC_MSG_CHECKING(for des_set_random_generator_seed prototype) 88 | AC_CACHE_VAL(cmu_cv_des_set_random_generator_seed_proto, [ 89 | AC_TRY_COMPILE( 90 | [ 91 | #include 92 | char des_set_random_generator_seed(int foo, int bar, int baz); 93 | ], 94 | [des_set_random_generator_seed(NULL, NULL);], 95 | cmu_cv_des_set_random_generator_seed_proto=no, 96 | cmu_cv_des_set_random_generator_seed_proto=yes) 97 | ]) 98 | if test "$cmu_cv_des_set_random_generator_seed_proto" = yes; then 99 | AC_DEFINE(HAVE_DES_SET_RANDOM_GENERATOR_SEED_PROTO)dnl 100 | fi 101 | AC_MSG_RESULT($cmu_cv_des_set_random_generator_seed_proto) 102 | ]) 103 | 104 | AC_DEFUN(CMU_TELNET_DES_NEW_RANDOM_KEY_PROTO, [ 105 | AC_MSG_CHECKING(for des_new_random_key prototype) 106 | AC_CACHE_VAL(cmu_cv_des_new_random_key_proto, [ 107 | AC_TRY_COMPILE( 108 | [ 109 | #include 110 | char des_new_random_key(int foo, int bar, int baz); 111 | ], 112 | [des_new_random_key(NULL, NULL);], 113 | cmu_cv_des_new_random_key_proto=no, 114 | cmu_cv_des_new_random_key_proto=yes) 115 | ]) 116 | if test "$cmu_cv_des_new_random_key_proto" = yes; then 117 | AC_DEFINE(HAVE_DES_NEW_RANDOM_KEY_PROTO)dnl 118 | fi 119 | AC_MSG_RESULT($cmu_cv_des_new_random_key_proto) 120 | ]) 121 | 122 | AC_DEFUN(CMU_TELNET_DES_ECB_ENCRYPT_PROTO, [ 123 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) 124 | AC_CACHE_VAL(cmu_cv_des_ecb_encrypt_proto, [ 125 | AC_TRY_COMPILE( 126 | [#include 127 | typedef unsigned char Block[8]; 128 | typedef struct { Block _; } Schedule[16]; 129 | void des_ecb_encrypt(Block, Block, Schedule, int);], 130 | [int foo = des_ecb_encrypt(NULL, NULL, NULL, 0);], 131 | cmu_cv_des_ecb_encrypt_proto=no, 132 | cmu_cv_des_ecb_encrypt_proto=yes) 133 | ]) 134 | if test "$cmu_cv_des_ecb_encrypt_proto" = yes; then 135 | AC_DEFINE(HAVE_DES_ECB_ENCRYPT_PROTO)dnl 136 | fi 137 | AC_MSG_RESULT($cmu_cv_des_ecb_encrypt_proto) 138 | ]) 139 | 140 | AC_DEFUN(CMU_TELNET_NEWDES, [ 141 | AC_REQUIRE([CMU_KRB4]) 142 | AC_REQUIRE([CMU_KRB5]) 143 | AC_MSG_CHECKING(for des_new_random_key prototype) 144 | AC_CACHE_VAL(ac_cv_func_des_new_random_key_proto, [ 145 | AC_TRY_COMPILE( 146 | [#include 147 | des_cblock key;], 148 | [des_new_random_key(&key);], 149 | ac_cv_func_des_new_random_key=yes, 150 | ac_cv_func_des_new_random_key=no) 151 | ]) 152 | if test "$ac_cv_func_des_new_random_key" = yes; then 153 | AC_DEFINE(NEWDESLIB)dnl 154 | fi 155 | AC_MSG_RESULT($ac_cv_func_des_new_random_key) 156 | ]) 157 | 158 | AC_DEFUN(CMU_TELNET_OLDNEWDES, [ 159 | AC_REQUIRE([CMU_KRB4]) 160 | AC_REQUIRE([CMU_KRB5]) 161 | saved_LIBS=$LIBS 162 | LIBS="$KRB_LIB_FLAGS $KRB5_LIB_FLAGS" 163 | if test "$with_des" = yes; then 164 | AC_CHECK_FUNCS(des_new_random_key) 165 | if test "$ac_cv_func_des_new_random_key" = yes; then 166 | AC_DEFINE(NEWDESLIB) 167 | fi 168 | fi 169 | LIBS=$saved_LIBS 170 | ]) 171 | 172 | AC_DEFUN(CMU_TELNET_GETTYTAB, [ 173 | if test -f "/etc/gettytab"; then 174 | AC_CHECK_FUNCS(getent getstr) 175 | if test "X$ac_cv_func_getent" != "Xyes"; then 176 | AC_DEFINE(HAVE_GETTYTAB) 177 | if test "X$ac_cv_func_getstr" = "Xyes"; then 178 | CFLAGS="$CFLAGS -Dgetstr=ggetstr" 179 | fi 180 | fi 181 | else 182 | AC_CHECK_FUNCS(cgetent) 183 | fi 184 | ]) 185 | 186 | AC_DEFUN(CMU_TELNET_ISSUE, [ 187 | if test -f "/etc/issue.net"; then 188 | AC_DEFINE(ISSUE_FILE, "/etc/issue.net") 189 | else 190 | if test -f "/etc/issue"; then 191 | AC_DEFINE(ISSUE_FILE, "/etc/issue") 192 | fi 193 | fi 194 | ]) 195 | 196 | AC_DEFUN(CMU_TELNET_PTYDIR, [ 197 | 198 | if test -d /dev/pts -o -d /dev/pty; then 199 | case "${host}" in 200 | *-*-irix*) 201 | ;; 202 | *-*-linux*) 203 | AC_DEFINE(PTYDIR) 204 | ;; 205 | *) 206 | AC_DEFINE(PTYDIR) 207 | AC_DEFINE(STREAMSPTY) 208 | ;; 209 | esac 210 | fi 211 | ]) 212 | 213 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | mpack (1.6-7) unstable; urgency=low 2 | 3 | * Standards-Version is 3.9.2 4 | * Fix debian-rules-missing-recommended-target 5 | * Debian source format is 3.0 (quilt) 6 | 7 | -- Anibal Monsalve Salazar Tue, 29 Nov 2011 09:40:28 +1100 8 | 9 | mpack (1.6-6) unstable; urgency=low 10 | 11 | * Priority is optional; closes: #416569 12 | * Standards-Version is 3.8.0 13 | 14 | -- Anibal Monsalve Salazar Tue, 23 Sep 2008 19:24:06 +1000 15 | 16 | mpack (1.6-5) unstable; urgency=low 17 | 18 | * Bumped Standards-Version to 3.7.3 19 | * Added homepage control header 20 | * Fixed the following lintian message: 21 | - debian-rules-ignores-make-clean-error 22 | 23 | -- Anibal Monsalve Salazar Sun, 30 Mar 2008 09:36:55 +1000 24 | 25 | mpack (1.6-4) unstable; urgency=low 26 | 27 | * Fixed "munpack no longer preserves filename". Closes: #212283, #356457. 28 | Patch by Ian Bygrave . 29 | 30 | -- Anibal Monsalve Salazar Sat, 22 Jul 2006 13:42:22 +1000 31 | 32 | mpack (1.6-3) unstable; urgency=low 33 | 34 | * Set Standards-Version to 3.7.2. 35 | * Fixed "New option -a", closes: #184506. Patch by 36 | James A Morrison . 37 | * Fixed "mpack -o /dev/stdout", closes: #303952. 38 | Patch by "Sven Rudolph" . 39 | 40 | -- Anibal Monsalve Salazar Sun, 25 Jun 2006 09:44:26 +1000 41 | 42 | mpack (1.6-2) unstable; urgency=low 43 | 44 | * New maintainer, closes: #353129. 45 | * ACKed NMUs. 46 | - "NMU patch", closes: #321685. 47 | - "FTBFS with gcc-3.4: conflicting types for 'malloc'", closes: #260652. 48 | - "implicit function declarations are evil", closes: #153187. 49 | - "Please remove inewsinn from Suggests", closes: #243737. 50 | - "'man munpack' typo: Supresses", closes: #311460. 51 | * Fixed the following linda errors: 52 | - E: mpack; Binary /usr/bin/mpack contains unneeded section comment. 53 | - E: mpack; Binary /usr/bin/munpack contains unneeded section comment. 54 | * Set priority to standard and added homepage to description. 55 | * Added watch file. 56 | 57 | -- Anibal Monsalve Salazar Fri, 17 Feb 2006 08:13:08 +1100 58 | 59 | mpack (1.6-1.1) unstable; urgency=low 60 | 61 | * Non-maintainer upload. 62 | * Include patch by Daniel Schepler (based on earlier patches 63 | by Roger Leigh and Andreas Jochens) to fix FTBFS with 64 | gcc 4.0 (Closes: #260652) and other code problems 65 | (Closes: #153187) 66 | * Change priority to optional, I see no reason why this should be 67 | standard. 68 | * Remove inewsinn from suggests as it isn't in the archive anymore 69 | (Closes: #243737) 70 | * Fix typo in munpack man page (Closes: #311460) 71 | * Bump Standards-Version to 3.6.2 (no changes) 72 | 73 | -- Frank Lichtenheld Sat, 6 Aug 2005 23:12:56 +0200 74 | 75 | mpack (1.6-1) unstable; urgency=low 76 | 77 | * New upstream version, incorporating a number of Debian patches. 78 | * Forward ported Debian patches: 79 | - /usr/tmp to /var/tmp 80 | - unixpk.c: Don't declare extern int errno 81 | * munpack: Mention -t in usage info. Closes: #182825, reported by 82 | Dan Jacobson. 83 | * Minor changes to function prototypes to fix the more alarming warnings. 84 | * Invoke configure instead of just make, now that upstream uses autoconf. 85 | * debian/rules: clean now deletes some autoconf junk. 86 | * debian/rules: update DEB_BUILD_OPTIONS support to noopt and nostrip. 87 | * debian/control: Recommend uudeview instead. 88 | * Dropped postinst and prerm, since /usr/doc symlinks are no longer needed. 89 | * debian/control: Update to standards version 3.6.0. 90 | 91 | -- Richard Braakman Fri, 25 Jul 2003 19:35:28 +0300 92 | 93 | mpack (1.5-9) unstable; urgency=low 94 | 95 | * Handle empty parameter lists without crashing, such as in 96 | "Content-Type: text/plain;". Thanks to Henry Grebler for 97 | finding this bug. 98 | * [SECURITY] Do not accept disposition filenames like "../a". 99 | Security impact is limited because only a single leading "../" 100 | was accepted. (closes #134210, reported by Herbert Xu) 101 | 102 | -- Richard Braakman Wed, 17 Jul 2002 12:01:31 +0300 103 | 104 | mpack (1.5-8) unstable; urgency=high 105 | 106 | * [SECURITY] Fix buffer overflows in parsing of MIME headers. 107 | * Removed emacs variables from the end of this changelog file. 108 | 109 | -- Richard Braakman Tue, 16 Jul 2002 01:50:55 +0300 110 | 111 | mpack (1.5-7) unstable; urgency=low 112 | 113 | * Only declare "extern int errno" if errno is not a macro. 114 | 115 | -- Richard Braakman Sun, 20 May 2001 19:30:45 +0300 116 | 117 | mpack (1.5-6) unstable; urgency=low 118 | 119 | * Made /var/tmp the default temp directory for mpack, just like 120 | it is for munpack. It used to be /tmp. Also fixed the mpack 121 | manpage, which used to say /usr/tmp. Spotted by Alex King. 122 | (closes #81997) 123 | * Moved manpages to /usr/share. 124 | * Made debian/rules sensitive to DEB_BUILD_OPTIONS environment variable. 125 | * Moved documentation to /usr/share/doc/mpack. 126 | * debian/postinst, prerm: Handle compatibility symlink /usr/doc/mpack. 127 | * Set Standards-Version to 3.2.1. 128 | 129 | -- Richard Braakman Sun, 28 Jan 2001 12:31:17 +0200 130 | 131 | mpack (1.5-5) unstable; urgency=low 132 | 133 | * Removed README.Debian and moved some bits of it to the copyright file. 134 | * Standards-Version 2.4.0.0. 135 | 136 | -- Richard Braakman Sat, 7 Feb 1998 12:39:11 +0100 137 | 138 | mpack (1.5-4) unstable; urgency=low 139 | 140 | * Changed TMPDIR default from /usr/tmp to /var/tmp for FSSTND compliance. 141 | * Upgraded to policy version 2.3.0.1. 142 | * Renamed README.debian to README.Debian. 143 | * Don't use debmake. 144 | 145 | -- Richard Braakman Sun, 18 Jan 1998 02:03:47 +0100 146 | 147 | mpack (1.5-3) unstable; urgency=low 148 | 149 | * Only Suggest rather than Recommend (#5628, #6616, #6881) 150 | * Don't stall on non-printable characters in Subject: header (#11148) 151 | * Upgraded to policy version 2.1.2.2 152 | * Changed to new source format (#9450) 153 | * New maintainer 154 | 155 | -- Richard Braakman Mon, 14 Jul 1997 21:52:05 +0200 156 | -------------------------------------------------------------------------------- /README.mac: -------------------------------------------------------------------------------- 1 | mpack/munpack version 1.5 for mac 2 | 3 | Mpack and munpack are utilities for encoding and decoding 4 | (respectively) binary files in MIME (Multipurpose Internet Mail 5 | Extensions) format mail messages. For compatibility with older forms 6 | of transferring binary files, the munpack program can also decode 7 | messages in split-uuencoded format. The Macintosh version can also 8 | decode messages in split-BinHex format. 9 | 10 | The canonical FTP site for this software is ftp.andrew.cmu.edu:pub/mpack/ 11 | Binaries are no longer provided. The pc, os2, amiga and archimedes ports 12 | have been removed. The mac version probably doesn't compile anymore, but 13 | is still included (MacOS X users can use the unix version...) 14 | 15 | This MIME implementation is intended to be as simple and portable as 16 | possible. For a slightly more sophisticated MIME implementation, see 17 | the program MetaMail, available via anonymous FTP to 18 | thumper.bellcore.com, in directory pub/nsb 19 | 20 | 21 | Decoding MIME messages: 22 | 23 | To decode a MIME message, first save it to a text file. If possible, 24 | save it with all headers included. Mpack can decode some MIME files 25 | when the headers are missing or incomplete, other files it cannot 26 | decode without having the information in the headers. In general, 27 | messages which have a statement at the beginning that they are in MIME 28 | format can be decoded without the headers. Messages which have been 29 | split into multiple parts generally require all headers in order to be 30 | reassembled and decoded. 31 | 32 | Some LAN-based mail systems and some mail providers (including America 33 | Online, as of the writing of this document) place the mail headers at 34 | the bottom of the message, instead of at the top of the message. If 35 | you are having problems decoding a MIME message on such a system, you 36 | need to convert the mail back into the standard format by removing the 37 | system's nonstandard headers and moving the standard Internet headers 38 | to the top of the message (separated from the message body with a 39 | blank line). 40 | 41 | There must be exactly one message per file. Mpack cannot deal with 42 | multiple messages in a single file, to decode things correctly it must 43 | know when one message ends and the next one begins. 44 | 45 | The Macintosh version of mpack/munpack is a single standalone 46 | application. A text file may be decoded either by drag & drop, or by 47 | choosing the "Decode Files..." item from the application's File menu. 48 | Non-text files may be encoded either by drag & drop, or by choosing 49 | the "Encode Files..." item from the application's File menu. 50 | 51 | The Macintosh version of mpack/munpack supports the new MacMIME 52 | standard (RFC 1740). This allows cross-platform transport of 53 | Macintosh files to any MIME-capable machine, and also preserves 54 | Macintosh specific file attributes between two Macintoshes. Mpack 55 | will use MacMIME for any unrecognized Macintosh file, and regular MIME 56 | for standard MIME types. 57 | 58 | For more details and descriptions of the preferences, see the "Help 59 | Using Mpack..." menu item in mpack which can be found under the help 60 | menu in systems 7 and above, and under the apple menu in older 61 | systems. 62 | 63 | Reporting bugs: 64 | 65 | Bugs and comments should be reported to mpack-bugs@andrew.cmu.edu. 66 | When reporting bugs or other problems, please include the following 67 | information: 68 | 69 | * The version number of Mpack 70 | * The platform (Unix, PC, OS/2, Mac, Amiga, Archimedes) 71 | * The EXACT output of any unsuccessful attempts. 72 | * If having a problem decoding, the first couple of lines 73 | of the input file. 74 | 75 | 76 | Compilation: 77 | 78 | Mpack was compiled with THINK C 6.0 with the 4-byte int option turned 79 | on (and the ANSI-small library compiled with the 4-byte int option) 80 | and prototype enforcement turned off. Included with this distribution 81 | should be the files "macproj.hqx" which is a BinHex4 version of the 82 | THINK C 6.0 project file, and "macrsrc.hqx" which is a BinHex4 version 83 | of the resources file. 84 | 85 | Mpack checks for the existence of "Internet Config", and if it is 86 | available, mpack uses it to translate MIME types to and from Macintosh 87 | type/creator codes. Included is the file "macICglue.hqx" which is a 88 | BinHex4 version of Internet Config's MPW object file library. This 89 | needs to be linked with the application. 90 | 91 | Using mpack: 92 | 93 | See the "Help Using Mpack..." menu item in the application. 94 | 95 | 96 | Acknowledgements: 97 | 98 | Written by John G. Myers, jgm+@cmu.edu 99 | 100 | The mac version was written by Christopher J. Newman, chrisn+@cmu.edu 101 | 102 | Send all bug reports to mpack-bugs@andrew.cmu.edu 103 | 104 | Thanks to Nathaniel Borenstein for testing early versions of mpack and 105 | for making many helpful suggestions. 106 | 107 | 108 | PGP signature: 109 | 110 | The mpack 1.6 distribution is not pgp signed. 111 | 112 | Legalese: 113 | 114 | (C) Copyright 1993,1994 by Carnegie Mellon University 115 | All Rights Reserved. 116 | 117 | Permission to use, copy, modify, distribute, and sell this software 118 | and its documentation for any purpose is hereby granted without fee, 119 | provided that the above copyright notice appear in all copies and that 120 | both that copyright notice and this permission notice appear in 121 | supporting documentation, and that the name of Carnegie Mellon 122 | University not be used in advertising or publicity pertaining to 123 | distribution of the software without specific, written prior 124 | permission. Carnegie Mellon University makes no representations about 125 | the suitability of this software for any purpose. It is provided "as 126 | is" without express or implied warranty. 127 | 128 | CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 129 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 130 | AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 131 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 132 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 133 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 134 | OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 135 | SOFTWARE. 136 | 137 | Portions of this software are derived from code written by Bell 138 | Communications Research, Inc. (Bellcore) and by RSA Data Security, 139 | Inc. and bear similar copyrights and disclaimers of warranty. 140 | 141 | -------------------------------------------------------------------------------- /cmulocal/tcl.m4: -------------------------------------------------------------------------------- 1 | dnl FIRST PASS AFTER STEALING THIS FROM CYRUS! 2 | dnl USE AT YOUR OWN PERIL! 3 | dnl I MEAN IT! 4 | dnl 5 | dnl tcl.m4: an autoconf Tcl locator 6 | dnl $Id: tcl.m4,v 1.3 2002/05/25 19:57:42 leg Exp $ 7 | dnl 8 | dnl This is rob's Tcl macro, fixed by tjs. It may need occasional tweaking, 9 | dnl but until the next impediment to compilation, it's fill-in-the-blank, 10 | dnl and it should be able to do reasonable things with user input. 11 | dnl 12 | dnl This will probably just work on Andrew systems, but given the variety 13 | dnl and apparent creativity of people who compile Tcl elsewhere, I don't know 14 | dnl what it will do. I have yet to see an autoconf Tcl test that users were 15 | dnl happy with. 16 | dnl 17 | dnl BUGS 18 | dnl The command-line arguments are overcomplicated. 19 | dnl There are doubtlessly others... 20 | 21 | dnl To use this macro, just do CMU_TCL. It outputs 22 | dnl TCL_LIBS, TCL_CPPFLAGS, and TCL_DEFS and SUBSTs them. 23 | dnl If successful, these have stuff in them. If not, they're empty. 24 | dnl If not successful, with_tcl has the value "no". 25 | 26 | AC_DEFUN(CMU_TCL, [ 27 | # --- BEGIN CMU_TCL --- 28 | dnl To link against Tcl, configure does several things to make my life 29 | dnl "easier". 30 | dnl 31 | dnl * maybe ask the user where they think Tcl lives, and try to find it 32 | dnl * maybe ask the user what "tclsh" is called this week (i.e., "tclsh8.0") 33 | dnl * run tclsh, ask it for a path, then run that path through sed 34 | dnl * sanity check its result (many installs are a little broken) 35 | dnl * try to figure out where Tcl is based on this result 36 | dnl * try to guess where the Tcl include files are 37 | dnl 38 | dnl Notes from previous incarnations: 39 | dnl > XXX MUST CHECK FOR TCL BEFORE KERBEROS V4 XXX 40 | dnl > This is because some genius at MIT named one of the Kerberos v4 41 | dnl > library functions log(). This of course conflicts with the 42 | dnl > logarithm function in the standard math library, used by Tcl. 43 | dnl 44 | dnl > Checking for Tcl first puts -lm before -lkrb on the library list. 45 | dnl 46 | 47 | dnl Check for some information from the user on what the world looks like 48 | AC_ARG_WITH(tclconfig,[ --with-tclconfig=PATH use tclConfig.sh from PATH 49 | (configure gets Tcl configuration from here)], 50 | dnl trim tclConfig.sh off the end so we can add it back on later. 51 | TclLibBase=`echo ${withval} | sed s/tclConfig.sh\$//`) 52 | AC_ARG_WITH(tcl, [ --with-tcl=PATH use Tcl from PATH], 53 | TclLibBase="${withval}/lib") 54 | AC_ARG_WITH(tclsh, [ --with-tclsh=TCLSH use TCLSH as the tclsh program 55 | (let configure find Tcl using this program)], 56 | TCLSH="${withval}") 57 | 58 | if test "$TCLSH" = "no" -o "$with_tclconfig" = "no" ; then 59 | AC_MSG_WARN([Tcl disabled because tclsh or tclconfig specified as "no"]) 60 | with_tcl=no 61 | fi 62 | 63 | if test "$with_tcl" != "no"; then 64 | if test \! -z "$with_tclconfig" -a \! -d "$with_tclconfig" ; then 65 | AC_MSG_ERROR([--with-tclconfig requires a directory argument.]) 66 | fi 67 | 68 | if test \! -z "$TCLSH" -a \! -x "$TCLSH" ; then 69 | AC_MSG_ERROR([--with-tclsh must specify an executable file.]) 70 | fi 71 | 72 | if test -z "$TclLibBase"; then # do we already know? 73 | # No? Run tclsh and ask it where it lives. 74 | 75 | # Do we know where a tclsh lives? 76 | if test -z "$TCLSH"; then 77 | # Try and find tclsh. Any tclsh. 78 | # If a new version of tcl comes out and unfortunately adds another 79 | # filename, it should be safe to add it (to the front of the line -- 80 | # somef vendors have older, badly installed tclshs that we want to avoid 81 | # if we can) 82 | AC_PATH_PROGS(TCLSH, [tclsh8.1 tclsh8.0 tclsh], "unknown") 83 | fi 84 | 85 | # Do we know where to get a tclsh? 86 | if test "${TCLSH}" != "unknown"; then 87 | AC_MSG_CHECKING([where Tcl says it lives]) 88 | TclLibBase=`echo puts \\\$tcl_library | ${TCLSH} | sed -e 's,[^/]*$,,'` 89 | AC_MSG_RESULT($TclLibBase) 90 | fi 91 | fi 92 | 93 | if test -z "$TclLibBase" ; then 94 | AC_MSG_RESULT([can't find tclsh]) 95 | AC_MSG_WARN([can't find Tcl installtion; use of Tcl disabled.]) 96 | with_tcl=no 97 | else 98 | AC_MSG_CHECKING([for tclConfig.sh]) 99 | # Check a list of places where the tclConfig.sh file might be. 100 | for tcldir in "${TclLibBase}" \ 101 | "${TclLibBase}/.." \ 102 | "${TclLibBase}"`echo ${TCLSH} | sed s/sh//` ; do 103 | if test -f "${tcldir}/tclConfig.sh"; then 104 | TclLibBase="${tcldir}" 105 | break 106 | fi 107 | done 108 | 109 | if test -z "${TclLibBase}" ; then 110 | AC_MSG_RESULT("unknown") 111 | AC_MSG_WARN([can't find Tcl configuration; use of Tcl disabled.]) 112 | with_tcl=no 113 | else 114 | AC_MSG_RESULT(${TclLibBase}/) 115 | fi 116 | 117 | if test "${with_tcl}" != no ; then 118 | AC_MSG_CHECKING([Tcl configuration on what Tcl needs to compile]) 119 | . ${TclLibBase}/tclConfig.sh 120 | AC_MSG_RESULT(ok) 121 | dnl no TK stuff for us. 122 | dnl . ${TclLibBase}/tkConfig.sh 123 | fi 124 | 125 | if test "${with_tcl}" != no ; then 126 | dnl Now, hunt for the Tcl include files, since we don't strictly 127 | dnl know where they are; some folks put them (properly) in the 128 | dnl default include path, or maybe in /usr/local; the *BSD folks 129 | dnl put them in other places. 130 | AC_MSG_CHECKING([where Tcl includes are]) 131 | for tclinclude in "${TCL_PREFIX}/include/tcl${TCL_VERSION}" \ 132 | "${TCL_PREFIX}/include/tcl" \ 133 | "${TCL_PREFIX}/include" ; do 134 | if test -r "${tclinclude}/tcl.h" ; then 135 | TCL_CPPFLAGS="-I${tclinclude}" 136 | break 137 | fi 138 | done 139 | if test -z "${TCL_CPPFLAGS}" ; then 140 | AC_MSG_WARN(can't find Tcl includes; use of Tcl disabled.) 141 | with_tcl=no 142 | fi 143 | AC_MSG_RESULT(${TCL_CPPFLAGS}) 144 | fi 145 | 146 | # Finally, pick up the Tcl configuration if we haven't found an 147 | # excuse not to. 148 | if test "${with_tcl}" != no; then 149 | dnl TCL_LIBS="${TK_LIB_SPEC} ${TK_XLIBSW} ${TCL_LD_SEARCH_FLAGS} ${TCL_LIB_SPEC}" 150 | TCL_LIBS="${TCL_LD_SEARCH_FLAGS} ${TCL_LIB_SPEC} ${TCL_LIBS}" 151 | fi 152 | fi 153 | fi 154 | 155 | AC_SUBST(TCL_DEFS) 156 | AC_SUBST(TCL_LIBS) 157 | AC_SUBST(TCL_CPPFLAGS) 158 | 159 | # --- END CMU_TCL --- 160 | ]) dnl CMU_TCL 161 | -------------------------------------------------------------------------------- /macICAPI.h: -------------------------------------------------------------------------------- 1 | /* (C) Copyright 1995 by Carnegie Mellon University 2 | * All Rights Reserved. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of Carnegie 9 | * Mellon University not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. Carnegie Mellon University makes no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 17 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 18 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 19 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 22 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 23 | * SOFTWARE. 24 | */ 25 | /* 26 | The canonical Internet Config interface is defined in Pascal. These headers have 27 | not been thoroughly tested. If there is a conflict between these headers and the 28 | Pascal interfaces, the Pascal should take precedence. 29 | */ 30 | 31 | /* ///////////////////////////////////////////////////////////////////////////////// */ 32 | 33 | #ifndef __ICAPI__ 34 | #define __ICAPI__ 35 | 36 | #ifndef __TYPES__ 37 | #include 38 | #endif 39 | 40 | #ifndef __FILES__ 41 | #include 42 | #endif 43 | 44 | #ifndef __ICTYPES__ 45 | #include 46 | #endif 47 | 48 | /* ///////////////////////////////////////////////////////////////////////////////// */ 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | pascal ICError ICStart(ICInstance *inst, OSType creator); 55 | /* call at application initialisation */ 56 | 57 | pascal ICError ICStop(ICInstance inst); 58 | /* call at application termination */ 59 | 60 | pascal ICError ICFindConfigFile(ICInstance inst, short count, ICDirSpecArrayPtr folders); 61 | /* count is the number of ICDirSpecs that are valid in folders */ 62 | /* searches the specified folders first, then backs out to preferences folder */ 63 | /* don't you worry about how it finds the file (; */ 64 | /* you can pass nil to folders if count is 0 */ 65 | 66 | pascal ICError ICSpecifyConfigFile(ICInstance inst, FSSpec *config); 67 | /* for use *only* by Internet Configuration application */ 68 | 69 | pascal ICError ICGetSeed(ICInstance inst, long *seed); 70 | /* returns current seed for prefs file */ 71 | /* this seed changes every time a preference is modified */ 72 | /* poll this to detect preference changes by other applications */ 73 | 74 | pascal ICError ICGetPerm(ICInstance inst, ICPerm *perm); 75 | /* returns the permissions currently associated with this file */ 76 | /* mainly used by overriding components, applications normally */ 77 | /* know what permissions they have */ 78 | 79 | pascal ICError ICBegin(ICInstance inst, ICPerm perm); 80 | /* start reading/writing the preferences */ 81 | /* must be balanaced by a ICEnd */ 82 | /* do not call WaitNextEvent between this pair */ 83 | /* specify either icReadOnlyPerm or icReadWritePerm */ 84 | /* note that this may open resource files and leave them open until ICEnd */ 85 | 86 | pascal ICError ICGetPref(ICInstance inst, ConstStr255Param key, ICAttr *attr, Ptr buf, long *size); 87 | /* this routine may be called without a ICBegin/ICEnd pair, in which case */ 88 | /* it implicitly calls ICBegin(inst, icReadOnlyPerm */ 89 | /* given a key string, returns the attributes and the (optionally) the data for a preference */ 90 | /* key must not be the empty string */ 91 | /* if buf is nil then no data fetched and incoming size is ignored*/ 92 | /* size must be non-negative, is size of allocated space for data at buf */ 93 | /* attr and size and always set on return */ 94 | /* size is actual size of data (if key present); */ 95 | /* attr is pref attributes */ 96 | /* if icTruncatedErr then everything is valid, except you lost some data, size is size of real data*/ 97 | /* on other errors, attr is ICattr_no_change and size is 0 */ 98 | 99 | pascal ICError ICSetPref(ICInstance inst, ConstStr255Param key, ICAttr attr, Ptr buf, long size); 100 | /* this routine may be called without a ICBegin/ICEnd pair, in which case */ 101 | /* it implicitly calls ICBegin(inst, icReadWritePerm */ 102 | /* given a key string, sets the attributes and the data for a preference (either is optional); */ 103 | /* key must not be the empty string */ 104 | /* if buf is nil then no data stored and size is ignored, used for setting attr */ 105 | /* size must be non-negative, is size of the data at buf to store */ 106 | /* icPermErr if ICBegin was given icReadOnlyPerm */ 107 | /* icPermErr if current attr is locked, new attr is locked and buf <> nil */ 108 | 109 | pascal ICError ICCountPref(ICInstance inst, long *count); 110 | /* count total number of preferences */ 111 | /* if error then count is 0 */ 112 | 113 | pascal ICError ICGetIndPref(ICInstance inst, long n, Str255 key); 114 | /* return the key of the Nth preference */ 115 | /* n must be positive */ 116 | /* icPrefNotFoundErr if n is beyond the last preference */ 117 | 118 | pascal ICError ICDeletePref(ICInstance inst, ConstStr255Param key); 119 | /* delete the preference specified by key */ 120 | /* key must not be the empty string */ 121 | /* preference specified by key must be present */ 122 | /* icPrefNotFoundErr if it isn't */ 123 | 124 | pascal ICError ICEnd(ICInstance inst); 125 | /* stop reading/writing the preferences */ 126 | 127 | pascal ICError ICDefaultFileName(ICInstance inst, Str63 name); 128 | /* return the default file name */ 129 | /* the component calls this routine to set up the default internet configuration file name*/ 130 | /* this allows this operation to be intercepted by a component that has captured us */ 131 | /* it currently gets it from the component resource file */ 132 | /* the glue version is hardwired */ 133 | 134 | pascal ICError ICGetComponentInstance(ICInstance inst, Ptr *component_inst); 135 | /* returns noErr and the component instance that we're talking to, if we're using the component */ 136 | /* returns an error and nil if we're doing it with glue */ 137 | 138 | #ifdef __cplusplus 139 | } 140 | #endif __cplusplus 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5 (mit/util/scripts/install.sh). 5 | # 6 | # Copyright 1991 by the Massachusetts Institute of Technology 7 | # 8 | # Permission to use, copy, modify, distribute, and sell this software and its 9 | # documentation for any purpose is hereby granted without fee, provided that 10 | # the above copyright notice appear in all copies and that both that 11 | # copyright notice and this permission notice appear in supporting 12 | # documentation, and that the name of M.I.T. not be used in advertising or 13 | # publicity pertaining to distribution of the software without specific, 14 | # written prior permission. M.I.T. makes no representations about the 15 | # suitability of this software for any purpose. It is provided "as is" 16 | # without express or implied warranty. 17 | # 18 | # Calling this script install-sh is preferred over install.sh, to prevent 19 | # `make' implicit rules from creating a file called install from it 20 | # when there is no Makefile. 21 | # 22 | # This script is compatible with the BSD install script, but was written 23 | # from scratch. It can only install one file at a time, a restriction 24 | # shared with many OS's install programs. 25 | 26 | 27 | # set DOITPROG to echo to test this script 28 | 29 | # Don't use :- since 4.3BSD and earlier shells don't like it. 30 | doit="${DOITPROG-}" 31 | 32 | 33 | # put in absolute paths if you don't have them in your path; or use env. vars. 34 | 35 | mvprog="${MVPROG-mv}" 36 | cpprog="${CPPROG-cp}" 37 | chmodprog="${CHMODPROG-chmod}" 38 | chownprog="${CHOWNPROG-chown}" 39 | chgrpprog="${CHGRPPROG-chgrp}" 40 | stripprog="${STRIPPROG-strip}" 41 | rmprog="${RMPROG-rm}" 42 | mkdirprog="${MKDIRPROG-mkdir}" 43 | 44 | transformbasename="" 45 | transform_arg="" 46 | instcmd="$mvprog" 47 | chmodcmd="$chmodprog 0755" 48 | chowncmd="" 49 | chgrpcmd="" 50 | stripcmd="" 51 | rmcmd="$rmprog -f" 52 | mvcmd="$mvprog" 53 | src="" 54 | dst="" 55 | dir_arg="" 56 | 57 | while [ x"$1" != x ]; do 58 | case $1 in 59 | -c) instcmd="$cpprog" 60 | shift 61 | continue;; 62 | 63 | -d) dir_arg=true 64 | shift 65 | continue;; 66 | 67 | -m) chmodcmd="$chmodprog $2" 68 | shift 69 | shift 70 | continue;; 71 | 72 | -o) chowncmd="$chownprog $2" 73 | shift 74 | shift 75 | continue;; 76 | 77 | -g) chgrpcmd="$chgrpprog $2" 78 | shift 79 | shift 80 | continue;; 81 | 82 | -s) stripcmd="$stripprog" 83 | shift 84 | continue;; 85 | 86 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 87 | shift 88 | continue;; 89 | 90 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 91 | shift 92 | continue;; 93 | 94 | *) if [ x"$src" = x ] 95 | then 96 | src=$1 97 | else 98 | # this colon is to work around a 386BSD /bin/sh bug 99 | : 100 | dst=$1 101 | fi 102 | shift 103 | continue;; 104 | esac 105 | done 106 | 107 | if [ x"$src" = x ] 108 | then 109 | echo "install: no input file specified" 110 | exit 1 111 | else 112 | true 113 | fi 114 | 115 | if [ x"$dir_arg" != x ]; then 116 | dst=$src 117 | src="" 118 | 119 | if [ -d $dst ]; then 120 | instcmd=: 121 | chmodcmd="" 122 | else 123 | instcmd=mkdir 124 | fi 125 | else 126 | 127 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 128 | # might cause directories to be created, which would be especially bad 129 | # if $src (and thus $dsttmp) contains '*'. 130 | 131 | if [ -f $src -o -d $src ] 132 | then 133 | true 134 | else 135 | echo "install: $src does not exist" 136 | exit 1 137 | fi 138 | 139 | if [ x"$dst" = x ] 140 | then 141 | echo "install: no destination specified" 142 | exit 1 143 | else 144 | true 145 | fi 146 | 147 | # If destination is a directory, append the input filename; if your system 148 | # does not like double slashes in filenames, you may need to add some logic 149 | 150 | if [ -d $dst ] 151 | then 152 | dst="$dst"/`basename $src` 153 | else 154 | true 155 | fi 156 | fi 157 | 158 | ## this sed command emulates the dirname command 159 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 160 | 161 | # Make sure that the destination directory exists. 162 | # this part is taken from Noah Friedman's mkinstalldirs script 163 | 164 | # Skip lots of stat calls in the usual case. 165 | if [ ! -d "$dstdir" ]; then 166 | defaultIFS=' 167 | ' 168 | IFS="${IFS-${defaultIFS}}" 169 | 170 | oIFS="${IFS}" 171 | # Some sh's can't handle IFS=/ for some reason. 172 | IFS='%' 173 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 174 | IFS="${oIFS}" 175 | 176 | pathcomp='' 177 | 178 | while [ $# -ne 0 ] ; do 179 | pathcomp="${pathcomp}${1}" 180 | shift 181 | 182 | if [ ! -d "${pathcomp}" ] ; 183 | then 184 | $mkdirprog "${pathcomp}" 185 | else 186 | true 187 | fi 188 | 189 | pathcomp="${pathcomp}/" 190 | done 191 | fi 192 | 193 | if [ x"$dir_arg" != x ] 194 | then 195 | $doit $instcmd $dst && 196 | 197 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && 198 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && 199 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && 200 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi 201 | else 202 | 203 | # If we're going to rename the final executable, determine the name now. 204 | 205 | if [ x"$transformarg" = x ] 206 | then 207 | dstfile=`basename $dst` 208 | else 209 | dstfile=`basename $dst $transformbasename | 210 | sed $transformarg`$transformbasename 211 | fi 212 | 213 | # don't allow the sed command to completely eliminate the filename 214 | 215 | if [ x"$dstfile" = x ] 216 | then 217 | dstfile=`basename $dst` 218 | else 219 | true 220 | fi 221 | 222 | # Make a temp file name in the proper directory. 223 | 224 | dsttmp=$dstdir/#inst.$$# 225 | 226 | # Move or copy the file name to the temp name 227 | 228 | $doit $instcmd $src $dsttmp && 229 | 230 | trap "rm -f ${dsttmp}" 0 && 231 | 232 | # and set any options; do chmod last to preserve setuid bits 233 | 234 | # If any of these fail, we abort the whole thing. If we want to 235 | # ignore errors from any of these, just make sure not to ignore 236 | # errors from the above "$doit $instcmd $src $dsttmp" command. 237 | 238 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && 239 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && 240 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && 241 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && 242 | 243 | # Now rename the file to the real destination. 244 | 245 | $doit $rmcmd -f $dstdir/$dstfile && 246 | $doit $mvcmd $dsttmp $dstdir/$dstfile 247 | 248 | fi && 249 | 250 | 251 | exit 0 252 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | # Copyright (C) 1996, 1997 Free Software Foundation, Inc. 4 | # Franc,ois Pinard , 1996. 5 | 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2, or (at your option) 9 | # any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19 | # 02111-1307, USA. 20 | 21 | if test $# -eq 0; then 22 | echo 1>&2 "Try \`$0 --help' for more information" 23 | exit 1 24 | fi 25 | 26 | case "$1" in 27 | 28 | -h|--h|--he|--hel|--help) 29 | echo "\ 30 | $0 [OPTION]... PROGRAM [ARGUMENT]... 31 | 32 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 33 | error status if there is no known handling for PROGRAM. 34 | 35 | Options: 36 | -h, --help display this help and exit 37 | -v, --version output version information and exit 38 | 39 | Supported PROGRAM values: 40 | aclocal touch file \`aclocal.m4' 41 | autoconf touch file \`configure' 42 | autoheader touch file \`config.h.in' 43 | automake touch all \`Makefile.in' files 44 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 45 | flex create \`lex.yy.c', if possible, from existing .c 46 | lex create \`lex.yy.c', if possible, from existing .c 47 | makeinfo touch the output file 48 | yacc create \`y.tab.[ch]', if possible, from existing .[ch]" 49 | ;; 50 | 51 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 52 | echo "missing - GNU libit 0.0" 53 | ;; 54 | 55 | -*) 56 | echo 1>&2 "$0: Unknown \`$1' option" 57 | echo 1>&2 "Try \`$0 --help' for more information" 58 | exit 1 59 | ;; 60 | 61 | aclocal) 62 | echo 1>&2 "\ 63 | WARNING: \`$1' is missing on your system. You should only need it if 64 | you modified \`acinclude.m4' or \`configure.in'. You might want 65 | to install the \`Automake' and \`Perl' packages. Grab them from 66 | any GNU archive site." 67 | touch aclocal.m4 68 | ;; 69 | 70 | autoconf) 71 | echo 1>&2 "\ 72 | WARNING: \`$1' is missing on your system. You should only need it if 73 | you modified \`configure.in'. You might want to install the 74 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 75 | archive site." 76 | touch configure 77 | ;; 78 | 79 | autoheader) 80 | echo 1>&2 "\ 81 | WARNING: \`$1' is missing on your system. You should only need it if 82 | you modified \`acconfig.h' or \`configure.in'. You might want 83 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 84 | from any GNU archive site." 85 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` 86 | test -z "$files" && files="config.h" 87 | touch_files= 88 | for f in $files; do 89 | case "$f" in 90 | *:*) touch_files="$touch_files "`echo "$f" | 91 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 92 | *) touch_files="$touch_files $f.in";; 93 | esac 94 | done 95 | touch $touch_files 96 | ;; 97 | 98 | automake) 99 | echo 1>&2 "\ 100 | WARNING: \`$1' is missing on your system. You should only need it if 101 | you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. 102 | You might want to install the \`Automake' and \`Perl' packages. 103 | Grab them from any GNU archive site." 104 | find . -type f -name Makefile.am -print | 105 | sed 's/\.am$/.in/' | 106 | while read f; do touch "$f"; done 107 | ;; 108 | 109 | bison|yacc) 110 | echo 1>&2 "\ 111 | WARNING: \`$1' is missing on your system. You should only need it if 112 | you modified a \`.y' file. You may need the \`Bison' package 113 | in order for those modifications to take effect. You can get 114 | \`Bison' from any GNU archive site." 115 | rm -f y.tab.c y.tab.h 116 | if [ $# -ne 1 ]; then 117 | eval LASTARG="\${$#}" 118 | case "$LASTARG" in 119 | *.y) 120 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 121 | if [ -f "$SRCFILE" ]; then 122 | cp "$SRCFILE" y.tab.c 123 | fi 124 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 125 | if [ -f "$SRCFILE" ]; then 126 | cp "$SRCFILE" y.tab.h 127 | fi 128 | ;; 129 | esac 130 | fi 131 | if [ ! -f y.tab.h ]; then 132 | echo >y.tab.h 133 | fi 134 | if [ ! -f y.tab.c ]; then 135 | echo 'main() { return 0; }' >y.tab.c 136 | fi 137 | ;; 138 | 139 | lex|flex) 140 | echo 1>&2 "\ 141 | WARNING: \`$1' is missing on your system. You should only need it if 142 | you modified a \`.l' file. You may need the \`Flex' package 143 | in order for those modifications to take effect. You can get 144 | \`Flex' from any GNU archive site." 145 | rm -f lex.yy.c 146 | if [ $# -ne 1 ]; then 147 | eval LASTARG="\${$#}" 148 | case "$LASTARG" in 149 | *.l) 150 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 151 | if [ -f "$SRCFILE" ]; then 152 | cp "$SRCFILE" lex.yy.c 153 | fi 154 | ;; 155 | esac 156 | fi 157 | if [ ! -f lex.yy.c ]; then 158 | echo 'main() { return 0; }' >lex.yy.c 159 | fi 160 | ;; 161 | 162 | makeinfo) 163 | echo 1>&2 "\ 164 | WARNING: \`$1' is missing on your system. You should only need it if 165 | you modified a \`.texi' or \`.texinfo' file, or any other file 166 | indirectly affecting the aspect of the manual. The spurious 167 | call might also be the consequence of using a buggy \`make' (AIX, 168 | DU, IRIX). You might want to install the \`Texinfo' package or 169 | the \`GNU make' package. Grab either from any GNU archive site." 170 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 171 | if test -z "$file"; then 172 | file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 173 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` 174 | fi 175 | touch $file 176 | ;; 177 | 178 | *) 179 | echo 1>&2 "\ 180 | WARNING: \`$1' is needed, and you do not seem to have it handy on your 181 | system. You might have modified some files without having the 182 | proper tools for further handling them. Check the \`README' file, 183 | it often tells you about the needed prerequirements for installing 184 | this package. You may also peek at any GNU archive site, in case 185 | some other package would contain this missing \`$1' program." 186 | exit 1 187 | ;; 188 | esac 189 | 190 | exit 0 191 | -------------------------------------------------------------------------------- /macndlog.c: -------------------------------------------------------------------------------- 1 | /* macndlog.c -- dialog utilities for nifty application library 2 | */ 3 | /* (C) Copyright 1995 by Carnegie Mellon University 4 | * All Rights Reserved. 5 | * 6 | * Permission to use, copy, modify, distribute, and sell this software 7 | * and its documentation for any purpose is hereby granted without 8 | * fee, provided that the above copyright notice appear in all copies 9 | * and that both that copyright notice and this permission notice 10 | * appear in supporting documentation, and that the name of Carnegie 11 | * Mellon University not be used in advertising or publicity 12 | * pertaining to distribution of the software without specific, 13 | * written prior permission. Carnegie Mellon University makes no 14 | * representations about the suitability of this software for any 15 | * purpose. It is provided "as is" without express or implied 16 | * warranty. 17 | * 18 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 19 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 20 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 21 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 22 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 23 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 24 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 25 | * SOFTWARE. 26 | */ 27 | /* (C) Copyright 1990-1995 by Christopher J. Newman 28 | * All Rights Reserved. 29 | * 30 | * Permission to use, copy, modify, distribute, and sell this software and its 31 | * documentation for any purpose is hereby granted without fee, provided that 32 | * the above copyright notice appear in all copies and that both that 33 | * copyright notice and this permission notice appear in supporting 34 | * documentation, and that the name of Christopher J. Newman not be used in 35 | * advertising or publicity pertaining to distribution of the software without 36 | * specific, written prior permission. Christopher J. Newman makes no 37 | * representations about the suitability of this software for any purpose. It 38 | * is provided "as is" without express or implied warranty. 39 | * 40 | * CHRISTOPHER J. NEWMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 41 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 42 | * SHALL CHRISTOPHER J. NEWMAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR 43 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 44 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 45 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 46 | * OF THIS SOFTWARE. 47 | * 48 | * Author: Christopher J. Newman 49 | * Message: This is a nifty program. 50 | */ 51 | 52 | #ifndef THINK_C 53 | #include 54 | #endif 55 | #include 56 | #include "macnapp.h" 57 | 58 | /* enable/disable menus for a moveable modal dialog 59 | */ 60 | void NAmodalMenus(int begin) 61 | { 62 | short i, end; 63 | MenuHandle mh; 64 | 65 | /* unhilite menus */ 66 | HiliteMenu(0); 67 | 68 | /* everything but the edit/apple/help menus */ 69 | for (i = mFile; (mh = NAmenuh(i)); ++i) { 70 | if (i != mEdit) { 71 | if (begin) DisableItem(mh, 0); 72 | else EnableItem(mh, 0); 73 | } 74 | } 75 | 76 | /* kill the help items */ 77 | mh = NAmenuh(mApple); 78 | i = NAappleitems; 79 | if (NAhelpcount) { 80 | HMGetHelpMenuHandle(&mh); 81 | i = NAhelpcount + 1; 82 | } 83 | for (end = NAhelpitems + i; i <= end; ++i) { 84 | if (begin) DisableItem(mh, i); 85 | else EnableItem(mh, i); 86 | } 87 | 88 | DrawMenuBar(); 89 | } 90 | 91 | /* enable/disable a control in a dialog window 92 | */ 93 | void NAenableDItem(DialogPtr dialog, short item, Boolean on) 94 | { 95 | short type; 96 | Handle ctrl; 97 | short ty; 98 | Rect box; 99 | 100 | GetDItem(dialog, item, &ty, &ctrl, &box); 101 | type = ty; 102 | if (on) type &= ~itemDisable; 103 | else type |= itemDisable; 104 | if (type == (editText | itemDisable)) { 105 | type = statText; 106 | } else if (type == statText) { 107 | type = editText; 108 | } 109 | SetDItem(dialog, item, type, ctrl, &box); 110 | } 111 | 112 | /* hilite a control in a dialog window 113 | */ 114 | void NAhiliteDItem(DialogPtr dialog, short item, short how) 115 | { 116 | Handle ctrl; 117 | short type; 118 | Rect box; 119 | PenState tmpPen; 120 | 121 | GetDItem(dialog, item, &type, &ctrl, &box); 122 | if (type & ctrlItem) { 123 | HiliteControl((ControlHandle) ctrl, how); 124 | } else if (type & (statText | editText)) { 125 | GetPenState(&tmpPen); 126 | PenNormal(); 127 | if (how == 255) PenPat(QD(gray)); 128 | InsetRect(&box, -3, -3); 129 | FrameRect(&box); 130 | SetPenState(&tmpPen); 131 | } 132 | } 133 | 134 | /* make an item visible/invisible in a dialog window 135 | */ 136 | void NAvisibleDItem(DialogPtr dialog, short item, Boolean show) 137 | { 138 | if (show) ShowDItem(dialog, item); 139 | else HideDItem(dialog, item); 140 | } 141 | 142 | /* set the text in a dialog item 143 | */ 144 | void NAsetIText(DialogPtr dialog, short item, PCstr *str) 145 | { 146 | Handle texth; 147 | 148 | NAgetDHandle(dialog, item, &texth); 149 | SetIText(texth, str); 150 | } 151 | 152 | /* get the text in a dialog item 153 | */ 154 | void NAgetIText(DialogPtr dialog, short item, PCstr *str) 155 | { 156 | Handle texth; 157 | 158 | NAgetDHandle(dialog, item, &texth); 159 | GetIText(texth, str); 160 | SetClen(str); 161 | } 162 | 163 | /* set the appropriate radio buttons 164 | */ 165 | short NAradioSet(DialogPtr dialog, short firstitem, short lastitem, short setting) 166 | { 167 | short item; 168 | ControlHandle ctrl; 169 | 170 | for (item = firstitem; item <= lastitem; item++) { 171 | NAgetDHandle(dialog, item, &ctrl); 172 | SetCtlValue(ctrl, item == setting ? 1 : 0); 173 | } 174 | 175 | return (setting - firstitem); 176 | } 177 | 178 | /* get the itemno of the active radio button 179 | */ 180 | short NAradioGet(DialogPtr dialog, short firstitem, short lastitem) 181 | { 182 | short item; 183 | ControlHandle ctrl; 184 | 185 | for (item = firstitem; item <= lastitem; item++) { 186 | NAgetDHandle(dialog, item, &ctrl); 187 | if (GetCtlValue(ctrl)) return (item); 188 | } 189 | 190 | return (firstitem); 191 | } 192 | 193 | /* handle the edit menu for a dialog window 194 | */ 195 | short NAdialogMenu(na_win *win, WORD menu, WORD item) 196 | { 197 | MenuHandle mh = NAmenuh(mEdit); 198 | DialogPeek dpeek = (DialogPeek) win->pwin; 199 | short result = NA_NOTPROCESSED; 200 | 201 | switch (menu) { 202 | case 0: 203 | if ((*dpeek->textH)->selStart != (*dpeek->textH)->selEnd) { 204 | EnableItem(mh, iCopy); 205 | EnableItem(mh, iCut); 206 | EnableItem(mh, iClear); 207 | } 208 | EnableItem(mh, iPaste); 209 | if ((*dpeek->textH)->teLength > 0) EnableItem(mh, iSelAll); 210 | break; 211 | case mEdit: 212 | switch (item) { 213 | case iCut: 214 | DlgCut(win->pwin); 215 | ZeroScrap(); 216 | TEToScrap(); 217 | break; 218 | case iCopy: 219 | DlgCopy(win->pwin); 220 | ZeroScrap(); 221 | TEToScrap(); 222 | break; 223 | case iClear: 224 | DlgDelete(win->pwin); 225 | break; 226 | case iPaste: 227 | DlgPaste(win->pwin); 228 | break; 229 | case iSelAll: 230 | SelIText(win->pwin, dpeek->editField + 1, 0, 32767); 231 | break; 232 | } 233 | result = NA_PROCESSED; 234 | break; 235 | } 236 | if (menu != 0) DisableItem(mh, iSelAll); 237 | 238 | return (result); 239 | } 240 | -------------------------------------------------------------------------------- /cmulocal/berkdb.m4: -------------------------------------------------------------------------------- 1 | dnl $Id: berkdb.m4,v 1.11 2003/04/15 22:25:41 rjs3 Exp $ 2 | 3 | AC_DEFUN(CMU_DB_INC_WHERE1, [ 4 | saved_CPPFLAGS=$CPPFLAGS 5 | CPPFLAGS="$saved_CPPFLAGS -I$1" 6 | AC_TRY_COMPILE([#include ], 7 | [DB *db; 8 | db_create(&db, NULL, 0); 9 | db->open(db, "foo.db", NULL, DB_UNKNOWN, DB_RDONLY, 0644);], 10 | ac_cv_found_db_inc=yes, 11 | ac_cv_found_db_inc=no) 12 | CPPFLAGS=$saved_CPPFLAGS 13 | ]) 14 | 15 | AC_DEFUN(CMU_DB_INC_WHERE, [ 16 | for i in $1; do 17 | AC_MSG_CHECKING(for db headers in $i) 18 | CMU_DB_INC_WHERE1($i) 19 | CMU_TEST_INCPATH($i, db) 20 | if test "$ac_cv_found_db_inc" = "yes"; then 21 | ac_cv_db_where_inc=$i 22 | AC_MSG_RESULT(found) 23 | break 24 | else 25 | AC_MSG_RESULT(not found) 26 | fi 27 | done 28 | ]) 29 | 30 | # 31 | # Test for lib files 32 | # 33 | 34 | AC_DEFUN(CMU_DB3_LIB_WHERE1, [ 35 | AC_REQUIRE([CMU_AFS]) 36 | AC_REQUIRE([CMU_KRB4]) 37 | saved_LIBS=$LIBS 38 | LIBS="$saved_LIBS -L$1 -ldb-3" 39 | AC_TRY_LINK(, 40 | [db_env_create();], 41 | [ac_cv_found_db_3_lib=yes], 42 | ac_cv_found_db_3_lib=no) 43 | LIBS=$saved_LIBS 44 | ]) 45 | AC_DEFUN(CMU_DB4_LIB_WHERE1, [ 46 | AC_REQUIRE([CMU_AFS]) 47 | AC_REQUIRE([CMU_KRB4]) 48 | saved_LIBS=$LIBS 49 | LIBS="$saved_LIBS -L$1 -ldb-4" 50 | AC_TRY_LINK(, 51 | [db_env_create();], 52 | [ac_cv_found_db_4_lib=yes], 53 | ac_cv_found_db_4_lib=no) 54 | LIBS=$saved_LIBS 55 | ]) 56 | 57 | AC_DEFUN(CMU_DB_LIB_WHERE, [ 58 | for i in $1; do 59 | AC_MSG_CHECKING(for db libraries in $i) 60 | if test "$enable_db4" = "yes"; then 61 | CMU_DB4_LIB_WHERE1($i) 62 | CMU_TEST_LIBPATH($i, [db-4]) 63 | ac_cv_found_db_lib=$ac_cv_found_db_4_lib 64 | else 65 | CMU_DB3_LIB_WHERE1($i) 66 | CMU_TEST_LIBPATH($i, [db-3]) 67 | ac_cv_found_db_lib=$ac_cv_found_db_3_lib 68 | fi 69 | if test "$ac_cv_found_db_lib" = "yes" ; then 70 | ac_cv_db_where_lib=$i 71 | AC_MSG_RESULT(found) 72 | break 73 | else 74 | AC_MSG_RESULT(not found) 75 | fi 76 | done 77 | ]) 78 | 79 | AC_DEFUN(CMU_USE_DB, [ 80 | AC_ARG_WITH(db, 81 | [ --with-db=PREFIX Compile with db support], 82 | [if test "X$with_db" = "X"; then 83 | with_db=yes 84 | fi]) 85 | AC_ARG_WITH(db-lib, 86 | [ --with-db-lib=dir use db libraries in dir], 87 | [if test "$withval" = "yes" -o "$withval" = "no"; then 88 | AC_MSG_ERROR([No argument for --with-db-lib]) 89 | fi]) 90 | AC_ARG_WITH(db-include, 91 | [ --with-db-include=dir use db headers in dir], 92 | [if test "$withval" = "yes" -o "$withval" = "no"; then 93 | AC_MSG_ERROR([No argument for --with-db-include]) 94 | fi]) 95 | AC_ARG_ENABLE(db4, 96 | [ --enable-db4 use db 4.x libraries]) 97 | 98 | if test "X$with_db" != "X"; then 99 | if test "$with_db" != "yes"; then 100 | ac_cv_db_where_lib=$with_db/lib 101 | ac_cv_db_where_inc=$with_db/include 102 | fi 103 | fi 104 | 105 | if test "X$with_db_lib" != "X"; then 106 | ac_cv_db_where_lib=$with_db_lib 107 | fi 108 | if test "X$ac_cv_db_where_lib" = "X"; then 109 | CMU_DB_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib) 110 | fi 111 | 112 | if test "X$with_db_include" != "X"; then 113 | ac_cv_db_where_inc=$with_db_include 114 | fi 115 | if test "X$ac_cv_db_where_inc" = "X"; then 116 | CMU_DB_INC_WHERE(/usr/athena/include /usr/local/include) 117 | fi 118 | 119 | AC_MSG_CHECKING(whether to include db) 120 | if test "X$ac_cv_db_where_lib" = "X" -o "X$ac_cv_db_where_inc" = "X"; then 121 | ac_cv_found_db=no 122 | AC_MSG_RESULT(no) 123 | else 124 | ac_cv_found_db=yes 125 | AC_MSG_RESULT(yes) 126 | DB_INC_DIR=$ac_cv_db_where_inc 127 | DB_LIB_DIR=$ac_cv_db_where_lib 128 | DB_INC_FLAGS="-I${DB_INC_DIR}" 129 | if test "$enable_db4" = "yes"; then 130 | DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-4" 131 | else 132 | DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-3" 133 | fi 134 | dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally 135 | dnl Allow makefile substitutions.... 136 | AC_SUBST(DB_INC_FLAGS) 137 | AC_SUBST(DB_LIB_FLAGS) 138 | if test "X$RPATH" = "X"; then 139 | RPATH="" 140 | fi 141 | case "${host}" in 142 | *-*-linux*) 143 | if test "X$RPATH" = "X"; then 144 | RPATH="-Wl,-rpath,${DB_LIB_DIR}" 145 | else 146 | RPATH="${RPATH}:${DB_LIB_DIR}" 147 | fi 148 | ;; 149 | *-*-hpux*) 150 | if test "X$RPATH" = "X"; then 151 | RPATH="-Wl,+b${DB_LIB_DIR}" 152 | else 153 | RPATH="${RPATH}:${DB_LIB_DIR}" 154 | fi 155 | ;; 156 | *-*-irix*) 157 | if test "X$RPATH" = "X"; then 158 | RPATH="-Wl,-rpath,${DB_LIB_DIR}" 159 | else 160 | RPATH="${RPATH}:${DB_LIB_DIR}" 161 | fi 162 | ;; 163 | *-*-solaris2*) 164 | if test "$ac_cv_prog_gcc" = yes; then 165 | if test "X$RPATH" = "X"; then 166 | RPATH="-Wl,-R${DB_LIB_DIR}" 167 | else 168 | RPATH="${RPATH}:${DB_LIB_DIR}" 169 | fi 170 | else 171 | RPATH="${RPATH} -R${DB_LIB_DIR}" 172 | fi 173 | ;; 174 | esac 175 | AC_SUBST(RPATH) 176 | fi 177 | ]) 178 | 179 | 180 | 181 | dnl ---- CUT HERE --- 182 | 183 | dnl These are the Cyrus Berkeley DB macros. In an ideal world these would be 184 | dnl identical to the above. 185 | 186 | dnl They are here so that they can be shared between Cyrus IMAPd 187 | dnl and Cyrus SASL with relative ease. 188 | 189 | dnl The big difference between this and the ones above is that we don't assume 190 | dnl that we know the name of the library, and we try a lot of permutations 191 | dnl instead. We also assume that DB4 is acceptable. 192 | 193 | dnl When we're done, there will be a BDB_LIBADD and a BDB_INCADD which should 194 | dnl be used when necessary. We should probably be smarter about our RPATH 195 | dnl handling. 196 | 197 | dnl Call these with BERKELEY_DB_CHK. 198 | 199 | dnl We will also set $dblib to "berkeley" if we are successful, "no" otherwise. 200 | 201 | dnl this is unbelievably painful due to confusion over what db-3 should be 202 | dnl named and where the db-3 header file is located. arg. 203 | AC_DEFUN(CYRUS_BERKELEY_DB_CHK_LIB, 204 | [ 205 | BDB_SAVE_LIBS=$LIBS 206 | 207 | if test -d $with_bdb_lib; then 208 | CMU_ADD_LIBPATH_TO($with_bdb_lib, LIBS) 209 | CMU_ADD_LIBPATH_TO($with_bdb_lib, BDB_LIBADD) 210 | else 211 | BDB_LIBADD="" 212 | fi 213 | 214 | for dbname in db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db 215 | do 216 | AC_CHECK_LIB($dbname, db_create, BDB_LIBADD="$BDB_LIBADD -l$dbname"; 217 | dblib="berkeley"; break, dblib="no") 218 | done 219 | if test "$dblib" = "no"; then 220 | AC_CHECK_LIB(db, db_open, BDB_LIBADD="$BDB_LIBADD -ldb"; 221 | dblib="berkeley"; dbname=db, 222 | dblib="no") 223 | fi 224 | 225 | LIBS=$BDB_SAVE_LIBS 226 | ]) 227 | 228 | AC_DEFUN(CYRUS_BERKELEY_DB_OPTS, 229 | [ 230 | AC_ARG_WITH(bdb-libdir, 231 | [ --with-bdb-libdir=DIR Berkeley DB lib files are in DIR], 232 | with_bdb_lib=$withval, 233 | [ test "${with_bdb_lib+set}" = set || with_bdb_lib=none]) 234 | AC_ARG_WITH(bdb-incdir, 235 | [ --with-bdb-incdir=DIR Berkeley DB include files are in DIR], 236 | with_bdb_inc=$withval, 237 | [ test "${with_bdb_inc+set}" = set || with_bdb_inc=none ]) 238 | ]) 239 | 240 | AC_DEFUN(CYRUS_BERKELEY_DB_CHK, 241 | [ 242 | AC_REQUIRE([CYRUS_BERKELEY_DB_OPTS]) 243 | 244 | cmu_save_CPPFLAGS=$CPPFLAGS 245 | 246 | if test -d $with_bdb_inc; then 247 | CPPFLAGS="$CPPFLAGS -I$with_bdb_inc" 248 | BDB_INCADD="-I$with_bdb_inc" 249 | else 250 | BDB_INCADD="" 251 | fi 252 | 253 | dnl Note that FreeBSD puts it in a wierd place 254 | dnl (but they should use with-bdb-incdir) 255 | AC_CHECK_HEADER(db.h, 256 | CYRUS_BERKELEY_DB_CHK_LIB(), 257 | dblib="no") 258 | 259 | CPPFLAGS=$cmu_save_CPPFLAGS 260 | ]) 261 | --------------------------------------------------------------------------------