All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy <timothy@diyab.net>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: SELinux <SELinux@tycho.nsa.gov>
Subject: Re: Non-PAM Policycoreutils
Date: Thu, 13 Oct 2005 18:11:18 -0400	[thread overview]
Message-ID: <434EDB86.2050702@diyab.net> (raw)
In-Reply-To: <1129233760.13490.44.camel@moss-spartans.epoch.ncsc.mil>

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Stephen Smalley wrote:
> On Thu, 2005-10-13 at 15:56 -0400, Timothy wrote:
> 
>>The crypt defined in unistd.h is only read if __USE_XOPEN is defined so
>>it's required or make will fail for non-pam builds because the function
>>authenticate_via_shadow_passwd uses crypt.  I tried to add that define
>>to the CFLAGS in the makefile but it does not see that it is defined for
>>some reason and still errors out.
> 
> 
> Hmm...actually, since it is wrapped by the #else for USE_PAM, it isn't a
> problem to have it in the .c file, but I noticed that the man page for
> crypt(3) on my system says to define _XOPEN_SOURCE instead of directly
> defining __USE_XOPEN (features.h enables the latter when the former is
> enabled).  Note that the former only has a single leading underscore,
> unlike the latter.  Does #define'ing _XOPEN_SOURCE work for you there
> instead of __USE_XOPEN?
> 

Just _XOPEN_SOURCE caused new errors but _XOPEN_SOURCE defined to 500
works.  New patch attached.

Timothy,

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDTtuGSYq2KfPEK/gRA2etAJ43Z4KRzStnX5Z/CTd2q/VURf9PhgCffkGq
yAzwBdfbzgKWH/3WAm6Kjww=
=5PaU
-----END PGP SIGNATURE-----

[-- Attachment #2: policycoreutils-nopam.patch --]
[-- Type: text/plain, Size: 2526 bytes --]

--- policycoreutils/newrole/Makefile	2005-07-18 10:13:55.000000000 -0400
+++ policycoreutils-1.26.slack/newrole/Makefile	2005-10-04 02:22:03.000000000 -0400
@@ -4,10 +4,19 @@
 MANDIR ?= $(PREFIX)/share/man
 ETCDIR ?= $(DESTDIR)/etc
 LOCALEDIR = /usr/share/locale
+PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
 
 CFLAGS ?= -Werror -Wall -W
-override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DUSE_PAM -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
-LDLIBS += -lselinux -lpam -lpam_misc -L$(PREFIX)/lib
+override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
+LDLIBS += -lselinux -L$(PREFIX)/lib
+ifeq (${PAMH}, /usr/include/security/pam_appl.h)
+	override CFLAGS += -DUSE_PAM
+	LDLIBS += -lpam -lpam_misc
+else
+	override CFLAGS += -D_XOPEN_SOURCE=500
+	LDLIBS += -lcrypt
+endif
+
 
 TARGETS=$(patsubst %.c,%,$(wildcard *.c))
 
@@ -19,7 +28,10 @@
 	test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1
 	install -m 555 newrole $(BINDIR)
 	install -m 644 newrole.1 $(MANDIR)/man1/
+ifeq (${PAMH}, /usr/include/security/pam_appl.h)
+	test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d
 	install -m 644 newrole.pamd $(ETCDIR)/pam.d/newrole
+endif
 
 clean:
 	rm -f $(TARGETS) *.o 
--- policycoreutils/run_init/Makefile	2005-07-18 10:13:56.000000000 -0400
+++ policycoreutils-1.26.slack/run_init/Makefile	2005-10-04 02:22:29.000000000 -0400
@@ -5,10 +5,18 @@
 MANDIR ?= $(PREFIX)/share/man
 ETCDIR ?= $(DESTDIR)/etc
 LOCALEDIR ?= /usr/share/locale
+PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
 
 CFLAGS ?= -Werror -Wall -W
-override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DUSE_PAM -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
-LDLIBS += -lselinux -lpam -lpam_misc -L$(PREFIX)/lib
+override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
+LDLIBS += -lselinux -L$(PREFIX)/lib
+ifeq (${PAMH}, /usr/include/security/pam_appl.h)
+	override CFLAGS += -DUSE_PAM
+	LDLIBS += -lpam -lpam_misc
+else
+	override CFLAGS += -D_XOPEN_SOURCE=500
+	LDLIBS += -lcrypt
+endif
 
 TARGETS=$(patsubst %.c,%,$(wildcard *.c))
 
@@ -25,7 +33,9 @@
 	install -m 555 open_init_pty $(SBINDIR)
 	install -m 644 run_init.8 $(MANDIR)/man8/
 	install -m 644 open_init_pty.8 $(MANDIR)/man8/
+ifeq (${PAMH}, /usr/include/security/pam_appl.h)
 	install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init
+endif
 
 clean:
 	-rm -f $(TARGETS) *.o 

  reply	other threads:[~2005-10-13 22:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-13 18:00 Non-PAM Policycoreutils Timothy
2005-10-13 18:16 ` Stephen Smalley
2005-10-13 19:18   ` Timothy
2005-10-13 19:39     ` Stephen Smalley
2005-10-13 19:56       ` Timothy
2005-10-13 20:02         ` Stephen Smalley
2005-10-13 22:11           ` Timothy [this message]
2005-10-14 15:20             ` Stephen Smalley

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=434EDB86.2050702@diyab.net \
    --to=timothy@diyab.net \
    --cc=SELinux@tycho.nsa.gov \
    --cc=sds@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.