| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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>
|