summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* quota-nld: fix open PID file failed when systemd read itHEADmasterlihaoxiang (F)2022-12-061-11/+35
| | | | | | | | | | | | | | | | | | 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>
* edquota: Fix editing of individual user grace timesJan Kara2022-11-012-3/+12
| | | | | | | | | | 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>
* setquota: Avoid false error messages when setting grace timesJan Kara2022-11-011-2/+4
| | | | | | | | | 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>
* Make configure.ac POSIX compliantSam James2022-09-261-1/+1
| | | | | | | | | | | | 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 versionJan Kara2022-09-231-1/+1
| | | | | | | | 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>
* Release quota-tools 4.09Jan Kara2022-09-212-1/+4
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* Avoid including manpages multiple times in man_MANSJan Kara2022-09-211-7/+9
| | | | | | | | | 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>
* Release quota-tools 4.08Jan Kara2022-09-192-1/+4
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* Include unconfigured manpages into distributionJan Kara2022-09-195-454/+482
| | | | | | | 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>
* Release quota-tools 4.07Jan Kara2022-09-162-1/+12
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* quotasys.c: fix strncpy usageDmitry V. Levin2021-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* common.c: fix strncat usageDmitry V. Levin2021-09-171-2/+1
| | | | | | | | | | | | | | | | | | | | 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>
* quotacheck, quotaon: Always display message about deprecated usageJan Kara2021-08-202-5/+9
| | | | | | | | 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>
* quota_nld: Initialize sa_mask when registering PID file removalPetr Písař2021-03-161-1/+1
| | | | | | | | 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>
* Drop sys/cdefs.h usageJan Kara2020-11-301-2/+1
| | | | | | | | | | 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>
* quotaio_xfs: Warn when large kernel timestamps cannot be handledJan Kara2020-11-242-0/+11
| | | | | | | | | | | 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>
* quotaops: fix compilation warningDmitry V. Levin2020-11-231-0/+2
| | | | | | | | | | | | 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>
* quotacheck: Remove a dead code from process_file()Petr Písař2020-11-231-1/+0
| | | | | | | | 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>
* quota: Use realloc(3) instead of reallocarray(3)Fabrice Fontaine2020-11-111-1/+1
| | | | | | | | | | 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>
* Release quota-tools 4.06v4.06Jan Kara2020-11-092-1/+36
|
* Remove quot toolJan Kara2020-11-098-1783/+1264
| | | | | | | 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>
* quotacheck,quotaon: Suggest using quota feature for ext4Jan Kara2020-10-194-24/+76
| | | | | | | | | 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>
* quota: Add --filesystem optionJan Kara2020-09-212-4/+28
| | | | | | | | 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>
* quota: Add synopsis for project quotaJan Kara2020-09-211-1/+2
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* Handle grace time overflows for XFS quotasJan Kara2020-09-212-9/+20
| | | | | | | Add checks and error handling to report when grace times set for XFS quotas would overflow. Signed-off-by: Jan Kara <jack@suse.cz>
* Support grace period expirations past y2038 for XFSDarrick J. Wong2020-09-072-5/+39
| | | | | | | | 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>
* Fix limits setting on XFS filesystemJan Kara2020-05-211-1/+3
| | | | | | | | | | | | | | 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>
* quota-tools: Set FS_DQ_TIMER_MASK for individual xfs grace timesEric Sandeen2020-05-141-0/+2
| | | | | | | | | | | | 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>
* quota-tools: pass quota type to QCMD for Q_XFS_GETQSTATEric Sandeen2020-05-132-2/+2
| | | | | | | | | | | | | | | | 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>
* Fix ignoring disabled quotasPetr Písař2020-03-261-1/+3
| | | | | | | | | | | | | | | | | | 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>
* warnquota: Initialize all members of a configparams structurePetr Písař2019-11-051-7/+1
| | | | | | | | | | | | | 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>
* warnquota: Free LDAP error messagePetr Písař2019-11-051-1/+4
| | | | | | | | 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>
* Make a directory for quota_nld PID file configurablePetr Písař2019-10-042-2/+12
| | | | | | | | | | | | | | | 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>
* warnquota: Clarify that CC_TO gets resolved through LDAPJan Kara2019-09-121-0/+2
| | | | | | | 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>
* warnquota: Print also additional error info for LDAP errorsJan Kara2019-09-121-5/+21
| | | | | | | LDAP library provides additional error information in some cases. Print it make debugging LDAP setup easier. Signed-off-by: Jan Kara <jack@suse.cz>
* warnquota: Properly detect LDAP errorsJan Kara2019-09-081-2/+2
| | | | | | | 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>
* warnquota: Do not ignore errors in config fileJan Kara2019-08-153-14/+85
| | | | | | | | | | | 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>
* warnquota: Fix help textJan Kara2019-08-121-1/+1
| | | | | | | The help text was wrongly saying that -v is equivalent to --version. It should be -V. Signed-off-by: Jan Kara <jack@suse.cz>
* quotacheck: Skip checking of filesystems with hidded quota files earlyJan Kara2019-07-301-2/+2
| | | | | | | | | | 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>
* quotaops: Make error string translatableJan Kara2019-05-281-1/+1
| | | | | | Add forgotten translation quotes to the error string. Signed-off-by: Jan Kara <jack@suse.cz>
* rpc: Clarify error message when cannot connect to rpc.rquotadJan Kara2019-05-282-19/+9
| | | | | | | | | | | 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: Report failure to obtain quota informationJan Kara2019-05-241-0/+18
| | | | | | | | 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>
* quotaops: Do not leak dquot structures on failureJan Kara2019-05-241-4/+5
| | | | | | | 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>
* quotaops: Do not return partial list from getprivs()Jan Kara2019-05-241-8/+11
| | | | | | | | | 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>
* Make messages about failures for NFS consistent with local filesystemsJan Kara2019-05-244-7/+7
| | | | | | | | | | | | | | | | 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 documentationJan Kara2019-04-024-4368/+1
| | | | | | | Delete old documentation files that were superseeded by doc/quotadoc.sgml. Signed-off-by: Jan Kara <jack@suse.cz>
* COPYING: Update mailing addressJan Kara2019-04-021-14/+14
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* edquota: Remove forgotten license headerJan Kara2019-04-021-32/+1
| | | | Signed-off-by: Jan Kara <jack@suse.cz>
* configure.ac: add --disable-pie optionFabrice Fontaine2019-04-022-1/+13
| | | | | | | | | | | 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>
* warnquota: Improve examples in warnquota.confJan Kara2019-04-011-32/+72
| | | | Signed-off-by: Jan Kara <jack@suse.cz>