Util-Linux Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] agetty: return proper value if compiled without ISSUEDIR support
@ 2019-12-11 13:44 Patrick Steinhardt
  2019-12-12 11:23 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Steinhardt @ 2019-12-11 13:44 UTC (permalink / raw)
  To: util-linux; +Cc: Patrick Steinhardt, Karel Zak

If agetty is compiled without support for ISSUEDIR, then it implements
a stub for `issuedir_read` that simply does nothing. In fact it does
too little, as it doesn't have a proper return statement even though the
function returns an integer.

Fix the issue by always returning `1` from `issuedir_read`. This
is the same error code that the real implementation of that function
returns in case it cannot open the directory and is thus a sensible
default to pretend that the directory doesn't exist.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 term-utils/agetty.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index a0d0876c3..3c20acc98 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1783,6 +1783,7 @@ static int issuedir_read(struct issue *ie __attribute__((__unused__)),
 			struct options *op __attribute__((__unused__)),
 			struct termios *tp __attribute__((__unused__)))
 {
+	return 1;
 }
 #endif /* ISSUEDIR_SUPPORT */
 
-- 
2.24.1


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

* Re: [PATCH] agetty: return proper value if compiled without ISSUEDIR support
  2019-12-11 13:44 [PATCH] agetty: return proper value if compiled without ISSUEDIR support Patrick Steinhardt
@ 2019-12-12 11:23 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2019-12-12 11:23 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: util-linux

On Wed, Dec 11, 2019 at 02:44:22PM +0100, Patrick Steinhardt wrote:
>  term-utils/agetty.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks!

    Karel

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


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 13:44 [PATCH] agetty: return proper value if compiled without ISSUEDIR support Patrick Steinhardt
2019-12-12 11:23 ` Karel Zak

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org
	public-inbox-index util-linux

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git