aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_env/pam_env.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2024-01-31 20:12:58 +0100
committerDmitry V. Levin <ldv@strace.io>2024-02-06 08:00:00 +0000
commit644dc6f0c15bccc7401e47785753e9c8d01018d3 (patch)
tree32afca676f02af3385fbd5feec7b43899358d3e7 /modules/pam_env/pam_env.c
parent9fa68ae79c213026d9621d6a70defb381e5a0533 (diff)
downloadpam-644dc6f0c15bccc7401e47785753e9c8d01018d3.tar.gz
pam-644dc6f0c15bccc7401e47785753e9c8d01018d3.tar.bz2
pam-644dc6f0c15bccc7401e47785753e9c8d01018d3.zip
libpam_internal: introduce pam_line
The pam_assemble_line function is renamed to pam_line_assemble and moved into libpam_internal so it can be shared across libpam and the pam_env module. Applied renaming to all other relevant functions and data structures so it is easier to locate them in files. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'modules/pam_env/pam_env.c')
-rw-r--r--modules/pam_env/pam_env.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c
index 6bece0f8..b0f0b453 100644
--- a/modules/pam_env/pam_env.c
+++ b/modules/pam_env/pam_env.c
@@ -31,7 +31,7 @@
#include "pam_inline.h"
#ifndef USE_ECONF
-#include "pam_assemble_line.h"
+#include "pam_line.h"
#endif
/* This little structure makes it easier to keep variables together */
@@ -316,9 +316,9 @@ econf_read_file(const pam_handle_t *pamh, const char *filename, const char *deli
static int read_file(const pam_handle_t *pamh, const char*filename, char ***lines)
{
FILE *conf;
- struct line_buffer buffer;
+ struct pam_line_buffer buffer;
- _pam_buffer_init(&buffer);
+ _pam_line_buffer_init(&buffer);
D(("Parsed file name is: %s", filename));
@@ -335,7 +335,7 @@ static int read_file(const pam_handle_t *pamh, const char*filename, char ***line
return PAM_BUF_ERR;
}
(*lines)[i] = 0;
- while (_pam_assemble_line(conf, &buffer, '\0') > 0) {
+ while (_pam_line_assemble(conf, &buffer, '\0') > 0) {
char *p = buffer.assembled;
char **tmp = NULL;
D(("Read line: %s", p));
@@ -344,7 +344,7 @@ static int read_file(const pam_handle_t *pamh, const char*filename, char ***line
pam_syslog(pamh, LOG_ERR, "Cannot allocate memory.");
(void) fclose(conf);
free_string_array(*lines);
- _pam_buffer_clear(&buffer);
+ _pam_line_buffer_clear(&buffer);
return PAM_BUF_ERR;
}
*lines = tmp;
@@ -353,14 +353,14 @@ static int read_file(const pam_handle_t *pamh, const char*filename, char ***line
pam_syslog(pamh, LOG_ERR, "Cannot allocate memory.");
(void) fclose(conf);
free_string_array(*lines);
- _pam_buffer_clear(&buffer);
+ _pam_line_buffer_clear(&buffer);
return PAM_BUF_ERR;
}
(*lines)[i] = 0;
}
(void) fclose(conf);
- _pam_buffer_clear(&buffer);
+ _pam_line_buffer_clear(&buffer);
return PAM_SUCCESS;
}
#endif