All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stuart Longland (VK4MSL)" <me@vk4msl.yi.org>
To: wharms@bfs.de
Cc: Ralf Baechle <ralf@linux-mips.org>,
	linux-hams@vger.kernel.org,
	Stuart Longland <stuartl@longlandclan.yi.org>
Subject: Re: [PATCH 1/2] kissattach: Add support for pty symlinking
Date: Wed, 15 Jul 2015 06:04:47 +1000	[thread overview]
Message-ID: <55A56B5F.5010904@vk4msl.yi.org> (raw)
In-Reply-To: <55A4D39A.6000200@bfs.de>

Hi Walter,
On 14/07/15 19:17, walter harms wrote:
> Am 28.06.2015 05:04, schrieb me@vk4msl.yi.org:
>> From: Stuart Longland <stuartl@longlandclan.yi.org>
>> -	fprintf(stderr, "usage: %s [-b] [-l] [-m mtu] [-v] tty port [inetaddr]\n", progname);
>> +	fprintf(stderr, "usage: %s [-b] [-l] [-m mtu] [-v] [-o user:group] [-p mode] tty port [inetaddr]\n",
>> +			progname);
> hi Stuart,
> what was the model for you cli ? i was looking at 'install' and it uses
> -g group
> -o owner
> -m mode

Well, -m was already taken with MTU and I didn't want to break backward
compatibility, so I was thinking along the lines of "permissions" and
"ownership", hence -p and -o.

I could split ownership into -u (user) and -g (group) however people are
probably used to chown specifying ownership as user:group.

>> +		/* Are we being asked to chown? */
>> +		if (pty_owner_user) {
>> +			/* Look up the user */
>> +			struct passwd user;
>> +			struct passwd* user_ptr = NULL;
>> +			struct group grp;
>> +			struct group* grp_ptr = NULL;
>> +			char buffer[512];
>> +			int err = getpwnam_r(pty_owner_user, &user,
>> +				buffer, sizeof(buffer)-1, &user_ptr);
> 
> why _r ? any need to make it thread safe ?
> 
> just my 2 cents,
> re,
>  wh

Call it paranoia, or an allergy to the non-threadsafe versions of the
function. :-)

I have a similar allergy to `int` and `unsigned int` for what it's
worth, preferring to use stdint.h or as a fallback, `char`, `short`,
`long` and `long long` since those are at least guaranteed to be a
certain size. (That said: I have seen a system where char was two bytes.)
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.

  reply	other threads:[~2015-07-14 20:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-28  3:04 PTY Improvements for kissattach, kissnetd me
2015-06-28  3:04 ` [PATCH 1/2] kissattach: Add support for pty symlinking me
2015-07-14  9:17   ` walter harms
2015-07-14 20:04     ` Stuart Longland (VK4MSL) [this message]
2015-06-28  3:04 ` [PATCH 2/2] kissnetd: Add support for symlinking PTYs me
2015-06-28  3:30 ` PTY Improvements for kissattach, kissnetd Stuart Longland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55A56B5F.5010904@vk4msl.yi.org \
    --to=me@vk4msl.yi.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=stuartl@longlandclan.yi.org \
    --cc=wharms@bfs.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.