summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-09-27 00:28:41 +0100
committerColin Watson <cjwatson@debian.org>2010-09-27 00:28:41 +0100
commit9eea6f5d590ca001ee29f4806a665b4f1dca54fa (patch)
treecaae0e8141212f0d9e9a91754888fb837133e319
parent4274affde9622e429f2937c569cd76f38722cb0d (diff)
Move security to libman.
* src/security.c: Move to ... * lib/security.c: ... here. * src/security.h: Move to ... * lib/security.h: ... here. * lib/Makefile.am (libman_la_SOURCES): Add security.c and security.h. * src/Makefile.am (lexgrog_SOURCES): Remove fake_security.c and security.h. (man_SOURCES, mandb_SOURCES): Remove security.c and security.h. * lib/README: Add security.*. * src/lexgrog_test.c: Call init_security, so that we can use generic security functions rather than fake_security. * src/fake_security.c: Remove. * lib/security.c (do_system_drop_privs): Unroll calls to do_system into calls to pipeline_start and pipeline_wait. * src/whatis.c (use_grep): Likewise. * src/util.c (do_system): Remove. * include/manconfig.h.in (do_system): Remove. * src/*.c: Update #include grouping for movements to libman.
-rw-r--r--ChangeLog26
-rw-r--r--include/manconfig.h.in1
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/Makefile.in18
-rw-r--r--lib/README1
-rw-r--r--lib/security.c (renamed from src/security.c)16
-rw-r--r--lib/security.h (renamed from src/security.h)0
-rw-r--r--src/Makefile.am6
-rw-r--r--src/Makefile.in18
-rw-r--r--src/check_mandirs.c2
-rw-r--r--src/fake_security.c75
-rw-r--r--src/lexgrog.l2
-rw-r--r--src/lexgrog_test.c8
-rw-r--r--src/man.c4
-rw-r--r--src/manconv.c2
-rw-r--r--src/mandb.c2
-rw-r--r--src/straycats.c4
-rw-r--r--src/util.c7
-rw-r--r--src/whatis.c5
19 files changed, 76 insertions, 123 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d7c7fc4..f0d68473 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+Mon Sep 27 00:24:50 BST 2010 Colin Watson <cjwatson@debian.org>
+
+ Move security to libman.
+
+ * src/security.c: Move to ...
+ * lib/security.c: ... here.
+ * src/security.h: Move to ...
+ * lib/security.h: ... here.
+ * lib/Makefile.am (libman_la_SOURCES): Add security.c and
+ security.h.
+ * src/Makefile.am (lexgrog_SOURCES): Remove fake_security.c and
+ security.h.
+ (man_SOURCES, mandb_SOURCES): Remove security.c and security.h.
+ * lib/README: Add security.*.
+ * src/lexgrog_test.c: Call init_security, so that we can use generic
+ security functions rather than fake_security.
+ * src/fake_security.c: Remove.
+
+ * lib/security.c (do_system_drop_privs): Unroll calls to do_system
+ into calls to pipeline_start and pipeline_wait.
+ * src/whatis.c (use_grep): Likewise.
+ * src/util.c (do_system): Remove.
+ * include/manconfig.h.in (do_system): Remove.
+
+ * src/*.c: Update #include grouping for movements to libman.
+
Sun Sep 26 23:53:08 BST 2010 Colin Watson <cjwatson@debian.org>
Get the tests working again following the switch to libtool.
diff --git a/include/manconfig.h.in b/include/manconfig.h.in
index 3c1c6312..78b5edf2 100644
--- a/include/manconfig.h.in
+++ b/include/manconfig.h.in
@@ -361,7 +361,6 @@ extern int find_name_decompressed (struct pipeline *p, const char *filename,
/* util.c */
extern int is_changed (const char *fa, const char *fb);
extern int is_directory (const char *path);
-extern int do_system (struct pipeline *pl);
extern char *escape_shell (const char *unesc);
extern int remove_directory (const char *directory);
extern char *trim_spaces (const char *s);
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 50ed8504..7e990205 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -47,6 +47,8 @@ libman_la_SOURCES = \
pathsearch.h \
pipeline.c \
pipeline.h \
+ security.c \
+ security.h \
tempfile.c \
wordfnmatch.c \
wordfnmatch.h \
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 132fcaf0..f7bc0310 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -251,8 +251,8 @@ am_libman_la_OBJECTS = libman_la-appendstr.lo libman_la-cleanup.lo \
libman_la-encodings.lo libman_la-hashtable.lo \
libman_la-linelength.lo libman_la-lower.lo \
libman_la-pathsearch.lo libman_la-pipeline.lo \
- libman_la-tempfile.lo libman_la-wordfnmatch.lo \
- libman_la-xregcomp.lo
+ libman_la-security.lo libman_la-tempfile.lo \
+ libman_la-wordfnmatch.lo libman_la-xregcomp.lo
libman_la_OBJECTS = $(am_libman_la_OBJECTS)
AM_V_lt = $(am__v_lt_$(V))
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
@@ -1095,8 +1095,9 @@ libman_la_CPPFLAGS = \
libman_la_SOURCES = appendstr.c cleanup.c cleanup.h debug.c \
decompress.c decompress.h encodings.c encodings.h hashtable.c \
hashtable.h linelength.c linelength.h lower.c lower.h \
- pathsearch.c pathsearch.h pipeline.c pipeline.h tempfile.c \
- wordfnmatch.c wordfnmatch.h xregcomp.c xregcomp.h flock.h
+ pathsearch.c pathsearch.h pipeline.c pipeline.h security.c \
+ security.h tempfile.c wordfnmatch.c wordfnmatch.h xregcomp.c \
+ xregcomp.h flock.h
libman_la_LIBADD = ../gnulib/lib/libgnu.la $(LTLIBOBJS) \
$(LIBCOMPRESS) @LIBINTL@
@@ -1187,6 +1188,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-lower.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-pathsearch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-pipeline.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-security.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-tempfile.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-wordfnmatch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-xregcomp.Plo@am__quote@
@@ -1295,6 +1297,14 @@ libman_la-pipeline.lo: pipeline.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-pipeline.lo `test -f 'pipeline.c' || echo '$(srcdir)/'`pipeline.c
+libman_la-security.lo: security.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-security.lo -MD -MP -MF $(DEPDIR)/libman_la-security.Tpo -c -o libman_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-security.Tpo $(DEPDIR)/libman_la-security.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='security.c' object='libman_la-security.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c
+
libman_la-tempfile.lo: tempfile.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-tempfile.lo -MD -MP -MF $(DEPDIR)/libman_la-tempfile.Tpo -c -o libman_la-tempfile.lo `test -f 'tempfile.c' || echo '$(srcdir)/'`tempfile.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-tempfile.Tpo $(DEPDIR)/libman_la-tempfile.Plo
diff --git a/lib/README b/lib/README
index 60718b70..bebc1a7c 100644
--- a/lib/README
+++ b/lib/README
@@ -16,6 +16,7 @@ linelength.* author - Martin Schulze, Jon Tombs, Colin Watson
lower.* author - Wilf., Colin Watson
pathsearch.* author - Colin Watson
pipeline.* author - James Clark, Colin Watson
+security.* author - John W. Eaton, Wilf., Colin Watson
tempfile.c author - Colin Watson
waitpid.c author - Carl Edman
wordfnmatch.* author - Colin Watson
diff --git a/src/security.c b/lib/security.c
index 3af1124c..4188c898 100644
--- a/src/security.c
+++ b/lib/security.c
@@ -211,12 +211,14 @@ int do_system_drop_privs (pipeline *p)
#ifdef SECURE_MAN_UID
# ifdef POSIX_SAVED_IDS
- if (uid == ruid)
- return do_system (p);
- else {
+ if (uid == ruid) {
+ pipeline_start (p);
+ return pipeline_wait (p);
+ } else {
int status;
drop_effective_privs ();
- status = do_system (p);
+ pipeline_start (p);
+ status = pipeline_wait (p);
regain_effective_privs ();
return status;
}
@@ -236,7 +238,8 @@ int do_system_drop_privs (pipeline *p)
pop_all_cleanups ();
if (SWAP_UIDS (ruid, ruid))
gripe_set_euid ();
- exit (do_system (p));
+ pipeline_start (p);
+ exit (pipeline_wait (p));
} else {
pid_t res;
int save = errno;
@@ -253,6 +256,7 @@ int do_system_drop_privs (pipeline *p)
# endif /* all ways to do a sys command after dropping privs */
#else /* !SECURE_MAN_UID */
- return do_system (p);
+ pipeline_start (p);
+ return pipeline_wait (p);
#endif /* SECURE_MAN_UID */
}
diff --git a/src/security.h b/lib/security.h
index 3cb07958..3cb07958 100644
--- a/src/security.h
+++ b/lib/security.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 9d6de000..0b3de372 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -83,14 +83,12 @@ lexgrog_SOURCES = \
compression.c \
descriptions.c \
descriptions.h \
- fake_security.c \
lexgrog.l \
lexgrog_test.c \
manconv.c \
manconv.h \
manconv_client.c \
manconv_client.h \
- security.h \
ult_src.c \
ult_src.h \
util.c
@@ -110,8 +108,6 @@ man_SOURCES = \
manconv_client.h \
manp.c \
manp.h \
- security.c \
- security.h \
ult_src.c \
ult_src.h \
util.c \
@@ -140,8 +136,6 @@ mandb_SOURCES = \
mandb.c \
manp.c \
manp.h \
- security.c \
- security.h \
straycats.c \
ult_src.c \
ult_src.h \
diff --git a/src/Makefile.in b/src/Makefile.in
index a281efd9..e77fc9e3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -241,16 +241,14 @@ am_globbing_OBJECTS = globbing.$(OBJEXT) globbing_test.$(OBJEXT) \
globbing_OBJECTS = $(am_globbing_OBJECTS)
globbing_DEPENDENCIES = $(LIBMAN)
am_lexgrog_OBJECTS = compression.$(OBJEXT) descriptions.$(OBJEXT) \
- fake_security.$(OBJEXT) lexgrog.$(OBJEXT) \
- lexgrog_test.$(OBJEXT) manconv.$(OBJEXT) \
+ lexgrog.$(OBJEXT) lexgrog_test.$(OBJEXT) manconv.$(OBJEXT) \
manconv_client.$(OBJEXT) ult_src.$(OBJEXT) util.$(OBJEXT)
lexgrog_OBJECTS = $(am_lexgrog_OBJECTS)
lexgrog_DEPENDENCIES = $(LIBMAN)
am_man_OBJECTS = compression.$(OBJEXT) convert_name.$(OBJEXT) \
filenames.$(OBJEXT) globbing.$(OBJEXT) man.$(OBJEXT) \
manconv.$(OBJEXT) manconv_client.$(OBJEXT) manp.$(OBJEXT) \
- security.$(OBJEXT) ult_src.$(OBJEXT) util.$(OBJEXT) \
- zsoelim.$(OBJEXT)
+ ult_src.$(OBJEXT) util.$(OBJEXT) zsoelim.$(OBJEXT)
man_OBJECTS = $(am_man_OBJECTS)
man_DEPENDENCIES = $(LIBMANDB)
am_manconv_OBJECTS = manconv.$(OBJEXT) manconv_main.$(OBJEXT)
@@ -260,8 +258,8 @@ am_mandb_OBJECTS = check_mandirs.$(OBJEXT) compression.$(OBJEXT) \
descriptions.$(OBJEXT) descriptions_store.$(OBJEXT) \
filenames.$(OBJEXT) globbing.$(OBJEXT) lexgrog.$(OBJEXT) \
manconv.$(OBJEXT) manconv_client.$(OBJEXT) mandb.$(OBJEXT) \
- manp.$(OBJEXT) security.$(OBJEXT) straycats.$(OBJEXT) \
- ult_src.$(OBJEXT) util.$(OBJEXT)
+ manp.$(OBJEXT) straycats.$(OBJEXT) ult_src.$(OBJEXT) \
+ util.$(OBJEXT)
mandb_OBJECTS = $(am_mandb_OBJECTS)
mandb_DEPENDENCIES = $(LIBMANDB)
am_manpath_OBJECTS = manp.$(OBJEXT) manpath.$(OBJEXT) util.$(OBJEXT)
@@ -1204,14 +1202,12 @@ lexgrog_SOURCES = \
compression.c \
descriptions.c \
descriptions.h \
- fake_security.c \
lexgrog.l \
lexgrog_test.c \
manconv.c \
manconv.h \
manconv_client.c \
manconv_client.h \
- security.h \
ult_src.c \
ult_src.h \
util.c
@@ -1232,8 +1228,6 @@ man_SOURCES = \
manconv_client.h \
manp.c \
manp.h \
- security.c \
- security.h \
ult_src.c \
ult_src.h \
util.c \
@@ -1264,8 +1258,6 @@ mandb_SOURCES = \
mandb.c \
manp.c \
manp.h \
- security.c \
- security.h \
straycats.c \
ult_src.c \
ult_src.h \
@@ -1509,7 +1501,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_name.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/descriptions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/descriptions_store.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake_security.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenames.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globbing.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globbing_test.Po@am__quote@
@@ -1522,7 +1513,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mandb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manpath.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/straycats.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ult_src.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
diff --git a/src/check_mandirs.c b/src/check_mandirs.c
index 1237b3de..808bfcf2 100644
--- a/src/check_mandirs.c
+++ b/src/check_mandirs.c
@@ -66,6 +66,7 @@
#include "error.h"
#include "hashtable.h"
+#include "security.h"
#include "mydbm.h"
#include "db_storage.h"
@@ -75,7 +76,6 @@
#include "globbing.h"
#include "manp.h"
#include "ult_src.h"
-#include "security.h"
#include "check_mandirs.h"
int opt_test; /* don't update db */
diff --git a/src/fake_security.c b/src/fake_security.c
deleted file mode 100644
index 68ea018f..00000000
--- a/src/fake_security.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * fake_security.c: fake routines for non setuid programs
- *
- * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
- * Copyright (C) 2001 Colin Watson.
- *
- * This file is part of man-db.
- *
- * man-db is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * man-db is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with man-db; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Mon Aug 8 20:35:30 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <errno.h>
-
-#include <sys/types.h>
-
-#include "gettext.h"
-#define _(String) gettext (String)
-
-#include "manconfig.h"
-
-#include "error.h"
-#include "pipeline.h"
-
-#include "security.h"
-
-uid_t ruid, euid, uid;
-
-#ifdef SECURE_MAN_UID
-static struct passwd *man_owner;
-
-struct passwd *get_man_owner (void)
-{
- if (man_owner)
- return man_owner;
-
- man_owner = getpwuid (0);
- if (!man_owner)
- error (FAIL, errno, _("can't get passwd structure for uid 0"));
- return man_owner;
-}
-#endif /* SECURE_MAN_UID */
-
-void drop_effective_privs (void)
-{
- /* do nothing */
-}
-
-void regain_effective_privs (void)
-{
- /* do nothing */
-}
-
-int do_system_drop_privs (pipeline *pl)
-{
- return do_system (pl);
-}
diff --git a/src/lexgrog.l b/src/lexgrog.l
index a9d2c2ef..60a8ebf4 100644
--- a/src/lexgrog.l
+++ b/src/lexgrog.l
@@ -47,9 +47,9 @@
#include "error.h"
#include "pipeline.h"
#include "decompress.h"
-
#include "security.h"
#include "encodings.h"
+
#include "manconv_client.h"
#define YY_READ_BUF_SIZE 1024
diff --git a/src/lexgrog_test.c b/src/lexgrog_test.c
index 78f19d22..d24b4ed4 100644
--- a/src/lexgrog_test.c
+++ b/src/lexgrog_test.c
@@ -43,6 +43,7 @@
#include "error.h"
#include "pipeline.h"
+#include "security.h"
#include "descriptions.h"
#include "ult_src.h"
@@ -148,6 +149,13 @@ int main (int argc, char **argv)
if (argp_parse (&argp, argc, argv, 0, 0, 0))
exit (FAIL);
+#ifdef SECURE_MAN_UID
+ /* We aren't setuid, but this allows generic code in lexgrog.l to
+ * use drop_effective_privs/regain_effective_privs.
+ */
+ init_security ();
+#endif /* SECURE_MAN_UID */
+
if (parse_man)
type = 0;
else
diff --git a/src/man.c b/src/man.c
index 1810e8fb..285b6e1e 100644
--- a/src/man.c
+++ b/src/man.c
@@ -91,6 +91,8 @@ static char *cwd;
#include "linelength.h"
#include "decompress.h"
#include "xregcomp.h"
+#include "security.h"
+#include "encodings.h"
#include "mydbm.h"
#include "db_storage.h"
@@ -100,8 +102,6 @@ static char *cwd;
#include "globbing.h"
#include "ult_src.h"
#include "manp.h"
-#include "security.h"
-#include "encodings.h"
#include "convert_name.h"
#include "zsoelim.h"
#include "manconv_client.h"
diff --git a/src/manconv.c b/src/manconv.c
index 8baadf39..e5a09e65 100644
--- a/src/manconv.c
+++ b/src/manconv.c
@@ -52,8 +52,8 @@
#include "error.h"
#include "pipeline.h"
-
#include "encodings.h"
+
#include "manconv.h"
#ifdef HAVE_ICONV
diff --git a/src/mandb.c b/src/mandb.c
index 49bca87e..baea7889 100644
--- a/src/mandb.c
+++ b/src/mandb.c
@@ -57,13 +57,13 @@
#include "error.h"
#include "cleanup.h"
#include "pipeline.h"
+#include "security.h"
#include "mydbm.h"
#include "check_mandirs.h"
#include "filenames.h"
#include "manp.h"
-#include "security.h"
char *program_name;
int quiet = 1;
diff --git a/src/straycats.c b/src/straycats.c
index 4d69735d..7219b9ee 100644
--- a/src/straycats.c
+++ b/src/straycats.c
@@ -62,14 +62,14 @@
#include "error.h"
#include "pipeline.h"
#include "decompress.h"
+#include "encodings.h"
+#include "security.h"
#include "mydbm.h"
#include "db_storage.h"
#include "descriptions.h"
-#include "encodings.h"
#include "manp.h"
-#include "security.h"
#include "manconv_client.h"
static char *catdir, *mandir;
diff --git a/src/util.c b/src/util.c
index 9af642f5..1b31e7ae 100644
--- a/src/util.c
+++ b/src/util.c
@@ -113,13 +113,6 @@ int is_directory (const char *path)
return ((sb.st_mode & S_IFDIR) != 0);
}
-/* wrapper for pipeline library */
-int do_system (pipeline *pl)
-{
- pipeline_start (pl);
- return pipeline_wait (pl);
-}
-
/* Escape dangerous metacharacters before dumping into a shell command. */
char *escape_shell (const char *unesc)
{
diff --git a/src/whatis.c b/src/whatis.c
index 2555be2e..9c86f25f 100644
--- a/src/whatis.c
+++ b/src/whatis.c
@@ -66,11 +66,11 @@
#include "lower.h"
#include "wordfnmatch.h"
#include "xregcomp.h"
+#include "encodings.h"
#include "mydbm.h"
#include "db_storage.h"
-#include "encodings.h"
#include "manp.h"
static char *manpathlist[MAXDIRS];
@@ -274,7 +274,8 @@ static inline int use_grep (char *page, char *manpath)
command_args (grep_cmd, anchored_page, whatis_file, NULL);
pipeline_command (grep_pl, grep_cmd);
- status = (do_system (grep_pl) == 0);
+ pipeline_start (grep_pl);
+ status = (pipeline_wait (grep_pl) == 0);
free (anchored_page);
pipeline_free (grep_pl);