summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog4
-rw-r--r--edquota.84
-rw-r--r--edquota.c10
-rw-r--r--quotacheck.c17
-rw-r--r--quotacheck_v2.c10
-rw-r--r--quotaops.c6
-rw-r--r--rquota_client.c6
7 files changed, 35 insertions, 22 deletions
diff --git a/Changelog b/Changelog
index c97aa72..b024fd0 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,8 @@
Changes in quota-tools from 3.12 to 3.13
+* minor manpage and help-text fixes (Jan Kara)
+* fixed quotacheck(8) to check each block only once (Jan Kara)
+* fixed quotacheck(8) messages about corrupted blocks (Jan Kara)
+* fixed quotacheck(8) to rename quota files after turning quotas off (Jan Kara)
* added sanity check to quota reporting (Jan Kara)
* fixed check for illegal references in quotacheck(8) (Jan Kara)
* added NFSv4 to the list of supported fs types (Jan Kara)
diff --git a/edquota.8 b/edquota.8
index 930dbec..3e05267 100644
--- a/edquota.8
+++ b/edquota.8
@@ -127,13 +127,13 @@ Edit the soft time limits for each filesystem.
In old quota format if the time limits are zero, the default time limits in
.B <linux/quota.h>
are used. In new quota format time limits must be specified (there is no default
-value set in kernel). Time units of 'seconds', 'minutes', 'hours', 'days', 'weeks', and 'months'
+value set in kernel). Time units of 'seconds', 'minutes', 'hours', and 'days'
are understood. Time limits are printed in the greatest possible time unit such that
the value is greater than or equal to one.
.TP
.B \-T
Edit time for the user/group when softlimit is enforced. Possible values
-are 'unset' or number and unit. Units are same as used in
+are 'unset' or number and unit. Units are the same as in
.B \-t
option.
.SH FILES
diff --git a/edquota.c b/edquota.c
index 793981f..6397826 100644
--- a/edquota.c
+++ b/edquota.c
@@ -34,7 +34,7 @@
#ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $"
#ident "$Copyright: All rights reserved. $"
-#ident "$Id: edquota.c,v 1.15 2004/07/13 12:08:55 jkar8572 Exp $"
+#ident "$Id: edquota.c,v 1.16 2005/03/31 11:48:02 jkar8572 Exp $"
/*
* Disk quota editor.
@@ -65,14 +65,14 @@ char *dirname;
void usage(void)
{
#if defined(RPC_SETQUOTA)
- errstr("%s%s%s",
- _("Usage:\tedquota [-r] [-u] [-F formatname] [-p username] [-f filesystem] username ...\n"),
+ errstr("%s%s%s%s",
+ _("Usage:\n\tedquota [-r] [-u] [-F formatname] [-p username] [-f filesystem] username ...\n"),
_("\tedquota [-r] -g [-F formatname] [-p groupname] [-f filesystem] groupname ...\n"),
_("\tedquota [-r] [-u|g] [-F formatname] [-f filesystem] -t\n"),
_("\tedquota [-r] [-u|g] [-F formatname] [-f filesystem] -T username|groupname ...\n"));
#else
- errstr("%s%s%s",
- _("Usage:\tedquota [-u] [-F formatname] [-p username] [-f filesystem] username ...\n"),
+ errstr("%s%s%s%s",
+ _("Usage:\n\tedquota [-u] [-F formatname] [-p username] [-f filesystem] username ...\n"),
_("\tedquota -g [-F formatname] [-p groupname] [-f filesystem] groupname ...\n"),
_("\tedquota [-u|g] [-F formatname] [-f filesystem] -t\n"),
_("\tedquota [-u|g] [-F formatname] [-f filesystem] -T username|groupname ...\n"));
diff --git a/quotacheck.c b/quotacheck.c
index 143963f..62a0e0b 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -8,7 +8,7 @@
* New quota format implementation - Jan Kara <jack@suse.cz> - Sponsored by SuSE CR
*/
-#ident "$Id: quotacheck.c,v 1.45 2005/03/18 11:21:57 jkar8572 Exp $"
+#ident "$Id: quotacheck.c,v 1.46 2005/03/31 11:48:02 jkar8572 Exp $"
#include <dirent.h>
#include <stdio.h>
@@ -559,8 +559,8 @@ int ask_yn(char *q, int def)
printf("%s [%c]: ", q, def ? 'y' : 'n');
fflush(stdout);
while (1) {
- fgets(a, sizeof(a), stdin);
- if (*a == '\n')
+ fgets(a, sizeof(a)-1, stdin);
+ if (a[0] == '\n')
return def;
if (!strcasecmp(a, "y\n"))
return 1;
@@ -651,7 +651,7 @@ static int rename_files(struct mntent *mnt, int type)
int fd;
#endif
- debug(FL_DEBUG, _("Data dumped.\n"));
+ debug(FL_DEBUG, _("Renaming new files to proper names.\n"));
if (get_qf_name(mnt, type, (1 << cfmt), 0, &filename) < 0)
die(2, _("Cannot get name of old quotafile on %s.\n"), mnt->mnt_dir);
if (stat(filename, &st) < 0) { /* File doesn't exist? */
@@ -761,8 +761,7 @@ static int dump_to_file(struct mntent *mnt, int type)
errstr(_("Cannot finish IO on new quotafile: %s\n"), strerror(errno));
return -1;
}
- if (rename_files(mnt, type) < 0)
- return -1;
+ debug(FL_DEBUG, _("Data dumped.\n"));
if (cfmt == kern_quota_on(mnt->mnt_fsname, type, 1 << cfmt)) { /* Quota turned on? */
char *filename;
@@ -776,6 +775,9 @@ static int dump_to_file(struct mntent *mnt, int type)
else {
int ret;
+ /* Rename files - if it fails we cannot do anything better then just turn on quotas again */
+ rename_files(mnt, type);
+
if (kernel_iface == IFACE_GENERIC)
ret = quotactl(QCMD(Q_QUOTAON, type), mnt->mnt_fsname, util2kernfmt(cfmt), filename);
else
@@ -787,6 +789,9 @@ static int dump_to_file(struct mntent *mnt, int type)
free(filename);
}
}
+ else
+ if (rename_files(mnt, type) < 0)
+ return -1;
return 0;
}
diff --git a/quotacheck_v2.c b/quotacheck_v2.c
index be53173..23b5ff3 100644
--- a/quotacheck_v2.c
+++ b/quotacheck_v2.c
@@ -110,9 +110,9 @@ static void blk_corrupted(int *corrupted, uint * lblk, uint blk, char *fmtstr, .
}
else if (*lblk != blk) {
if (!*corrupted)
- errstr( "%u", blk);
+ fprintf(stderr, "%u", blk);
else
- errstr( ", %u", blk);
+ fprintf(stderr, ", %u", blk);
}
*corrupted = 1;
*lblk = blk;
@@ -164,7 +164,9 @@ static int buffer_entry(dqbuf_t buf, uint blk, int *corrupted, uint * lblk, int
return 0;
}
else if (flags & FL_INTERACTIVE) {
- errstr(_("\nFound more structures for ID %u. Values: BHARD: %Ld/%Ld BSOFT: %Ld/%Ld IHARD: %Ld/%Ld ISOFT: %Ld/%Ld\n"),
+ if (!(flags & (FL_DEBUG | FL_VERBOSE)))
+ fputc('\n', stderr);
+ errstr(_("Found more structures for ID %u. Values: BHARD: %Ld/%Ld BSOFT: %Ld/%Ld IHARD: %Ld/%Ld ISOFT: %Ld/%Ld\n"),
(uint) id, (long long)fdq->dqb_bhardlimit, (long long)mdq.dqb_bhardlimit,
(long long)fdq->dqb_bsoftlimit, (long long)mdq.dqb_bsoftlimit,
(long long)fdq->dqb_ihardlimit, (long long)mdq.dqb_ihardlimit,
@@ -282,7 +284,7 @@ static int check_tree_blk(int fd, uint blk, int depth, int type, uint blocks, ui
}
}
else if (check_tree_ref(blk, __le32_to_cpu(r[i]), blocks, 0, corrupted, lblk) >= 0 && __le32_to_cpu(r[i]))
- if (check_data_blk(fd, __le32_to_cpu(r[i]), type, blocks, corrupted, lblk) < 0) {
+ if (!GET_BLK(__le32_to_cpu(r[i])) && check_data_blk(fd, __le32_to_cpu(r[i]), type, blocks, corrupted, lblk) < 0) {
freedqbuf(buf);
return -1;
}
diff --git a/quotaops.c b/quotaops.c
index f699f3d..8bb2999 100644
--- a/quotaops.c
+++ b/quotaops.c
@@ -34,7 +34,7 @@
#ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $"
#ident "$Copyright: All rights reserved. $"
-#ident "$Id: quotaops.c,v 1.15 2004/08/26 15:38:10 jkar8572 Exp $"
+#ident "$Id: quotaops.c,v 1.16 2005/03/31 11:48:02 jkar8572 Exp $"
#include <rpc/rpc.h>
#include <sys/types.h>
@@ -503,7 +503,7 @@ format_err:
goto format_err;
if (str2timeunits(btime, bunits, &bseconds) < 0) {
units_err:
- errstr(_("Bad time units. Units are 'second', 'minute', 'hour' and 'day'.\n"));
+ errstr(_("Bad time units. Units are 'second', 'minute', 'hour', and 'day'.\n"));
return -1;
}
bseconds += now;
@@ -639,7 +639,7 @@ int readtimes(struct quota_handle **handles, int infd)
#endif
if (str2timeunits(btime, bunits, &bseconds) < 0 ||
str2timeunits(itime, iunits, &iseconds) < 0) {
- errstr(_("Bad time units. Units are 'second', 'minute', 'hour' and 'day'.\n"));
+ errstr(_("Bad time units. Units are 'second', 'minute', 'hour', and 'day'.\n"));
return -1;
}
for (i = 0; handles[i]; i++) {
diff --git a/rquota_client.c b/rquota_client.c
index 19b5607..4620a1f 100644
--- a/rquota_client.c
+++ b/rquota_client.c
@@ -9,7 +9,7 @@
*
* This part does the rpc-communication with the rquotad.
*
- * Version: $Id: rquota_client.c,v 1.8 2004/02/12 09:45:14 jkar8572 Exp $
+ * Version: $Id: rquota_client.c,v 1.9 2005/03/31 11:48:02 jkar8572 Exp $
*
* Author: Marco van Wieringen <mvw@planets.elm.net>
*
@@ -149,8 +149,10 @@ int rpc_rquota_get(struct dquot *dquot)
* Strip off pathname on nfs mounted dir. Ignore entries of any
* automounter.
*/
- if ((pathname = strchr(fsname_tmp, ':')) == (char *)0 || *(pathname + 1) == '(')
+ if ((pathname = strchr(fsname_tmp, ':')) == (char *)0 || *(pathname + 1) == '(') {
+ free(fsname_tmp);
return -ENOENT;
+ }
*pathname++ = '\0';