SHA256
1
0
forked from pool/libselinux

Accepting request 34369 from security:SELinux

Copy from security:SELinux/libselinux based on submit request 34369 from user prusnak

OBS-URL: https://build.opensuse.org/request/show/34369
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libselinux?expand=0&rev=14
This commit is contained in:
OBS User autobuild 2010-03-12 16:35:22 +00:00 committed by Git OBS Bridge
parent 0a621a8bdb
commit 448d5530f8
8 changed files with 209 additions and 28 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c899b1b2708e28d9a46b3590c8d0d35bcafb911667319ba5895a2a8ab8eaf77
size 48225

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1a37fa19bfa6e34e5de0664324b2c14a1aa6a135cf33d55d30b6dc4f392416c3
size 134184

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67a89821c9cd01288af5e6c784cc963fd13cc7c5d2a06ae8e7241ce187682ea1
size 156090

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Thu Feb 25 14:57:16 UTC 2010 - prusnak@suse.cz
- updated to 2.0.91
* changes too numerous to list
-------------------------------------------------------------------
Sat Dec 12 16:43:54 CET 2009 - jengelh@medozas.de
- add baselibs.conf as a source
-------------------------------------------------------------------
Fri Jul 24 17:09:50 CEST 2009 - thomas@novell.com
- updated selinux-ready script
-------------------------------------------------------------------
Wed Jul 22 15:17:25 CEST 2009 - prusnak@suse.cz

View File

@ -1,5 +1,5 @@
#
# spec file for package libselinux-bindings (Version 2.0.80)
# spec file for package libselinux-bindings (Version 2.0.91)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -22,14 +22,16 @@ BuildRequires: python-devel ruby-devel swig
BuildRequires: libsepol-devel-static >= %{libsepol_ver}
Name: libselinux-bindings
Version: 2.0.80
Release: 5
Version: 2.0.91
Release: 1
Url: http://www.nsa.gov/selinux/
License: GPLv2 ; Public Domain, Freeware
Group: System/Libraries
Summary: SELinux library and simple utilities
Source: libselinux-%{version}.tar.bz2
Patch0: libselinux-%{version}-rhat.patch.bz2
Source1: selinux-ready
Source2: baselibs.conf
Patch0: libselinux-rhat.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define debug_package_requires python-selinux = %{version}-%{release}
@ -112,7 +114,7 @@ make %{?jobs:-j%jobs} LIBDIR="%{_libdir}" CFLAGS="$RPM_OPT_FLAGS" -C src rubywra
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install-pywrap
make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" -C src install-rubywrap
rm -rf $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_libdir}/libselinux.*
rm -rf $RPM_BUILD_ROOT/%{_lib} $RPM_BUILD_ROOT%{_libdir}/libselinux.* $RPM_BUILD_ROOT%{_libdir}/pkgconfig
%clean
rm -rf $RPM_BUILD_ROOT

156
libselinux-rhat.patch Normal file
View File

@ -0,0 +1,156 @@
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxconlist.8 libselinux-2.0.90/man/man8/selinuxconlist.8
--- nsalibselinux/man/man8/selinuxconlist.8 1969-12-31 19:00:00.000000000 -0500
+++ libselinux-2.0.90/man/man8/selinuxconlist.8 2010-01-18 16:52:28.000000000 -0500
@@ -0,0 +1,18 @@
+.TH "selinuxconlist" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
+.SH "NAME"
+selinuxconlist \- list all SELinux context reachable for user
+.SH "SYNOPSIS"
+.B selinuxconlist [-l level] user [context]
+
+.SH "DESCRIPTION"
+.B selinuxconlist
+reports the list of context reachable for user from the current context or specified context
+
+.B \-l level
+mcs/mls level
+
+.SH AUTHOR
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
+
+.SH "SEE ALSO"
+secon(8), selinuxdefcon(8)
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libselinux-2.0.90/man/man8/selinuxdefcon.8
--- nsalibselinux/man/man8/selinuxdefcon.8 1969-12-31 19:00:00.000000000 -0500
+++ libselinux-2.0.90/man/man8/selinuxdefcon.8 2010-01-18 16:52:28.000000000 -0500
@@ -0,0 +1,24 @@
+.TH "selinuxdefcon" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
+.SH "NAME"
+selinuxdefcon \- report default SELinux context for user
+
+.SH "SYNOPSIS"
+.B selinuxdefcon [-l level] user fromcon
+
+.SH "DESCRIPTION"
+.B selinuxdefcon
+reports the default context for the specified user from the specified context
+
+.B \-l level
+mcs/mls level
+
+.SH EXAMPLE
+# selinuxdefcon jsmith system_u:system_r:sshd_t:s0
+.br
+unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
+
+.SH AUTHOR
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
+
+.SH "SEE ALSO"
+secon(8), selinuxconlist(8)
diff --exclude-from=exclude -N -u -r nsalibselinux/src/callbacks.c libselinux-2.0.90/src/callbacks.c
--- nsalibselinux/src/callbacks.c 2009-04-08 09:06:23.000000000 -0400
+++ libselinux-2.0.90/src/callbacks.c 2010-01-18 16:52:28.000000000 -0500
@@ -16,6 +16,7 @@
{
int rc;
va_list ap;
+ if (is_selinux_enabled() == 0) return 0;
va_start(ap, fmt);
rc = vfprintf(stderr, fmt, ap);
va_end(ap);
diff --exclude-from=exclude -N -u -r nsalibselinux/src/init.c libselinux-2.0.90/src/init.c
--- nsalibselinux/src/init.c 2009-07-14 11:16:03.000000000 -0400
+++ libselinux-2.0.90/src/init.c 2010-02-22 11:04:16.000000000 -0500
@@ -23,7 +23,7 @@
static void init_selinuxmnt(void)
{
char *buf=NULL, *p;
- FILE *fp;
+ FILE *fp=NULL;
struct statfs sfbuf;
int rc;
size_t len;
@@ -57,16 +57,17 @@
break;
}
}
- fclose(fp);
- if (!exists)
- return;
+ if (!exists)
+ goto out;
+
+ fclose(fp);
/* At this point, the usual spot doesn't have an selinuxfs so
* we look around for it */
fp = fopen("/proc/mounts", "r");
if (!fp)
- return;
+ goto out;
__fsetlocking(fp, FSETLOCKING_BYCALLER);
while ((num = getline(&buf, &len, fp)) != -1) {
@@ -90,7 +91,8 @@
out:
free(buf);
- fclose(fp);
+ if (fp)
+ fclose(fp);
return;
}
diff --exclude-from=exclude -N -u -r nsalibselinux/src/libselinux.pc.in libselinux-2.0.90/src/libselinux.pc.in
--- nsalibselinux/src/libselinux.pc.in 2009-11-02 12:58:30.000000000 -0500
+++ libselinux-2.0.90/src/libselinux.pc.in 2010-02-18 10:02:46.000000000 -0500
@@ -1,6 +1,6 @@
prefix=@prefix@
exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+libdir=${exec_prefix}/@libdir@
includedir=@includedir@
Name: libselinux
diff --exclude-from=exclude -N -u -r nsalibselinux/src/Makefile libselinux-2.0.90/src/Makefile
--- nsalibselinux/src/Makefile 2009-12-01 15:46:50.000000000 -0500
+++ libselinux-2.0.90/src/Makefile 2010-02-18 10:20:27.000000000 -0500
@@ -11,6 +11,7 @@
RUBYPLATFORM ?= $(shell ruby -e 'print RUBY_PLATFORM')
RUBYINC ?= $(LIBDIR)/ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
RUBYINSTALL ?= $(LIBDIR)/ruby/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
+LIBBASE=$(shell basename $(LIBDIR))
VERSION = $(shell cat ../VERSION)
LIBVERSION = 1
@@ -85,7 +86,7 @@
ln -sf $@ $(TARGET)
$(LIBPC): $(LIBPC).in
- sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
+ sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
selinuxswig_python_exception.i: ../include/selinux/selinux.h
bash exception.sh > $@
diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.90/src/matchpathcon.c
--- nsalibselinux/src/matchpathcon.c 2009-03-06 14:41:45.000000000 -0500
+++ libselinux-2.0.90/src/matchpathcon.c 2010-01-18 16:52:28.000000000 -0500
@@ -2,6 +2,7 @@
#include <string.h>
#include <errno.h>
#include <stdio.h>
+#include <syslog.h>
#include "selinux_internal.h"
#include "label_internal.h"
#include "callbacks.h"
@@ -57,7 +58,7 @@
{
va_list ap;
va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
+ vsyslog(LOG_ERR, fmt, ap);
va_end(ap);
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Feb 25 14:57:16 UTC 2010 - prusnak@suse.cz
- updated to 2.0.91
* changes too numerous to list
-------------------------------------------------------------------
Sat Dec 12 16:43:54 CET 2009 - jengelh@medozas.de
@ -6,7 +12,7 @@ Sat Dec 12 16:43:54 CET 2009 - jengelh@medozas.de
-------------------------------------------------------------------
Fri Jul 24 17:09:50 CEST 2009 - thomas@novell.com
- updated selinux-ready script
- updated selinux-ready script
-------------------------------------------------------------------
Wed Jul 22 15:17:25 CEST 2009 - prusnak@suse.cz

View File

@ -1,5 +1,5 @@
#
# spec file for package libselinux (Version 2.0.80)
# spec file for package libselinux (Version 2.0.91)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -21,8 +21,8 @@
BuildRequires: libsepol-devel >= %{libsepol_ver}
Name: libselinux
Version: 2.0.80
Release: 5
Version: 2.0.91
Release: 1
Url: http://www.nsa.gov/selinux/
License: GPLv2 ; Public Domain, Freeware
Group: System/Libraries
@ -30,7 +30,7 @@ Summary: SELinux library and simple utilities
Source: %{name}-%{version}.tar.bz2
Source1: selinux-ready
Source2: baselibs.conf
Patch0: %{name}-%{version}-rhat.patch.bz2
Patch0: %{name}-rhat.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define debug_package_requires libselinux1 = %{version}-%{release}
@ -104,20 +104,20 @@ Requires: libsepol-devel >= %{libsepol_ver}
Requires: glibc-devel
%description devel
Security-enhanced Linux is a patch of the Linux(R) kernel and a number
of utilities with enhanced security functionality designed to add
mandatory access controls to Linux. The Security-enhanced Linux kernel
contains new architectural components originally developed to improve
the security of the Flask operating system. These architectural
components provide general support for the enforcement of many kinds of
mandatory access control policies, including those based on the
concepts of Type Enforcement(R), Role-based Access Control, and
Multi-level Security.
This package contains the header files and static libraries, which are
This package contains the development files, which are
necessary to develop your own software using libselinux.
%package devel-static
License: GPLv2 ; Public Domain, Freeware
Summary: Static development Include Files and Libraries for SELinux
Group: Development/Libraries/C and C++
Requires: libselinux-devel = %{version}
%description devel-static
This package contains the static development files, which are
necessary to develop your own software using libselinux.
%prep
%setup -q
@ -149,7 +149,6 @@ rm -f $RPM_BUILD_ROOT%{_sbindir}/selinux_check_securetty_context
mv $RPM_BUILD_ROOT%{_sbindir}/getdefaultcon $RPM_BUILD_ROOT%{_sbindir}/selinuxdefcon
mv $RPM_BUILD_ROOT%{_sbindir}/getconlist $RPM_BUILD_ROOT%{_sbindir}/selinuxconlist
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/selinux-ready
rm -f %{buildroot}%{_libdir}/*.a
%clean
rm -rf $RPM_BUILD_ROOT
@ -185,5 +184,10 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_includedir}/selinux
%{_includedir}/selinux/*
%{_mandir}/man3/*
%{_libdir}/pkgconfig/libselinux.pc
%files devel-static
%defattr(-,root,root,-)
%{_libdir}/libselinux.a
%changelog