summaryrefslogtreecommitdiff
path: root/clients/zlocate
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2007-07-20 04:26:48 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2007-07-20 04:26:48 +0000
commit82ea504def6eb144c2b13b315890b297e29345c5 (patch)
treeb4623148e6feddde431fcb3b564342c5b0d64523 /clients/zlocate
parent0feeeb3f9ce439f7bca5b691c7c681319a107a8e (diff)
parente6df42eaf361b9878e79ab8964aa26e1ddb95cef (diff)
unpack of new upstream
Diffstat (limited to 'clients/zlocate')
-rw-r--r--clients/zlocate/Makefile.in22
-rw-r--r--clients/zlocate/zlocate.c27
2 files changed, 17 insertions, 32 deletions
diff --git a/clients/zlocate/Makefile.in b/clients/zlocate/Makefile.in
index 2a6dd06..fe88f0e 100644
--- a/clients/zlocate/Makefile.in
+++ b/clients/zlocate/Makefile.in
@@ -8,31 +8,32 @@ sbindir=@sbindir@
lsbindir=@lsbindir@
includedir=${prefix}/include
-mandir=@mandir@
+mandir=${prefix}/man
libdir=${exec_prefix}/lib
bindir=${exec_prefix}/bin
+top_builddir=../..
srcdir=@srcdir@
top_srcdir=@top_srcdir@
-top_builddir=../..
BUILDTOP=../..
VPATH=@srcdir@
+LIBTOOL=@LIBTOOL@
CC=@CC@
INSTALL=@INSTALL@
-LIBTOOL=@LIBTOOL@
+LIBZEPHYR=${BUILDTOP}/lib/libzephyr.la
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
ALL_CFLAGS=${CFLAGS} -I${top_srcdir}/h -I${BUILDTOP}/h ${CPPFLAGS}
-LDFLAGS=-L${BUILDTOP}/lib @LDFLAGS@
-LIBS=${BUILDTOP}/lib/libzephyr.la @LIBS@ -lcom_err
+LDFLAGS=@LDFLAGS@
+LIBS=${LIBZEPHYR} @LIBS@ -lcom_err
OBJS= zlocate.o
all: zlocate
-zlocate: ${OBJS} ${BUILDTOP}/lib/libzephyr.la
- ${LIBTOOL} ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+zlocate: ${OBJS} ${LIBZEPHYR}
+ ${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
.c.o:
${CC} -c ${ALL_CFLAGS} $<
@@ -40,11 +41,12 @@ zlocate: ${OBJS} ${BUILDTOP}/lib/libzephyr.la
check:
install: zlocate
- ${LIBTOOL} ${INSTALL} -m 755 -s zlocate ${DESTDIR}${bindir}
- ${LIBTOOL} ${INSTALL} -m 644 ${srcdir}/zlocate.1 ${DESTDIR}${mandir}/man1
+ ${LIBTOOL} --mode=install ${INSTALL} -m 755 zlocate ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/zlocate.1 ${DESTDIR}${mandir}/man1
clean:
- ${LIBTOOL} rm -f ${OBJS} zlocate
+ ${LIBTOOL} --mode=clean rm -f zlocate
+ rm -f ${OBJS}
${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
diff --git a/clients/zlocate/zlocate.c b/clients/zlocate/zlocate.c
index 8428274..4469565 100644
--- a/clients/zlocate/zlocate.c
+++ b/clients/zlocate/zlocate.c
@@ -72,7 +72,6 @@ main(argc,argv)
char user[BUFSIZ],*whichuser;
ZAsyncLocateData_t ald;
int retval,i,numlocs,numfound,loc,auth,rlen;
- char *galaxy;
ZNotice_t notice;
#ifdef _POSIX_VERSION
struct sigaction sa;
@@ -101,12 +100,6 @@ main(argc,argv)
case '1':
oneline = 1;
break;
- case 'G':
- if (i+1 == argc)
- usage();
- galaxy = argv[i+1];
- i++;
- break;
default:
usage();
break;
@@ -126,37 +119,27 @@ main(argc,argv)
numleft = numusers;
numfound = 0;
+ rlen = strlen(ZGetRealm());
i = 0;
for (loc = 0; loc < argc; loc++) {
- char *rhs;
-
- if (argv[loc][0] == '-') {
- if (argv[loc][1] == 'G')
- loc++;
- continue;
- }
-
- rhs = ZGetRhs(galaxy);
- rlen = strlen(rhs);
+ if (argv[loc][0] == '-') continue;
(void) strncpy(user,argv[loc],sizeof(user) - rlen - 2);
user[sizeof(user) - rlen - 2] = '\0';
if (!strchr(user,'@')) {
(void) strcat(user,"@");
- (void) strcat(user,rhs);
+ (void) strcat(user,ZGetRealm());
}
if (parallel) {
- if ((retval = ZRequestLocations(galaxy, user, &ald,
- i ? UNSAFE : UNACKED,
+ if ((retval = ZRequestLocations(user, &ald, i ? UNSAFE : UNACKED,
auth?ZAUTH:ZNOAUTH)) != ZERR_NONE) {
com_err(whoami,retval,"requesting location of %s",user);
exit(1);
}
i = 1;
} else {
- if ((retval = ZLocateUser(galaxy, user,&numlocs,
- auth?ZAUTH:ZNOAUTH)) != ZERR_NONE) {
+ if ((retval = ZLocateUser(user,&numlocs,auth?ZAUTH:ZNOAUTH)) != ZERR_NONE) {
com_err(whoami,retval,"while locating user %s",user);
exit(1);
}