Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 55781
Collapse All | Expand All

(-)shadow-4.0.3.orig/lib/Makefile.am (-1 / +1 lines)
Lines 1-7 Link Here
1
1
2
AUTOMAKE_OPTIONS = 1.0 foreign
2
AUTOMAKE_OPTIONS = 1.0 foreign
3
3
4
DEFS = 
4
DEFS = -DWITH_SELINUX
5
INCLUDES =
5
INCLUDES =
6
6
7
lib_LTLIBRARIES = libshadow.la
7
lib_LTLIBRARIES = libshadow.la
(-)shadow-4.0.3.orig/lib/Makefile.in (-1 / +1 lines)
Lines 56-62 Link Here
56
CXXFLAGS = @CXXFLAGS@
56
CXXFLAGS = @CXXFLAGS@
57
CYGPATH_W = @CYGPATH_W@
57
CYGPATH_W = @CYGPATH_W@
58
58
59
DEFS = 
59
DEFS = -DWITH_SELINUX
60
DEPDIR = @DEPDIR@
60
DEPDIR = @DEPDIR@
61
ECHO = @ECHO@
61
ECHO = @ECHO@
62
ECHO_C = @ECHO_C@
62
ECHO_C = @ECHO_C@
(-)shadow-4.0.3.orig/lib/commonio.c (-6 / +49 lines)
Lines 15-21 Link Here
15
#ifdef HAVE_SHADOW_H
15
#ifdef HAVE_SHADOW_H
16
#include <shadow.h>
16
#include <shadow.h>
17
#endif
17
#endif
18
18
#ifdef WITH_SELINUX
19
#include <selinux/selinux.h>
20
static security_context_t old_context=NULL;
21
#endif
19
#include "commonio.h"
22
#include "commonio.h"
20
23
21
/* local function prototypes */
24
/* local function prototypes */
Lines 437-442 Link Here
437
		return 0;
440
		return 0;
438
	}
441
	}
439
442
443
#ifdef WITH_SELINUX
444
	db->scontext=NULL;
445
	if (is_selinux_enabled() &&  (! db->readonly)) {
446
	  if (fgetfilecon(fileno(db->fp),&db->scontext) < 0) {
447
		goto cleanup;
448
	  }
449
	}
450
#endif
451
440
	buflen = BUFLEN;
452
	buflen = BUFLEN;
441
	buf = (char *) malloc(buflen);
453
	buf = (char *) malloc(buflen);
442
	if (!buf)
454
	if (!buf)
Lines 492-497 Link Here
492
	free(buf);
504
	free(buf);
493
cleanup:
505
cleanup:
494
	free_linked_list(db);
506
	free_linked_list(db);
507
#ifdef WITH_SELINUX
508
	if (db->scontext!= NULL) {
509
	  freecon(db->scontext);
510
	  db->scontext=NULL;
511
	}
512
#endif
495
	fclose(db->fp);
513
	fclose(db->fp);
496
	db->fp = NULL;
514
	db->fp = NULL;
497
	errno = ENOMEM;
515
	errno = ENOMEM;
Lines 627-632 Link Here
627
			goto fail;
645
			goto fail;
628
		}
646
		}
629
647
648
#ifdef WITH_SELINUX
649
		if (db->scontext != NULL) {
650
		  int stat=getfscreatecon(&old_context);
651
		  if (stat< 0) {
652
		    errors++;
653
		    goto fail;
654
		  }
655
		  if (setfscreatecon(db->scontext)<0) {
656
		    errors++;
657
		    goto fail;
658
		  }
659
		}
660
#endif
630
		/*
661
		/*
631
		 * Create backup file.
662
		 * Create backup file.
632
		 */
663
		 */
Lines 683-696 Link Here
683
		goto fail;
714
		goto fail;
684
715
685
	nscd_need_reload = 1;
716
	nscd_need_reload = 1;
686
717
	goto success;
718
fail:
719
	errors++;
687
success:
720
success:
688
	free_linked_list(db);
689
	return 1;
690
721
691
fail:
722
#ifdef WITH_SELINUX
723
	if (db->scontext != NULL) {
724
	  if (setfscreatecon(old_context)<0) {
725
	    errors++;
726
	  }
727
	  if (old_context != NULL) {		  
728
	    freecon(old_context);
729
	    old_context=NULL;
730
	  }
731
	  freecon(db->scontext);
732
	  db->scontext=NULL;
733
	}
734
#endif
692
	free_linked_list(db);
735
	free_linked_list(db);
693
	return 0;
736
	return errors==0;
694
}
737
}
695
738
696
739
(-)shadow-4.0.3.orig/lib/commonio.h (+6 lines)
Lines 1-5 Link Here
1
/* $Id: shadow-4.0.4.1-selinux.diff,v 1.1 2004/01/23 19:51:06 pebenito Exp $ */
1
/* $Id: shadow-4.0.4.1-selinux.diff,v 1.1 2004/01/23 19:51:06 pebenito Exp $ */
2
2
3
#ifdef WITH_SELINUX
4
#include <selinux/selinux.h>
5
#endif
3
/*
6
/*
4
 * Linked list entry.
7
 * Linked list entry.
5
 */
8
 */
Lines 70-75 Link Here
70
	 */
73
	 */
71
	FILE *fp;
74
	FILE *fp;
72
75
76
#ifdef WITH_SELINUX
77
        security_context_t scontext;
78
#endif
73
	/*
79
	/*
74
	 * Head, tail, current position in linked list.
80
	 * Head, tail, current position in linked list.
75
	 */
81
	 */
(-)shadow-4.0.3.orig/src/Makefile.am (-2 / +2 lines)
Lines 4-10 Link Here
4
ubindir = ${prefix}/bin
4
ubindir = ${prefix}/bin
5
usbindir = ${prefix}/sbin
5
usbindir = ${prefix}/sbin
6
6
7
DEFS = -D_HAVE_CONFIG_H -DLOCALEDIR=\"$(datadir)/locale\"
7
DEFS = -D_HAVE_CONFIG_H -DLOCALEDIR=\"$(datadir)/locale\" -DWITH_SELINUX
8
8
9
INCLUDES = -I${top_srcdir} \
9
INCLUDES = -I${top_srcdir} \
10
	-I${top_srcdir}/lib \
10
	-I${top_srcdir}/lib \
Lines 35-41 Link Here
35
suidubins = chage chfn chsh expiry gpasswd newgrp passwd
35
suidubins = chage chfn chsh expiry gpasswd newgrp passwd
36
36
37
LDADD = $(top_builddir)/libmisc/libmisc.la \
37
LDADD = $(top_builddir)/libmisc/libmisc.la \
38
	$(top_builddir)/lib/libshadow.la
38
	$(top_builddir)/lib/libshadow.la -lselinux
39
39
40
chpasswd_LDADD = $(LDADD) $(LIBPAM)
40
chpasswd_LDADD = $(LDADD) $(LIBPAM)
41
chage_LDADD    = $(LDADD) $(LIBPAM)
41
chage_LDADD    = $(LDADD) $(LIBPAM)
(-)shadow-4.0.3.orig/src/Makefile.in (-1 / +1 lines)
Lines 145-151 Link Here
145
suidubins = chage chfn chsh expiry gpasswd newgrp passwd
145
suidubins = chage chfn chsh expiry gpasswd newgrp passwd
146
146
147
LDADD = $(top_builddir)/libmisc/libmisc.la \
147
LDADD = $(top_builddir)/libmisc/libmisc.la \
148
	$(top_builddir)/lib/libshadow.la
148
	$(top_builddir)/lib/libshadow.la -lselinux
149
149
150
150
151
chpasswd_LDADD = $(LDADD) $(LIBPAM)
151
chpasswd_LDADD = $(LDADD) $(LIBPAM)

Return to bug 55781