* The "write" of util-linux-2.20 not work.
@ 2011-09-06 0:59 xinglp
2011-09-06 1:21 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: xinglp @ 2011-09-06 0:59 UTC (permalink / raw)
To: util-linux, LFS Developers Mailinglist
it just prints
write: : No such file or directory
util-linux-2.19.1 works well
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: The "write" of util-linux-2.20 not work.
2011-09-06 0:59 The "write" of util-linux-2.20 not work xinglp
@ 2011-09-06 1:21 ` Karel Zak
0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2011-09-06 1:21 UTC (permalink / raw)
To: xinglp; +Cc: util-linux, LFS Developers Mailinglist
On Tue, Sep 06, 2011 at 08:59:01AM +0800, xinglp wrote:
> it just prints
> write: : No such file or directory
>
> util-linux-2.19.1 works well
Hmm.. I found this stupid change:
- (void)sprintf(path, "/dev/%s", tty);
+ printf(path, "/dev/%s", tty);
in the commit 5f51b8b25de1c6c688d5172ed04008a94b241e05. Fixed below.
Karel
>From b89fdd9c05a6e5f12ab56441389e5ee9d1d7f30f Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 6 Sep 2011 03:18:46 +0200
Subject: [PATCH] write: fix path for freopen()
Reported-by: xinglp <xinglp@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
term-utils/write.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/term-utils/write.c b/term-utils/write.c
index a825f62..a70eb7b 100644
--- a/term-utils/write.c
+++ b/term-utils/write.c
@@ -322,7 +322,7 @@ void do_write(char *tty, char *mytty, uid_t myuid)
if (strlen(tty) + 6 > sizeof(path))
errx(EXIT_FAILURE, _("tty path %s too long"), tty);
- printf(path, "/dev/%s", tty);
+ snprintf(path, sizeof(path), "/dev/%s", tty);
if ((freopen(path, "w", stdout)) == NULL)
err(EXIT_FAILURE, "%s", path);
--
1.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-06 1:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-06 0:59 The "write" of util-linux-2.20 not work xinglp
2011-09-06 1:21 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).