summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2003-11-09 18:48:16 +0000
committerMartin Schlemmer <azarah@gentoo.org>2003-11-09 18:48:16 +0000
commitbc68658105ba6cae7e8c3a53c2386df60e2243ee (patch)
tree87ce35929511ecf913bec9ac3451f38f0c3a9f8b /sys-libs/pwdb
parentUpdate version. (diff)
downloadgentoo-2-bc68658105ba6cae7e8c3a53c2386df60e2243ee.tar.gz
gentoo-2-bc68658105ba6cae7e8c3a53c2386df60e2243ee.tar.bz2
gentoo-2-bc68658105ba6cae7e8c3a53c2386df60e2243ee.zip
Update version.
Diffstat (limited to 'sys-libs/pwdb')
-rw-r--r--sys-libs/pwdb/ChangeLog8
-rw-r--r--sys-libs/pwdb/Manifest9
-rw-r--r--sys-libs/pwdb/files/digest-pwdb-0.621
-rw-r--r--sys-libs/pwdb/files/pwdb-0.62-selinux.patch445
-rw-r--r--sys-libs/pwdb/files/pwdb-0.62-use-gcc-as-linker.patch12
-rw-r--r--sys-libs/pwdb/pwdb-0.62.ebuild67
6 files changed, 536 insertions, 6 deletions
diff --git a/sys-libs/pwdb/ChangeLog b/sys-libs/pwdb/ChangeLog
index 3295879710a9..977ba1897ffd 100644
--- a/sys-libs/pwdb/ChangeLog
+++ b/sys-libs/pwdb/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-libs/pwdb
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/pwdb/ChangeLog,v 1.17 2003/10/29 03:57:22 pebenito Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/pwdb/ChangeLog,v 1.18 2003/11/09 18:48:05 azarah Exp $
+
+*pwdb-0.62 (09 Nov 2003)
+
+ 09 Nov 2003; Martin Schlemmer <azarah@gentoo.org> pwdb-0.62.ebuild,
+ files/pwdb-0.62-selinux.patch, files/pwdb-0.62-use-gcc-as-linker.patch:
+ Update version.
28 Oct 2003; Chris PeBenito <pebenito@gentoo.org> pwdb-0.61-r4.ebuild,
files/pwdb-0.61-selinux.diff.bz2:
diff --git a/sys-libs/pwdb/Manifest b/sys-libs/pwdb/Manifest
index d6b9812d3af8..69c9f5c51680 100644
--- a/sys-libs/pwdb/Manifest
+++ b/sys-libs/pwdb/Manifest
@@ -1,11 +1,10 @@
-MD5 d51f939de9f7bd5090af4955e5d40785 pwdb-0.62.ebuild 1718
+MD5 19a6a20c25a59a365f539cf58e2a8da5 pwdb-0.62.ebuild 1686
MD5 77b39e459d4f7599753285bfbf2d2ebf pwdb-0.61-r4.ebuild 1712
-MD5 08ebe4110c26ae8d9bd8506cdc0b8177 .pwdb-0.62.ebuild.swp 12288
-MD5 07bed319e58fed99200f4c525e73c0ea ChangeLog 2289
-MD5 89ad1810bd5ea7cd5d3c990c89c688ce files/pwdb-0.62-use-gcc-as-linker.patch 509
+MD5 b713f6703639ff9b4f56d7a4dfdf8da5 ChangeLog 2476
+MD5 f2d1888e60ba62137f53ed5378eb7e25 files/pwdb-0.62-use-gcc-as-linker.patch 508
MD5 8cc9a65a57937cd962ff641cf94e40c3 files/digest-pwdb-0.62 61
MD5 bfc6ac3622c2b25c39d9f48d8474c2dc files/digest-pwdb-0.61-r4 61
MD5 0d0c7a6216f5cf079472dfe36ea9d71c files/passwd 143
MD5 cd2a9858f40c4a6e7098424f5785b7bc files/pwdb-0.61-hppa.patch 487
-MD5 3aabb785f0ad589ba178ffce981e5783 files/pwdb-0.62-selinux.patch 10468
+MD5 0116d898239a003d326c723514d6d30a files/pwdb-0.62-selinux.patch 10581
MD5 79659c4025929dac91dc8afc808eec2a files/pwdb-0.61-selinux.diff.bz2 1993
diff --git a/sys-libs/pwdb/files/digest-pwdb-0.62 b/sys-libs/pwdb/files/digest-pwdb-0.62
new file mode 100644
index 000000000000..fdf881196ce6
--- /dev/null
+++ b/sys-libs/pwdb/files/digest-pwdb-0.62
@@ -0,0 +1 @@
+MD5 1a1fd0312040ef37aa741d09465774b4 pwdb-0.62.tar.gz 133183
diff --git a/sys-libs/pwdb/files/pwdb-0.62-selinux.patch b/sys-libs/pwdb/files/pwdb-0.62-selinux.patch
new file mode 100644
index 000000000000..e87d5a8a8f52
--- /dev/null
+++ b/sys-libs/pwdb/files/pwdb-0.62-selinux.patch
@@ -0,0 +1,445 @@
+--- pwdb-0.62/examples/Makefile.pwdbselinux 1998-10-06 19:57:04.000000000 -0400
++++ pwdb-0.62/examples/Makefile 2003-07-09 14:45:54.702663000 -0400
+@@ -4,6 +4,8 @@ PROGS = posix gentest tpwdb radtest grou
+ SRCS = $(addsuffix .c,$(PROGS))
+ OBJS = $(addsuffix .o,$(PROGS))
+
++SELINUXLIBS = -lselinux -lattr
++
+ # rules
+ junk:
+ @echo "this is not a top-level Makefile"
+@@ -14,20 +16,20 @@ junk:
+
+ all: ${PROGS} ../libpwdb/libpwdb.a
+
+-posix: posix.o ../libpwdb/libpwdb.a
+- $(CC) -o $@ $< ../libpwdb/libpwdb.a -lnsl
++posix: posix.o ../libpwdb/libpwdb.a
++ $(CC) -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ tpwdb: tpwdb.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ radtest: radtest.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ gentest: gentest.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ grouptest: grouptest.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ clean:
+ rm -f ${PROGS} *.o *~
+--- pwdb-0.62/libpwdb/shadow/shadowio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/shadow/shadowio.c 2003-07-09 14:45:54.705662544 -0400
+@@ -16,6 +16,12 @@
+
+ #include "../_pwdb_internal.h"
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++static int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
++
+ struct spw_file_entry {
+ char *spwf_line;
+ int spwf_changed;
+@@ -259,8 +265,28 @@ int __pwdb_spw_close (void)
+ if (fstat (fileno (spwfp), &sb))
+ return 0;
+
+- if (create_backup_file(spwfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t passwd_context=NULL;
++ if (fgetfilecon(fileno (spwfp),&passwd_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(passwd_context);
++ return 0;
++ }
++ if (setfscreatecon(passwd_context)) {
++ freecon(passwd_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(passwd_context);
++ }
++#endif
++ if (create_backup_file(spwfp, backup, &sb)){
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (spwfp);
+@@ -278,11 +304,15 @@ int __pwdb_spw_close (void)
+ */
+
+ spwfp = fopen_with_umask(newfile, "w", 0777);
+- if (!spwfp)
+- return 0;
++ if (!spwfp){
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)){
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -308,7 +338,7 @@ int __pwdb_spw_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -352,7 +382,20 @@ int __pwdb_spw_close (void)
+ }
+ spwf_tail = 0;
+ isopen = 0;
+- return 1;
++
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ int __pwdb_spw_update (const struct __pwdb_spwd *spwd)
+--- pwdb-0.62/libpwdb/shadow/sgroupio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/shadow/sgroupio.c 2003-07-09 14:45:54.704662696 -0400
+@@ -16,6 +16,12 @@
+
+ #include "../_pwdb_internal.h"
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++static int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
++
+ static int islocked;
+ static int isopen;
+ static int open_modes;
+@@ -278,8 +284,28 @@ int __pwdb_sgr_close (void)
+ if (fstat (fileno (sgrfp), &sb))
+ return 0;
+
+- if (create_backup_file(sgrfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t passwd_context=NULL;
++ if (fgetfilecon(fileno (sgrfp),&passwd_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(passwd_context);
++ return 0;
++ }
++ if (setfscreatecon(passwd_context)) {
++ freecon(passwd_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(passwd_context);
++ }
++#endif
++ if (create_backup_file(sgrfp, backup, &sb)){
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (sgrfp);
+@@ -296,11 +322,15 @@ int __pwdb_sgr_close (void)
+ */
+
+ sgrfp = fopen_with_umask(newfile, "w", 0777);
+- if (!sgrfp)
+- return 0;
++ if (!sgrfp){
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)){
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -326,7 +356,7 @@ int __pwdb_sgr_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -370,7 +400,20 @@ int __pwdb_sgr_close (void)
+ }
+ sgr_tail = 0;
+ isopen = 0;
+- return 1;
++
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ int __pwdb_sgr_update (const struct __pwdb_sgrp *sgrent)
+--- pwdb-0.62/libpwdb/unix/pwio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/unix/pwio.c 2003-07-09 14:45:54.707662240 -0400
+@@ -16,6 +16,11 @@
+
+ #include "../_pwdb_internal.h"
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++static int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
+ struct pw_file_entry {
+ char *pwf_line;
+ int pwf_changed;
+@@ -204,8 +209,28 @@ int __pwdb_pw_close (void)
+ if (fstat (fileno (pwfp), &sb))
+ return 0;
+
+- if (create_backup_file(pwfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t passwd_context=NULL;
++ if (fgetfilecon(fileno (pwfp),&passwd_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(passwd_context);
++ return 0;
++ }
++ if (setfscreatecon(passwd_context)) {
++ freecon(passwd_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(passwd_context);
++ }
++#endif
++ if (create_backup_file(pwfp, backup, &sb)) {
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (pwfp);
+@@ -222,11 +247,15 @@ int __pwdb_pw_close (void)
+ */
+
+ pwfp = fopen_with_umask(newfile, "w", 0777);
+- if (!pwfp)
+- return 0;
++ if (!pwfp) {
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)) {
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -251,7 +280,7 @@ int __pwdb_pw_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -294,7 +323,20 @@ int __pwdb_pw_close (void)
+ }
+ pwf_tail = 0;
+ isopen = 0;
+- return 1;
++
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ /*
+--- pwdb-0.62/libpwdb/unix/groupio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/unix/groupio.c 2003-07-09 14:45:54.708662088 -0400
+@@ -11,6 +11,12 @@
+ #include "../_pwdb_internal.h"
+
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
++
+ static int islocked;
+ static int isopen;
+ static int open_modes;
+@@ -259,8 +265,28 @@ int __pwdb_gr_close (void)
+ if (fstat (fileno (grfp), &sb))
+ return 0;
+
+- if (create_backup_file(grfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t group_context=NULL;
++ if (fgetfilecon(fileno (grfp),&group_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(group_context);
++ return 0;
++ }
++ if (setfscreatecon(group_context)) {
++ freecon(group_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(group_context);
++ }
++#endif
++ if (create_backup_file(grfp, backup, &sb)) {
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (grfp);
+@@ -278,11 +304,15 @@ int __pwdb_gr_close (void)
+ */
+
+ grfp = fopen_with_umask(newfile, "w", 0777);
+- if (!grfp)
+- return 0;
++ if (!grfp) {
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)) {
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -308,7 +338,7 @@ int __pwdb_gr_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -351,7 +381,19 @@ int __pwdb_gr_close (void)
+ }
+ grf_tail = 0;
+ isopen = 0;
+- return 1;
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ /* update an entry */
+--- pwdb-0.62/libpwdb/Makefile.pwdbselinux 1999-04-10 05:31:20.000000000 -0400
++++ pwdb-0.62/libpwdb/Makefile 2003-07-09 14:45:54.709661936 -0400
+@@ -22,7 +22,7 @@ HEADERS = pwdb/pwdb_public.h pwdb/pwdb_c
+
+ # needed for generic interface compilation
+ # if header files are not installed (CG)
+-CFLAGS+=-I.
++CFLAGS+=-I. -DWITH_SELINUX
+
+ CFLAGS+=# -DDEBUG
+
+@@ -50,7 +50,7 @@ all: $(LIBSTATIC) $(LIBDYNAME)
+
+ $(LIBDYNAME): $(LIBOBJ)
+ #$(LD) -soname $(LIBSONAME) -x -shared -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl -lc
+- $(CC) -shared -Wl,-soname -Wl,$(LIBSONAME) -Wl,-x -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl -lc
++ $(CC) -shared -Wl,-soname -Wl,$(LIBSONAME) -Wl,-x -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl -lc -lselinux -lattr
+ @ln -sf $(LIBFILENAME) $@
+
+ $(LIBSTATIC): $(LIBOBJ)
+
diff --git a/sys-libs/pwdb/files/pwdb-0.62-use-gcc-as-linker.patch b/sys-libs/pwdb/files/pwdb-0.62-use-gcc-as-linker.patch
new file mode 100644
index 000000000000..113b15058a74
--- /dev/null
+++ b/sys-libs/pwdb/files/pwdb-0.62-use-gcc-as-linker.patch
@@ -0,0 +1,12 @@
+--- pwdb-0.62/libpwdb/Makefile 2003-03-24 09:42:42.000000000 +0000
++++ pwdb-0.62/libpwdb/Makefile 2003-03-24 09:34:04.000000000 +0000
+@@ -50,7 +50,8 @@
+
+
+ $(LIBDYNAME): $(LIBOBJ)
+- $(LD) -soname $(LIBSONAME) -x -shared -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl -lc
++ #$(LD) -soname $(LIBSONAME) -x -shared -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl -lc
++ $(CC) -shared -Wl,-soname -Wl,$(LIBSONAME) -Wl,-x -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl -lc
+ @ln -sf $(LIBFILENAME) $@
+
+ $(LIBSTATIC): $(LIBOBJ)
diff --git a/sys-libs/pwdb/pwdb-0.62.ebuild b/sys-libs/pwdb/pwdb-0.62.ebuild
new file mode 100644
index 000000000000..0a0c53b5e30e
--- /dev/null
+++ b/sys-libs/pwdb/pwdb-0.62.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/pwdb/pwdb-0.62.ebuild,v 1.1 2003/11/09 18:48:05 azarah Exp $
+
+inherit eutils flag-o-matic
+filter-flags "-fstack-protector"
+
+IUSE="selinux"
+
+DESCRIPTION="Password database"
+HOMEPAGE="http://www.firstlinux.com/cgi-bin/package/content.cgi?ID=6886"
+SRC_URI="mirror://gentoo/${P}.tar.gz
+ http://nl.lunar-linux.org/lunar/sources/sources/${P}.tar.gz"
+
+LICENSE="BSD | GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~arm ~ia64"
+
+DEPEND="virtual/glibc
+ selinux? ( sys-libs/libselinux )"
+
+src_unpack () {
+ unpack ${A}
+
+ cd ${S}
+ # Uses gcc as linker needed for hppa, but good idea in general.
+ epatch ${FILESDIR}/${P}-use-gcc-as-linker.patch
+
+ use selinux && epatch ${FILESDIR}/${P}-selinux.patch
+
+ sed -i -e "s/^DIRS = .*/DIRS = libpwdb/" -e "s:EXTRAS += :EXTRAS += ${CFLAGS} :" \
+ Makefile
+ sed -i -e "s/=gcc/=${CC:-gcc}/g" default.defs
+}
+
+src_compile() {
+ # author has specified application to be compiled with `-g`
+ # no problem, but with ccc `-g` disables optimisation to make
+ # debugging easier, `-g3` enables debugging and optimisation
+ [ "${ARCH}" = "alpha" -a "${CC}" = "ccc" ] && append-flags -g3
+
+ emake || die
+}
+
+src_install() {
+ dodir /lib /usr/include/pwdb
+ make INCLUDED=${D}/usr/include/pwdb \
+ LIBDIR=${D}/lib \
+ LDCONFIG="echo" \
+ install || die
+
+ preplib /
+ dodir /usr/lib
+ mv ${D}/lib/*.a ${D}/usr/lib
+
+ # See bug $4411 for more info
+ gen_usr_ldscript libpwdb.so
+
+ insinto /etc
+ doins conf/pwdb.conf
+
+ dodoc CHANGES Copyright CREDITS README
+ dohtml -r doc
+ docinto txt
+ dodoc doc/*.txt
+}
+