summaryrefslogtreecommitdiff
path: root/source3/libsmb/namequery.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-15 11:48:23 -0700
committerAndrew Tridgell <tridge@samba.org>2009-09-15 11:48:23 -0700
commitdac0fb0b7c369255e0d07e47a11f6a0288019da1 (patch)
tree63b513e26972b3c5286a015b6dc110b4b20b1305 /source3/libsmb/namequery.c
parentefe9f952504a5a3114cada5f0caed315c4bc654d (diff)
parente44c4141fdfa07bb3bd09f28e5f093d27f170dc8 (diff)
downloadsamba-dac0fb0b7c369255e0d07e47a11f6a0288019da1.tar.gz
samba-dac0fb0b7c369255e0d07e47a11f6a0288019da1.tar.bz2
samba-dac0fb0b7c369255e0d07e47a11f6a0288019da1.zip
Merge branch 'master' of /home/tridge/samba/git/combined
Diffstat (limited to 'source3/libsmb/namequery.c')
-rw-r--r--source3/libsmb/namequery.c128
1 files changed, 0 insertions, 128 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 1a641ac791..930f0a54f4 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -847,134 +847,6 @@ struct sockaddr_storage *name_query(int fd,
}
/********************************************************
- Start parsing the lmhosts file.
-*********************************************************/
-
-XFILE *startlmhosts(const char *fname)
-{
- XFILE *fp = x_fopen(fname,O_RDONLY, 0);
- if (!fp) {
- DEBUG(4,("startlmhosts: Can't open lmhosts file %s. "
- "Error was %s\n",
- fname, strerror(errno)));
- return NULL;
- }
- return fp;
-}
-
-/********************************************************
- Parse the next line in the lmhosts file.
-*********************************************************/
-
-bool getlmhostsent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, int *name_type,
- struct sockaddr_storage *pss)
-{
- char line[1024];
-
- *pp_name = NULL;
-
- while(!x_feof(fp) && !x_ferror(fp)) {
- char *ip = NULL;
- char *flags = NULL;
- char *extra = NULL;
- char *name = NULL;
- const char *ptr;
- char *ptr1 = NULL;
- int count = 0;
-
- *name_type = -1;
-
- if (!fgets_slash(line,sizeof(line),fp)) {
- continue;
- }
-
- if (*line == '#') {
- continue;
- }
-
- ptr = line;
-
- if (next_token_talloc(ctx, &ptr, &ip, NULL))
- ++count;
- if (next_token_talloc(ctx, &ptr, &name, NULL))
- ++count;
- if (next_token_talloc(ctx, &ptr, &flags, NULL))
- ++count;
- if (next_token_talloc(ctx, &ptr, &extra, NULL))
- ++count;
-
- if (count <= 0)
- continue;
-
- if (count > 0 && count < 2) {
- DEBUG(0,("getlmhostsent: Ill formed hosts line [%s]\n",
- line));
- continue;
- }
-
- if (count >= 4) {
- DEBUG(0,("getlmhostsent: too many columns "
- "in lmhosts file (obsolete syntax)\n"));
- continue;
- }
-
- if (!flags) {
- flags = talloc_strdup(ctx, "");
- if (!flags) {
- continue;
- }
- }
-
- DEBUG(4, ("getlmhostsent: lmhost entry: %s %s %s\n",
- ip, name, flags));
-
- if (strchr_m(flags,'G') || strchr_m(flags,'S')) {
- DEBUG(0,("getlmhostsent: group flag "
- "in lmhosts ignored (obsolete)\n"));
- continue;
- }
-
- if (!interpret_string_addr(pss, ip, AI_NUMERICHOST)) {
- DEBUG(0,("getlmhostsent: invalid address "
- "%s.\n", ip));
- }
-
- /* Extra feature. If the name ends in '#XX',
- * where XX is a hex number, then only add that name type. */
- if((ptr1 = strchr_m(name, '#')) != NULL) {
- char *endptr;
- ptr1++;
-
- *name_type = (int)strtol(ptr1, &endptr, 16);
- if(!*ptr1 || (endptr == ptr1)) {
- DEBUG(0,("getlmhostsent: invalid name "
- "%s containing '#'.\n", name));
- continue;
- }
-
- *(--ptr1) = '\0'; /* Truncate at the '#' */
- }
-
- *pp_name = talloc_strdup(ctx, name);
- if (!*pp_name) {
- return false;
- }
- return true;
- }
-
- return false;
-}
-
-/********************************************************
- Finish parsing the lmhosts file.
-*********************************************************/
-
-void endlmhosts(XFILE *fp)
-{
- x_fclose(fp);
-}
-
-/********************************************************
convert an array if struct sockaddr_storage to struct ip_service
return false on failure. Port is set to PORT_NONE;
*********************************************************/