Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 34721 Details for
Bug 55781
shadow 4.0.4.1-r2 mislabeling
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
updated patch
shadow-4.0.4.1-selinux.diff (text/plain), 4.20 KB, created by
petre rodan (RETIRED)
on 2004-07-03 12:03:05 UTC
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
petre rodan (RETIRED)
Created:
2004-07-03 12:03:05 UTC
Size:
4.20 KB
patch
obsolete
>diff -urN shadow-4.0.3.orig/lib/Makefile.am shadow-4.0.3/lib/Makefile.am >--- shadow-4.0.3.orig/lib/Makefile.am 2001-10-06 14:53:20.000000000 -0500 >+++ shadow-4.0.3/lib/Makefile.am 2003-08-07 08:38:20.000000000 -0500 >@@ -1,7 +1,7 @@ > > AUTOMAKE_OPTIONS = 1.0 foreign > >-DEFS = >+DEFS = -DWITH_SELINUX > INCLUDES = > > lib_LTLIBRARIES = libshadow.la >diff -urN shadow-4.0.3.orig/lib/Makefile.in shadow-4.0.3/lib/Makefile.in >--- shadow-4.0.3.orig/lib/Makefile.in 2004-01-14 16:15:26.000000000 +0200 >+++ shadow-4.0.3/lib/Makefile.in 2004-07-03 21:34:31.815854072 +0300 >@@ -56,7 +56,7 @@ > CXXFLAGS = @CXXFLAGS@ > CYGPATH_W = @CYGPATH_W@ > >-DEFS = >+DEFS = -DWITH_SELINUX > DEPDIR = @DEPDIR@ > ECHO = @ECHO@ > ECHO_C = @ECHO_C@ >diff -urN shadow-4.0.3.orig/lib/commonio.c shadow-4.0.3/lib/commonio.c >--- shadow-4.0.3.orig/lib/commonio.c 2001-11-17 07:15:52.000000000 -0600 >+++ shadow-4.0.3/lib/commonio.c 2003-08-07 08:38:20.000000000 -0500 >@@ -15,7 +15,10 @@ > #ifdef HAVE_SHADOW_H > #include <shadow.h> > #endif >- >+#ifdef WITH_SELINUX >+#include <selinux/selinux.h> >+static security_context_t old_context=NULL; >+#endif > #include "commonio.h" > > /* local function prototypes */ >@@ -437,6 +440,15 @@ > return 0; > } > >+#ifdef WITH_SELINUX >+ db->scontext=NULL; >+ if (is_selinux_enabled() && (! db->readonly)) { >+ if (fgetfilecon(fileno(db->fp),&db->scontext) < 0) { >+ goto cleanup; >+ } >+ } >+#endif >+ > buflen = BUFLEN; > buf = (char *) malloc(buflen); > if (!buf) >@@ -492,6 +504,12 @@ > free(buf); > cleanup: > free_linked_list(db); >+#ifdef WITH_SELINUX >+ if (db->scontext!= NULL) { >+ freecon(db->scontext); >+ db->scontext=NULL; >+ } >+#endif > fclose(db->fp); > db->fp = NULL; > errno = ENOMEM; >@@ -627,6 +645,19 @@ > goto fail; > } > >+#ifdef WITH_SELINUX >+ if (db->scontext != NULL) { >+ int stat=getfscreatecon(&old_context); >+ if (stat< 0) { >+ errors++; >+ goto fail; >+ } >+ if (setfscreatecon(db->scontext)<0) { >+ errors++; >+ goto fail; >+ } >+ } >+#endif > /* > * Create backup file. > */ >@@ -683,14 +714,26 @@ > goto fail; > > nscd_need_reload = 1; >- >+ goto success; >+fail: >+ errors++; > success: >- free_linked_list(db); >- return 1; > >-fail: >+#ifdef WITH_SELINUX >+ if (db->scontext != NULL) { >+ if (setfscreatecon(old_context)<0) { >+ errors++; >+ } >+ if (old_context != NULL) { >+ freecon(old_context); >+ old_context=NULL; >+ } >+ freecon(db->scontext); >+ db->scontext=NULL; >+ } >+#endif > free_linked_list(db); >- return 0; >+ return errors==0; > } > > >diff -urN shadow-4.0.3.orig/lib/commonio.h shadow-4.0.3/lib/commonio.h >--- shadow-4.0.3.orig/lib/commonio.h 2001-08-14 16:09:54.000000000 -0500 >+++ shadow-4.0.3/lib/commonio.h 2003-08-07 08:38:20.000000000 -0500 >@@ -1,5 +1,8 @@ > /* $Id: shadow-4.0.4.1-selinux.diff,v 1.1 2004/01/23 19:51:06 pebenito Exp $ */ > >+#ifdef WITH_SELINUX >+#include <selinux/selinux.h> >+#endif > /* > * Linked list entry. > */ >@@ -70,6 +73,9 @@ > */ > FILE *fp; > >+#ifdef WITH_SELINUX >+ security_context_t scontext; >+#endif > /* > * Head, tail, current position in linked list. > */ >diff -urN shadow-4.0.3.orig/src/Makefile.am shadow-4.0.3/src/Makefile.am >--- shadow-4.0.3.orig/src/Makefile.am 2002-03-10 01:12:52.000000000 -0600 >+++ shadow-4.0.3/src/Makefile.am 2003-08-07 08:38:20.000000000 -0500 >@@ -4,7 +4,7 @@ > ubindir = ${prefix}/bin > usbindir = ${prefix}/sbin > >-DEFS = -D_HAVE_CONFIG_H -DLOCALEDIR=\"$(datadir)/locale\" >+DEFS = -D_HAVE_CONFIG_H -DLOCALEDIR=\"$(datadir)/locale\" -DWITH_SELINUX > > INCLUDES = -I${top_srcdir} \ > -I${top_srcdir}/lib \ >@@ -35,7 +35,7 @@ > suidubins = chage chfn chsh expiry gpasswd newgrp passwd > > LDADD = $(top_builddir)/libmisc/libmisc.la \ >- $(top_builddir)/lib/libshadow.la >+ $(top_builddir)/lib/libshadow.la -lselinux > > chpasswd_LDADD = $(LDADD) $(LIBPAM) > chage_LDADD = $(LDADD) $(LIBPAM) >diff -urN shadow-4.0.3.orig/src/Makefile.in shadow-4.0.3/src/Makefile.in >--- shadow-4.0.3.orig/src/Makefile.in 2002-03-13 13:04:10.000000000 -0600 >+++ shadow-4.0.3/src/Makefile.in 2003-08-07 08:45:13.000000000 -0500 >@@ -145,7 +145,7 @@ > suidubins = chage chfn chsh expiry gpasswd newgrp passwd > > LDADD = $(top_builddir)/libmisc/libmisc.la \ >- $(top_builddir)/lib/libshadow.la >+ $(top_builddir)/lib/libshadow.la -lselinux > > > chpasswd_LDADD = $(LDADD) $(LIBPAM)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55781
: 34721