summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release quota-tools 4.04v4.04Jan Kara2017-09-052-1/+48
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* Use TI-RPC for RPC client communicationJan Kara2017-09-051-10/+23
| | | | | | | | 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>
* rpc.rquotad: IPv6 supportJan Kara2017-09-054-79/+167
| | | | | | | | 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>
* rpc: Factor out getting of port numberJan Kara2017-09-051-29/+35
| | | | | | | Factor out getting of service port number so simplify transition to IPv6. Signed-off-by: Jan Kara <jack@suse.cz>
* Add support for ipv6 to good_clientJan Kara2017-09-051-7/+30
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* quotacheck: Deallocate memory after direct scanningPetr Písař2017-08-311-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* quota: Return non-zero exit code when getting quota failsIan Chard2017-08-311-0/+5
| | | | | | | | 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>
* quotaops: check return code of ftruncate and lseek callsDmitry V. Levin2017-05-181-24/+29
| | | | | | | | | 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>
* Use configure macros instead of hardcoded defaultsDmitry V. Levin2017-05-182-2/+6
| | | | | Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Jan Kara <jack@suse.cz>
* quotaops: check return code of fgets callsDmitry V. Levin2017-05-181-8/+20
| | | | | | | 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>
* quotaops: check setgid/setuid return codeDmitry V. Levin2017-05-181-2/+4
| | | | | | | | 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>
* quotacheck: fix ask_yn UB when fgets returns NULLDmitry V. Levin2017-05-181-2/+2
| | | | | | | | 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>
* quotacheck: change to the directory before opening it, not afterDmitry V. Levin2017-05-181-3/+8
| | | | | | | | | | | 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>
* Do not install quota_nld.8 when quota_nld is not installedDmitry V. Levin2017-05-181-1/+4
| | | | | | | | | | 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>
* quota-tools: add missing newline to die() messagesTheodore Ts'o2017-02-092-3/+3
| | | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jan Kara <jack@suse.cz>
* quotacheck: Use direct scanning also for ext4Jan Kara2016-08-091-1/+4
| | | | | | | 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>
* Improve detection of XFS quota interfaceJan Kara2016-07-121-8/+10
| | | | | | | | | 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>
* quotaon: Improve reporting of quota stateJan Kara2016-07-123-19/+55
| | | | | | | | | 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>
* quota: fix coredump if projid file does not existWang Shilong2016-07-061-2/+4
| | | | | | | | | 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>
* quotacheck: Fix buggy error check of read(2)Jan Kara2016-07-061-1/+1
| | | | | | | | '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>
* repquota: use the same whitespace for quotaio_meta as quotaio_v2Theodore Ts'o2016-04-041-2/+3
| | | | | | | | | | 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>
* repquota: Add project quota supportJan Kara2016-03-312-7/+33
| | | | | Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Jan Kara <jack@suse.cz>
* edquota: Project quota supportJan Kara2016-03-312-17/+34
| | | | | Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Jan Kara <jack@suse.cz>
* setquota: Project quota supportJan Kara2016-03-312-22/+58
| | | | | Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Jan Kara <jack@suse.cz>
* quota: Add project quota supportJan Kara2016-03-312-8/+43
| | | | | Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Jan Kara <jack@suse.cz>
* quotasync: Add project quota supportJan Kara2016-03-312-5/+17
| | | | | Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Jan Kara <jack@suse.cz>
* quotaon: Add project quota supportJan Kara2016-03-313-21/+61
| | | | | Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Add support for project quota into generic codeJan Kara2016-03-316-13/+224
| | | | | | | | | | | 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>
* Fix warnings due to missing stdlib.hJan Kara2016-03-302-0/+2
| | | | | | | | 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>
* Support systems which do not have nl_langinfo()Theodore Ts'o2016-03-302-0/+7
| | | | | | | | 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>
* Provide fallback definitions for MNTTYPE_NFS and MNTTYPE_NOAUTOTheodore Ts'o2016-03-301-0/+8
| | | | | | | | | | 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>
* Use NGROUPS_MAX instead of NGROUPSTheodore Ts'o2016-03-302-4/+6
| | | | | | | | | 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>
* Allow building on systems that do not have rpc header filesTheodore Ts'o2016-03-303-14/+20
| | | | | | | 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>
* Update the gitignore file to ignore additional generated filesTheodore Ts'o2016-03-301-0/+3
| | | | | | | 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>
* Don't build rpc.rquotad when --disable-rpc was requested.Lars Wendler2016-02-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 using Q_XGETNEXTQUOTAJan Kara2016-01-272-3/+40
| | | | | | | Add support for scanning of all available quota structures using Q_XGETNEXTQUOTA quotactl. Signed-off-by: Jan Kara <jack@suse.cz>
* Scan dquots using Q_GETNEXTQUOTAJan Kara2016-01-274-1/+65
| | | | | | | 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>
* Don't link all binaries with ldap libraryJan Kara2016-01-191-14/+12
| | | | | | | | | | | | | | | 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>
* repquota: -F option takes an argEric Sandeen2016-01-191-1/+1
| | | | | | | | | | 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>
* Set -fPIC and -pie as default params when buildingTomáš Chvátal2016-01-052-1/+2
| | | | | Signed-off-by: Tomáš Chvátal <tchvatal@suse.cz> Signed-off-by: Jan Kara <jack@suse.cz>
* Do not accidentaly override commandline passed CFLAGS.Tomáš Chvátal2016-01-041-1/+1
| | | | | Signed-off-by: Tomáš Chvátal <tchvatal@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Respect the docdir declaration and do not override.Tomáš Chvátal2016-01-041-1/+0
| | | | | Signed-off-by: Tomáš Chvátal <tchvatal@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Print explicitely disabled options properlyJan Kara2016-01-041-1/+11
| | | | | | | 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>
* Distribute ldap-scripts directory tooTomáš Chvátal2016-01-041-1/+2
| | | | | Signed-off-by: Tomáš Chvátal <tchvatal@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Fix build with disabled ldapJan Kara2016-01-041-18/+18
| | | | | Reported-by: Tomas Chvatal <tchvatal@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Fix whitespace in configure.acTomáš Chvátal2016-01-041-1/+1
| | | | | Signed-off-by: Tomáš Chvátal <tchvatal@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
* Release quota-tools 4.03v4.03Jan Kara2015-12-182-1/+29
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* Revive ChangelogJan Kara2015-12-182-4/+958
| | | | | | | | 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>
* Update release script to work with new build systemJan Kara2015-12-181-7/+7
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* Make new build system use original versioning schemeJan Kara2015-12-181-3/+2
| | | | | | | | 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>