Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jun 2017 15:35:56 +0200
From:      Jeremie Le Hen <jlh@freebsd.org>
To:        John <jwd@freebsd.org>
Cc:        Slawa Olhovchenkov <slw@zxy.spb.ru>, freebsd-arch@freebsd.org
Subject:   Re: rtools were deemed almost unused 15 years ago...
Message-ID:  <CAGSa5y0kqa97x%2B86%2BwEeCSeCAHXgtgJnK6rSn56brXJPovjFVA@mail.gmail.com>
In-Reply-To: <20170626124348.GA11618@FreeBSD.org>
References:  <CAGSa5y3kVajpSSJUT9Vt0-dTwtaXMwNWvv_ELH14z68osM0UYA@mail.gmail.com> <CAGSa5y1=1zN0ywKQ--HTi%2BDY18M5o%2BGR0fv6CyaaF9WX-z9BZg@mail.gmail.com> <20170625130923.GD18123@zxy.spb.ru> <CAGSa5y1o300nthcsRd1pGzy04SjMrmRWtRrp4DP_NrpqF2rr=g@mail.gmail.com> <20170626124348.GA11618@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 26, 2017 at 2:43 PM, John <jwd@freebsd.org> wrote:
> ----- Jeremie Le Hen's Original Message -----
>> On Sun, Jun 25, 2017 at 3:09 PM, Slawa Olhovchenkov <slw@zxy.spb.ru> wrote:
>> > On Sat, Jun 24, 2017 at 10:29:22PM +0200, Jeremie Le Hen wrote:
>> >
>> >> So the first step was to create a port with FreeBSD rcmds, here we
>> >> are!  But I need some eyes to vet it:
>> >> https://reviews.freebsd.org/D11345
>> >
>> > 1. Create port
>> > 2. Port unmantained
>> > 3. Port broken
>> > 4. Port removed.
>> > 5. Lack of functionality.
>>
>> Feel free to step in to help with the maintenance :-).
>
> Let's commit this little snippet which is a major win for HA heads
> with 10 of thousands of file descriptors open...

I don't have any context here. If you think it's the right thing to
do, then go ahead and I will update the port tarball.

> Index: libexec/rshd/rshd.c
> ===================================================================
> --- libexec/rshd/rshd.c (revision 316672)
> +++ libexec/rshd/rshd.c (working copy)
> @@ -191,7 +191,7 @@
>         struct passwd *pwd;
>         u_short port;
>         fd_set ready, readfrom;
> -       int cc, fd, nfd, pv[2], pid, s;
> +       int cc, nfd, pv[2], pid, s;
>         int one = 1;
>         const char *cp, *errorstr;
>         char sig, buf[BUFSIZ];
> @@ -496,8 +496,7 @@
>  #ifdef USE_BLACKLIST
>         blacklist(0, STDIN_FILENO, "success");
>  #endif
> -       for (fd = getdtablesize(); fd > 2; fd--)
> -               (void) close(fd);
> +       closefrom(3);
>         if (setsid() == -1)
>                 syslog(LOG_ERR, "setsid() failed: %m");
>         if (setlogin(pwd->pw_name) < 0)
>
> Cheers,
> John
>
>> --
>> Jeremie Le Hen
>> jlh@FreeBSD.org
>> _______________________________________________
>> freebsd-arch@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-arch
>> To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"



-- 
Jeremie Le Hen
jlh@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGSa5y0kqa97x%2B86%2BwEeCSeCAHXgtgJnK6rSn56brXJPovjFVA>