#include <afs/cellconfig.h>
#include <rx/rx_globals.h>
#include <afs/volser.h>
+#include <afs/volser_prototypes.h>
#include <afs/volint.h>
#include <afs/keys.h>
#include <afs/afsutil.h>
register afs_int32 code; /*Return code */
struct afsconf_dir *tdir; /*Ptr to conf dir info */
struct afsconf_cell info; /*Info about chosen cell */
- struct ktc_principal sname; /*Service name */
- struct ktc_token ttoken; /*Service ticket */
afs_int32 scIndex; /*Chosen security index */
+ afs_int32 secFlags;
struct rx_securityClass *sc; /*Generated security object */
afs_int32 i; /*Loop index */
#ifdef USS_VOL_DB
printf("[%s] Getting tickets if needed\n", rn);
#endif /* USS_VOL_DB */
- if (!a_noAuthFlag) {
- /*
- * We don't need tickets for unauthenticated connections.
- */
- strcpy(sname.cell, info.name);
- sname.instance[0] = 0;
- strcpy(sname.name, "afs");
- code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
- if (code) {
- fprintf(stderr,
- "%s: Couldn't get AFS tokens, running unauthenticated.\n",
- uss_whoami);
- scIndex = 0;
- } else {
- /*
- * We got a ticket, go for an authenticated connection.
- */
- if (ttoken.kvno >= 0 && ttoken.kvno <= 256)
- scIndex = 2; /*Kerberos */
- else {
- fprintf(stderr, "%s: Funny kvno (%d) in ticket, proceeding\n",
- uss_whoami, ttoken.kvno);
- scIndex = 2;
- }
- } /*Got a ticket */
- } /*Authentication desired */
- else
- scIndex = 0;
- /*
- * Generate the appropriate security object for the connection.
- */
-#ifdef USS_VOL_DB
- printf("[%s] Generating Rx security object\n", rn);
-#endif /* USS_VOL_DB */
- switch (scIndex) {
- case 0:
- sc = (struct rx_securityClass *)
- rxnull_NewClientSecurityObject();
- break;
-
- case 1:
- break;
-
- case 2:
- sc = (struct rx_securityClass *)
- rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey,
- ttoken.kvno, ttoken.ticketLen,
- ttoken.ticket);
- break;
+ secFlags = AFSCONF_SECOPTS_FALLBACK_NULL;
+ if (a_noAuthFlag)
+ secFlags |= AFSCONF_SECOPTS_NOAUTH;
+
+ code = afsconf_PickClientSecObj(tdir, secFlags, &info, a_cellName,
+ &sc, &scIndex, NULL);
+ if (code) {
+ printf("%s: Can't create client security object\n", uss_whoami);
+ exit(1);
+ }
+ if (scIndex == RX_SECIDX_NULL && !a_noAuthFlag) {
+ fprintf(stderr,
+ "%s: Couldn't get AFS tokens, running unauthenticated.\n",
+ uss_whoami);
}
/*
register struct hostent *th;
afs_int32 addr;
- char b1, b2, b3, b4;
+ afs_int32 b1, b2, b3, b4;
register afs_int32 code;
code = sscanf(a_name, "%d.%d.%d.%d", &b1, &b2, &b3, &b4);
* Parsed as 128.2.9.4, or similar; return it in network
* byte order (128 in byte 0).
*/
- addr =
- (((afs_int32) b1) << 24) | (((afs_int32) b2) << 16) |
- (((afs_int32) b3) << 8) | (afs_int32) b4;
+ addr = (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
return htonl(addr);
}
static char rn[] = "uss_vol_CreateVol"; /*Routine name */
#endif
afs_int32 pname; /*Partition name */
- afs_int32 volid, code; /*Volume ID, return code */
+ afs_uint32 volid; /*Volume ID */
+ afs_int32 code; /*return code */
afs_int32 saddr; /*Socket info for server */
int VolExistFlag = 0; /*Does the volume exist? */
int mpExistFlag = 0; /*Does the mountpoint exist? */
*------------------------------------------------------------------------*/
static int
-uss_vol_GetEntryByID(ubik_client *cstruct, afs_uint32 volid,
+uss_vol_GetEntryByID(struct ubik_client *cstruct, afs_uint32 volid,
afs_int32 voltype, struct nvldbentry *entryp)
{
struct vldbentry oentry;