All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: Daniel J Walsh <dwalsh@redhat.com>
Cc: Joshua Brindle <jbrindle@tresys.com>,
	"Christopher J. PeBenito" <cpebenito@tresys.com>,
	SE Linux <selinux@tycho.nsa.gov>,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: Multiple small fixes to policycoreutils
Date: Wed, 15 Nov 2006 17:01:58 -0500	[thread overview]
Message-ID: <455B8E56.4070708@mentalrootkit.com> (raw)
In-Reply-To: <455B7588.9020508@redhat.com>

Daniel J Walsh wrote:
> Joshua Brindle wrote:
>> Karl MacMillan wrote:

<snip>

>>>
>>> What about a top-level USE_PIE makefile variable that directs all 
>>> sub-Makefiles to set PIE flags if appropriate for that module? By 
>>> default it would be off. This gets the behavior you want without 
>>> having to carry a patch and keeps the current behavior.
>>>
>>
>> No patch necessary, like Chris said make CFLAGS="-fPIE -02 -Werror 
>> -Wall" LDFLAGS="-pie"
>>
>> done and done.
>>
> No, because then all compiled apps become -pie.  We only want this on 
> the daemons.
> 

What about this instead?

diff -r fdaf7172a43e Makefile
--- a/Makefile	Wed Nov 15 15:49:31 2006 -0500
+++ b/Makefile	Wed Nov 15 16:49:07 2006 -0500
@@ -1,10 +1,15 @@ SUBDIRS=libsepol libselinux libsemanage
  SUBDIRS=libsepol libselinux libsemanage checkpolicy policycoreutils # 
policy
  PYSUBDIRS=libselinux libsemanage
+
+# Turn on PIE for programs / daemons that support it. Default
+# is off (0).
+export USE_PIE=0

  ifeq ($(DEBUG),1)
  	export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow
  	export LDFLAGS = -g
  endif
+

  install relabel:
  	@for subdir in $(SUBDIRS); do \
diff -r fdaf7172a43e policycoreutils/newrole/newrole.c
--- a/policycoreutils/newrole/newrole.c	Wed Nov 15 15:49:31 2006 -0500
+++ b/policycoreutils/newrole/newrole.c	Wed Nov 15 15:52:26 2006 -0500
@@ -1028,6 +1028,7 @@ int main(int argc, char *argv[])
  	{
  		fprintf(stderr, _("newrole: incorrect password for %s\n"),
  			pw.pw_name);
+		send_audit_message(0, old_context, new_context, ttyn);
  		goto err_close_pam;
  	}

diff -r fdaf7172a43e policycoreutils/restorecond/Makefile
--- a/policycoreutils/restorecond/Makefile	Wed Nov 15 15:49:31 2006 -0500
+++ b/policycoreutils/restorecond/Makefile	Wed Nov 15 16:45:24 2006 -0500
@@ -5,9 +5,15 @@ INITDIR = $(DESTDIR)/etc/rc.d/init.d
  INITDIR = $(DESTDIR)/etc/rc.d/init.d
  SELINUXDIR = $(DESTDIR)/etc/selinux

-CFLAGS ?= -g -Werror -Wall -W
-override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
+CFLAGS ?= -Werror -Wall -W
  LDLIBS += -lselinux -lsepol -L$(PREFIX)/lib
+
+ifeq ($(USE_PIE),1)
+	override LDFLAGS += -pie
+	override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64 -fPIE
+else
+	override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
+endif

  all: restorecond

diff -r fdaf7172a43e policycoreutils/restorecond/restorecond.conf
--- a/policycoreutils/restorecond/restorecond.conf	Wed Nov 15 15:49:31 
2006 -0500
+++ b/policycoreutils/restorecond/restorecond.conf	Wed Nov 15 15:52:26 
2006 -0500
@@ -2,5 +2,6 @@
  /etc/samba/secrets.tdb
  /etc/mtab
  /var/run/utmp
+/var/log/wtmp
  ~/public_html
  ~/.mozilla/plugins/libflashplayer.so
diff -r fdaf7172a43e policycoreutils/scripts/genhomedircon.8
--- a/policycoreutils/scripts/genhomedircon.8	Wed Nov 15 15:49:31 2006 -0500
+++ b/policycoreutils/scripts/genhomedircon.8	Wed Nov 15 15:52:26 2006 -0500
@@ -45,35 +45,30 @@ Indicates the selinux type of this insta
  .SH DESCRIPTION
  .PP
  This utility is used to generate file context configuration entries for
-user home directories based on their default roles and is run when 
building
-the policy. It can also be run when ever the
-.I /etc/selinux/<<SELINUXTYPE>>/users/local.users
-file is changed
+user home directories based on their
+.B prefix
+entry in the the
+.B semanage user record.
+genhomedircon is run when building
+the policy. It is also run automaticaly when ever the
+.B semanage
+utility modifies
+.B user
+or
+.B login
+records.
  Specifically, we replace HOME_ROOT, HOME_DIR, and ROLE macros in the
  .I /etc/selinux/<<SELINUXTYPE>>/contexts/files/homedir_template
-file with generic and user-specific values.
-.I local.users
-file. If a user has more than one role in
-.I local.users,
-.B genhomedircon
-uses the first role in the list.
+file with generic and user-specific values.  HOME_ROOT and HOME_DIR is 
replaced with each distinct location where login users homedirectories 
are located.  Defaults to /home. ROLE is replaced based on the prefix 
entry in the
+.B user
+record.
  .PP
-If a user is not listed in
-.I local.users,
-.B genhomedircon
-assumes that the user's home dir will be found in one of the
-HOME_ROOTs.
-When looking for these users,
-.B genhomedircon
-only considers real users. "Real" users (as opposed
-to system users) are those whose UID is greater than or equal
+genhomedircon searches through all password entires for all "login" 
user home directories, (as opposed
+to system users).  Login users are those whose UID is greater than or 
equal
  .I STARTING_UID
  (default 500) and whose login shell is not "/sbin/nologin", or
  "/bin/false".
  .PP
-Users who are explicitly defined in
-.I local.users,
-are always "real" (including root, in the default configuration).
  .SH AUTHOR
  This manual page was originally written by
  .I Manoj Srivastava <srivasta@debian.org>,
diff -r fdaf7172a43e policycoreutils/semanage/semanage.8
--- a/policycoreutils/semanage/semanage.8	Wed Nov 15 15:49:31 2006 -0500
+++ b/policycoreutils/semanage/semanage.8	Wed Nov 15 15:52:26 2006 -0500
@@ -7,7 +7,7 @@ semanage \- SELinux Policy Management to
  .br
  .B semanage login \-{a|d|m} [\-sr] login_name
  .br
-.B semanage user \-{a|d|m} [\-LrR] selinux_name
+.B semanage user \-{a|d|m} [\-LrRP] selinux_name
  .br
  .B semanage port \-{a|d|m} [\-tr] [\-p protocol] port | port_range
  .br
@@ -71,6 +71,9 @@ MLS/MCS Security Range (MLS/MCS Systems
  .I                \-R, \-\-role
  SELinux Roles.  You must enclose multiple roles within quotes, 
separate by spaces. Or specify \-R multiple times.
  .TP
+.I                \-P, \-\-prefix
+SELinux Prefix.  Prefix added to home_dir_t and home_t for labeling 
users home directories.
+.TP
  .I                \-s, \-\-seuser
  SELinux user name
  .TP
diff -r fdaf7172a43e policycoreutils/semodule_expand/semodule_expand.8
--- a/policycoreutils/semodule_expand/semodule_expand.8	Wed Nov 15 
15:49:31 2006 -0500
+++ b/policycoreutils/semodule_expand/semodule_expand.8	Wed Nov 15 
15:52:26 2006 -0500
@@ -18,7 +18,7 @@ together a set of packages into a single
  .SH "OPTIONS"
  .TP
  .B \-V
-verbose mode
+show version
  .TP
  .B \-c [version]
  policy version to create



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  parent reply	other threads:[~2006-11-15 22:01 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 15:06 Multiple small fixes to policycoreutils Daniel J Walsh
2006-11-14 16:13 ` Christopher J. PeBenito
2006-11-14 16:18   ` Daniel J Walsh
2006-11-14 19:19     ` Christopher J. PeBenito
2006-11-14 20:09       ` Daniel J Walsh
2006-11-15 18:34         ` Karl MacMillan
2006-11-15 19:38           ` Joshua Brindle
2006-11-15 20:16             ` Daniel J Walsh
2006-11-15 20:18               ` Joshua Brindle
2006-11-15 22:01               ` Karl MacMillan [this message]
2006-11-16  0:05                 ` Joshua Brindle
2006-11-16 22:15                   ` Karl MacMillan
2006-11-17  0:50                     ` Joshua Brindle
2006-11-17 12:02                     ` Daniel J Walsh
2006-11-20 17:10                       ` Karl MacMillan
2006-11-20 17:36                         ` More " Daniel J Walsh
2006-11-20 18:28                           ` Joshua Brindle
2006-11-20 20:14                             ` Karl MacMillan
2006-11-20 20:25                               ` Stephen Smalley
2006-11-21  3:54                                 ` Joshua Brindle
2006-11-21 14:35                                   ` Karl MacMillan
2006-11-21 14:37                                 ` Karl MacMillan
2006-11-20 21:58                             ` Daniel J Walsh
2006-11-21 13:53                               ` Stephen Smalley
2006-11-22 19:16                                 ` Daniel J Walsh
2006-11-22 19:22                                   ` Joshua Brindle
2006-11-22 20:05                                     ` Daniel J Walsh
2006-11-22 20:31                                       ` Joshua Brindle
2006-11-22 21:21                                         ` Daniel J Walsh
2006-11-28 19:37                                           ` Joshua Brindle
2006-11-29 21:18                                           ` Joshua Brindle
2006-11-22 20:06                                     ` Daniel J Walsh
2006-11-22 20:34                                       ` Joshua Brindle
2006-11-22 21:10                                         ` Daniel J Walsh
2006-11-22 20:07                                     ` Daniel J Walsh
2006-11-22 20:35                                       ` Joshua Brindle
2006-11-22 20:08                                     ` Daniel J Walsh
2006-11-22 20:36                                       ` Joshua Brindle
2006-11-22 20:10                                     ` Daniel J Walsh
2006-11-22 20:36                                       ` Joshua Brindle
2006-11-22 21:07                                         ` Daniel J Walsh
2006-11-27 13:39                                           ` Joshua Brindle
2006-11-21 21:13                           ` Stephen Smalley
2006-11-15 16:13 ` Multiple " Joshua Brindle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455B8E56.4070708@mentalrootkit.com \
    --to=kmacmillan@mentalrootkit.com \
    --cc=cpebenito@tresys.com \
    --cc=dwalsh@redhat.com \
    --cc=jbrindle@tresys.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.