Skip to contentSkip to conversation

rpcbind: install the rpcbind program to sbindir.

PATCH Superseded Michael Orlitzky 3 participants 6 messages Jul 28, 2017 – Aug 1, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover rpcbind: install the rpcbind program to sbindir.

According to its own man page, the rpcbind program "can only be started by the super-user." On systems where a distinction is made, it therefore makes sense to install rpcbind to the autotools sbindir rather than the regular bindir where it is currently installed.

Michael Orlitzky (1):
autotools: install rpcbind to --sbindir.

 Makefile.am                | 3 ++-
 configure.ac               | 6 +++---
 systemd/rpcbind.service.in | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
2.13.0
#1 lore raw

PATCH 1/1 autotools: install rpcbind to --sbindir.

According to its own man page, the rpcbind program "can only be started by the super-user." On systems where a distinction is made, it therefore makes sense to install rpcbind to the autotools sbindir rather than the regular bindir where it is currently installed. This is accomplished by three small changes:

1. Move rpcbind from bin_PROGRAMS to sbin_PROGRAMS in Makefile.am.
2. Change @_bindir@ to @_sbindir@ in the rpcbind systemd service file.
3. Tell configure.ac that it should substitute the value of $sbindir into @_sbindir@ instead of $bindir$ into @_bindir@.

The rpcinfo tool remains where it is, in bindir, since unprivileged users are able to usefully run it. This avoids forcing maintainers to choose between two bad options: hiding rpcinfo from unprivileged users, or installing a useless rpcbind for them.

---
 Makefile.am                | 3 ++-
 configure.ac               | 6 +++---
 systemd/rpcbind.service.in | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
Makefile.am +2 -1
index 43c2710..c160a95 100644
@@ -29,7 +29,8 @@ if LIBWRAP
 AM_CPPFLAGS +=	-DLIBWRAP
 endif
 
-bin_PROGRAMS = rpcbind rpcinfo
+bin_PROGRAMS = rpcinfo
+sbin_PROGRAMS = rpcbind
 
 rpcbind_SOURCES = \
 	src/check_bound.c \
configure.ac +3 -3
index 3790310..359a418 100644
@@ -61,9 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread])
 
 AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
 
-# make bindir available for substitution in config file
+# make sbindir available for substitution in config file
 # 2 "evals" needed to expand variable names
-AC_SUBST([_bindir])
-AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
+AC_SUBST([_sbindir])
+AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir])
 
 AC_OUTPUT([Makefile systemd/rpcbind.service])
systemd/rpcbind.service.in +1 -1
index 03a9e0b..f8cfa9f 100644
@@ -12,7 +12,7 @@ After=rpcbind.socket
 [Service]
 Type=notify
 # distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
-ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
+ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f
 
 [Install]
 WantedBy=multi-user.target
Signature · 1 line
2.13.0
#2 lore raw

Re: [PATCH 1/1] autotools: install rpcbind to --sbindir.

Quoted 15 lines · Michael Orlitzky

According to its own man page, the rpcbind program "can only be started by the super-user." On systems where a distinction is made, it therefore makes sense to install rpcbind to the autotools sbindir rather than the regular bindir where it is currently installed. This is accomplished by three small changes:

1. Move rpcbind from bin_PROGRAMS to sbin_PROGRAMS in Makefile.am.
2. Change @_bindir@ to @_sbindir@ in the rpcbind systemd service file.
3. Tell configure.ac that it should substitute the value of $sbindir into @_sbindir@ instead of $bindir$ into @_bindir@.

The rpcinfo tool remains where it is, in bindir, since unprivileged users are able to usefully run it. This avoids forcing maintainers to choose between two bad options: hiding rpcinfo from unprivileged users, or installing a useless rpcbind for them.

Quoted 5 lines
---
 Makefile.am                | 3 ++-
 configure.ac               | 6 +++---
 systemd/rpcbind.service.in | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

A couple things... You are missing a Signed-off-by line

Also I would like some more input from others about changing the default install directory to sbin

Anybody have a problem with this?

steved.

Quoted 46 lines
Makefile.am +2 -1
index 43c2710..c160a95 100644
@@ -29,7 +29,8 @@ if LIBWRAP
 AM_CPPFLAGS +=	-DLIBWRAP
 endif
 
-bin_PROGRAMS = rpcbind rpcinfo
+bin_PROGRAMS = rpcinfo
+sbin_PROGRAMS = rpcbind
 
 rpcbind_SOURCES = \
 	src/check_bound.c \
configure.ac +3 -3
index 3790310..359a418 100644
@@ -61,9 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread])
 
 AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
 
-# make bindir available for substitution in config file
+# make sbindir available for substitution in config file
 # 2 "evals" needed to expand variable names
-AC_SUBST([_bindir])
-AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
+AC_SUBST([_sbindir])
+AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir])
 
 AC_OUTPUT([Makefile systemd/rpcbind.service])
systemd/rpcbind.service.in +1 -1
index 03a9e0b..f8cfa9f 100644
@@ -12,7 +12,7 @@ After=rpcbind.socket
 [Service]
 Type=notify
 # distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
-ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
+ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f
 
 [Install]
 WantedBy=multi-user.target
#3 lore raw

Re: [PATCH 1/1] autotools: install rpcbind to --sbindir.

Quoted 21 lines · Steve Dickson
Quoted 15 lines · Michael Orlitzky

According to its own man page, the rpcbind program "can only be started by the super-user." On systems where a distinction is made, it therefore makes sense to install rpcbind to the autotools sbindir rather than the regular bindir where it is currently installed. This is accomplished by three small changes:

1. Move rpcbind from bin_PROGRAMS to sbin_PROGRAMS in Makefile.am.
2. Change @_bindir@ to @_sbindir@ in the rpcbind systemd service file.
3. Tell configure.ac that it should substitute the value of $sbindir into @_sbindir@ instead of $bindir$ into @_bindir@.

The rpcinfo tool remains where it is, in bindir, since unprivileged users are able to usefully run it. This avoids forcing maintainers to choose between two bad options: hiding rpcinfo from unprivileged users, or installing a useless rpcbind for them.

Quoted 5 lines
---
 Makefile.am                | 3 ++-
 configure.ac               | 6 +++---
 systemd/rpcbind.service.in | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
Quoted 6 lines

A couple things... You are missing a Signed-off-by line

Also I would like some more input from others about changing the default install directory to sbin

Anybody have a problem with this?

In SUSE we run
./configure --bindir=/sbin .....
for rpcbind.

So: no, we do not have a problem with this. Nor do I personally.

This came up before in the thread starting
https://www.spinics.net/lists/linux-nfs/msg60349.html
but didn't quite get resolved for some reason that I don't recall.

Thanks,
NeilBrown

Quoted 52 lines

steved.

Quoted 38 lines
Makefile.am +2 -1
index 43c2710..c160a95 100644
@@ -29,7 +29,8 @@ if LIBWRAP
 AM_CPPFLAGS +=	-DLIBWRAP
 endif
 
-bin_PROGRAMS = rpcbind rpcinfo
+bin_PROGRAMS = rpcinfo
+sbin_PROGRAMS = rpcbind
 
 rpcbind_SOURCES = \
 	src/check_bound.c \
configure.ac +3 -3
index 3790310..359a418 100644
@@ -61,9 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread])
 
 AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
 
-# make bindir available for substitution in config file
+# make sbindir available for substitution in config file
 # 2 "evals" needed to expand variable names
-AC_SUBST([_bindir])
-AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
+AC_SUBST([_sbindir])
+AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir])
 
 AC_OUTPUT([Makefile systemd/rpcbind.service])
systemd/rpcbind.service.in +0 -0
index 03a9e0b..f8cfa9f 100644

systemd/rpcbind.service.in After=rpcbind.socket · line 18

Quoted 8 lines
systemd/rpcbind.service.in +1 -1
@@ -12,7 +12,7 @@ After=rpcbind.socket
 [Service]
 Type=notify
 # distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
-ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
+ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f
 
 [Install]
 WantedBy=multi-user.target

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Re: [PATCH 1/1] autotools: install rpcbind to --sbindir.

Quoted 34 lines · NeilBrown
Quoted 21 lines · Steve Dickson
Quoted 15 lines · Michael Orlitzky

According to its own man page, the rpcbind program "can only be started by the super-user." On systems where a distinction is made, it therefore makes sense to install rpcbind to the autotools sbindir rather than the regular bindir where it is currently installed. This is accomplished by three small changes:

1. Move rpcbind from bin_PROGRAMS to sbin_PROGRAMS in Makefile.am.
2. Change @_bindir@ to @_sbindir@ in the rpcbind systemd service file.
3. Tell configure.ac that it should substitute the value of $sbindir into @_sbindir@ instead of $bindir$ into @_bindir@.

The rpcinfo tool remains where it is, in bindir, since unprivileged users are able to usefully run it. This avoids forcing maintainers to choose between two bad options: hiding rpcinfo from unprivileged users, or installing a useless rpcbind for them.

Quoted 5 lines
---
 Makefile.am                | 3 ++-
 configure.ac               | 6 +++---
 systemd/rpcbind.service.in | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
Quoted 6 lines

A couple things... You are missing a Signed-off-by line

Also I would like some more input from others about changing the default install directory to sbin

Anybody have a problem with this?

In SUSE we run
./configure --bindir=/sbin .....
for rpcbind.

Quoted 5 lines

So: no, we do not have a problem with this. Nor do I personally.

This came up before in the thread starting
https://www.spinics.net/lists/linux-nfs/msg60349.html
but didn't quite get resolved for some reason that I don't recall.It turns out commit 5739ac634 (Fix path for rpcbind in rpcbind.service)

move the rpcbind from sbindir to bindir and now this patch is moving it back?? There is definitely some confusion here!

steved.

Quoted 56 lines

Thanks,
NeilBrown

Quoted 52 lines

steved.

Quoted 38 lines
Makefile.am +2 -1
index 43c2710..c160a95 100644
@@ -29,7 +29,8 @@ if LIBWRAP
 AM_CPPFLAGS +=	-DLIBWRAP
 endif
 
-bin_PROGRAMS = rpcbind rpcinfo
+bin_PROGRAMS = rpcinfo
+sbin_PROGRAMS = rpcbind
 
 rpcbind_SOURCES = \
 	src/check_bound.c \
configure.ac +3 -3
index 3790310..359a418 100644
@@ -61,9 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread])
 
 AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
 
-# make bindir available for substitution in config file
+# make sbindir available for substitution in config file
 # 2 "evals" needed to expand variable names
-AC_SUBST([_bindir])
-AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
+AC_SUBST([_sbindir])
+AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir])
 
 AC_OUTPUT([Makefile systemd/rpcbind.service])
systemd/rpcbind.service.in +0 -0
index 03a9e0b..f8cfa9f 100644

systemd/rpcbind.service.in After=rpcbind.socket · line 18

Quoted 8 lines
systemd/rpcbind.service.in +1 -1
@@ -12,7 +12,7 @@ After=rpcbind.socket
 [Service]
 Type=notify
 # distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
-ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
+ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f
 
 [Install]
 WantedBy=multi-user.target

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

Re: [PATCH 1/1] autotools: install rpcbind to --sbindir.

Quoted 5 lines · Steve Dickson

It turns out commit 5739ac634 (Fix path for rpcbind in rpcbind.service) move the rpcbind from sbindir to bindir and now this patch is moving it back?? There is definitely some confusion here!

Before my patch, rpcbind was installed to bindir, so having @_sbindir@ in the systemd service file back then was wrong. After my patch, rpcbind is actually installed to the sbindir, so that's the right thing to have in the service file.

The original confusion may have been caused by what Neil said that they do on SUSE, which is set

  ./configure --bindir=/sbin

We're actually doing the same thing on Gentoo, and my motivation for this patch is so that we can stop: doing that puts rpcinfo in /sbin, and users can't see it in their paths.