]> err.no Git - util-linux/commitdiff
build-sys: add SUID_CFLAGS
authorKarel Zak <kzak@redhat.com>
Tue, 24 Apr 2007 09:44:19 +0000 (11:44 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Apr 2007 22:20:46 +0000 (00:20 +0200)
The patch allows to define special CFLAGS for typical suid programs
(like mount, umount, chfn, ...). Some distributions use for example
"-fpic" for suid binaries.

Signed-off-by: Karel Zak <kzak@redhat.com>
README
configure.ac
login-utils/Makefile.am
misc-utils/Makefile.am
mount/Makefile.am

diff --git a/README b/README
index 9b3cdea6acda2f32d914da34705bf2735f09f9cd..ff49b3e607894aa80d73d5e8022b6d513020b670 100644 (file)
--- a/README
+++ b/README
@@ -48,3 +48,15 @@ VERSION SCHEMA:
              suffix = "devel" or "rc<N>"
 
 
+COMPILATION:
+
+      See the INSTALL file for more details.
+
+      Notes:
+            * use SUID_CFLAGS when you want to define special compiler options
+              for typical suid programs, for example:
+
+                  SUID_CFLAGS="-fpic" ./configure
+
+              Now this feature is supported for chfn, chsh, newgrp, write,
+              mount and umount.
index 66e88df8b8bb546983e8972853ca508dcd090f5a..d24ce099535d4d3c4cfd8c4e6d542866400e11dd 100644 (file)
@@ -398,6 +398,9 @@ if test x$enable_use_tty_group = xyes; then
   AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
 fi
 
+
+AC_SUBST([SUID_CFLAGS])
+
 CPPFLAGS="-fsigned-char -fomit-frame-pointer $CPPFLAGS"
 
 LIBS=""
index 404b7987f695d80c9d07efeaf11ea63b6f656e59..74aa29ea371a066792b5ee18f2a68a6eebc3a047 100644 (file)
@@ -51,6 +51,10 @@ login_LDADD = ../lib/libsetproctitle.a
 newgrp_LDADD =
 vipw_LDADD =
 
+chfn_CFLAGS = $(SUID_CFLAGS)
+chsh_CFLAGS = $(SUID_CFLAGS)
+newgrp_CFLAGS = $(SUID_CFLAGS)
+
 if NEED_LIBCRYPT
 chfn_LDADD += -lcrypt
 chsh_LDADD += -lcrypt
index 5ccb76da64b571b5d9af0d75f5552e8fa1f27ac5..461344d1659540d1190b8ab83f2d2c5acdf34343 100644 (file)
@@ -64,6 +64,7 @@ if BUILD_WRITE
 
 usrbinexec_PROGRAMS += write
 man_MANS += write.1
+write_CFLAGS = $(SUID_CFLAGS)
 
 if USE_TTY_GROUP
 install-exec-hook::
index f34fc83b96c6160ed14961e45dba76937191a29a..6f0d403d9ad764532d8c18b37b4b31a61b058787 100644 (file)
@@ -22,6 +22,7 @@ mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
        $(MNTHDRS)
 
 mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
+mount_CFLAGS = $(SUID_CFLAGS)
 
 umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
        getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
@@ -29,6 +30,7 @@ umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c
        $(MNTHDRS)
        
 umount_LDADD = $(top_srcdir)/lib/libenv.a
+umount_CFLAGS = $(SUID_CFLAGS)
 
 swapon_SOURCES = swapon.c xmalloc.c \
        get_label_uuid.c mount_by_label.c mount_blkid.c \