diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/namequery.c | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/source4/libcli/namequery.c b/source4/libcli/namequery.c index 2a67df5ffd2..85270c10019 100644 --- a/source4/libcli/namequery.c +++ b/source4/libcli/namequery.c @@ -457,118 +457,6 @@ struct ipv4_addr *name_query(int fd,const char *name,int name_type, } /******************************************************** - Start parsing the lmhosts file. -*********************************************************/ - -XFILE *startlmhosts(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 *mem_ctx, - XFILE *fp, pstring name, int *name_type, struct ipv4_addr *ipaddr) -{ - pstring line; - - while(!x_feof(fp) && !x_ferror(fp)) { - pstring ip,flags,extra; - const char *ptr; - char *ptr1; - int count = 0; - - *name_type = -1; - - if (!fgets_slash(line,sizeof(pstring),fp)) - continue; - - if (*line == '#') - continue; - - pstrcpy(ip,""); - pstrcpy(name,""); - pstrcpy(flags,""); - - ptr = line; - - if (next_token(&ptr,ip ,NULL,sizeof(ip))) - ++count; - if (next_token(&ptr,name ,NULL, sizeof(pstring))) - ++count; - if (next_token(&ptr,flags,NULL, sizeof(flags))) - ++count; - if (next_token(&ptr,extra,NULL, sizeof(extra))) - ++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; - } - - 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; - } - - *ipaddr = interpret_addr2(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 '#' */ - } - - return True; - } - - return False; -} - -/******************************************************** - Finish parsing the lmhosts file. -*********************************************************/ - -void endlmhosts(XFILE *fp) -{ - x_fclose(fp); -} - - -/******************************************************** Resolve via "bcast" method. *********************************************************/ |