Skip to contentSkip to conversation

remove chown from makefiles too?

DISCUSSION Eric Sandeen 2 participants 5 messages Jul 30, 2009 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi, after the setuid bits got removed from the make install process, this sort of thing is still left in several Makefiles:

install-exec-hook:

	list='$(sbin_PROGRAMS)'; \
	for p in $$list; do \
		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
	done

But this fails for a normal user installing into a chroot, as an rpmbuild by a non-root user might do.

I don't think there's any reason for the chown; can this just be removed?

Thanks,
-Eric

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi,

Quoted 9 lines · Eric Sandeen

Hi, after the setuid bits got removed from the make install process, this sort of thing is still left in several Makefiles:

install-exec-hook:

	list='$(sbin_PROGRAMS)'; \
	for p in $$list; do \
		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
	done
Quoted 4 lines

But this fails for a normal user installing into a chroot, as an rpmbuild by a non-root user might do.

I don't think there's any reason for the chown; can this just be removed?

Well, I see.

I will once remove the chown and normalize it unless the removal makes inconvenience to someone.

Thank you for the comment.

Ryusuke Konishi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 2 lines · Ryusuke Konishi

Hi,
On Thu, 30 Jul 2009 09:59:09 -0500, Eric Sandeen <[email protected]> wrote:

...

Quoted 10 lines
Quoted 1 line

I don't think there's any reason for the chown; can this just be removed?

Well, I see.

I will once remove the chown and normalize it unless the removal makes inconvenience to someone.

Thank you for the comment.

Ryusuke Konishi

thanks - on a similar topic, the Makefile in lib/ wants to run ldconfig, I think it's a similar problem for non-root builds.

For now I've just worked around these problems in the Fedora build.

Thanks,
-Eric

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 13 lines · Eric Sandeen
Quoted 2 lines · Ryusuke Konishi

Hi,
On Thu, 30 Jul 2009 09:59:09 -0500, Eric Sandeen <[email protected]> wrote:

...

Quoted 7 lines
Quoted 1 line

I don't think there's any reason for the chown; can this just be removed?

Well, I see.

I will once remove the chown and normalize it unless the removal makes inconvenience to someone.

Quoted 8 lines
Quoted 3 lines

Thank you for the comment.

Ryusuke Konishi

thanks - on a similar topic, the Makefile in lib/ wants to run ldconfig, I think it's a similar problem for non-root builds.

For now I've just worked around these problems in the Fedora build.

Yes, It's been in my mind.

Here I attach the patch to remove these install-exec-hooks.

After some tests, I will push it to the git tree in two separate patches.

Thanks,
Ryusuke Konishi

lib/Makefile.am +0 -3
index 131702b..1dbe74f 100644
@@ -23,6 +23,3 @@ libnilfs_la_CFLAGS = -Wall
 libnilfs_la_CPPFLAGS = -I$(top_srcdir)/include
 libnilfs_la_LDFLAGS = -version-info $(VERSIONINFO)
 libnilfs_la_LIBADD = libnilfsmisc.la
-
-install-exec-hook:
-	$(LDCONFIG) $(DESTDIR)$(libdir)
sbin/cleanerd/Makefile.am +0 -6
index edde74e..6fac7ff 100644
@@ -14,9 +14,3 @@ nilfs_cleanerd_CPPFLAGS = -I$(top_srcdir)/include \
 nilfs_cleanerd_LDADD = $(top_builddir)/lib/libnilfs.la
 
 dist_sysconf_DATA = nilfs_cleanerd.conf
-
-install-exec-hook:
-	list='$(sbin_PROGRAMS)'; \
-	for p in $$list; do \
-		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
-	done
sbin/mkfs/Makefile.am +0 -6
index bae054a..3fd1288 100644
@@ -10,9 +10,3 @@ mkfs_nilfs2_SOURCES = mkfs.c bitops.c ../../lib/crc32.c mkfs.h
 mkfs_nilfs2_CFLAGS = -Wall
 mkfs_nilfs2_CPPFLAGS = -I$(top_srcdir)/include
 mkfs_nilfs2_LDADD = -luuid
-
-install-exec-hook:
-	list='$(sbin_PROGRAMS)'; \
-	for p in $$list; do \
-		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
-	done
sbin/mount/Makefile.am +0 -6
index 9aea415..0f8d55f 100644
@@ -20,9 +20,3 @@ mount_nilfs2_LDADD = $(top_builddir)/lib/libnilfsmisc.la
 
 umount_nilfs2_SOURCES = umount.nilfs2.c $(COMMONSOURCES) $(COMMONHEADERS)
 umount_nilfs2_LDADD = $(top_builddir)/lib/libnilfsmisc.la
-
-install-exec-hook:
-	list='$(sbin_PROGRAMS)'; \
-	for p in $$list; do \
-		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
-	done

A message that is not in the archive (sent off-list or not yet received): [email protected]

author Reviewed-by
#8 lore raw
Quoted 22 lines · Ryusuke Konishi
Quoted 11 lines · Eric Sandeen
Quoted 2 lines · Ryusuke Konishi

Hi,
On Thu, 30 Jul 2009 09:59:09 -0500, Eric Sandeen <[email protected]> wrote:

...

Quoted 6 lines
Quoted 1 line

I don't think there's any reason for the chown; can this just be removed?

Well, I see.

I will once remove the chown and normalize it unless the removal makes inconvenience to someone.

Quoted 7 lines
Quoted 3 lines

Thank you for the comment.

Ryusuke Konishi

thanks - on a similar topic, the Makefile in lib/ wants to run ldconfig, I think it's a similar problem for non-root builds.

For now I've just worked around these problems in the Fedora build.

Yes, It's been in my mind.

Quoted 7 lines

Here I attach the patch to remove these install-exec-hooks.

After some tests, I will push it to the git tree in two separate patches.

Thanks,
Ryusuke Konishi

Looks good to me.

if you like. :)

Thanks,
-Eric

Quoted 53 lines
lib/Makefile.am +0 -3
index 131702b..1dbe74f 100644
@@ -23,6 +23,3 @@ libnilfs_la_CFLAGS = -Wall
 libnilfs_la_CPPFLAGS = -I$(top_srcdir)/include
 libnilfs_la_LDFLAGS = -version-info $(VERSIONINFO)
 libnilfs_la_LIBADD = libnilfsmisc.la
-
-install-exec-hook:
-	$(LDCONFIG) $(DESTDIR)$(libdir)
sbin/cleanerd/Makefile.am +0 -6
index edde74e..6fac7ff 100644
@@ -14,9 +14,3 @@ nilfs_cleanerd_CPPFLAGS = -I$(top_srcdir)/include \
 nilfs_cleanerd_LDADD = $(top_builddir)/lib/libnilfs.la
 
 dist_sysconf_DATA = nilfs_cleanerd.conf
-
-install-exec-hook:
-	list='$(sbin_PROGRAMS)'; \
-	for p in $$list; do \
-		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
-	done
sbin/mkfs/Makefile.am +0 -6
index bae054a..3fd1288 100644
@@ -10,9 +10,3 @@ mkfs_nilfs2_SOURCES = mkfs.c bitops.c ../../lib/crc32.c mkfs.h
 mkfs_nilfs2_CFLAGS = -Wall
 mkfs_nilfs2_CPPFLAGS = -I$(top_srcdir)/include
 mkfs_nilfs2_LDADD = -luuid
-
-install-exec-hook:
-	list='$(sbin_PROGRAMS)'; \
-	for p in $$list; do \
-		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
-	done
sbin/mount/Makefile.am +0 -6
index 9aea415..0f8d55f 100644
@@ -20,9 +20,3 @@ mount_nilfs2_LDADD = $(top_builddir)/lib/libnilfsmisc.la
 
 umount_nilfs2_SOURCES = umount.nilfs2.c $(COMMONSOURCES) $(COMMONHEADERS)
 umount_nilfs2_LDADD = $(top_builddir)/lib/libnilfsmisc.la
-
-install-exec-hook:
-	list='$(sbin_PROGRAMS)'; \
-	for p in $$list; do \
-		chown root $(DESTDIR)$(sbindir)/$$p$(EXEEXT); \
-	done