aboutsummaryrefslogtreecommitdiff
path: root/pam_sql
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-03-15 10:08:34 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-03-15 10:08:34 +0000
commit874bc492cc860f60581428dd891651eb8d5353d9 (patch)
treec9779b597257d491b20e94cf584f42f2f67f93a2 /pam_sql
parentc934a7f3605f00e1f7f0507816646cc60651a007 (diff)
downloadpam-modules-874bc492cc860f60581428dd891651eb8d5353d9.tar.gz
pam-modules-874bc492cc860f60581428dd891651eb8d5353d9.tar.bz2
Prepare for the release
git-svn-id: file:///svnroot/pam-modules/trunk@83 56984be4-0537-0410-a56c-fcb268c96130
Diffstat (limited to 'pam_sql')
-rw-r--r--pam_sql/pam_sql.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/pam_sql/pam_sql.c b/pam_sql/pam_sql.c
index d948544..51ed168 100644
--- a/pam_sql/pam_sql.c
+++ b/pam_sql/pam_sql.c
@@ -219,6 +219,7 @@ read_config ()
int rc = 0;
int line = 0;
char buf[128];
+ gray_slist_t slist = NULL;
fp = fopen (config_file, "r");
if (!fp) {
@@ -244,11 +245,44 @@ read_config ()
}
p[len-1] = 0;
- chop(p);
+ len = chop(p);
if (*p == 0 || *p == '#')
continue;
+
+ if (p[len-1] == '\\') {
+ int err = 0;
+ /* Collect continuation lines */
+ if (!slist)
+ slist = gray_slist_create();
+ do {
+ gray_slist_append(slist, p, len-2);
+ p = fgets (buf, sizeof buf, fp);
+ if (!p)
+ break;
+ line++;
+ len = strlen(p);
+ if (len == 0)
+ break;
+ if (p[len-1] != '\n') {
+ _pam_log(LOG_EMERG,
+ "%s:%d: string too long",
+ config_file, line);
+ err = 1;
+ break;
+ }
+ p[len-1] = 0;
+ len = chop(p);
+ } while (p[len-1] == '\\');
+ if (len)
+ gray_slist_append(slist, p, len);
+ gray_slist_append_char(slist, 0);
+ p = gray_slist_finish(slist);
+ if (err)
+ continue;
+ }
+
env = malloc(sizeof *env);
if (!env) {
_pam_log(LOG_EMERG, "not enough memory");
@@ -281,7 +315,8 @@ read_config ()
env->next = config_env;
config_env = env;
}
-
+
+ gray_slist_free(&slist);
fclose(fp);
return rc;
}

Return to:

Send suggestions and report system problems to the System administrator.