Skip to Content.
Sympa Menu

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

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 (6f3b128a5b4136e5eee18ce816af7b22ed8f3342)
  • Date: Tue, 3 Mar 2015 09:40:23 -0600

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

utils/ulimits/BUILD | 3 +
utils/ulimits/CONFIGURE | 17 ++++++
utils/ulimits/DETAILS | 2
utils/ulimits/HISTORY | 6 ++
utils/ulimits/PRE_BUILD | 6 --
utils/ulimits/ulimits.patch | 113
--------------------------------------------
6 files changed, 26 insertions(+), 121 deletions(-)

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

ulimits: => 0.3.2

diff --git a/utils/ulimits/BUILD b/utils/ulimits/BUILD
new file mode 100755
index 0000000..ea61742
--- /dev/null
+++ b/utils/ulimits/BUILD
@@ -0,0 +1,3 @@
+OPTS="$ULIMITS_OPTS $OPTS" &&
+
+default_build
diff --git a/utils/ulimits/CONFIGURE b/utils/ulimits/CONFIGURE
index 7fe4ee6..ffcb5a7 100755
--- a/utils/ulimits/CONFIGURE
+++ b/utils/ulimits/CONFIGURE
@@ -1 +1,16 @@
-config_query ULIMITS_PATCH "Apply the patch for multiple groups, comments
and tab separators support?" n
+# deprecate ulimits patch
+if [[ -n $ULIMITS_PATCH ]]; then
+ persistent_add ULIMITS_OPTS &&
+
+ if [[ $ULIMITS_PATCH == y ]]; then
+ list_add ULIMITS_OPTS '--enable-merged-limits'
+ else
+ list_add ULIMITS_OPTS '--disable-merged-limits'
+ fi &&
+
+ persistent_remove ULIMITS_PATCH
+fi &&
+
+config_query_option ULIMITS_OPTS "Enable ability to merge all limits strings
matching the user?" n \
+ "--enable-merged-limits" \
+ "--disable-merged-limits"
diff --git a/utils/ulimits/DETAILS b/utils/ulimits/DETAILS
index 2dc1d4a..d9821c4 100755
--- a/utils/ulimits/DETAILS
+++ b/utils/ulimits/DETAILS
@@ -1,5 +1,5 @@
SPELL=ulimits
- VERSION=0.3.1
+ VERSION=0.3.2
BRANCH=`echo $VERSION|cut -d . -f 1,2`
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE2=$SOURCE.sig
diff --git a/utils/ulimits/HISTORY b/utils/ulimits/HISTORY
index 862c393..cac45b2 100644
--- a/utils/ulimits/HISTORY
+++ b/utils/ulimits/HISTORY
@@ -1,3 +1,9 @@
+2015-03-03 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: upddated spell to 0.3.2
+ * CONFIGURE: deprecate ULIMITS_PATCH in favour of new configure flags
+ * BUILD: use ULIMITS_OPTS
+ * PRE_BUILD, ulimits.patch: dropped, fixed by upstream
+
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
diff --git a/utils/ulimits/PRE_BUILD b/utils/ulimits/PRE_BUILD
deleted file mode 100755
index 167ede7..0000000
--- a/utils/ulimits/PRE_BUILD
+++ /dev/null
@@ -1,6 +0,0 @@
-default_pre_build &&
-cd "$SOURCE_DIRECTORY" &&
-
-if [[ $ULIMITS_PATCH == y ]]; then
- patch -p0 < "$SPELL_DIRECTORY/ulimits.patch"
-fi
diff --git a/utils/ulimits/ulimits.patch b/utils/ulimits/ulimits.patch
deleted file mode 100644
index 63b057e..0000000
--- a/utils/ulimits/ulimits.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-# Author: Vlad Glagolev <stealth AT sourcemage.org>
-#
-# Changes in this patch:
-# * multiple groups and comments support
-# * bugfix for tab separators
---- src/ulimits.c.orig
-+++ src/ulimits.c
-@@ -29,6 +29,7 @@
-
- #include <unistd.h>
- #include <pwd.h>
-+#include <grp.h>
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <sys/resource.h>
-@@ -95,6 +96,47 @@
- #define PLIMIT_PRIORITY RLIMIT_NLIMITS + 3
-
- /**
-+ * Check if user is in the group
-+ *
-+ * @param uname A pointer to a username
-+ * @param gname A pointer to a groupname
-+ * @return 0 if a user belongs to group, -1 otherwise
-+ */
-+static int user_in_group(const char *uname, const char *gname)
-+{
-+ struct group *groupdata;
-+ char *const *list;
-+
-+ if (uname == NULL || gname == NULL) {
-+ return -1;
-+ }
-+
-+ if (*gname == '@') {
-+ gname++;
-+ } else {
-+ return -1;
-+ }
-+
-+ groupdata = getgrnam(gname);
-+
-+ if (groupdata == NULL) {
-+ return -1;
-+ }
-+
-+ list = groupdata->gr_mem;
-+
-+ while (*list != NULL) {
-+ if (strcmp(*list, uname) == 0) {
-+ return 0;
-+ }
-+
-+ list++;
-+ }
-+
-+ return -1;
-+}
-+
-+/**
- * 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
-@@ -243,6 +285,9 @@
- return -1;
- }
-
-+ if ((n = strlen(buffer)) != 0)
-+ buffer[n++] = ' ';
-+
- while ( (c = fgetc(f)) != '\n' ) {
- if ( c == EOF )
- return -1;
-@@ -284,9 +329,11 @@
- while ( ! found && ! feof(f) ) {
- c = fgetc(f);
-
-- if ( isgraph(c) && n < len - 1 )
-+ if (c == '#')
-+ discard_line(f);
-+ else if ( isgraph(c) && n < len - 1 )
- buffer[n++] = (char)c;
-- else if ( c == ' ' && n > 0 )
-+ else if ( (c == ' ' || c == '\t') && n > 0 )
- found = 1;
- else {
- n = 0;
-@@ -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;
-- else if ( strcmp(nbuf, user) == 0 )
-+ else if ( strcmp(nbuf, user) == 0 || user_in_group(user, nbuf) == 0
)
- user_found = get_line(f, lbuf, sizeof(lbuf)) != -1;
- else
- discard_line(f);



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

Archive powered by MHonArc 2.6.24.

Top of Page