]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
ubik: Make ugen_ClientInit honor noAuthFlag
authorAndrew Deason <adeason@sinenomine.net>
Tue, 20 Jul 2010 17:46:00 +0000 (12:46 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 20 Jul 2010 19:05:44 +0000 (12:05 -0700)
ugen_ClientInit was still trying to use tokens to make an
authenticated connection, even if noAuthFlag was set. Make it so we do
not attempt authenticated connections with noAuthFlag, and suppress
the "Could not get afs tokens" message if noAuthFlag was set.

Change-Id: I1a0afbb8507307f09a3555e6a7ce0c197ddcc6ef
Reviewed-on: http://gerrit.openafs.org/2454
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/ubik/uinit.c

index e30c65d0d65c87b872a3b6dde076b50ccf196dbb..56bcaf33f72dadfd7396ae70af64772b5ea59067 100644 (file)
@@ -76,6 +76,10 @@ ugen_ClientInit(int noAuthFlag, const char *confDir, char *cellName, afs_int32 s
        confdir = AFSDIR_CLIENT_ETC_DIRPATH;
     }
 
+    if (noAuthFlag) {
+       secFlags |= AFSCONF_SECOPTS_NOAUTH;
+    }
+
     tdir = afsconf_Open(confdir);
     if (!tdir) {
        fprintf(stderr,
@@ -100,7 +104,7 @@ ugen_ClientInit(int noAuthFlag, const char *confDir, char *cellName, afs_int32 s
        fprintf(stderr, "%s: can't create client security object", funcName);
        return -1;
     }
-    if (scIndex == RX_SECIDX_NULL) {
+    if (scIndex == RX_SECIDX_NULL && !noAuthFlag) {
        fprintf(stderr,
                "%s: Could not get afs tokens, running unauthenticated.\n",
                funcName);