op: controlled privilege escalation (a flexible alternative to sudo)
C M4 Shell Makefile Perl Lex Other
Latest commit 48d5487 Jun 1, 2016 @gits68 gits68 committed with Fix: header guard.
Failed to load latest commit information.
build-aux revision initiale Jan 10, 2017
contrib modif * -> *$vers* Jan 10, 2017
m4 revision initiale Jan 10, 2017
.gitignore ajout config.cache Jan 10, 2017
AUTHORS ajout myself Jan 10, 2017
COPYING Version 1.24 released on 2004-05-12 09:45 Jun 6, 2012
ChangeLog ajout 1.33 Jan 10, 2017
INSTALL update Jan 10, 2017
Makefile.am op_SOURCE += rplregex.* Jan 10, 2017
Makefile.in update Jan 10, 2017
NEWS Released 1.31. The main change is a move to the autotools, so please … Jun 6, 2012
README Released 1.31. The main change is a move to the autotools, so please … Jun 6, 2012
aclocal.m4 update Jan 10, 2017
atov.c static code analysis : flawfinder Jan 10, 2017
autogen.sh modif autoreconf -> autoreconf268 Jan 10, 2017
config.h.in update Jan 10, 2017
configure ajout patch "in +;" Jan 10, 2017
configure.ac modif AC_PREREQ : 2.59 -> 2.68 Jan 10, 2017
defs.h Fix: header guard. Jan 10, 2017
lex.c update Jan 10, 2017
lex.l depl defs.h to the top to handle right features.h later (unistd.h) Jan 10, 2017
main.c depl defs.h to the top to handle right features.h later (unistd.h) Jan 10, 2017
op.1 1.32 released. Mostly minor changes, fixes for a few compile issues o… Jun 6, 2012
op.conf Version 1.26 now reads configuration files in /etc/op.d in addition t… Jun 6, 2012
op.conf-dist modif prvall -> keypriv Jan 10, 2017
op.conf.complex Version 1.26 now reads configuration files in /etc/op.d in addition t… Jun 6, 2012
op.list.in Version 1.26 now reads configuration files in /etc/op.d in addition t… Jun 6, 2012
op.pam Released 1.30 which fixes a few bugs including a fairly major one int… Jun 6, 2012
op.paper Version 1.1 released on 1995-12-29 02:23 Jun 5, 2012
regexp.c ajout config.h / #ifndef HAVE_REGEX Jan 10, 2017
regexp.h indent -linux -i4 + k&r => ansi Jan 10, 2017
rplregex.c new regex API compatible w/ both V8 regexp and POSIX regex Jan 10, 2017
rplregex.h Fix: header guard. Jan 10, 2017
snprintf.c modif <config.h> -> "config.h" Jan 10, 2017
strlcat.c modif config.h -> defs.h Jan 10, 2017
strlcpy.c modif config.h -> defs.h Jan 10, 2017
util.c ajout Copyright 1991, David Koblas, even if not true :) Jan 10, 2017
yywrap.c modigf <config.h> -> "config.h" Jan 10, 2017



This document is largely out of date, but left for historical interest.

Alec Thomas, 08/06/2005


Op is a tool for allowing users to run root privileged commands
without the root password. It is described in detail in "Op: A Flexible
Tool for Restricted Superuser Access" by Tom Christiansen. From this
description Dave Koblas produced an impementation of op in C. Tom's
original paper is included in this distribution in the file
"op.paper". Differences between that design and the current
implementation are noted in the file "op.changes".

I first came into contact with op at Octel in 1992. Over the years I
added a couple of things, and ported it to architectures Octel cared
about. Those included SunOS 4.1.x, Solaris 2.2 and greater, AIX,
HP-UX 9.x, BSDI 1.1 and Linux 1.x. I added support for SecurID access
control from Security Dynamics. This particular code has only been
tested under SunOS and Solaris. I also enhanced the syslog stuff so it
would log the command parameters that op executes as well as the
command name. Support for Solaris shadow passwords was also added.

I left Octel in 1996, and payed little attention to op for over a
year. Recently, I had a need for op on Linux 2.0. I had to tweak the
shadow password implementation to get it to work. while I was at it I
cleaned up some of the logging code. It seems to work quite well on
Linux. I've tried hard not to break other platforms with my mods, so
they probably still work too. 8).I will test this code on any platform
I need to use it on. If you have ported or built this code on other
platforms, I'd like to hear from you. You can reach me via email at
hbo@egbok.com. I'll try to help out with bugs time permitting.

**** Disclaimer ****

This code has been extensively tested only on the Sun
architectures. We have noticed no egregious bugs on those platforms,
but that's no guarantee such bugs don't exist. That goes double for
the non-Sun architectures where testing has involved building,
installing and running "op sh" once or twice.

To build op, edit defs.h to point OP_ACCESS at the full pathname of
your op.access file. You can study the sample file included with the
distribution to get an idea of its semantics. Next, edit the Makefile
and remove comments from  the lines appropriate to your

If you have shadow passwords, define the USE_SHADOW symbol to build in
Solaris style shadow support. This also works on Linux 2.0.30. Shadow
passwords on other architectures have not been tested and are not
supported. If you successfully port op to another platform's shadow
password implementation, send me the diffs, and I'll try to roll them
into the main distribution.

 If you have the Security Dynamics ACE server software,
uncomment the lines pertaining to SECURID. Define SECURIDLIBDIR and
SECURIDINC to point at where the  sdiclient library, and the ACE
header files live respectively. The keyword "securid" in op.access
will enable the client code. Each host that runs op in this mode must
be configured as a client in the ACE server's database.

After that, a simple make in the source directory should build op. To
test op, the executable must be setuid root, and the op.access file
must reside at the place OP_ACCESS points to.

I'm grateful to Tom Christiansen and Dave Koblas for the original
design and implementation of op. I'm also grateful to all those folks
who, like Tom and Dave, have made my life easier by giving away
marvelous, useful source code. I'm happy to give a little bit back, at
long last.

/* +-------------------------------------------------------------------+ */
/* | Copyright 1991, David Koblas.                                     | */
/* |   Permission to use, copy, modify, and distribute this software   | */
/* |   and its documentation for any purpose and without fee is hereby | */
/* |   granted, provided that the above copyright notice appear in all | */
/* |   copies and that both that copyright notice and this permission  | */
/* |   notice appear in supporting documentation.  This software is    | */
/* |   provided "as is" without express or implied warranty.           | */
/* +-------------------------------------------------------------------+ */

	Ditto for my contributions which are Copyright (C) 1995, 1997 by
	Howard Owen. (hbo@egbok.com)

	And again for contributions by me, Alec Thomas (alec@swapoff.org),
	Copyright (C) 2002-2005.