Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (d3bb6183074fd98624b0ba922f70653003605a99)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (d3bb6183074fd98624b0ba922f70653003605a99)
  • Date: Mon, 2 Mar 2015 05:10:07 -0600

GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:

utils/ulimits/CONFIGURE | 1
utils/ulimits/DETAILS | 7 ++
utils/ulimits/E25FBABB.gpg |binary
utils/ulimits/HISTORY | 8 +++
utils/ulimits/PRE_BUILD | 4 +
utils/ulimits/ulimits.patch | 104
++++++++++++--------------------------------
6 files changed, 47 insertions(+), 77 deletions(-)

New commits:
commit d3bb6183074fd98624b0ba922f70653003605a99
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

ulimits: => 0.3.1

diff --git a/utils/ulimits/CONFIGURE b/utils/ulimits/CONFIGURE
new file mode 100755
index 0000000..7fe4ee6
--- /dev/null
+++ b/utils/ulimits/CONFIGURE
@@ -0,0 +1 @@
+config_query ULIMITS_PATCH "Apply the patch for multiple groups, comments
and tab separators support?" n
diff --git a/utils/ulimits/DETAILS b/utils/ulimits/DETAILS
index 4446c90..2dc1d4a 100755
--- a/utils/ulimits/DETAILS
+++ b/utils/ulimits/DETAILS
@@ -1,9 +1,12 @@
SPELL=ulimits
- VERSION=0.3.0
+ VERSION=0.3.1
BRANCH=`echo $VERSION|cut -d . -f 1,2`
SOURCE=$SPELL-$VERSION.tar.gz
+ SOURCE2=$SOURCE.sig
SOURCE_URL[0]=http://www.incenp.org/files/softs/$SPELL/$BRANCH/$SOURCE
-
SOURCE_HASH=sha512:1e355f3701e6ebb983a3b6ee391c0218946e3b9036e13cd1f93a10d4d4a0e6bb81a76cb576f3eeb842eabf21ffe998db661b45168710cb6d4882e4679567194c
+ SOURCE2_URL[0]=${SOURCE_URL[0]}.sig
+ SOURCE_GPG=E25FBABB.gpg:$SOURCE2:UPSTREAM_KEY
+ SOURCE2_IGNORE=signature
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
WEB_SITE=http://www.incenp.org/dvlpt/ulimits.html
LICENSE[0]=GPL
diff --git a/utils/ulimits/E25FBABB.gpg b/utils/ulimits/E25FBABB.gpg
new file mode 100644
index 0000000..c1858ce
Binary files /dev/null and b/utils/ulimits/E25FBABB.gpg differ
diff --git a/utils/ulimits/HISTORY b/utils/ulimits/HISTORY
index 1144f35..862c393 100644
--- a/utils/ulimits/HISTORY
+++ b/utils/ulimits/HISTORY
@@ -1,2 +1,10 @@
+2015-03-02 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: upddated spell to 0.3.1; converted to gpg signature
checking
+ * E25FBABB.gpg: added, E25FBABB public key (Damien Goutte-Gattat
+ <dgouttegattat AT incenp.org>) imported
+ * CONFIGURE: added, to optionally apply the patch
+ * PRE_BUILD: use ULIMITS_PATCH variable
+ * ulimits.patch: updated for new version
+
2014-10-02 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS, PRE_BUILD, ulimits.patch: spell created, version 0.3.0
diff --git a/utils/ulimits/PRE_BUILD b/utils/ulimits/PRE_BUILD
index 896ac92..167ede7 100755
--- a/utils/ulimits/PRE_BUILD
+++ b/utils/ulimits/PRE_BUILD
@@ -1,4 +1,6 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&

-patch -p0 < "$SPELL_DIRECTORY/ulimits.patch"
+if [[ $ULIMITS_PATCH == y ]]; then
+ patch -p0 < "$SPELL_DIRECTORY/ulimits.patch"
+fi
diff --git a/utils/ulimits/ulimits.patch b/utils/ulimits/ulimits.patch
index 8116518..63b057e 100644
--- a/utils/ulimits/ulimits.patch
+++ b/utils/ulimits/ulimits.patch
@@ -1,13 +1,10 @@
# Author: Vlad Glagolev <stealth AT sourcemage.org>
#
# Changes in this patch:
-# * groups and comments support
-# * bugfix for not found user or empty file
-# * bugfix for unlimited values
+# * multiple groups and comments support
# * bugfix for tab separators
-
---- src/ulimits.c.orig 2013-01-28 14:39:13.000000000 +0400
-+++ src/ulimits.c 2014-10-02 21:39:49.318495483 +0400
+--- src/ulimits.c.orig
++++ src/ulimits.c
@@ -29,6 +29,7 @@

#include <unistd.h>
@@ -26,7 +23,7 @@
+ * @param gname A pointer to a groupname
+ * @return 0 if a user belongs to group, -1 otherwise
+ */
-+static int user_in_group(const *uname, const char *gname)
++static int user_in_group(const char *uname, const char *gname)
+{
+ struct group *groupdata;
+ char *const *list;
@@ -64,59 +61,17 @@
* Parses a single limit specification.
* This function parses a single limit specification (that is, a single
* letter followed by a numerical value) and fills the provided
-@@ -109,7 +151,7 @@
- parse_limit_value(char **s, struct rlimit_setting *rlimit)
- {
- char *c, *p;
-- int value;
-+ int value, inf;
-
- if ( s == NULL || *s == NULL || rlimit == NULL ) {
- errno = EINVAL;
-@@ -123,7 +165,16 @@
-
- /* Get the numerical value for the limit. */
- errno = 0;
-- value = strtol(c + 1, &p, 10);
-+
-+ /* A single dash means no limits. */
-+ if (*(c+1) == '-') {
-+ p = c+2;
-+ inf = 1;
-+ } else {
-+ value = strtol(c + 1, &p, 10);
-+ inf = 0;
-+ }
-+
- if ( errno || p == c + 1 )
+@@ -243,6 +285,9 @@
return -1;
+ }

-@@ -132,7 +183,7 @@
- #define ULIMIT(symbol, letter, unused1, factor, unused2) \
- case letter: \
- rlimit->resource = symbol; \
-- rlimit->limit = value * factor; \
-+ rlimit->limit = inf == 1 ? RLIM_INFINITY : value * factor; \
- break;
- #include "ulimits.h"
- #undef ULIMIT
-@@ -174,15 +225,6 @@
- while ( *s == ' ' || *s == '\t' )
- s += 1;
-
-- /* A single dash means no limits. */
-- if ( *s == '-' && *(s + 1) == '\0' ) {
-- for ( ; n < RLIMIT_NLIMITS && n < len - 1 ; n++ ) {
-- rlimits[n].resource = n;
-- rlimits[n].limit = RLIM_INFINITY;
-- }
-- s += 1;
-- }
--
- while ( *s != '\0' && n < len - 1 ) {
- if ( parse_limit_value(&s, &(rlimits[n])) < 0 )
++ if ((n = strlen(buffer)) != 0)
++ buffer[n++] = ' ';
++
+ while ( (c = fgetc(f)) != '\n' ) {
+ if ( c == EOF )
return -1;
-@@ -280,9 +322,11 @@
+@@ -284,9 +329,11 @@
while ( ! found && ! feof(f) ) {
c = fgetc(f);

@@ -130,7 +85,24 @@
found = 1;
else {
n = 0;
-@@ -357,18 +401,21 @@
+@@ -343,7 +390,8 @@
+ size_t len)
+ {
+ FILE *f;
+- char lbuf[LIMIT_LINE_LENGTH+1], nbuf[USER_NAME_LENGTH+1];
++ // Initialize arrays to perform strlen() on them in get_line()
++ char lbuf[LIMIT_LINE_LENGTH+1] = "", nbuf[USER_NAME_LENGTH+1] = "";
+ int user_found = 0, default_found = 0;
+ ssize_t n = 0;
+
+@@ -355,13 +403,13 @@
+ if ( (f = open_limits_file(LIMITS_FILE)) == NULL )
+ return -1;
+
+- while ( ! user_found && ! feof(f) ) {
++ while ( ! feof(f) ) {
+ if ( get_first_field(f, nbuf, sizeof(nbuf)) == -1 )
+ continue;

if ( strcmp(nbuf, "*") == 0 )
default_found = get_line(f, lbuf, sizeof(lbuf)) != -1;
@@ -139,19 +111,3 @@
user_found = get_line(f, lbuf, sizeof(lbuf)) != -1;
else
discard_line(f);
- }
- fclose(f);
-
-- if ( user_found || default_found )
-+ if ( user_found || default_found ) {
- if ( (n = parse_limit_string(lbuf, rlimits, len)) == -1 )
- errno = EBADMSG;
-
-- return n;
-+ return n;
-+ }
-+
-+ return -1;
- }
-
- static int



  • [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (d3bb6183074fd98624b0ba922f70653003605a99), Vlad Glagolev, 03/02/2015

Archive powered by MHonArc 2.6.24.

Top of Page