Separate out SAMPLE_SERVICE (the Kerberos service name) and SAMPLE_PORT
authorTheodore Tso <tytso@mit.edu>
Wed, 1 Dec 1993 22:52:41 +0000 (22:52 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 1 Dec 1993 22:52:41 +0000 (22:52 +0000)
the TCP/IP port to look up in /etc/services.  They are two separate concept
which should have separate defines.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3070 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/sample/sample.h
src/appl/sample/sclient/sclient.c

index d5801f1c8384856e4dbb47da9bde42abe1add66c..7bb299f2157d3e99bea58f055f20cfc8a61517ac 100644 (file)
@@ -31,6 +31,7 @@
 #define KRB5_SAMPLE__
 
 #define SAMPLE_SERVICE "sample"
+#define SAMPLE_PORT "sample"
 #define SAMPLE_VERSION "KRB5_sample_protocol_v1.0"
 
 #endif /* KRB5_SAMPLE__ */
index 7538834364200854a345f5580b2c2f4db1408109..32ade26171a2fe1105cb7472ef81868204a53a3e 100644 (file)
@@ -87,11 +87,11 @@ char *argv[];
        sin.sin_port = htons(atoi(argv[2]));
     } else {
        /* find the port number for knetd */
-       sp = getservbyname(SAMPLE_SERVICE, "tcp");
+       sp = getservbyname(SAMPLE_PORT, "tcp");
        if (!sp) {
            fprintf(stderr,
                    "unknown service %s/tcp; check /etc/services\n",
-                   SAMPLE_SERVICE);
+                   SAMPLE_PORT);
            exit(1);
        }
        /* copy the port number */