When a Kerberos 5 cross-realm trust is used, B<aklog> looks up the AFS ID
corresponding to the name (Kerberos principal) of the person invoking the
command, and if the user doesn't exist and the
-system:authuser@FOREIGN.REALM PTS group exists, then it attempts automatic
+C<system:authuser@FOREIGN.REALM> PTS group exists, then it attempts automatic
registration of the user with the foreign cell. The user is then added to
-the system:authuser@FOREIGN.REALM PTS group if registration is successful.
+the C<system:authuser@FOREIGN.REALM> PTS group if registration is successful.
Automatic registration in the foreign cell will fail if the group quota
-for the system:authuser@FOREIGN.REALM group is less than one. Each
+for the C<system:authuser@FOREIGN.REALM> group is less than one. Each
automatic registration decrements the group quota by one.
+=head1 CAUTIONS
+
When using B<aklog>, be aware that AFS uses the Kerberos v4 principal
naming format, not the Kerberos v5 format, when referring to principals in
PTS ACLs, F<UserList>, and similar locations. AFS will internally map
C<user.admin>, and for the principal C<host/shell.example.com>, refer to
it as C<rcmd.shell>.
+The B<aklog> mapping of Kerberos v5 principal to Kerberos v4 principal and
+the determination that a Kerberos realm is foreign is performed in the
+absence of the actual AFS server configuration. If the B<aklog> mapping
+of Kerberos v5 principal to Kerberos v4 principal or the foreign realm
+determination is wrong, the PTS name-to-id lookup will produce the wrong
+AFS ID for the user. The AFS ID is only used for display purposes and
+should not be trusted. Use the B<-noprdb> switch to disable the PTS
+name-to-id lookup.
+
=head1 OPTIONS
=over 4
* structure which should be freed by the caller.
* @param[out[ userPtr
* A string containing the principal of the user to whom the token was
- * issued. This is a malloc'd block which should be freed by the caller.
+ * issued. This is a malloc'd block which should be freed by the caller,
+ * if set.
*
* @returns
* 0 on success, an error value upon failure
static int
rxkad_build_native_token(krb5_context context, krb5_creds *v5cred,
struct ktc_tokenUnion **tokenPtr, char **userPtr) {
- char username[BUFSIZ];
+ char username[BUFSIZ]="";
struct ktc_token token;
int status;
#ifdef HAVE_NO_KRB5_524
(char *) &k4inst,
(char *) &k4realm);
if (status) {
- afs_com_err(progname, status, "while converting principal "
- "to Kerberos V4 format");
- return AKLOG_KERBEROS;
- }
- strcpy (username, k4name);
- if (k4inst[0]) {
- strcat (username, ".");
- strcat (username, k4inst);
+ if (!noprdb)
+ afs_com_err(progname, status,
+ "while converting principal to Kerberos V4 format");
+ } else {
+ strcpy (username, k4name);
+ if (k4inst[0]) {
+ strcat (username, ".");
+ strcat (username, k4inst);
+ }
}
#else
len = min(get_princ_len(context, v5cred->client, 0),
return status;
}
- *userPtr = strdup(username);
+ if (username[0] != '\0')
+ *userPtr = strdup(username);
return 0;
}
* structure which should be freed by the caller.
* @param[out[ userPtr
* A string containing the principal of the user to whom the token was
- * issued. This is a malloc'd block which should be freed by the caller.
+ * issued. This is a malloc'd block which should be freed by the caller,
+ * if set.
*
* @returns
* 0 on success, an error value upon failure
* be freed by the caller.
* @parma[out] authuser
* A string containing the principal of the user to whom the token was
- * issued. This is a malloc'd block which should be freed by the caller.
+ * issued. This is a malloc'd block which should be freed by the caller,
+ * if set.
* @param[out] foreign
* Whether the user is considered as 'foreign' to the realm of the cell.
*
/* We now have the username, plus the realm name, so stitch them together
* to give us the name that the ptserver will know the user by */
- if (realmUsed == NULL) {
+ if (realmUsed == NULL || username == NULL) {
*authuser = username;
username = NULL;
*foreign = 0;
noprdb = 1;
#endif
- if (noprdb) {
+ if (username == NULL) {
+ afs_dprintf("Not resolving name to id\n");
+ }
+ else if (noprdb) {
afs_dprintf("Not resolving name %s to id (-noprdb set)\n", username);
}
else {
}
}
- afs_dprintf("Setting tokens. %s @ %s \n", username, cellconf.name);
+ if (username) {
+ afs_dprintf("Setting tokens. %s @ %s\n",
+ username, cellconf.name);
+ } else {
+ afs_dprintf("Setting tokens for cell %s\n", cellconf.name);
+ }
#ifndef AFS_AIX51_ENV
/* on AIX 4.1.4 with AFS 3.4a+ if a write is not done before