All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] agetty: remove variable that is set but not read
@ 2017-04-02  8:14 Sami Kerola
  2017-04-02  8:14 ` [PATCH 2/3] lib/cpuset: stop changing variable that is " Sami Kerola
  2017-04-02  8:14 ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Sami Kerola
  0 siblings, 2 replies; 14+ messages in thread
From: Sami Kerola @ 2017-04-02  8:14 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 term-utils/agetty.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index da6c9e5e3..6a2085a3c 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1279,15 +1279,10 @@ static void termio_init(struct options *op, struct termios *tp)
 
 	/* Check for terminal size and if not found set default */
 	if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) == 0) {
-		int set = 0;
-		if (ws.ws_row == 0) {
+		if (ws.ws_row == 0)
 			ws.ws_row = 24;
-			set++;
-		}
-		if (ws.ws_col == 0) {
+		if (ws.ws_col == 0)
 			ws.ws_col = 80;
-			set++;
-		}
 		if (ioctl(STDIN_FILENO, TIOCSWINSZ, &ws))
 			debug("TIOCSWINSZ ioctl failed\n");
 	}
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] lib/cpuset: stop changing variable that is not read
  2017-04-02  8:14 [PATCH 1/3] agetty: remove variable that is set but not read Sami Kerola
@ 2017-04-02  8:14 ` Sami Kerola
  2017-04-02  8:14 ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Sami Kerola
  1 sibling, 0 replies; 14+ messages in thread
From: Sami Kerola @ 2017-04-02  8:14 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 lib/cpuset.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/cpuset.c b/lib/cpuset.c
index fbe99e2a5..6d82522f5 100644
--- a/lib/cpuset.c
+++ b/lib/cpuset.c
@@ -255,7 +255,6 @@ int cpumask_parse(const char *str, cpu_set_t *set, size_t setsize)
 			CPU_SET_S(cpu + 2, setsize, set);
 		if (val & 8)
 			CPU_SET_S(cpu + 3, setsize, set);
-		len--;
 		ptr--;
 		cpu += 4;
 	}
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-02  8:14 [PATCH 1/3] agetty: remove variable that is set but not read Sami Kerola
  2017-04-02  8:14 ` [PATCH 2/3] lib/cpuset: stop changing variable that is " Sami Kerola
@ 2017-04-02  8:14 ` Sami Kerola
  2017-04-03  1:13   ` J William Piggott
  2017-04-03  8:56   ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Karel Zak
  1 sibling, 2 replies; 14+ messages in thread
From: Sami Kerola @ 2017-04-02  8:14 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Without this change an attempt to remove hostname printing required following
rather clumsy agetty invocation.

  /sbin/agetty --nohostname --login-options '/bin/login -H -- \u'

After the change --nohostname behaves similar way with --host option, that
is when combined with --remote the effect is passed to login(1).

In same go improve manual page a little bit.  This includes small mistake in
commit 01095ae33c that claimed option -r is added to command line when
passing hostname login while it should have been -h.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 term-utils/agetty.8 | 27 +++++++++++++++++----------
 term-utils/agetty.c |  9 ++++++---
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/term-utils/agetty.8 b/term-utils/agetty.8
index 40be8b46c..bdb1a7d35 100644
--- a/term-utils/agetty.8
+++ b/term-utils/agetty.8
@@ -90,18 +90,22 @@ Assume that the tty is 8-bit clean, hence disable parity detection.
 .TP
 \-a, \-\-autologin \fIusername\fP
 Log the specified user automatically in without asking for a login name and
-password.  The \-f \fIusername\fP option is added to the \fB/bin/login\fP
-command line by default.  The \-\-login\-options option changes this default
-behavior and then only \\u is replaced by the \fIusername\fP and no other
-option is added to the login command line.
+password.  The \-f \fIusername\fP option and argument are added to the
+\fB/bin/login\fP command line by default.  The \-\-login\-options option
+changes this default behavior and then only \\u is replaced by the
+\fIusername\fP and no other option is added to the login command line.
 .TP
 \-c, \-\-noreset
 Don't reset terminal cflags (control modes).  See \fBtermios\fP(3) for more
 details.
 .TP
 \-E, \-\-remote
-If an \fB\-H\fP \fIfakehost\fP option is given, then an \fB\-r\fP
-\fIfakehost\fP option is added to the \fB/bin/login\fP command line.
+If an \fB\-\-host\fP \fIfakehost\fP option is given, then an \fB\-h\fP
+\fIfakehost\fP option and argument are added to the \fB/bin/login\fP
+command line.
+.IP
+If an \fB\-\-nohost\fR option is given, then an \fB\-H\fP option
+is added to the \fB/bin/login\fP command line.
 .TP
 \-f, \-\-issue\-file \fIissue_file\fP
 Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
@@ -184,9 +188,11 @@ Do not print a newline before writing out /etc/issue.
 .TP
 \-o, \-\-login\-options "\fIlogin_options\fP"
 Options  that  are passed to the login program.  \\u is replaced
-by the login name.  The default \fB/bin/login\fP command line
-is "/bin/login -- <username>".
-
+by the login name.  The default login options string is
+"/bin/login -- \\u".
+.IP
+See also \fB\-\-autologin\fR and \fB\-\-remote\fR options.
+.IP
 Please read the SECURITY NOTICE below if you want to use this.
 .TP
 \-p, \-\-login\-pause
@@ -217,7 +223,8 @@ Note that this has no support for any Unicode characters.
 \-w, \-\-wait\-cr
 Wait for the user or the modem to send a carriage-return or a
 linefeed character before sending the \fI/etc/issue\fP (or other) file
-and the login prompt.  Very useful in connection with the \-I option.
+and the login prompt.  Very useful in connection with the \-\-init\-string
+option.
 .TP
 \-\-nohints
 Do not print hints about Num, Caps and Scroll Locks.
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 6a2085a3c..93a3843c7 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -493,9 +493,12 @@ int main(int argc, char **argv)
 		login_options_to_argv(login_argv, &login_argc,
 				      options.logopt, username);
 	} else {
-		if (fakehost && (options.flags & F_REMOTE)) {
-			login_argv[login_argc++] = "-h";
-			login_argv[login_argc++] = fakehost;
+		if (options.flags & F_REMOTE) {
+			if (fakehost) {
+				login_argv[login_argc++] = "-h";
+				login_argv[login_argc++] = fakehost;
+			} else if (options.flags & F_NOHOSTNAME)
+				login_argv[login_argc++] = "-H";
 		}
 		if (username) {
 			if (options.autolog)
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-02  8:14 ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Sami Kerola
@ 2017-04-03  1:13   ` J William Piggott
  2017-04-03  8:40     ` Sami Kerola
  2017-04-03  8:56   ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Karel Zak
  1 sibling, 1 reply; 14+ messages in thread
From: J William Piggott @ 2017-04-03  1:13 UTC (permalink / raw)
  To: Sami Kerola, util-linux



On 04/02/2017 04:14 AM, Sami Kerola wrote:
> Without this change an attempt to remove hostname printing required following
> rather clumsy agetty invocation.
> 
>   /sbin/agetty --nohostname --login-options '/bin/login -H -- \u'
> 
> After the change --nohostname behaves similar way with --host option, that
> is when combined with --remote the effect is passed to login(1).
> 
> In same go improve manual page a little bit.  This includes small mistake in
> commit 01095ae33c that claimed option -r is added to command line when
> passing hostname login while it should have been -h.
> 
> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
> ---
>  term-utils/agetty.8 | 27 +++++++++++++++++----------
>  term-utils/agetty.c |  9 ++++++---
>  2 files changed, 23 insertions(+), 13 deletions(-)
> 
> diff --git a/term-utils/agetty.8 b/term-utils/agetty.8
> index 40be8b46c..bdb1a7d35 100644
> --- a/term-utils/agetty.8
> +++ b/term-utils/agetty.8
> @@ -90,18 +90,22 @@ Assume that the tty is 8-bit clean, hence disable parity detection.
>  .TP
>  \-a, \-\-autologin \fIusername\fP
>  Log the specified user automatically in without asking for a login name and

Hey Sami, since you're here you might want to fix this too?

Log in the specified user automatically without asking for a name and
 OR
Automatically log in the specified user without asking for a name and

I think the second is better.

> -password.  The \-f \fIusername\fP option is added to the \fB/bin/login\fP
> -command line by default.  The \-\-login\-options option changes this default
> -behavior and then only \\u is replaced by the \fIusername\fP and no other
> -option is added to the login command line.
> +password.  The \-f \fIusername\fP option and argument are added to the

The \-f should be bold.

> +\fB/bin/login\fP command line by default.  The \-\-login\-options option

That reads a bit awkward (and it's not in bold), how about just:

.RB Using \ \-\-login\-options

> +changes this default behavior and then only \\u is replaced by the
> +\fIusername\fP and no other option is added to the login command line.
>  .TP
>  \-c, \-\-noreset
>  Don't reset terminal cflags (control modes).  See \fBtermios\fP(3) for more
>  details.
>  .TP
>  \-E, \-\-remote
> -If an \fB\-H\fP \fIfakehost\fP option is given, then an \fB\-r\fP
> -\fIfakehost\fP option is added to the \fB/bin/login\fP command line.
> +If an \fB\-\-host\fP \fIfakehost\fP option is given, then an \fB\-h\fP

If a \fB\-\-host\fP

> +\fIfakehost\fP option and argument are added to the \fB/bin/login\fP
> +command line.
> +.IP
> +If an \fB\-\-nohost\fR option is given, then an \fB\-H\fP option

If a \fB\-\-nohost\fR

Actually, they all should be using 'the'. Although it is common for
util-linux man-pages' to use the a/an indefinite article for command and
option names; they are specific nouns that require using the definite
article 'the'.

https://owl.english.purdue.edu/owl/resource/540/01/

> +is added to the \fB/bin/login\fP command line.
>  .TP
>  \-f, \-\-issue\-file \fIissue_file\fP
>  Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
> @@ -184,9 +188,11 @@ Do not print a newline before writing out /etc/issue.
>  .TP
>  \-o, \-\-login\-options "\fIlogin_options\fP"
>  Options  that  are passed to the login program.  \\u is replaced
> -by the login name.  The default \fB/bin/login\fP command line
> -is "/bin/login -- <username>".
> -
> +by the login name.  The default login options string is
> +"/bin/login -- \\u".

by the login name.  The default login command is
.BR "/bin/login -- \\u" .

> +.IP
> +See also \fB\-\-autologin\fR and \fB\-\-remote\fR options.

Also see the \fB\-\-autologin\fR and \fB\-\-remote\fR options.

> +.IP
>  Please read the SECURITY NOTICE below if you want to use this.

Please read the SECURITY NOTICE below before using this option.

>  .TP
>  \-p, \-\-login\-pause
> @@ -217,7 +223,8 @@ Note that this has no support for any Unicode characters.
>  \-w, \-\-wait\-cr
>  Wait for the user or the modem to send a carriage-return or a
>  linefeed character before sending the \fI/etc/issue\fP (or other) file
> -and the login prompt.  Very useful in connection with the \-I option.
> +and the login prompt.  Very useful in connection with the \-\-init\-string

This is useful with the \-\-init\-string

> +option.
>  .TP
>  \-\-nohints
>  Do not print hints about Num, Caps and Scroll Locks.
> diff --git a/term-utils/agetty.c b/term-utils/agetty.c
> index 6a2085a3c..93a3843c7 100644
> --- a/term-utils/agetty.c
> +++ b/term-utils/agetty.c
> @@ -493,9 +493,12 @@ int main(int argc, char **argv)
>  		login_options_to_argv(login_argv, &login_argc,
>  				      options.logopt, username);
>  	} else {
> -		if (fakehost && (options.flags & F_REMOTE)) {
> -			login_argv[login_argc++] = "-h";
> -			login_argv[login_argc++] = fakehost;
> +		if (options.flags & F_REMOTE) {
> +			if (fakehost) {
> +				login_argv[login_argc++] = "-h";
> +				login_argv[login_argc++] = fakehost;
> +			} else if (options.flags & F_NOHOSTNAME)
> +				login_argv[login_argc++] = "-H";
>  		}
>  		if (username) {
>  			if (options.autolog)
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-03  1:13   ` J William Piggott
@ 2017-04-03  8:40     ` Sami Kerola
  2017-04-03 21:20       ` Sami Kerola
  0 siblings, 1 reply; 14+ messages in thread
From: Sami Kerola @ 2017-04-03  8:40 UTC (permalink / raw)
  To: J William Piggott; +Cc: util-linux

On 3 April 2017 at 02:13, J William Piggott <elseifthen@gmx.com> wrote:
> On 04/02/2017 04:14 AM, Sami Kerola wrote:
>> Without this change an attempt to remove hostname printing required following
>> rather clumsy agetty invocation.
>>
>>   /sbin/agetty --nohostname --login-options '/bin/login -H -- \u'
>>
>> After the change --nohostname behaves similar way with --host option, that
>> is when combined with --remote the effect is passed to login(1).
>>
>> In same go improve manual page a little bit.  This includes small mistake in
>> commit 01095ae33c that claimed option -r is added to command line when
>> passing hostname login while it should have been -h.
>>
>> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
>> ---
>>  term-utils/agetty.8 | 27 +++++++++++++++++----------
>>  term-utils/agetty.c |  9 ++++++---
>>  2 files changed, 23 insertions(+), 13 deletions(-)
>>
>> diff --git a/term-utils/agetty.8 b/term-utils/agetty.8
>> index 40be8b46c..bdb1a7d35 100644
>> --- a/term-utils/agetty.8
>> +++ b/term-utils/agetty.8
>> @@ -90,18 +90,22 @@ Assume that the tty is 8-bit clean, hence disable parity detection.
>>  .TP
>>  \-a, \-\-autologin \fIusername\fP
>>  Log the specified user automatically in without asking for a login name and
>
> Hey Sami, since you're here you might want to fix this too?

Hi JWP,

Let me split the change in two:

1. --nohostname option forward + minimal manual change
2. manual page update

Karel, please hold on with these three changes. I will push changes to
a some branch in my git and tell when the stuff is fast forwardable.

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-02  8:14 ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Sami Kerola
  2017-04-03  1:13   ` J William Piggott
@ 2017-04-03  8:56   ` Karel Zak
  1 sibling, 0 replies; 14+ messages in thread
From: Karel Zak @ 2017-04-03  8:56 UTC (permalink / raw)
  To: Sami Kerola; +Cc: util-linux

On Sun, Apr 02, 2017 at 09:14:36AM +0100, Sami Kerola wrote:
> +.IP
> +If an \fB\-\-nohost\fR option is given, then an \fB\-H\fP option
                ^^^^^^
 The name of the option is --nohostname

>  	} else {
> -		if (fakehost && (options.flags & F_REMOTE)) {
> -			login_argv[login_argc++] = "-h";
> -			login_argv[login_argc++] = fakehost;
> +		if (options.flags & F_REMOTE) {
> +			if (fakehost) {
> +				login_argv[login_argc++] = "-h";
> +				login_argv[login_argc++] = fakehost;
> +			} else if (options.flags & F_NOHOSTNAME)
> +				login_argv[login_argc++] = "-H";

 Seems good.

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-03  8:40     ` Sami Kerola
@ 2017-04-03 21:20       ` Sami Kerola
  2017-04-05  1:03         ` J William Piggott
  2017-04-05 23:33         ` J William Piggott
  0 siblings, 2 replies; 14+ messages in thread
From: Sami Kerola @ 2017-04-03 21:20 UTC (permalink / raw)
  To: J William Piggott; +Cc: util-linux

On 3 April 2017 at 09:40, Sami Kerola <kerolasa@iki.fi> wrote:
> On 3 April 2017 at 02:13, J William Piggott <elseifthen@gmx.com> wrote:
>>
>> Hey Sami, since you're here you might want to fix this too?
>
> Hi JWP,
>
> Let me split the change in two:
>
> 1. --nohostname option forward + minimal manual change
> 2. manual page update
>
> Karel, please hold on with these three changes. I will push changes to
> a some branch in my git and tell when the stuff is fast forwardable.

Here are the updated changes, first one is the minimal option forwarding
and second tries to make manual page better.

https://github.com/kerolasa/lelux-utiliteetit/commit/343cc275591327bc2094f88387f09702a542dc8c
https://github.com/kerolasa/lelux-utiliteetit/commit/c9151874b67a652b7095243fde2203ab8cd7d107

Branch name is: 2017wk13

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-03 21:20       ` Sami Kerola
@ 2017-04-05  1:03         ` J William Piggott
  2017-04-05  8:51           ` Karel Zak
  2017-04-05 23:33         ` J William Piggott
  1 sibling, 1 reply; 14+ messages in thread
From: J William Piggott @ 2017-04-05  1:03 UTC (permalink / raw)
  To: kerolasa; +Cc: util-linux


I don't understand this:

 8< ---

       -o, --login-options "/path/command --option argument -- \u"
              Options   that  are passed to the login program.  \u is replaced
              by the login name.  The default is "/bin/login -- \u".
 8< ---

Is this saying the argument must include the login command? Is that what
"/path/command" represents? If yes, then the second line is incorrect.
If no, then the last sentence is incorrect.


On 04/03/2017 05:20 PM, Sami Kerola wrote:
> On 3 April 2017 at 09:40, Sami Kerola <kerolasa@iki.fi> wrote:
>> On 3 April 2017 at 02:13, J William Piggott <elseifthen@gmx.com> wrote:
>>>
>>> Hey Sami, since you're here you might want to fix this too?
>>
>> Hi JWP,
>>
>> Let me split the change in two:
>>
>> 1. --nohostname option forward + minimal manual change
>> 2. manual page update
>>
>> Karel, please hold on with these three changes. I will push changes to
>> a some branch in my git and tell when the stuff is fast forwardable.
> 
> Here are the updated changes, first one is the minimal option forwarding
> and second tries to make manual page better.
> 
> https://github.com/kerolasa/lelux-utiliteetit/commit/343cc275591327bc2094f88387f09702a542dc8c
> https://github.com/kerolasa/lelux-utiliteetit/commit/c9151874b67a652b7095243fde2203ab8cd7d107
> 
> Branch name is: 2017wk13
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-05  1:03         ` J William Piggott
@ 2017-04-05  8:51           ` Karel Zak
  2017-04-05 15:24             ` J William Piggott
  0 siblings, 1 reply; 14+ messages in thread
From: Karel Zak @ 2017-04-05  8:51 UTC (permalink / raw)
  To: J William Piggott; +Cc: kerolasa, util-linux

On Tue, Apr 04, 2017 at 09:03:08PM -0400, J William Piggott wrote:
> 
> I don't understand this:
> 
>  8< ---
> 
>        -o, --login-options "/path/command --option argument -- \u"
>               Options   that  are passed to the login program.  \u is replaced
>               by the login name.  The default is "/bin/login -- \u".
>  8< ---
> 
> Is this saying the argument must include the login command? Is that what
> "/path/command" represents? If yes, then the second line is incorrect.
> If no, then the last sentence is incorrect.

from code:

    login_argv[login_argc++] = options.login; 
    ...

    login_options_to_argv(login_argv, &login_argc,
                        options.logopt, username);
    ...
    execv(options.login, login_argv);


where:
    options.login is --login-program
    login-options is --login-options

so the man page is wrong, --login-options should be without the path.

I'll fix it.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-05  8:51           ` Karel Zak
@ 2017-04-05 15:24             ` J William Piggott
  0 siblings, 0 replies; 14+ messages in thread
From: J William Piggott @ 2017-04-05 15:24 UTC (permalink / raw)
  To: Karel Zak; +Cc: kerolasa, util-linux



On 04/05/2017 04:51 AM, Karel Zak wrote:
> On Tue, Apr 04, 2017 at 09:03:08PM -0400, J William Piggott wrote:
>>
>> I don't understand this:
>>
>>  8< ---
>>
>>        -o, --login-options "/path/command --option argument -- \u"
>>               Options   that  are passed to the login program.  \u is replaced
>>               by the login name.  The default is "/bin/login -- \u".
>>  8< ---
>>
>> Is this saying the argument must include the login command? Is that what
>> "/path/command" represents? If yes, then the second line is incorrect.
>> If no, then the last sentence is incorrect.
> 
> from code:
> 
>     login_argv[login_argc++] = options.login; 
>     ...
> 
>     login_options_to_argv(login_argv, &login_argc,
>                         options.logopt, username);
>     ...
>     execv(options.login, login_argv);
> 
> 
> where:
>     options.login is --login-program
>     login-options is --login-options
> 
> so the man page is wrong, --login-options should be without the path.
> 
> I'll fix it.

The man-page quote is from Sami's working branch (which I'm reviewing).

PS It looks like your email didn't make it to the list for some reason.

> 
>     Karel
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-03 21:20       ` Sami Kerola
  2017-04-05  1:03         ` J William Piggott
@ 2017-04-05 23:33         ` J William Piggott
  2017-04-06  8:41           ` Karel Zak
  1 sibling, 1 reply; 14+ messages in thread
From: J William Piggott @ 2017-04-05 23:33 UTC (permalink / raw)
  To: kerolasa; +Cc: util-linux

[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]


On 04/03/2017 05:20 PM, Sami Kerola wrote:
> On 3 April 2017 at 09:40, Sami Kerola <kerolasa@iki.fi> wrote:
>> On 3 April 2017 at 02:13, J William Piggott <elseifthen@gmx.com> wrote:
>>>
>>> Hey Sami, since you're here you might want to fix this too?
>>
>> Hi JWP,
>>
>> Let me split the change in two:
>>
>> 1. --nohostname option forward + minimal manual change
>> 2. manual page update
>>
>> Karel, please hold on with these three changes. I will push changes to
>> a some branch in my git and tell when the stuff is fast forwardable.
> 
> Here are the updated changes, first one is the minimal option forwarding
> and second tries to make manual page better.
> 
> https://github.com/kerolasa/lelux-utiliteetit/commit/343cc275591327bc2094f88387f09702a542dc8c
> https://github.com/kerolasa/lelux-utiliteetit/commit/c9151874b67a652b7095243fde2203ab8cd7d107
> 
> Branch name is: 2017wk13
>

Sami,

Rather than trying to comment on all of your changes, I'm submitting my
suggestions via the attached patch. It applies over your 2017wk13 branch.

I changed --login-options according to Karel's comments. Please check
that I understood him correctly. Instead of trying to illustrate it's use
in the replaceable argument, I moved it to an example.

I added some language explaining the purpose of --remote. Please check
that I understood that correctly also.



[-- Attachment #2: sami-branch-2017wk13.patch --]
[-- Type: text/x-patch, Size: 5999 bytes --]

diff --git a/term-utils/agetty.8 b/term-utils/agetty.8
index 5477035..23adff3 100644
--- a/term-utils/agetty.8
+++ b/term-utils/agetty.8
@@ -89,22 +89,29 @@ or 'hurd' for GNU Hurd on a virtual terminal.
 Assume that the tty is 8-bit clean, hence disable parity detection.
 .TP
 \-a, \-\-autologin \fIusername\fP
-Automatically log in the specified user without asking username or password.
-Use of this option causes \fB\-f \fIusername\fR option and argument to be
-added to the \fB/bin/login\fP command line.  This option can combined with
-\fB\-\-login\-options\fR, and then \\u is replaced by the \fIusername\fR.
+Automatically log in the specified user without asking for a username or password.
+Using this option causes an \fB\-f \fIusername\fR option and argument to be
+added to the \fB/bin/login\fP command line.  See \fB\-\-login\-options\fR, which
+can be used to modify this option's behavior.
 .TP
 \-c, \-\-noreset
 Do not reset terminal cflags (control modes).  See \fBtermios\fP(3) for more
 details.
 .TP
 \-E, \-\-remote
+Typically the \fBlogin\fP(1) command is given a remote hostname when
+called by something such as \fBtelnetd\fP(8).  This option allows \fBagetty\fP
+to pass what it is using for a hostname to \fBlogin\fP(1) for use
+in \fButmp\fP(5).  See \fB\-\-host\fP, \fBlogin\fP(1), and \fButmp\fP(5).
+.IP
 If the \fB\-\-host\fP \fIfakehost\fP option is given, then an \fB\-h\fP
 \fIfakehost\fP option and argument are added to the \fB/bin/login\fP
 command line.
 .IP
-If an \fB\-\-nohostname\fR option is given, then an \fB\-H\fP option
+If the \fB\-\-nohostname\fR option is given, then an \fB\-H\fP option
 is added to the \fB/bin/login\fP command line.
+.IP
+See \fB\-\-login\-options\fR.
 .TP
 \-f, \-\-issue\-file \fIissue_file\fP
 Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
@@ -116,8 +123,8 @@ Enable hardware (RTS/CTS) flow control.  It is left up to the
 application to disable software (XON/XOFF) flow protocol where
 appropriate.
 .TP
-\-H, \-\-host \fIlogin_host\fP
-Write the specified \fIlogin_host\fP into the utmp file.  Normally,
+\-H, \-\-host \fIfakehost\fP
+Write the specified \fIfakehost\fP into the utmp file.  Normally,
 no login host is given, since \fBagetty\fP is used for local hardwired
 connections and consoles.  However, this option can be useful for
 identifying terminal concentrators and the like.
@@ -137,12 +144,13 @@ octal 012), write \\012.
 .TP
 \-J, \-\-noclear
 Do not clear the screen before prompting for the login name.
-By default screen is cleared.
+By default the screen is cleared.
 .TP
 \-l, \-\-login\-program \fIlogin_program\fP
 Invoke the specified \fIlogin_program\fP instead of /bin/login.  This allows
-the use of a non-standard login program.  Such program could for example
-ask for a dial-up password or use a different password file.
+the use of a non-standard login program.  Such a program could, for example,
+ask for a dial-up password or use a different password file. See
+\fB\-\-login\-options\fP.
 .TP
 \-L, \-\-local\-line[=\fImode\fP]
 Control the CLOCAL line flag.  The optional \fImode\fP argument is 'auto', 'always' or 'never'.
@@ -192,13 +200,17 @@ program that \fBagetty\fR starts (usually /bin/login) is run as root.
 \-N, \-\-nonewline
 Do not print a newline before writing out /etc/issue.
 .TP
-\-o, \-\-login\-options "\fI/path/command --option argument -- \\u\fP"
-Options  that  are passed to the login program.  \\u is replaced
-by the login name.  The default is "/bin/login -- \\u".
-.IP
-Also see the \fB\-\-autologin\fR and \fB\-\-remote\fR options.
-.IP
+\-o, \-\-login\-options "\fIlogin_options\fP"
+Options  and arguments that  are passed to \fBlogin\fP(1). Where \\u is
+replaced by the login name. For example:
+.RS
+.IP "" 4
+.B "\-\-login\-options '-h darkstar -- \\\u'"
+.PP
+See \fB\-\-autologin\fR, \fB\-\-login\-program\fR and \fB\-\-remote\fR.
+.PP
 Please read the SECURITY NOTICE below before using this option.
+.RE
 .TP
 \-p, \-\-login\-pause
 Wait for any key before dropping to the login prompt.  Can be combined
@@ -226,8 +238,8 @@ Note that this has no support for any Unicode characters.
 .TP
 \-w, \-\-wait\-cr
 Wait for the user or the modem to send a carriage-return or a
-linefeed character before sending the \fI/etc/issue\fP (or other) file
-and the login prompt.  This is useful with the \-\-init\-string
+linefeed character before sending the \fI/etc/issue\fP file (or others)
+and the login prompt.  This is useful with the \fB\-\-init\-string\fP
 option.
 .TP
 \-\-nohints
@@ -283,7 +295,7 @@ for the other fields.  See \fIinittab(5)\fP for more details.
 For a hardwired line or a console tty:
 
 .RS
-/sbin/agetty 9600 ttyS1
+.B /sbin/agetty\ 9600\ ttyS1
 .RE
 
 For a directly connected terminal without proper carrier-detect wiring
@@ -291,13 +303,13 @@ For a directly connected terminal without proper carrier-detect wiring
 prompt):
 
 .RS
-/sbin/agetty \-\-local\-line 9600 ttyS1 vt100
+.B /sbin/agetty\ \-\-local\-line\ 9600\ ttyS1\ vt100
 .RE
 
 For an old-style dial-in line with a 9600/2400/1200 baud modem:
 
 .RS
-/sbin/agetty \-\-extract\-baud \-\-timeout 60 ttyS1 9600,2400,1200
+.B /sbin/agetty\ \-\-extract\-baud\ \-\-timeout\ 60\ ttyS1\ 9600,2400,1200
 .RE
 
 For a Hayes modem with a fixed 115200 bps interface to the machine
@@ -306,7 +318,7 @@ modem/computer DCD track modem/modem DCD, makes a DTR drop cause a
 disconnection, and turns on auto-answer after 1 ring):
 
 .RS
-/sbin/agetty \-\-wait\-cr \-\-init\-string 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1
+.B /sbin/agetty\ \-\-wait\-cr\ \-\-init\-string\ 'ATE0Q1&D2&C1S0=1\\015'\ 115200\ ttyS1
 .RE
 
 .SH SECURITY NOTICE
@@ -394,7 +406,7 @@ Insert the string "1 user" or "<n> users" where <n> is the number of current
 users logged in.
 .TP
 v
-Insert the version of the OS, that is the build-date and such.
+Insert the version of the OS, that is, the build-date and such.
 .PP
 An example.  On my system, the following \fI/etc/issue\fP file:
 .sp

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login
  2017-04-05 23:33         ` J William Piggott
@ 2017-04-06  8:41           ` Karel Zak
  2017-04-06 14:21             ` [PATCH] agetty: various man-page fixes J William Piggott
  0 siblings, 1 reply; 14+ messages in thread
From: Karel Zak @ 2017-04-06  8:41 UTC (permalink / raw)
  To: J William Piggott; +Cc: kerolasa, util-linux

On Wed, Apr 05, 2017 at 07:33:58PM -0400, J William Piggott wrote:
> 
> On 04/03/2017 05:20 PM, Sami Kerola wrote:
> > On 3 April 2017 at 09:40, Sami Kerola <kerolasa@iki.fi> wrote:
> >> On 3 April 2017 at 02:13, J William Piggott <elseifthen@gmx.com> wrote:
> >>>
> >>> Hey Sami, since you're here you might want to fix this too?
> >>
> >> Hi JWP,
> >>
> >> Let me split the change in two:
> >>
> >> 1. --nohostname option forward + minimal manual change
> >> 2. manual page update
> >>
> >> Karel, please hold on with these three changes. I will push changes to
> >> a some branch in my git and tell when the stuff is fast forwardable.
> > 
> > Here are the updated changes, first one is the minimal option forwarding
> > and second tries to make manual page better.
> > 
> > https://github.com/kerolasa/lelux-utiliteetit/commit/343cc275591327bc2094f88387f09702a542dc8c
> > https://github.com/kerolasa/lelux-utiliteetit/commit/c9151874b67a652b7095243fde2203ab8cd7d107
> > 
> > Branch name is: 2017wk13
> >
> 
> Sami,
> 
> Rather than trying to comment on all of your changes, I'm submitting my
> suggestions via the attached patch. It applies over your 2017wk13 branch.
> 
> I changed --login-options according to Karel's comments. Please check
> that I understood him correctly. Instead of trying to illustrate it's use
> in the replaceable argument, I moved it to an example.
> 
> I added some language explaining the purpose of --remote. Please check
> that I understood that correctly also.

 Can you use master branch? Sami's patches are already merged and I
 did some changes to the man page too.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] agetty: various man-page fixes
  2017-04-06  8:41           ` Karel Zak
@ 2017-04-06 14:21             ` J William Piggott
  2017-04-10 13:47               ` Karel Zak
  0 siblings, 1 reply; 14+ messages in thread
From: J William Piggott @ 2017-04-06 14:21 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux


term-utils/agetty.8

Signed-off-by: J William Piggott <elseifthen@gmx.com>
---

On 04/06/2017 04:41 AM, Karel Zak wrote:
> 
>  Can you use master branch? Sami's patches are already merged and I
>  did some changes to the man page too.
> 
>     Karel
>

Sorry, I didn't know you merged it already.

 term-utils/agetty.8 | 60 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 24 deletions(-)

diff --git a/term-utils/agetty.8 b/term-utils/agetty.8
index 9560c1f..23adff3 100644
--- a/term-utils/agetty.8
+++ b/term-utils/agetty.8
@@ -89,22 +89,29 @@ or 'hurd' for GNU Hurd on a virtual terminal.
 Assume that the tty is 8-bit clean, hence disable parity detection.
 .TP
 \-a, \-\-autologin \fIusername\fP
-Automatically log in the specified user without asking username or password.
-Use of this option causes \fB\-f \fIusername\fR option and argument to be
-added to the \fB/bin/login\fP command line.  This option can combined with
-\fB\-\-login\-options\fR, and then \\u is replaced by the \fIusername\fR.
+Automatically log in the specified user without asking for a username or password.
+Using this option causes an \fB\-f \fIusername\fR option and argument to be
+added to the \fB/bin/login\fP command line.  See \fB\-\-login\-options\fR, which
+can be used to modify this option's behavior.
 .TP
 \-c, \-\-noreset
 Do not reset terminal cflags (control modes).  See \fBtermios\fP(3) for more
 details.
 .TP
 \-E, \-\-remote
+Typically the \fBlogin\fP(1) command is given a remote hostname when
+called by something such as \fBtelnetd\fP(8).  This option allows \fBagetty\fP
+to pass what it is using for a hostname to \fBlogin\fP(1) for use
+in \fButmp\fP(5).  See \fB\-\-host\fP, \fBlogin\fP(1), and \fButmp\fP(5).
+.IP
 If the \fB\-\-host\fP \fIfakehost\fP option is given, then an \fB\-h\fP
 \fIfakehost\fP option and argument are added to the \fB/bin/login\fP
 command line.
 .IP
-If an \fB\-\-nohostname\fR option is given, then an \fB\-H\fP option
+If the \fB\-\-nohostname\fR option is given, then an \fB\-H\fP option
 is added to the \fB/bin/login\fP command line.
+.IP
+See \fB\-\-login\-options\fR.
 .TP
 \-f, \-\-issue\-file \fIissue_file\fP
 Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
@@ -116,8 +123,8 @@ Enable hardware (RTS/CTS) flow control.  It is left up to the
 application to disable software (XON/XOFF) flow protocol where
 appropriate.
 .TP
-\-H, \-\-host \fIlogin_host\fP
-Write the specified \fIlogin_host\fP into the utmp file.  Normally,
+\-H, \-\-host \fIfakehost\fP
+Write the specified \fIfakehost\fP into the utmp file.  Normally,
 no login host is given, since \fBagetty\fP is used for local hardwired
 connections and consoles.  However, this option can be useful for
 identifying terminal concentrators and the like.
@@ -137,12 +144,13 @@ octal 012), write \\012.
 .TP
 \-J, \-\-noclear
 Do not clear the screen before prompting for the login name.
-By default screen is cleared.
+By default the screen is cleared.
 .TP
 \-l, \-\-login\-program \fIlogin_program\fP
 Invoke the specified \fIlogin_program\fP instead of /bin/login.  This allows
-the use of a non-standard login program.  Such program could for example
-ask for a dial-up password or use a different password file.
+the use of a non-standard login program.  Such a program could, for example,
+ask for a dial-up password or use a different password file. See
+\fB\-\-login\-options\fP.
 .TP
 \-L, \-\-local\-line[=\fImode\fP]
 Control the CLOCAL line flag.  The optional \fImode\fP argument is 'auto', 'always' or 'never'.
@@ -192,13 +200,17 @@ program that \fBagetty\fR starts (usually /bin/login) is run as root.
 \-N, \-\-nonewline
 Do not print a newline before writing out /etc/issue.
 .TP
-\-o, \-\-login\-options \fIoptions\fP
-Options  that  are passed to the login program.  \\u is replaced
-by the user name.  The default is "-- \\u".
-.IP
-Also see the \fB\-\-login\-program\fR, \fB\-\-autologin\fR and \fB\-\-remote\fR options.
-.IP
-Please, read the SECURITY NOTICE below before using this option.
+\-o, \-\-login\-options "\fIlogin_options\fP"
+Options  and arguments that  are passed to \fBlogin\fP(1). Where \\u is
+replaced by the login name. For example:
+.RS
+.IP "" 4
+.B "\-\-login\-options '-h darkstar -- \\\u'"
+.PP
+See \fB\-\-autologin\fR, \fB\-\-login\-program\fR and \fB\-\-remote\fR.
+.PP
+Please read the SECURITY NOTICE below before using this option.
+.RE
 .TP
 \-p, \-\-login\-pause
 Wait for any key before dropping to the login prompt.  Can be combined
@@ -226,8 +238,8 @@ Note that this has no support for any Unicode characters.
 .TP
 \-w, \-\-wait\-cr
 Wait for the user or the modem to send a carriage-return or a
-linefeed character before sending the \fI/etc/issue\fP (or other) file
-and the login prompt.  This is useful with the \-\-init\-string
+linefeed character before sending the \fI/etc/issue\fP file (or others)
+and the login prompt.  This is useful with the \fB\-\-init\-string\fP
 option.
 .TP
 \-\-nohints
@@ -283,7 +295,7 @@ for the other fields.  See \fIinittab(5)\fP for more details.
 For a hardwired line or a console tty:
 
 .RS
-/sbin/agetty 9600 ttyS1
+.B /sbin/agetty\ 9600\ ttyS1
 .RE
 
 For a directly connected terminal without proper carrier-detect wiring
@@ -291,13 +303,13 @@ For a directly connected terminal without proper carrier-detect wiring
 prompt):
 
 .RS
-/sbin/agetty \-\-local\-line 9600 ttyS1 vt100
+.B /sbin/agetty\ \-\-local\-line\ 9600\ ttyS1\ vt100
 .RE
 
 For an old-style dial-in line with a 9600/2400/1200 baud modem:
 
 .RS
-/sbin/agetty \-\-extract\-baud \-\-timeout 60 ttyS1 9600,2400,1200
+.B /sbin/agetty\ \-\-extract\-baud\ \-\-timeout\ 60\ ttyS1\ 9600,2400,1200
 .RE
 
 For a Hayes modem with a fixed 115200 bps interface to the machine
@@ -306,7 +318,7 @@ modem/computer DCD track modem/modem DCD, makes a DTR drop cause a
 disconnection, and turns on auto-answer after 1 ring):
 
 .RS
-/sbin/agetty \-\-wait\-cr \-\-init\-string 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1
+.B /sbin/agetty\ \-\-wait\-cr\ \-\-init\-string\ 'ATE0Q1&D2&C1S0=1\\015'\ 115200\ ttyS1
 .RE
 
 .SH SECURITY NOTICE
@@ -394,7 +406,7 @@ Insert the string "1 user" or "<n> users" where <n> is the number of current
 users logged in.
 .TP
 v
-Insert the version of the OS, that is the build-date and such.
+Insert the version of the OS, that is, the build-date and such.
 .PP
 An example.  On my system, the following \fI/etc/issue\fP file:
 .sp

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] agetty: various man-page fixes
  2017-04-06 14:21             ` [PATCH] agetty: various man-page fixes J William Piggott
@ 2017-04-10 13:47               ` Karel Zak
  0 siblings, 0 replies; 14+ messages in thread
From: Karel Zak @ 2017-04-10 13:47 UTC (permalink / raw)
  To: J William Piggott; +Cc: util-linux

On Thu, Apr 06, 2017 at 10:21:07AM -0400, J William Piggott wrote:
>  term-utils/agetty.8 | 60 ++++++++++++++++++++++++++++++++---------------------
>  1 file changed, 36 insertions(+), 24 deletions(-)

Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-04-10 13:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-02  8:14 [PATCH 1/3] agetty: remove variable that is set but not read Sami Kerola
2017-04-02  8:14 ` [PATCH 2/3] lib/cpuset: stop changing variable that is " Sami Kerola
2017-04-02  8:14 ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Sami Kerola
2017-04-03  1:13   ` J William Piggott
2017-04-03  8:40     ` Sami Kerola
2017-04-03 21:20       ` Sami Kerola
2017-04-05  1:03         ` J William Piggott
2017-04-05  8:51           ` Karel Zak
2017-04-05 15:24             ` J William Piggott
2017-04-05 23:33         ` J William Piggott
2017-04-06  8:41           ` Karel Zak
2017-04-06 14:21             ` [PATCH] agetty: various man-page fixes J William Piggott
2017-04-10 13:47               ` Karel Zak
2017-04-03  8:56   ` [PATCH 3/3] agetty: make --remote to forward --nohostname as -H to login Karel Zak

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.