#else /* !WINDOWS */
#include <afs/stds.h>
+#ifndef AFS_OBSD_ENV
#include <afs/com_err.h>
+#endif
#include <afs/param.h>
#ifdef AFS_SUN5_ENV
#include <afs/vice.h>
#include <afs/venus.h>
#include <afs/ptserver.h>
+#include <afs/ptuser.h>
#include <afs/dirpath.h>
#endif /* WINDOWS */
#if !defined(HAVE_KRB5_524_CONVERT_CREDS) && defined(HAVE_KRB524_CONVERT_CREDS_KDC)
#define krb5_524_convert_creds krb524_convert_creds_kdc
#elif !defined(HAVE_KRB5_524_CONVERT_CREDS) && !defined(HAVE_KRB524_CONVERT_CREDS_KDC)
-#error "You must have one of krb5_524_convert_creds or krb5_524_convert_creds_kdc available"
+#error "You must have one of krb5_524_convert_creds or krb524_convert_creds_kdc available"
#endif
#endif /* WINDOWS */
{
int status = AKLOG_SUCCESS;
struct afsconf_dir *configdir;
- char *dirpath;
memset(local_cell, 0, sizeof(local_cell));
memset((char *)cellconfig, 0, sizeof(*cellconfig));
* doing anything. Otherwise, log to it and mark that it has been logged
* to.
*/
-#ifdef __STDC__
static int auth_to_cell(krb5_context context, char *cell, char *realm)
-#else
-static int auth_to_cell(context, cell, realm)
-
- krb5_context context;
- char *cell;
- char *realm;
-#endif /* __STDC__ */
{
int status = AKLOG_SUCCESS;
char username[BUFSIZ]; /* To hold client username structure */
- long viceId; /* AFS uid of user */
+ afs_int32 viceId; /* AFS uid of user */
char name[ANAME_SZ]; /* Name of afs key */
char primary_instance[INST_SZ]; /* Instance of afs key */
strncpy(username, get_princ_str(context, v5cred->client, 0), len);
username[len] = '\0';
- if (second_comp(context, v5cred->client) > 1) {
+ if (second_comp(context, v5cred->client)) {
strcat(username, ".");
p = username + strlen(username);
len = min(get_princ_len(context, v5cred->client, 1),
strcpy(lastcell, aserver.cell);
- if (!pr_Initialize (0, confname, aserver.cell, 0))
+ if (!pr_Initialize (0, confname, aserver.cell))
status = pr_SNameToId (username, &viceId);
if (dflag) {
* level
*/
- if ((status = pr_Initialize(1L, confname, aserver.cell, 0))) {
+ if ((status = pr_Initialize(1L, confname, aserver.cell))) {
printf("Error %d\n", status);
}
#ifndef WINDOWS /* struct ViceIoctl missing */
-#ifdef __STDC__
static int get_afs_mountpoint(char *file, char *mountpoint, int size)
-#else
-static int get_afs_mountpoint(file, mountpoint, size)
- char *file;
- char *mountpoint;
- int size;
-#endif /* __STDC__ */
{
#ifdef AFS_SUN_ENV
char V ='V'; /* AFS has problem on Sun with pioctl */
* to be descended. After that, it should be called with the arguemnt
* NULL.
*/
-#ifdef __STDC__
static char *next_path(char *origpath)
-#else
-static char *next_path(origpath)
- char *origpath;
-#endif /* __STDC__ */
{
static char path[MAXPATHLEN + 1];
static char pathtocheck[MAXPATHLEN + 1];
? elast_comp - last_comp : strlen(last_comp);
strncat(pathtocheck, last_comp, len);
memset(linkbuf, 0, sizeof(linkbuf));
- if ((link = readlink(pathtocheck, linkbuf,
- sizeof(linkbuf))) > 0) {
+ if (link = (readlink(pathtocheck, linkbuf,
+ sizeof(linkbuf)) > 0)) {
if (++symlinkcount > MAXSYMLINKS) {
fprintf(stderr, "%s: %s\n", progname, strerror(ELOOP));
exit(AKLOG_BADPATH);
#ifndef WINDOWS /* struct ViceIoctl missing */
-#ifdef __STDC__
static void add_hosts(char *file)
-#else
-static void add_hosts(file)
- char *file;
-#endif /* __STDC__ */
{
#ifdef AFS_SUN_ENV
char V = 'V'; /* AFS has problem on SunOS */
* This routine descends through a path to a directory, logging to
* every cell it encounters along the way.
*/
-#ifdef __STDC__
static int auth_to_path(krb5_context context, char *path)
-#else
-static int auth_to_path(context, path)
- krb5_context context;
- char *path; /* The path to which we try to authenticate */
-#endif /* __STDC__ */
{
int status = AKLOG_SUCCESS;
int auth_to_cell_status = AKLOG_SUCCESS;
if (path[0] == DIR)
strcpy(pathtocheck, path);
else {
- if (getwd(pathtocheck) == NULL) {
+ if (getcwd(pathtocheck, sizeof(pathtocheck)) == NULL) {
fprintf(stderr, "Unable to find current working directory:\n");
fprintf(stderr, "%s\n", pathtocheck);
fprintf(stderr, "Try an absolute pathname.\n");
/* Print usage message and exit */
-#ifdef __STDC__
static void usage(void)
-#else
-static void usage()
-#endif /* __STDC__ */
{
fprintf(stderr, "\nUsage: %s %s%s%s\n", progname,
"[-d] [[-cell | -c] cell [-k krb_realm]] ",