Skip to content

Commit

Permalink
Version 1.32 released on 2005-12-08 01:52
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Jun 5, 2012
1 parent 055bacc commit a410330
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 33 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
08/12/05 - op 1.32
==================

* Added rpl_malloc/rpl_realloc so that systems with dodgy implementations
will link. This fixes compilation on HPUX, for example.
* If a 'help' parameter does not exist, use the actual command to be run for
the help.
* Added detection for openlog() returning void.

01/09/05 - op 1.31
==================

Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ man_MANS=op.1
EXTRA_DIST=op.conf op.conf.complex op.list.in op.pam op.paper op.1
#README

AM_CPPFLAGS = -Wall -DSYSCONFDIR=\"$(sysconfdir)\"
AM_CPPFLAGS = -Wall -DSYSCONFDIR=\"$(sysconfdir)\" @EXTRA_CPPFLAGS@

install-exec-hook:
chmod 4755 $(DESTDIR)$(bindir)/op
Expand Down
7 changes: 3 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
Expand All @@ -14,8 +14,6 @@

@SET_MAKE@

SOURCES = $(op_SOURCES)

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
Expand Down Expand Up @@ -105,6 +103,7 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CPPFLAGS = @EXTRA_CPPFLAGS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
Expand Down Expand Up @@ -162,7 +161,7 @@ op_SOURCES = atov.c defs.h lex.l main.c regexp.c regexp.h util.c
man_MANS = op.1
EXTRA_DIST = op.conf op.conf.complex op.list.in op.pam op.paper op.1
#README
AM_CPPFLAGS = -Wall -DSYSCONFDIR=\"$(sysconfdir)\"
AM_CPPFLAGS = -Wall -DSYSCONFDIR=\"$(sysconfdir)\" @EXTRA_CPPFLAGS@
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am

Expand Down
4 changes: 2 additions & 2 deletions aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-

# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
Expand Down Expand Up @@ -28,7 +28,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.5])])
[AM_AUTOMAKE_VERSION([1.9.6])])

# AM_AUX_DIR_EXPAND -*- Autoconf -*-

Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK

/* Does openlog() return void? */
#undef OPENLOG_VOID

/* Name of package */
#undef PACKAGE

Expand Down
66 changes: 54 additions & 12 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for op 1.31.
# Generated by GNU Autoconf 2.59 for op 1.32.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='op'
PACKAGE_TARNAME='op'
PACKAGE_VERSION='1.31'
PACKAGE_STRING='op 1.31'
PACKAGE_VERSION='1.32'
PACKAGE_STRING='op 1.32'
PACKAGE_BUGREPORT='[email protected]'

ac_unique_file="regexp.h"
Expand Down Expand Up @@ -311,7 +311,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"

ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LEX LEXLIB LEX_OUTPUT_ROOT EXTRA_CPPFLAGS CPP EGREP LIBOBJS LTLIBOBJS'
ac_subst_files=''

# Initialize some variables set by options.
Expand Down Expand Up @@ -780,7 +780,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures op 1.31 to adapt to many kinds of systems.
\`configure' configures op 1.32 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -842,7 +842,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of op 1.31:";;
short | recursive ) echo "Configuration of op 1.32:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -968,7 +968,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
op configure 1.31
op configure 1.32
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
Expand All @@ -982,7 +982,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by op $as_me 1.31, which was
It was created by op $as_me 1.32, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -1628,7 +1628,7 @@ fi
# Define the identity of the package.
PACKAGE='op'
VERSION='1.31'
VERSION='1.32'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -3422,6 +3422,46 @@ fi
fi
OPENLOG_VOID=1
cat >conftest.$ac_ext <<_ACEOF
int main(int, char**){int i = openlog(); return 0;}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
OPENLOG_VOID=0
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
cat >>confdefs.h <<_ACEOF
#define OPENLOG_VOID ${OPENLOG_VOID}
_ACEOF
# Feature checks
auto_detect_auth=no
with_pam=${with_pam:-yes}
Expand Down Expand Up @@ -3554,7 +3594,7 @@ if test "${enable_xauth+set}" = set; then
fi;
if test "${enable_xauth}" != no; then
CPPFLAGS="$CPPFLAGS -DXAUTH=\\\"$enable_xauth\\\""
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -DXAUTH=\\\"$enable_xauth\\\""
fi
Expand Down Expand Up @@ -3632,6 +3672,7 @@ _ACEOF
fi
# Checks for header files.
Expand Down Expand Up @@ -7201,7 +7242,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by op $as_me 1.31, which was
This file was extended by op $as_me 1.32, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -7264,7 +7305,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
op config.status 1.31
op config.status 1.32
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Expand Down Expand Up @@ -7504,6 +7545,7 @@ s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
s,@LEX@,$LEX,;t t
s,@LEXLIB@,$LEXLIB,;t t
s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
s,@CPP@,$CPP,;t t
s,@EGREP@,$EGREP,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
Expand Down
12 changes: 10 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT(op, 1.31, [email protected])
AC_INIT(op, 1.32, [email protected])
AC_CONFIG_SRCDIR([regexp.h])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
Expand All @@ -15,6 +15,13 @@ AC_PROG_MAKE_SET

AC_CHECK_FUNC([crypt], [], [AC_CHECK_LIB([crypt], [crypt], [], [AC_MSG_ERROR(Can't find crypt())])])

OPENLOG_VOID=1
AC_COMPILE_IFELSE(
[int main(int, char**){int i = openlog(); return 0;}],
OPENLOG_VOID=0
)
AC_DEFINE_UNQUOTED([OPENLOG_VOID], [${OPENLOG_VOID}], [Does openlog() return void?])

# Feature checks
auto_detect_auth=no
with_pam=${with_pam:-yes}
Expand Down Expand Up @@ -53,10 +60,11 @@ fi
enable_xauth=${enable_xauth:-no}
AC_ARG_ENABLE(xauth, [ --enable-xauth=<xauth> enable xauth support and specify xauth binary])
if test "${enable_xauth}" != no; then
CPPFLAGS="$CPPFLAGS -DXAUTH=\\\"$enable_xauth\\\""
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -DXAUTH=\\\"$enable_xauth\\\""
fi

AC_CHECK_LIB([fl], [yywrap])
AC_SUBST(EXTRA_CPPFLAGS)

# Checks for header files.
AC_HEADER_DIRENT
Expand Down
35 changes: 24 additions & 11 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,29 @@ int length = 0, i;
if (VerifyPermissions(new) >= 0) {
char *help = FindOpt(new, "help");

if (!help || !*help) help = "(no help available)";
printf("%-*s", length + 2, new->name);
while (*help) {
int j;

printf("%-*.*s\n", 77 - length, 77 - length, help);
for (j = 0; j < 77 - length && *help; ++j, ++help) ;
if (j == 77 - length)
printf("%-*s", length + 2, "");
if (!help || !*help) {
int j, len = 0;

for (j = 0; j < cmd->nargs; ++j)
len += strlen(cmd->args[j]) + 1;
help = (char*)malloc(len);
strcpy(help, cmd->args[0]);
for (j = 1; j < cmd->nargs; ++j) {
strcat(help, " ");
if (strchr(cmd->args[j], ' ') || strchr(cmd->args[j], '\t')) {
strcat(help, "'");
strcat(help, cmd->args[j]);
strcat(help, "'");
} else
strcat(help, cmd->args[j]);
}
}
printf("%-*s", length + 2, new->name);
printf("%-*.*s", 77 - length, 77 - length, help);
if (strlen(help) > 77 - length)
printf("...\n");
else
printf("\n");
}
}
}
Expand Down Expand Up @@ -250,7 +263,7 @@ char *argv[];
}
}

#if defined (bsdi) || defined (SOLARIS) || defined (__linux__)
#if OPENLOG_VOID
openlog("op", LOG_PID | LOG_CONS, LOG_AUTH);
#else
if (openlog("op", LOG_PID | LOG_CONS, LOG_AUTH) < 0)
Expand All @@ -260,7 +273,7 @@ char *argv[];
read_conf_dir = ReadDir( OP_ACCESS_DIR );

if (!read_conf && !read_conf_dir)
fatal(1, "could not open %s or any configuration files in %s", OP_ACCESS, OP_ACCESS_DIR);
fatal(1, "could not open %s or any configuration files in %s (check that file permissions are 600)", OP_ACCESS, OP_ACCESS_DIR);

if ((pw = getpwuid(getuid())) == NULL)
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion op.1
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ is set to the specified value in the new environment.
Disables the destruction of the users environment.
.TP
.B help
Define help for this mnemonic.
Define help for this mnemonic. Defaults to the full command.
.I op -l
will display this help when it lists the available commands. eg.
.I help="This is some help"
Expand Down
5 changes: 5 additions & 0 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ int array_extend(array_t *array, int capacity) {
array->data = realloc(array->data, sizeof(void**) * array->capacity);
return 1;
}

#undef malloc
void * rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc (n); }
#undef realloc
void * rpl_realloc (void *ptr, size_t n) { if (n == 0) n = 1; return realloc (ptr, n); }

0 comments on commit a410330

Please sign in to comment.