summaryrefslogtreecommitdiff
path: root/contrib/bind/bin/nslookup
diff options
context:
space:
mode:
authorJeroen Ruigrok van der Werven <asmodai@FreeBSD.org>2000-05-26 07:17:19 +0000
committerJeroen Ruigrok van der Werven <asmodai@FreeBSD.org>2000-05-26 07:17:19 +0000
commita1f80258ebd90659a76bec0da3db9a1cff2f19bf (patch)
tree58c578d1f5a84acb9535b8fc95abe2637662f30f /contrib/bind/bin/nslookup
parent3664462f40b554812efa0ee39af44bb18ab65b8c (diff)
Notes
Diffstat (limited to 'contrib/bind/bin/nslookup')
-rw-r--r--contrib/bind/bin/nslookup/commands.l6
-rw-r--r--contrib/bind/bin/nslookup/list.c65
-rw-r--r--contrib/bind/bin/nslookup/main.c4
-rw-r--r--contrib/bind/bin/nslookup/nslookup.help3
4 files changed, 11 insertions, 67 deletions
diff --git a/contrib/bind/bin/nslookup/commands.l b/contrib/bind/bin/nslookup/commands.l
index 286ae952a78c..19cf06269ca4 100644
--- a/contrib/bind/bin/nslookup/commands.l
+++ b/contrib/bind/bin/nslookup/commands.l
@@ -105,7 +105,7 @@ extern void ViewList(char *);
%}
WS [ \t]
FLET [A-Za-z0-9.*\\_]
-LET [A-Za-z0-9.*]
+LET [A-Za-z0-9.*_]
NAME [A-Za-z0-9.*=_/-]
%%
^{WS}*server{WS}+{LET}{NAME}*{WS}*$ {
@@ -142,10 +142,6 @@ NAME [A-Za-z0-9.*=_/-]
Finger(yytext, 0);
return(1);
}
-^{WS}*view{WS}+{NAME}+{WS}*$ {
- ViewList((char *)yytext);
- return(1);
- }
^{WS}*ls{WS}+(("-a"|"-d"|"-h"|"-m"|"-s"){WS}+)?{LET}{NAME}*{WS}+>>?{WS}+{NAME}+{WS}*$ {
/*
* 2nd arg.
diff --git a/contrib/bind/bin/nslookup/list.c b/contrib/bind/bin/nslookup/list.c
index 1b7f452b1ff0..db46d7f6da55 100644
--- a/contrib/bind/bin/nslookup/list.c
+++ b/contrib/bind/bin/nslookup/list.c
@@ -53,7 +53,7 @@
#ifndef lint
static const char sccsid[] = "@(#)list.c 5.23 (Berkeley) 3/21/91";
-static const char rcsid[] = "$Id: list.c,v 8.21 1999/10/15 19:49:08 vixie Exp $";
+static const char rcsid[] = "$Id: list.c,v 8.23 2000/03/30 23:25:34 vixie Exp $";
#endif /* not lint */
/*
@@ -135,7 +135,6 @@ int ListSubr();
*
* To see all types of information sorted by name, do the following:
* ls -d domain.edu > file
- * view file
*
* Results:
* SUCCESS the listing was successful.
@@ -422,8 +421,12 @@ ListSubr(int qtype, char *domain, char *cmd) {
}
name = ns_rr_name(rr);
if (origin[0] == '\0' && name[0] != '\0') {
- fprintf(filePtr, "$ORIGIN %s.\n", name);
- strcpy(origin, name);
+ if (strcmp(name, ".") != 0)
+ strcpy(origin, name);
+ fprintf(filePtr, "$ORIGIN %s.\n", origin);
+ if (strcmp(name, ".") == 0)
+ strcpy(origin, name);
+ strcpy(name_ctx, "@");
}
if (qtype == T_ANY || ns_rr_type(rr) == qtype) {
if (ns_sprintrr(&handle, &rr, name_ctx, origin,
@@ -496,60 +499,6 @@ ListSubr(int qtype, char *domain, char *cmd) {
return (ERROR);
}
}
-
-/*
- *******************************************************************************
- *
- * ViewList --
- *
- * A hack to view the output of the ls command in sorted
- * order using more.
- *
- *******************************************************************************
- */
-
-void
-ViewList(char *string) {
- char file[PATH_MAX];
- char command[PATH_MAX];
- int i, j;
- char soafile[PATH_MAX];
-
- /* sscanf(string, " view %s", file); */
- i = matchString(" view ", string);
- if (i > 0) {
- j = pickString(string + i, file, sizeof file);
- if (j == 0) {
- fprintf(stderr, "*** invalid file name: %s\n", string + i);
- return ;
- }
- }
-
- if ( !mktemp(strcpy(soafile,"/var/tmp/nslookup_tmpXXXXXX"))) {
- fprintf(stderr, "*** cannot create temp file\n");
- return ;
- }
- (void)sprintf(command, "sed '\
-/^$/,${\
-/@/,$d\
-}\
-/^[^ ]/{\
-h\
-s/^\\([^ ]* *\\).*/\\1/\
-x\
-}\
-1,/^$/{\
-w %s\
-d\
-}\
-/^ /{\
-G\
-s/^ *//\
-s/^\\(.*\\)\\n\\(.*\\)$/\\2\\1/\
-}' %s | sort | (cat %s -; rm %s) | %s",
- soafile, file, soafile, soafile, pager);
- system(command);
-}
/*
*******************************************************************************
diff --git a/contrib/bind/bin/nslookup/main.c b/contrib/bind/bin/nslookup/main.c
index d36c0f47ee5d..f78d9273cd1f 100644
--- a/contrib/bind/bin/nslookup/main.c
+++ b/contrib/bind/bin/nslookup/main.c
@@ -77,7 +77,7 @@ char copyright[] =
#ifndef lint
static const char sccsid[] = "@(#)main.c 5.42 (Berkeley) 3/3/91";
-static const char rcsid[] = "$Id: main.c,v 8.13 1999/10/13 16:39:19 vixie Exp $";
+static const char rcsid[] = "$Id: main.c,v 8.14 2000/03/30 23:25:34 vixie Exp $";
#endif /* not lint */
/*
@@ -171,7 +171,7 @@ jmp_buf env;
/*
- * Browser command for help and view.
+ * Browser command for help.
*/
char *pager;
diff --git a/contrib/bind/bin/nslookup/nslookup.help b/contrib/bind/bin/nslookup/nslookup.help
index 015bdc2e94fa..31a66345a523 100644
--- a/contrib/bind/bin/nslookup/nslookup.help
+++ b/contrib/bind/bin/nslookup/nslookup.help
@@ -1,4 +1,4 @@
-$Id: nslookup.help,v 8.4 1996/10/25 18:09:41 vixie Exp $
+$Id: nslookup.help,v 8.5 2000/03/30 23:25:35 vixie Exp $
Commands: (identifiers are shown in uppercase, [] means optional)
NAME - print info about the host/domain NAME using default server
@@ -30,5 +30,4 @@ ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to FILE)
-s - list well-known services
-d - list all records
-t TYPE - list records of the given type (e.g., A,CNAME,MX, etc.)
-view FILE - sort an 'ls' output file and view it with more
exit - exit the program, ^D also exits