summaryrefslogtreecommitdiff
path: root/source4/lib/util_file.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-15 20:03:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:11 -0500
commit85263c3061a4d086c9ab92b67238477cae15584f (patch)
treebaeeb52ae1c536bd6828828f78bba2f026112a23 /source4/lib/util_file.c
parentfd619b4fb3a9a5c05df765d2cf57a042a4d5da2d (diff)
downloadsamba-85263c3061a4d086c9ab92b67238477cae15584f.tar.gz
samba-85263c3061a4d086c9ab92b67238477cae15584f.tar.bz2
samba-85263c3061a4d086c9ab92b67238477cae15584f.zip
r10246: Remove unused function
Move auth-specific file to auth/ (This used to be commit 8aa9711a306b30da905f53148ebe352462852d74)
Diffstat (limited to 'source4/lib/util_file.c')
-rw-r--r--source4/lib/util_file.c90
1 files changed, 1 insertions, 89 deletions
diff --git a/source4/lib/util_file.c b/source4/lib/util_file.c
index 338b9547a5..156d09aaf5 100644
--- a/source4/lib/util_file.c
+++ b/source4/lib/util_file.c
@@ -22,94 +22,6 @@
#include "system/shmem.h"
#include "system/filesys.h"
-/*************************************************************************
- gets a line out of a file.
- line is of format "xxxx:xxxxxx:xxxxx:".
- lines with "#" at the front are ignored.
-*************************************************************************/
-int getfileline(void *vp, char *linebuf, int linebuf_size)
-{
- /* Static buffers we will return. */
- FILE *fp = (FILE *)vp;
- uint8_t c;
- uint8_t *p;
- size_t linebuf_len;
-
- if (fp == NULL)
- {
- DEBUG(0,("getfileline: Bad file pointer.\n"));
- return -1;
- }
-
- /*
- * Scan the file, a line at a time.
- */
- while (!feof(fp))
- {
- linebuf[0] = '\0';
-
- fgets(linebuf, linebuf_size, fp);
- if (ferror(fp))
- {
- return -1;
- }
-
- /*
- * Check if the string is terminated with a newline - if not
- * then we must keep reading and discard until we get one.
- */
-
- linebuf_len = strlen(linebuf);
- if (linebuf_len == 0)
- {
- linebuf[0] = '\0';
- return 0;
- }
-
- if (linebuf[linebuf_len - 1] != '\n')
- {
- c = '\0';
- while (!ferror(fp) && !feof(fp))
- {
- c = fgetc(fp);
- if (c == '\n')
- {
- break;
- }
- }
- }
- else
- {
- linebuf[linebuf_len - 1] = '\0';
- }
-
-#ifdef DEBUG_PASSWORD
- DEBUG(100, ("getfileline: got line |%s|\n", linebuf));
-#endif
- if ((linebuf[0] == 0) && feof(fp))
- {
- DEBUG(4, ("getfileline: end of file reached\n"));
- return 0;
- }
-
- if (linebuf[0] == '#' || linebuf[0] == '\0')
- {
- DEBUG(6, ("getfileline: skipping comment or blank line\n"));
- continue;
- }
-
- p = (uint8_t *) strchr_m(linebuf, ':');
- if (p == NULL)
- {
- DEBUG(0, ("getfileline: malformed line entry (no :)\n"));
- continue;
- }
- return linebuf_len;
- }
- return -1;
-}
-
-
/****************************************************************************
read a line from a file with possible \ continuation chars.
Blanks at the start or end of a line are stripped.
@@ -350,7 +262,7 @@ char **fd_lines_load(int fd, int *numlines, TALLOC_CTX *mem_ctx)
/****************************************************************************
-take a lislist of lines and modify them to produce a list where \ continues
+take a list of lines and modify them to produce a list where \ continues
a line
****************************************************************************/
void file_lines_slashcont(char **lines)