Commit Graph

75 Commits

Author SHA1 Message Date
Damien Goutte-Gattat b1fce792c4 Fix man page header.
Use correct arguments to the .TH command.
2020-01-05 23:11:02 +00:00
Damien Goutte-Gattat 3c696a2580 Update project location. 2018-12-22 19:44:12 +00:00
Damien Goutte-Gattat b1a0b0e6bf Merge branch 'develop' 2016-10-11 16:51:21 +02:00
Damien Goutte-Gattat 9766dcdb10 Prepare 0.3.3 release 2016-10-11 16:50:20 +02:00
Damien Goutte-Gattat 343ecbba6b Markdown-ify the README file 2016-10-10 19:41:43 +02:00
Damien Goutte-Gattat d35813da45 Set umask in "exec" mode
This patch ensures that ulimits parses the K= value properly, and
sets the umask for its own process accordingly. This has no effect
when ulimits is called to set limits on its parent process (since
there's no way to modify the umask of any other process than our
own process), but at least it allows to honor the K= value when
ulimits is called in "exec" mode.

Incenp-bug-id: 2
2016-10-10 18:07:16 +02:00
Damien Goutte-Gattat 8c36aa2ff1 Merge branch 'develop' 2015-03-03 00:48:22 +01:00
Damien Goutte-Gattat cec13adc63 Allow merging of limits at configure time
Add a configure-time switch (--enable-merged-limits) to make ulimits
considering all lines matching a given user, instead of only a single

This restores the behavior implemented by Vlad's patch.
2015-03-03 00:43:39 +01:00
Damien Goutte-Gattat 40750dff44 Update release files 2015-03-02 20:24:02 +01:00
Damien Goutte-Gattat 2597ddeb7b Do not merge limits from several lines
Only a single line (be it a user-matching, @group-matching, or
default line) is to be considered, even if there is several lines
for that user (in that case, only the first line rules) or several
lines for the group(s) the user belongs to (in that case, only the
last line rules).

There’s nothing in limits(5) suggesting that limits from several
matching lines should be merged together, and indeed that’s not the
behavior of /bin/login.
2015-03-02 18:45:06 +01:00
Damien Goutte-Gattat 096f6c8ceb Stop parsing at the first user-matching line
As per the limits(5) man page:

“If more than one line with limits for an user exist, only the
first line for this user will be considered.

If no lines are specified for an user, the last @group line matching
a group whose the user is a member of will be considered, or the
last line with default limits if no groups contain the user.”

So wo may stop parsing the limits file as soon as we have a line
matching the username. On the other hand, without a user-matching
line, we must continue parsing until EOF so that we have the last
default or @group-matching line, if any.
2015-03-02 18:35:02 +01:00
Damien Goutte-Gattat b1b4e7e34b Coding style fix
Apply cosmetic changes to Vlad's patch.
2015-03-02 18:03:37 +01:00
Vlad Glagolev 48dc97dcd6 Better support of limits file syntax
This patch adds support for @group syntax and comment lines
in the limits file. It also allows the use of a tab character
as a separator.
2015-03-02 17:19:52 +01:00
Damien Goutte-Gattat a43e9f33d9 Merge branch 'develop' 2015-01-29 18:57:55 +01:00
Damien Goutte-Gattat a57b620697 Prepare distribution of 0.3.1 release 2015-01-29 18:38:34 +01:00
Damien Goutte-Gattat 0646291128 Allow dash as limit value
Recognize a dash when a limit value is expected, meaning that the
corresponding resource is unlimited.
2015-01-29 18:20:08 +01:00
Damien Goutte-Gattat 452807fb67 Always set terminator value in rlimit_setting array
The special -1 value in the rlimit_setting array was only
initialized when actually parsing a limit string, but not when
no limit string was found. This resulted in the program walking
through unitialized memory when the /etc/limits file contained
no limit string for the calling user and no default string.
2015-01-29 17:56:25 +01:00
Damien Goutte-Gattat e6ad418511 Fix compile-time warnings
Fix all warnings generated by GCC -Wall -Wextra flags.
2015-01-29 17:49:46 +01:00
Damien Goutte-Gattat 569d027863 Merge branch 'develop' 2013-01-28 11:39:13 +01:00
Damien Goutte-Gattat 1621c6e1fe Add IS_SETUID_ROOT macro 2013-01-28 10:43:38 +01:00
Damien Goutte-Gattat f85cd4eac2 Make sure to drop privileges before exec'ing 2013-01-28 10:35:58 +01:00
Damien Goutte-Gattat 5f0fbe1d29 Bump version number to 0.3.0 2013-01-28 00:24:36 +01:00
Damien Goutte-Gattat cd357c7232 Update man page 2013-01-28 00:19:59 +01:00
Damien Goutte-Gattat 3541abf254 Update copyright years 2013-01-28 00:16:23 +01:00
Damien Goutte-Gattat da88333a5c Update README 2013-01-28 00:13:32 +01:00
Damien Goutte-Gattat 1dc2023a3e Print error messages only in main 2013-01-28 00:08:00 +01:00
Damien Goutte-Gattat 2956867cbe Use setrlimit when prlimit is not available 2013-01-28 00:01:53 +01:00
Damien Goutte-Gattat c3f4a9bd17 Update man page 2013-01-27 23:49:53 +01:00
Damien Goutte-Gattat 1c92633a63 Update help message 2013-01-27 23:41:49 +01:00
Damien Goutte-Gattat 9f44951d95 Add exec mode
When called with non-option arguments, set limits for the
current process and then exec the specified program.
2013-01-27 23:31:56 +01:00
Damien Goutte-Gattat bc246a05be Do not hardcode the location of ps(1)
Use Autoconf to detect the absolute path of ps(1) at configure time.
2012-09-10 00:53:42 +02:00
Damien Goutte-Gattat 47f5156b0f Merge branch 'develop' 2012-06-27 11:37:40 +02:00
Damien Goutte-Gattat b08271416c Bump version number to 0.2.1 2012-06-27 11:37:18 +02:00
Damien Goutte-Gattat 1065f07aa0 Add a portability note in the README 2012-06-27 11:32:41 +02:00
Damien Goutte-Gattat bd0de3048a Add more details to the man page 2012-06-27 11:21:22 +02:00
Damien Goutte-Gattat 96df78d6ea Update man page 2012-06-27 09:27:50 +02:00
Damien Goutte-Gattat a1af3d8fb0 Merge branch 'develop' 2012-06-27 00:10:03 +02:00
Damien Goutte-Gattat 33945e2229 Update NEWS file 2012-06-27 00:09:23 +02:00
Damien Goutte-Gattat 6b03db9e01 Check permissions on limits file
When running as root, we need to ensure the limits file is only
writable by root, without going any further if it is not.
2012-06-27 00:04:01 +02:00
Damien Goutte-Gattat b1f1b13ca3 Check the limits file is indeed a file 2012-06-23 11:11:34 +02:00
Damien Goutte-Gattat 5090ab994f Add the -s, --set option
Add an option to force the default behavior of setting limits
instead of printing a command.
2012-06-23 10:55:01 +02:00
Damien Goutte-Gattat a37e7ea0e0 Compile even if prlimit(2) is not available 2012-06-22 23:59:52 +02:00
Damien Goutte-Gattat d522dd7fe5 Add NEWS file 2012-06-22 23:47:21 +02:00
Damien Goutte-Gattat a1d2d61938 Bump version number to 0.2.0 2012-06-20 23:56:48 +02:00
Damien Goutte-Gattat e4f9fcdf42 Use macros to generate limits cases 2012-06-20 21:23:33 +02:00
Damien Goutte-Gattat 5531121e69 Add support for unlimited values in -c output 2012-06-20 20:42:41 +02:00
Damien Goutte-Gattat 9c24356492 Recognize single dash in limit string 2012-06-20 16:30:55 +02:00
Damien Goutte-Gattat 8ed8a9e715 Rename pseudo limits symbols
Change the symbol prefix for the pseudo limits UMASK and PRIORITY
from RLIMIT_ to PLIMIT_, to avoid confusion with the symbols for
the true resource limits.
2012-06-20 15:06:48 +02:00
Damien Goutte-Gattat 62b8338e78 Expect P value to be in the range 0..39 2012-06-20 15:03:42 +02:00
Damien Goutte-Gattat 118b072301 Recognize K (umask) and P (priority) pseudo limits 2012-06-20 11:29:42 +02:00