aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-27 14:54:58 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-27 14:54:58 +0000
commitaaf0e433317374ee564582c75389389b60fd7b27 (patch)
tree9cb64965ce7754c6f7f276d5341ee478a5b382ab /lib
parenta6ce07e20e5cb3090f5b21dbe6d428d921a931ee (diff)
downloadpam-modules-aaf0e433317374ee564582c75389389b60fd7b27.tar.gz
pam-modules-aaf0e433317374ee564582c75389389b60fd7b27.tar.bz2
Rewrite Makefile.am's in a clearer and simpler way
* configure.ac: Require libtool 2.2.5a * Make.rules (.c.lo, .lo.la): Remove (AM_LDFLAGS, INCLUDES, LIBS): New assignments. * pam_sql/Makefile.am, pam_fshadow/Makefile.am, pam_sql/Makefile.am, pam_regex/Makefile.am, pam_log/Makefile.am: Rewrite. * pam_sql/pam_sql.h, pam_sql/pam_mysql.c, pam_sql/pam_pgsql.c. pam_sql/pam_sql.c: Rewrite. * pam_sql/sha1.h, pam_sql/md5.c, pam_sql/md5.h, pam_sql/sha1.c * pam_fshadow/pam_fshadow.c: New option [no]shadow * doc/pam-modules.texi: Update. * lib/graypam.h (gray_trim_ws): New proto * lib/strutil.c: New file. * lib/Makefile.am: Add strutil.c git-svn-id: file:///svnroot/pam-modules/trunk@105 56984be4-0537-0410-a56c-fcb268c96130
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/graypam.h2
-rw-r--r--lib/strutil.c32
3 files changed, 35 insertions, 0 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 8626822..bf9e458 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -28,6 +28,7 @@ libgraypam_la_SOURCES = \
md5.h\
sha1.c\
sha1.h\
+ strutil.c\
vartab.c\
escape.c
diff --git a/lib/graypam.h b/lib/graypam.h
index 94e3de2..0423e89 100644
--- a/lib/graypam.h
+++ b/lib/graypam.h
@@ -193,5 +193,7 @@ struct keyword {
struct keyword *gray_find_keyword(struct keyword *kwtab, const char *str,
size_t len);
+
+int gray_trim_ws(char *str);
#endif
diff --git a/lib/strutil.c b/lib/strutil.c
new file mode 100644
index 0000000..e12169b
--- /dev/null
+++ b/lib/strutil.c
@@ -0,0 +1,32 @@
+/* This file is part of pam-modules.
+ Copyright (C) 2009 Sergey Poznyakoff
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 3 of the License, or (at your
+ option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <graypam.h>
+
+/*
+ * Chop off trailing whitespace. Return length of the resulting string
+ */
+int
+gray_trim_ws(char *str)
+{
+ int len;
+
+ for (len = strlen(str); len > 0 && isspace(str[len-1]); len--)
+ ;
+ str[len] = 0;
+ return len;
+}
+

Return to:

Send suggestions and report system problems to the System administrator.