| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Running quota_nld by systemd might cause the problem that systemd
couldn't open the PID file generated by quota_nld. In fact, the PID
file hasn't existed yet because it originates from the child process
of quota_nld which is a daemon process. As the main process exit,
systemd try to access the PID file but the daemon hadn't create it
that time.
In this situation, we move the procedure of creating PID file into the
parent process to ensure the PID file must existed when quota_nld exit.
After that, the above problem would never occur again.
[JK: Fixed up SIGTERM handling and format strings]
Signed-off-by: lihaoxiang <lihaoxiang9@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
| |
When user is not over softlimit, there's no point to set the grace time.
The kernel will just ignore it. Output error message instead so that
user is not confused. Also editing of grace times when quotas are
enabled did not really work because we didn't tell the kernel grace
times have changed. Fix it.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
| |
When setting grace times for a user with only inodes or blocks over
softlimit, setquota(8) was wrongly complaining about not being able to
set the grace time of the non-exceeded entity although it was left
unset. Silence this bogus error message.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Configure scripts need to be runnable with a POSIX-compliant /bin/sh. Replace
== comparison operator (bashism) with = (POSIX) to fix errors:
configure: WARNING: tcpd.h not found
./configure: 8453: test: X: unexpected operator
checking that generated files are newer than configure... done
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
Update required gettext version to 0.19 so that newer autoconf macros
get copied. The old ones from 2014 start to have compatibility issues.
Reported-by: Sam James <thesamesam@users.sourceforge.net>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
| |
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
| |
Due to variable assignments getting reordered by automake the variable
man_MANS contained some manpages two times. This then resulted in
complaints when installing the manpages. Avoid the problem by reworking
how the list of manpages is constructed.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
| |
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
Include manpages for features not configured by configure script into
the distribution tarball. This makes the distribution tarball complete.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
| |
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When quota is configured using --enable-werror, gcc -flto fails with
the following diagnostics:
In function 'strncpy',
inlined from 'sstrncpy' at common.c:107:2,
inlined from 'copy_mntoptarg' at quotasys.c:774:3,
inlined from 'copy_mntoptarg' at quotasys.c:769:13:
/usr/include/bits/string_fortified.h:91:10: error: '__builtin_strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
91 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^
quotasys.c: In function 'copy_mntoptarg':
quotasys.c:774:25: note: length computed here
774 | sstrncpy(buf, optarg, min(buflen, strlen(optarg) + 1));
| ^
This diagnostics is correct: strcpy() copies at most "len" bytes of the string
pointed to by "src", including the terminating null byte, to the buffer
pointed to by "dest".
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When quota is configured using --enable-werror, gcc -flto fails with
the following diagnostics:
In function 'strncat',
inlined from 'sstrncat' at common.c:113:2,
inlined from 'get_proc_num' at quotastats.c:46:2:
/usr/include/bits/string_fortified.h:122:10: error: '__builtin___strncat_chk' specified bound 4096 equals destination size [-Werror=str
ingop-overflow=]
122 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^
This diagnostics is correct: when "src" contains "len" or more bytes,
strncat() writes "len"+1 bytes to "dest" ("len" from "src" plus
the terminating null byte).
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
Visible quota files on ext4 filesystem are deprecated. Make sure we
always display the warning message and also expand the message to
explain how the filesystem can be converted.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
term_action.sa_mask is an automatic variable and and thus unitialized.
This patch empties the signal mask.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
| |
quota.h header includes sys/cdefs.h because it uses __P() macro in
quotactl syscall declaration. However glibc currently defines __P() is
nop and it only causes issues with other libc implementations (e.g. musl
libc). So just drop __P() usage and sys/cdefs.h include.
Reported-by: 2xsaiko <git@dblsaiko.net>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
| |
When time_t is 32-bit, warn if the kernel returns anything that cannot
fit in these time stamps. This also fixes a compilation warning that
shift exceeds data type size. Similarly when converting data to pass to
kernel, just avoid the pointless shift (generating compiler warning)
when time_t is 32-bit.
Reported-by: "Dmitry V. Levin" <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When quota is configured using --enable-werror --disable-bsd_behaviour,
the compilation fails with the following diagnostics:
quotaops.c: In function 'getprivs':
quotaops.c:143:1: error: label 'out_err' defined but not used [-Werror=unused-label]
Fixes: 7942290a ("quotaops: Do not leak dquot structures on failure")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
The ret variable inicialization is useless because it is assigned in
all (two) subsequent code branches.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
| |
reallocarray(3) has been added to glibc relatively recently (version
2.26, from 2017) and apparently not all users run new enough glibc. Just
use realloc(3) for now since in this case there's no real risk of
overflow.
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
| |
|
|
|
|
|
|
|
| |
The tool hasn't been compiled already in the previous version and nobody
complained. Just delete it completely.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
| |
Ext4 supports quota using internal quota files for quite some time.
Suggest using this quota feature instead of external quota files if the
kernel is new enough since external quota files on ext4 will be
deprecated.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
Add option --filesystem to specify filesystem to report quotas for while
still maintaining the capability of specifying also names to report
quotas for.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
| |
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
Add checks and error handling to report when grace times set for XFS
quotas would overflow.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
Add the ability to interpret the larger quota grace period expiration
timestamps that the kernel can export via struct xfs_kern_dqblk.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
xfs_commit_dquot() always set FS_DQ_LIMIT_MASK when calling
Q_XFS_SETQLIM. So far this wasn't a problem since quota tools didn't
support setting of anything else for XFS but now that kernel will start
supporting setting of grace times for XFS, we need to be more careful
and set limits bits only if we really want to update them. Also
FS_DQ_LIMIT_MASK contains real-time limits as well. Quota tools
currently don't support them in any way so avoid telling kernel to set
them.
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
| |
xfs quota code doesn't currently allow increasing an individual
user's grace time, but kernel patches are in development for this.
In order for setquota to be able to send this update via
setquota -T, we need to add the FS_DQ_TIMER_MASK when we are trying
to update the grace times on an individual user's dquot.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Older kernels ignored the type sent to Q_XFS_GETQSTAT, and returned
timer information for the first quota type which was found to be
enabled.
As of 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls")
the kernel now honors the quota type requested, so send that from the
Q_XFS_GETQSTAT calls in quota tools.
Older kernels ignore the type altogether, so this change should be
backwards compatible with no change in behavior.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
quota(1) command ignores file systems without enabled quotas. (In
contrast to "quota -f".) This works for local file systems and it used
to work for NFS file system until commit 4cd287f3fa38 ("rpc: Clarify error
message when cannot connect to rpc.rquotad"). quota(1) command now reports
an error whenever at least one NFS-mounted file system has disabled the
quotas. This renders the tool unusable.
This patch readds an exception for the ENOENT errno that was removed
with the commit probably by a mistake.
[JK: Improve commit message, make getprivs() print more descriptive
message in case quota is not enabled]
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Running warnquota under valgrind reported many "Conditional jump or
move depends on uninitialised value" mistakes because readconfigfile()
did not initizalize ldap_bindpw member if some of the configuration
options were missing from the configuration file.
This patch simply initializes all bytes of the configparams structure
to 0 instead of settting each of the members explicitly.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
ldap_get_option(3) documents that a pointer set by
LDAP_OPT_DIAGNOSTIC_MESSAGE must be freed with ldap_memfree(3).
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While Filesystem Hierarchy Standard prescribes /var/run path for
storing PID files, some (systemd-based) distributions uses /run.
This patch adds a --with-pid-dir=DIRECTORY option to the ./configure
script. The option enables to change the path. Default one is
/var/run as used to be until now.
(I did not use $localstatedir environment variable because Autoconf
manual allows using "precious" variables only in a makefile.)
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
Clarify that CC_TO field from warnquota.conf gets resolved through LDAP
lookup similarly to normal message recifient.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
LDAP library provides additional error information in some cases. Print
it make debugging LDAP setup easier.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
ldap_search_ext_s() and ldap_sasl_bind_s() can return also positive
error result codes. Catch them properly.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
| |
Currently warnquota ignores unknown variables, or lines we cannot parse
in the config file. This is potentially dangerous as that may result
in errors being missed and warnquota operating differently than
administrator intended. Change warnquota to abort on errors in config
file and provide -I option for ignoring errors for backward
compatibility.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
The help text was wrongly saying that -v is equivalent to --version.
It should be -V.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
| |
Currently when filesystem tracks quotas in hidden quota files (but is
also capable of tracking it in regular files), we scan the whole
filesystem and only after that find out we cannot actually make use of
newly created quota files. Just detect this case before scanning the fs
and skip it.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
| |
Add forgotten translation quotes to the error string.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
| |
Currently when RPC rquota service is not registered, we report somewhat
confusing "No such file of directory" error. For other errors when
creating rquota request we report "Connection refused". There's no big
difference for user between these errors and neither of them tells what
really happened. So just unify handling of these errors and report more
general error telling the user where the problem is.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
| |
setquota currently silently ignored when it could not obtain quota
information to update and just skipped updating for the filesystem. Make
it report error and exit properly.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
Some error paths in getprivs() were not properly freeing already fetched
structures. Free them properly in case of error.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
| |
When we failed to get some dquots from NFS server, we just reported
error, didn't include the dquot in the list built in getprivs() but
otherwise continued operation. Fail getprivs() in case of error instead
so that the failure propagates properly to the caller.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, some types for failures when fetching quota information for
NFS filesystem were silent (e.g. when rpc.rquotad was not running) while
others were reporting error message (e.g. when rpc connection failed).
There's no big difference in these for the user / administrator and also
is inconsistent with how we deal with local filesystems - there we
report error if the filesystem was explicitely specified on command line
and silently ignore it for "scan all" operations.
So change error reporting for NFS to report errors about quota not being
supported if and only if filesystem was explicitely specified on command
line.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
| |
Delete old documentation files that were superseeded by
doc/quotadoc.sgml.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
| |
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
| |
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
|
|
|
|
|
| |
PIE is not necessarily supported on all architectures, so add an option
to allow the user to disable the PIE.
This fixes the build on the m68k architecture:
- http://autobuild.buildroot.org/results/25985bbc160e3d62b23c4c613b2a81f3711621e3
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
| |
Signed-off-by: Jan Kara <jack@suse.cz>
|