Page MenuHomeFreeBSD

net/bsdrcmds - FreeBSD ruptime/rsh/rwho/rlogin/rcp/rwhod/rlogind/rshd
ClosedPublic

Authored by jlh on Jun 24 2017, 8:25 PM.
Tags
None
Referenced Files
F81652078: D11345.diff
Fri, Apr 19, 12:02 PM
Unknown Object (File)
Mar 10 2024, 12:17 AM
Unknown Object (File)
Mar 10 2024, 12:17 AM
Unknown Object (File)
Mar 10 2024, 12:17 AM
Unknown Object (File)
Mar 10 2024, 12:17 AM
Unknown Object (File)
Mar 10 2024, 12:17 AM
Unknown Object (File)
Mar 10 2024, 12:17 AM
Unknown Object (File)
Mar 10 2024, 12:17 AM

Details

Summary

In order to remove rcmds from the base system, as proposed in [1], I created a port for them so that they are still available for those who need them.

Note that there are no rc scripts because the base system doesn't seem to have them. I assume people run those daemon through inetd(8) nowadays.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018239.html

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Use my correct FreeBSD login, not the one I use at work :o).

ngie added a subscriber: ngie.
ngie added inline comments.
net/bsdrcmds/pkg-plist
1 ↗(On Diff #30045)

Could you please sort pkg-plist?

This revision is now accepted and ready to land.Jun 25 2017, 1:10 AM
jlh edited edge metadata.

Sorted pkg-plist, as requested by ngie@.

This revision now requires review to proceed.Jun 25 2017, 10:00 AM
jlh marked an inline comment as done.Jun 25 2017, 10:00 AM
matthew added inline comments.
net/bsdrcmds/Makefile
24 ↗(On Diff #30056)

This chunk should read:

IPV6_MAKE_ARGS= USE_IPV6=yes

28 ↗(On Diff #30056)

Similarly:

LIBBLACKLIST_MAKE_ARGS= USE_LIBBLACKLIST=yes

jbeich requested changes to this revision.Jun 26 2017, 7:06 AM
jbeich added a subscriber: jbeich.
  • LIBBLACKLIST=on fails to build on 10.3-RELEASE
  • portlint -AC complains about whitespace
  • make stage-qa (with DEVELOPER=yes in make.conf) complains about setuid files under ${STAGEDIR}
  • net/Makefile chunk is missing but required for make index
net/bsdrcmds/Makefile
14 ↗(On Diff #30056)

Don't use USES=fakeroot for <bsd.prog.mk> consumers e.g.,

# Makefile
USES=		uidfix ...
MAKE_ARGS=	BINOWN=${BINOWN} BINMODE=${BINMODE}

# pkg-plist
@(,,4555) bin/rcp
...
16 ↗(On Diff #30056)
  • Consider making both options enabled by default (like base system did).
  • FreeBSD 10.* and DragonFly don't have libblacklist(3), so you may also want:
OPTIONS_EXCLUDE_FreeBSD_9=	LIBBLACKLIST
OPTIONS_EXCLUDE_DragonFly=	LIBBLACKLIST

or

.if !exists(/usr/include/blacklist.h)
OPTIONS_EXCLUDE=	LIBBLACKLIST
.endif
17 ↗(On Diff #30056)

Drop to avoid redundancy with Mk/bsd.options.desc.mk.

18 ↗(On Diff #30056)
  • Drop Enable noise and describe which commands can notify blacklistd(8) unless all of them can.
  • From a cosmetic POV you may want to group LIBBLACKLIST_DESC and LIBBLACKLIST_MAKE_ARGS together.
This revision now requires changes to proceed.Jun 26 2017, 7:06 AM
jlh edited edge metadata.
jlh marked 6 inline comments as done.

Addressed requests from matthew@ and jbeich@.

  • make stage-qa (with DEVELOPER=yes in make.conf) complains about setuid files under ${STAGEDIR}

This is by design, it seems rcp(1)/rlogin(1)/rsh(1) require it.

net/bsdrcmds/Makefile
14 ↗(On Diff #30056)

Sorry this was a remnant of a former test. I both tried "uidfix" and "fakeroot" in order to be able to not need root for testing my port, but both failed (IIRC to store port options in /var/db/ports). So now I'm just using a test jail and I've just removed this.

16 ↗(On Diff #30056)

I used the latter, I find it more flexible.

jlh marked 2 inline comments as done.

Really sort pkg-plist.

I tested the changes and realized that <OPT>_MAKE_ARGS should be before .include <bsd.port.options.mk>

What the ownership and mode is on files installed to staging doesn't really matter all that much -- pkg(8)
should set them to the default ownership (root:wheel) and mode (755 or 644) at install time. (If you think
about it, you'll see it has to be that way in order to support building packages as non-root)

The only permissions bits that gets passed through to the generated package are if the file has execute
bits set in staging. Otherwise, you need to use pkg-plist to control ownership and permissions on final
installation.

net/bsdrcmds/pkg-plist
2 ↗(On Diff #30084)

In order for any of these files to be installed SUID from the package, you need eg.:

@(,,4555) bin/rsh

Where the empty values mean use the defaults: user root and group wheel. Similarly for rlogin, rcp

  • portlint -AC still complains about whitespace
  • fails to build via poudriere-devel due to BUILD_AS_NON_ROOT=yes by default
net/bsdrcmds/Makefile
18 ↗(On Diff #30084)

LIBBLACKLIST is still disabled by default and would cause a POLA violation for binary package users switching from base to ports when 12.0 is released.

25 ↗(On Diff #30084)

logind(8) doesn't exist. Did you mean rlogind(8) (i.e. with r prefix)?

28 ↗(On Diff #30084)

This line can be dropped as .if ${PORT_OPTIONS:MFOO} conditionals are gone.

14 ↗(On Diff #30056)
  • My example above has both non-root builds working and make stage-qa warnings fixed. Why not use it instead of regressing?
  • bsd.port.mk invokes ${SU_CMD} to write saved options, if it doesn't there's a generic bug affecting all ports with options.
  • pkg-fallout@ has build-as-user job which (unlike with Tier2 archs) spams individual maintainers on bustage.
jlh marked 3 inline comments as done.
  • Fix install mode for suid binaries.
  • Make "portlint -AC" happy.
  • Apply the uidfix snippet from jbeich@
  • Enable LIBBLACKLIST by default when it's available
  • Fix a comment: s/logind/r&/
  • Remove unused include <bsd.port.options.mk>
  • Update source tarball to include r320406.

What the ownership and mode is on files installed to staging doesn't really matter all that much -- pkg(8)
should set them to the default ownership (root:wheel) and mode (755 or 644) at install time. (If you think
about it, you'll see it has to be that way in order to support building packages as non-root)

The only permissions bits that gets passed through to the generated package are if the file has execute
bits set in staging. Otherwise, you need to use pkg-plist to control ownership and permissions on final
installation.

Gotcha, thanks for explaining.

  • portlint -AC still complains about whitespace

portlint -AC

looks fine.
:)

  • fails to build via poudriere-devel due to BUILD_AS_NON_ROOT=yes by default

Not sure what I'm supposed to do here.

net/bsdrcmds/Makefile
18 ↗(On Diff #30084)

Good point. I added OPTIONS_DEFAULT= LIBBLACKLIST.

25 ↗(On Diff #30084)

Yes indeed, thanks for catching this.

14 ↗(On Diff #30056)

I just missed the comment among the others.

I still can't build as user and I don't understand what you're asking me to do here

bsdrcmds$ make

> Switching to root credentials to create /var/db/ports/net_bsdrcmds

su: Sorry

> Cannot create /var/db/ports/net_bsdrcmds, check permissions

In D11345#235684, @jlh wrote:
  • portlint -AC still complains about whitespace

portlint -AC

looks fine.

Perhaps, tabs are lost via copy-paste into Phabricator.

net/bsdrcmds/Makefile
14 ↗(On Diff #30168)

Can you sort values alphabetically? This is purely cosmetic.

This revision is now accepted and ready to land.Jun 28 2017, 10:19 AM
net/bsdrcmds/Makefile
14 ↗(On Diff #30168)

Nevermind. It's already sorted.

Ah I missed the LGTM. Sorry the UI is confusing.

This revision was automatically updated to reflect the committed changes.