Age | Commit message (Collapse) | Author | Files | Lines |
|
quotaio_xfs has a mix of quotactl calls using do_quotactl() and using
quotactl_handle(). This is confusing because the command argument
behaves differently. Convert all places to use quotactl_handle().
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Patches implementing tmpfs quota support, commit 00534e79856c ("Enable
support for tmpfs quotas") in particular, broke quota-tools on XFS
because quotactl(2) syscall got called with wrong arguments. Fix it.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
When quotactl(2) fails, xfs_read_dquot() will happily return zero-filled
structure. This is fine when the user structure does not exist but it is
wrong when there's other error (like EACCESS). Fix the error handling.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
These days BSD_BEHAVIOUR is really old legacy and there's no point in
doing permission checks in userspace when kernel does it for us. So
disable BSD_BEHAVIOUR by default.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
It is undefined whether getgroups() call will return current egid in the
list of groups it returns. Add an explicit check for egid to the
permission checks performed when BSD_BEHAVIOUR is enabled.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
To achieve so, add a new function quotactl_handle() to the quotaio subsystem,
this will call do_quotactl() with or without a valid quotadev, according to the
filesystem type.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
To be able to set quotas on filesystems without a backing device, quota tools
should be able to use quotactl_fd().
To achieve that, add a new helper, do_quotactl(), to select between quotactl()
and quotactl_fd().
This shouldn't change the semantics of current code. quotactl_fd() will be
called if and only if the handlers contain an empty device, and a valid
mountpoint.
All current calls containing a value device should be still handled by quotactl().
The same is true for calls passing a NULL device on purpose, aiming to sync
active quotas.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
The field holds information if we are searching a directory mountpoint or a
device, rename the field to something more meaningful.
We could switch it to bool, but it seems pointless to include a whole header
just for it, so keep the int type.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
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>
|
|
CFLAGS is a variable that users are entitled to modify in order
to compile the package, so do not tamper with CFLAGS, apply
package specific changes to AM_CFLAGS instead.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
CFLAGS and LIBS are variables that users are entitled to modify in order
to compile the package, so do not tamper with CFLAGS and LIBS.
COM_ERR_CFLAGS, EXT2FS_CFLAGS, DBUS_CFLAGS, LIBNL3_CFLAGS, TIRPC_CFLAGS,
COMM_ERR_LIBS, EXT2FS_LIBS, DBUS_LIBS, LIBNL3_LIBS, and TIRPC_LIBS
should be used directly where appropriate and apparently they already
are.
This reverts commit b54d97d677481287faa5d6b98c92f111141c1af3.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Quota is not multithreaded so it does not have to use thread-safe
function variants. Furthermore some clone of libtirpc reportedly does
not implement the reentrant function getrpcbynumber_r(). So just avoid
using it.
Reported-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
CFLAGS and LIBS found by pkg_check_modules must be used
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
Fixes the following build issue with musl:
dqblk_v2.h:32:2: error: unknown type name ‘loff_t’
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/quota/0005-include-fcntl.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
quota.h uses the __P definition, so it must include <sys/cdefs.h>.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Retrieved (and slighly updated) from:
https://git.buildroot.net/buildroot/tree/package/quota/0004-import-sys-cdefs.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
[Thomas: borrowed from OpenEmbedded.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Retrieved (and slightly updated) from:
https://git.buildroot.net/buildroot/tree/package/quota/0003-remove-non-posix-types.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
quot tool functionality is currently superseeded by repquota. Because
the tool is licenses under 4-clause BSD license that is incompatible
with GPLv2 (which the rest of the tools uses) and the original author is
not reachable, just drop the tool from being distributed for now.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Quota tools is licensed as GPLv2. Historically, it contains some old
copyright disclaimers with BSD license which is incompatible with GPLv2.
However these files were over time rewritten, mostly by me, so let's
relicense them under GPLv2 as well.
Acked-by: Marco van Wieringen <mvw@planets.elm.net>
Acked-by: Petr Pisar <petr.pisar@atlas.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Handle failure to in daemon(3) call and bail out with proper error code.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
daemon() function can fail. Then we should also report an failure
instead of continuing on foreground.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
If a user does not occupy any space or inodes on a file system but
quota limits are set, quota(1) tool still reports "none":
# quota -u test
Disk quotas for user test (uid 500): none
That's because the tool skips printing details for file systems
without any used resources. The message is also used for a file
system without any quota limits which is confusing at times.
This patch makes the distinction and changes "none" message into "no
quota limits set" and "no limited resources used" respectively.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Limit of maximum allowable space usage for RPC transfer was wrongly set
to ~4GB instead of ~4TB due to overflow in constant initialization. Fix
it.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
rpc.rquotad spins in libtirpc's rendezvous_request() on accepting TCP
connections because the polled TCP socket is not listening:
poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=5,
events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=6,
events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=7,
events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 4, -1) = 2 ([{fd=5,
revents=POLLHUP}, {fd=7, revents=POLLHUP}])
accept(5, 0x7ffe61698700, [128]) = -1 EINVAL (Invalid argument)
accept(7, 0x7ffe61698700, [128]) = -1 EINVAL (Invalid argument)
The polled descriptors are:
rpc.rquot 21981 root 4u IPv4 80449159 0t0 UDP *:rquotad
rpc.rquot 21981 root 5u sock 0,9 0t0 80449162 protocol: TCP
rpc.rquot 21981 root 6u IPv6 80449165 0t0 UDP *:rquotad
rpc.rquot 21981 root 7u sock 0,9 0t0 80449168 protocol: TCPv6
That results into a high CPU usage just after staring rpc.rquotad
process.
This patch adds a listen() call to svc_create_sock()
routine which is needed with libtirpc version of svc_tli_create()
as well as a needed IPv6 setsockopt().
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
HPE XFS has a different superblock magic and type name
to allow the community XFS and HPE XFS to coexist in
the same linux kernel.
This patch add HPE XFS support to the quota-tools so
our customers can use it.
Signed-off-by: Mark Tinguely <mark.tinguely@hpe.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
GCC 8 with GNU libc 2.27 warns:
gcc -DHAVE_CONFIG_H -I. -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/libnl3 -g -O2 -Wall -fPIC -I/usr/include/tirpc -c -o quota_nld-quota_nld.o `test -f 'quota_nld.c' || echo './'`quota_nld.c
quota_nld.c: In function ‘write_console_warning’:
quota_nld.c:273:7: warning: ‘strcmp’ argument 2 declared attribute ‘nonstring’ [-Wstringop-overflow=]
if (strcmp(user, uent->ut_user))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/utmp.h:29,
from quota_nld.c:23:
/usr/include/bits/utmp.h:65:8: note: argument ‘ut_user’ declared here
char ut_user[UT_NAMESIZE]
^~~~~~~
This is because ut_user value misses the terminating null byte if it
fits exactly into ut_user array, as document in utmp(5):
String fields are terminated by a null byte ('\0') if they are
shorter than the size of the field.
Recent GCC and glibc recevied compile-time checks and annotations
(__attribute_nonstring_) that catches these mistakes.
This patch fixes it by using strncmp(3) and by ignoring user names
that does not fit into utmp log format. It's better not to warn than
spamming unrelated user.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
GCC 8 with GNU libc 2.27 prerelease warns:
gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -fPIC -I/usr/include/tirpc -c -o warnquota.o warnquota.c
warnquota.c: In function ‘lookup_user’:
warnquota.c:415:29: warning: ‘%s’ directive output may be truncated writing up to 2047 bytes into a region of size 255 [-Wformat-truncation=]
snprintf(searchbuf, 256, "(%s=%s)", config->ldap_search_attr, user);
^~
warnquota.c:415:2: note: ‘snprintf’ output 4 or more bytes (assuming 2051) into a destination of size 256
snprintf(searchbuf, 256, "(%s=%s)", config->ldap_search_attr, user);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warnquota.c: In function ‘warn_quota’:
warnquota.c:896:51: warning: ‘%s’ directive output may be truncated writing up to 2047 bytes into a region of size 2041 [-Wformat-truncation=]
snprintf(config->ldap_uri, CNF_BUFFER, "ldap://%s:%d", config->ldap_host, config->ldap_port);
^~ ~~~~~~~~~~~~~~~~~
warnquota.c:896:4: note: ‘snprintf’ output between 10 and 2067 bytes into a destination of size 2048
snprintf(config->ldap_uri, CNF_BUFFER, "ldap://%s:%d", config->ldap_host, config->ldap_port);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is patch fixes it by catching the cases when snprintf() truncates and
reporting an error.
Perfect fix would fall back into dynamically allocated buffers but
I think that would make these corner case too complicated provided
nobody had yet complained about them.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
rquote(3) documents rpcsvc header files. Thus it should be installed
only if the the header files are installed and that is only if RPC
configure feature is enabled.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Currently quotacheck will just continue if quotafile magic is invalid.
Instead ask whether we should continue assuming quota format passed from
the command line.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Currently quotacheck returns with zero exit code even though caching of
quota file fails. Fix it to return with non-zero exit code in that case
as expected.
Reported-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
A question when quota file version is incorrect is asked even if
quotacheck is run in non-interactive mode. Avoid asking the question in
that case and fail the check instead.
Reproted-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Vladimit Meshkov reported that when user -2 exists and user namespaces
are enabled in the kernel, repquota(8) fails to output anything. He also
analyzed this is because in such case repquota(8) tries to query info
for user -1 which is invalid ID, gets error from the kernel, and bails
out.
Fix the problem by stopping iteration over IDs when we reach ID -1.
Reported-by: Vladimir Meshkov <ubob74@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Add an optional argument to option -s allowing user to manually specify
units used for outputting results.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Currently standard RPC library in glibc is used for client RPC
communication to rpc.rquotad. Make tools use libtirpc so that IPv6 is
properly supported.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Add support for listening on IPv6 addresses as well.
[Heavily modified from original code by Anders Blomdell]
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Factor out getting of service port number so simplify transition to
IPv6.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
quotacheck had memory leaks because it did not clean up after direct
ext scanning:
==6885== 1,392 (88 direct, 1,304 indirect) bytes in 1 blocks are definitely lost in loss record 19 of 23
==6885== at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==6885== by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4)
==6885== by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4)
==6885== by 0x10BBA5: ext2_direct_scan (quotacheck.c:435)
==6885== by 0x10DA8A: check_dir (quotacheck.c:971)
==6885== by 0x10E634: check_all (quotacheck.c:1192)
==6885== by 0x10E6EC: main (quotacheck.c:1212)
==6885==
==6885== 8,464 (144 direct, 8,320 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 23
==6885== at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==6885== by 0x4E5749D: ext2fs_open_inode_scan (in /usr/lib64/libext2fs.so.2.4)
==6885== by 0x10BBF0: ext2_direct_scan (quotacheck.c:440)
==6885== by 0x10DA8A: check_dir (quotacheck.c:971)
==6885== by 0x10E634: check_all (quotacheck.c:1192)
==6885== by 0x10E6EC: main (quotacheck.c:1212)
==6885==
==6885== 15,243 (88 direct, 15,155 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 23
==6885== at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==6885== by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4)
==6885== by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4)
==6885== by 0x10BB55: ext2_direct_scan (quotacheck.c:430)
==6885== by 0x10DA8A: check_dir (quotacheck.c:971)
==6885== by 0x10E634: check_all (quotacheck.c:1192)
==6885== by 0x10E6EC: main (quotacheck.c:1212)
[JK: Improve coding style]
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Make sure we return with non-zero exit code when getting quotas for some
user fails.
Signed-off-by: Ian Chard <flup@users.sf.net>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
ftruncate and lseek syscalls may fail for different reasons,
do not ignore these errors. Create a helper function and use it
instead of duplicating error checks and diagnostic messages.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
fgets can return NULL anytime, do not ignore it.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
setgid/setuid syscalls may fail for different reasons,
do not ignore these errors.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Do not use a random value from the stack as an answer when fgets
returns NULL, return the default value in the latter case.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
This avoids the race between opening the directory being scanned
and changing into that directory for processing its contants.
This is not the only race of that kind, but chdir return code
has to be checked anyway and the fix costs nothing, so let it be fixed.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
When netlink support is not enabled, quota_nld is not built
and not installed but quota_nld.8 is still installed.
Fix this inconsistency and install quota_nld.8 iff quota_nld
is installed.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
We mistakenly didn't use direct scanning through libext2fs for ext4
filesystem. Add ext4 to the list of filesystem libext2fs can handle.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Except for really ancient kernels XFS quota interface is always
available when quota is compiled in. In recent kernels it is also usable
for other filesystems than XFS. So always add XFS quota format as usable
if we have non-ancient kernel.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
quotactl Q_XFS_GETQSTAT is able to report whether only accounting or
also quota enforcement is turned on. This works for XFS and GFS2 for
ages and since kernel 4.1 also for other filesystems. Use this quotactl
when it is supported and report more details in verbose mode.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
if '/etc/projid' dose not exist,@project_file will
be NULL pointer, fclose will cause coredump, add
check in endprent().
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
'rd' was declared as size_t which is unsigned so it could never be less
than 0. Fix it by declaring 'rd' as ssize_t which is the real read(2)
return type.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
If a quota implementation does not have a report function, such as
quotaio_meta, print the same white spaces so that xfstests generic/235
doesn't fail. The extra white sapce makes it easier to read the
output, and consistency is a good thing in any case.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
The support for project quota in generic code is simple. We just need
functions to convert project ID to project name and back (we follow what
xfsprogs do in that regard), add detection whether project quota is
enabled for the filesystem, and increase number of quota types. We also
have to update various checks to count with project quotas.
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
When compiling without RPC, we do not get stdlib.h automatically
included via other includes and thus miss some function definitions.
Include stdlib.h explicitely.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Add a configure check and skip use of nl_langinfo if it is not
present.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Not all C library's /usr/include/mntent.h are guaranteed to define
MNTTYPE_NFS and MNTTYPE_AUTO. Since we already are defining a large
number of MNTTYPE_* macros for our own use in mntopt.h, add fallback
definitions for MNTTYPE_NFS and MNTTYPE_NOAUTO there.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
NGRROUPS_MAX is what is defined by SuSv3; NGROUPS is not guaranteed by
any standard, but is just an ancient BSD'ism. Since Android's bionic
libc has the former but not the latter, let's use NGROUPS_MAX instead.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Android's bionic C library doesn't have Sun RPC support.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Ignore the files generated by libtool, gettext, and rpcgen
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
This fixes a buch of undefined references:
x86_64-pc-linux-gnu-gcc -march=native -mtune=native -O2 -pipe -D_GNU_SOURCE -Wa
ll -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -pie -Wl,-O1 -Wl,--hash-st
yle=gnu -Wl,--sort-common -Wl,--as-needed -o rpc.rquotad rquota_server.o rquota_
svc.o svc_socket.o libquota.a
rquota_svc.o: In function `rquotaprog_2':
rquota_svc.c:(.text+0x1d3): undefined reference to `xdr_setquota_rslt'
rquota_svc.c:(.text+0x1da): undefined reference to `xdr_ext_setquota_args'
rquota_svc.c:(.text+0x2b2): undefined reference to `xdr_setquota_rslt'
rquota_svc.c:(.text+0x2b9): undefined reference to `xdr_ext_setquota_args'
rquota_svc.c:(.text+0x2ff): undefined reference to `xdr_getquota_rslt'
rquota_svc.c:(.text+0x306): undefined reference to `xdr_ext_getquota_args'
rquota_svc.c:(.text+0x31a): undefined reference to `xdr_getquota_rslt'
rquota_svc.c:(.text+0x321): undefined reference to `xdr_ext_getquota_args'
rquota_svc.o: In function `rquotaprog_1':
rquota_svc.c:(.text+0x3f3): undefined reference to `xdr_setquota_rslt'
rquota_svc.c:(.text+0x3fa): undefined reference to `xdr_setquota_args'
rquota_svc.c:(.text+0x4d2): undefined reference to `xdr_setquota_rslt'
rquota_svc.c:(.text+0x4d9): undefined reference to `xdr_setquota_args'
rquota_svc.c:(.text+0x51f): undefined reference to `xdr_getquota_rslt'
rquota_svc.c:(.text+0x526): undefined reference to `xdr_getquota_args'
rquota_svc.c:(.text+0x53a): undefined reference to `xdr_getquota_rslt'
rquota_svc.c:(.text+0x541): undefined reference to `xdr_getquota_args'
collect2: error: ld returned 1 exit status
Makefile:901: recipe for target 'rpc.rquotad' failed
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Add support for scanning of all available quota structures using
Q_XGETNEXTQUOTA quotactl.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Check for new kernel quotactl Q_GETNEXTQUOTA and if available use it for
scanning all dquot structures.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
The default action-if-found of AC_CHECK_LIB() is to append checked
library to LIBS. Thus check for ldap library resulted in unwanted
addition of -lldap to LIBS as [] is an empty string in M4 and the
default action is used.
Fix the problem by providing proper action-if-found which was currently
just hidden behind the check. Also do similar cleanup for
AC_CHECK_HEADER check although there it didn't have any undesired
side-effect.
Reported-by: Petr Písař <petrp@users.sf.net>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Commit a5876145 added a new -O option which takes an
argument, but in the process lost the argument specifier
for "F". As a result, the use of "-F" segfaults when NULL
is sent to name2fmt() instead of the provided argument.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Currently we printed only an empty string when some build option was
disabled explicitely via --disable-foo. Print 'no' in that case as well.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Reported-by: Tomas Chvatal <tchvatal@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
I like the old format of Changelog more, also some of the history is
covered only in the text file. Finally sometimes hand-editing Changelog
may be useful. So revive Changelog in git.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
New build system changed versioning scheme to x.y.z but quota-tools have
traditionally used x.y where 'y' has two digits. There is no strong
reason to change the original scheme so return to it.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
An option called LDAP_TLS has been added to warnquota.conf which
controls whether the LDAP connection uses StartTLS. The option supports
the following values
never - Don't ask for a certificate
allow - Ask for certificate, proceed if valid
try - Ask for certificate, proceed if valid or not given
demand - Ask for certificate, proceed only if given and valid
Signed-off-by: Ian Allison <iana@pims.math.ca>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Quota subsystem in kernel introduced project quota. This patch improves
the userspace side.
This patch prevents quota_nld writing warnings to a console when
receiving project quota warnings from kernel because there is no such
concept, "console associated with a project id".
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Make from clean sources failed because automake dependency tracking
doesn't directly work with generated source files such as rquota.c or
rquota.h. Fix the problem by telling automake to generate these files
first using BUILT_SOURCES variable.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Otherwise tool never updates quota because old mtime always <= new.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Otherwise make install fails if it's already exists:
make install-exec-hook
make[3]: Entering directory `/root/quota'
ln: failed to create symbolic link `/usr/local/sbin/quotaoff': File exists
make[3]: *** [install-exec-hook] Error 1
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Some of LDAP functions return dynamically allocated memory that the
caller is responsible to free. So do this to avoid memory leaks.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Sometimes admin may not want to be CCed on emails. Allow that by setting
CC_TO to empty string (not setting CC_TO at all currently defaults to
sending CC to root so we don't want to change that for compatibility
reasons).
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Michael Meskes <michael@fam-meskes.de>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
When user doesn't edit the file with limits / grace times, there is no
need to overwrite the values in quota files. Maybe admin really wanted
to cancel the operation by not writing the file.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Error handling didn't properly free quota structures allocated for a
user when editing of limits failed for some reason. We also didn't bail
out when editing of grace times failed. Fix the problems by jumping to a
proper label.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Reopen the file with grace times - editor may have written the file into
a new inode and thus we cannot read the contents through the old fd.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Refresh the po's again now.
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Reflect what was done before and try to mimic it
Remove ChangeLog, now autogenerated for dist target
Remove confusing gettext README and try to add new approach for translations
[JK: Fixed build without RPC support]
Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
This define is unused and using it would be a bad idea (kernel quota
version doesn't mean anything useful anymore). Remove it.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
If NFS server does uses quotas, then it's high chance the RCP rquotad
service is not running at all. Then listing quotas for such NFS mount
point results into a warning about "connection refused".
This warning can be obtrusive if a host has mounted various mixture of
NFS exports with and without quotas.
This patch recognizes this special error state (after performing
a query to a client without running rquotad) and considers such
server as having quotas disabled. This silents the warning
effectively.
JK: Some coding style fixes, treat also rpc_set_quota() this way.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Commit 0214512479e0 (Properly handle signed space and inode values)
broke parsing of pure numbers in str2number() so that it would always
complain about "Integer overflow while interpreting decimal unit". Fix
condition checking for overflow.
Also number2str() was buggy and wouldn't guess proper units for negative
numbers.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jakub Bogusz <qboosh@pld-linux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
When LDAP is configured do not lookup only 'TO' field in LDAP but also a
'CC' field.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
The RPC transports grace time as unsigned int, but the value stored
there and retrivedd from is treated as singed difference against current time.
This leads to overflow after expiring the grace time which is
presented as an enourmously large grace time instead of "none" in the
quota(1) output.
There also possible an overflow when the time difference is still
bigger than an int can represent.
This first issue is solved by explicit type cast to/from int32_t, the
second issue is fixes by limiting the value into int32_t range.
<https://sourceforge.net/p/linuxquota/bugs/115/>
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
quotaon(8) manual page lists location of quotaon and quotaoff tools as
/usr/sbin. However configure option --enable-rootsbin allows to
relocte the executable into /sbin redendering the manual wrong.
This patch removes the path from the manual page, so it's valid in
both cases.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
For cluster filesystems, kernel can sometimes return negative values of
used space or inodes (because counters are not completely synchronized
across the cluster). Make quota tools properly print these.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Julian Ospald <hasufell@gentoo.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
|
|
macros/functions from endian.h are the proper, documented userspace
interface to use.
|
|
Fix compilation warning about missing stat(3) prototype.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
quota_nld has used VFS_DQUOT netlink family id as an id of a multicast
group to listen to. That is wrong - instead proper multicast group id
should be looked up. To do that we need a support for this functionality
in libnl so convert quota_nld to use libnl-3.0 and properly lookup
multicast group id.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
This patch renames rquotad(8) to rpc.rquotad(8) to reflect the
executable name. It also shows complete synopsis and documents --help option.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
If XFS_ROOTHACK is not defined, sbflags gets set but never used. This
patch declares the variable only if needed.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
JK: Fixup localization and handling of multiple output filesystems /
types.
Signed-off-by: Jonathan Overholt <jonathan@overholt.org>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
There are no manpages in this section in quota tools anymore. So just
remove the installation commands.
Signed-off-by: Carsten Grohmann <cgrohmann@users.sf.net>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Functions for reading quota specification in quotaops.c create new
temporary FILE stream handle, they close it on successful return,
but they forget to close it on unsuccessful return. That leads to
memory leaks. This patch ensures that the handle gets closed in all
cases.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Debian will automatically switch between autoconf version 2.13 and
modern autoconf based on the version number in the AC_PREREQ
statement. Without the AC_PREREQ, debian's autoconf driver script
will try to use autoconf 2.13, and the configure.in file uses autoconf
macros which were introduced in the autoconf 2.50. So add an
AC_PREREQ statement to make the right thing happen automatically.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
quota: Fix long variant for -A option in usage
repquota: Fix long variant for -c option in usage and manual
repquota: Fix long variant for -C option in usage and manual
repquota: Add -a, --all options to usage
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
This fixes `quotasync -h' exit code as well as it uses more portable
EXIT_SUCCESS/EXIT_FAILURE values.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
There was a couple of useful messages that were printed when -v was
specified but not when -d was specified. Fix this.
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
XFS and GFS have no quota files. Skip unnecessary examination and
rename of these files when running quotacheck.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
With this patch, it's possible to specify inode values including
decimal units in the editor run by edquota.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
This patch allows to specify suffixes at inode limits on setquota
command line and standard input. Decimal Units k, m, g, t are
implemented. Numeric value without suffix is equivatent to single
inodes as before. This is complementary functionality to `quota -s'.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
With this patch, it's possible to specify block values including
binary units in the editor run by edquota.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|
|
This patch adds support for binary suffixes on `setquota -b' input.
Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
|