* [PATCH] Patch for quota-tools to avoid project quota crash
@ 2016-07-06 1:22 Theodore Ts'o
2016-07-06 1:35 ` Theodore Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2016-07-06 1:22 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-fsdevel
Hi Jan,
This patch is needed to avoid "quota -v -P 123" from crashing if
/etc/projid does not exist.
Cheers,
- Ted
>From b5edd1734a69364d614140273b812dc50d61842c Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Tue, 5 Jul 2016 21:16:43 -0400
Subject: [PATCH] Don't crash if /etc/projid file does not exist
In endprent(), if project_file is NULL, don't try to fclose it, or
else glibc will not be amused.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
quotasys.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/quotasys.c b/quotasys.c
index c78e02c..fb40230 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -98,6 +98,8 @@ void setprent(void)
/* Close /etc/projid file */
void endprent(void)
{
+ if (!project_file)
+ return;
fclose(project_file);
project_file = NULL;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Patch for quota-tools to avoid project quota crash
2016-07-06 1:22 [PATCH] Patch for quota-tools to avoid project quota crash Theodore Ts'o
@ 2016-07-06 1:35 ` Theodore Ts'o
2016-07-06 9:47 ` Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2016-07-06 1:35 UTC (permalink / raw)
To: Jan Kara, Wang Shilong; +Cc: linux-fsdevel
On Tue, Jul 05, 2016 at 09:22:29PM -0400, Theodore Ts'o wrote:
> Hi Jan,
>
> This patch is needed to avoid "quota -v -P 123" from crashing if
> /etc/projid does not exist.
Oops, I didn't see that Wang shilong had submitted a similar patch.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Patch for quota-tools to avoid project quota crash
2016-07-06 1:35 ` Theodore Ts'o
@ 2016-07-06 9:47 ` Jan Kara
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2016-07-06 9:47 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Jan Kara, Wang Shilong, linux-fsdevel
On Tue 05-07-16 21:35:32, Ted Tso wrote:
> On Tue, Jul 05, 2016 at 09:22:29PM -0400, Theodore Ts'o wrote:
> > Hi Jan,
> >
> > This patch is needed to avoid "quota -v -P 123" from crashing if
> > /etc/projid does not exist.
>
> Oops, I didn't see that Wang shilong had submitted a similar patch.
Yes. I've merged the patch from Wang Shilong. Thanks for the fix anyway.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-06 9:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-06 1:22 [PATCH] Patch for quota-tools to avoid project quota crash Theodore Ts'o
2016-07-06 1:35 ` Theodore Ts'o
2016-07-06 9:47 ` Jan Kara
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.