/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
-
-#include "uss_acl.h"
-#include "uss_common.h"
-#include "uss_fs.h"
-#include <rx/xdr.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netdb.h>
-#include <errno.h>
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
+#include <roken.h>
#undef VIRTUE
#undef VICE
#include <afs/afsint.h>
#include <afs/prs_fs.h>
#include <afs/com_err.h>
+#include <afs/afs_consts.h>
+#include <rx/xdr.h>
+
+#include "uss_acl.h"
+#include "uss_common.h"
+#include "uss_fs.h"
#define MAXNAME 100
-#define MAXSIZE 2048
#undef USS_ACL_DB
afs_int32 rights;
};
-static int PruneList();
+static int PruneList(struct AclEntry **a_aclPP);
/*------------------------------------------------------------------------
* As advertised.
*------------------------------------------------------------------------*/
-static
-foldcmp(a_str1, a_str2)
- register char *a_str1;
- register char *a_str2;
-
+static int
+foldcmp(char *a_str1, char *a_str2)
{ /*foldcmp */
- register char t, u;
+ char t, u;
while (1) {
t = *a_str1++;
*------------------------------------------------------------------------*/
static afs_int32
-Convert(a_rights)
- register char *a_rights;
-
+Convert(char *a_rights)
{ /*Convert */
- register int i, len;
+ int i, len;
afs_int32 mode;
- register char tc;
+ char tc;
if (!strcmp(a_rights, "read"))
return (PRSFS_READ | PRSFS_LOOKUP);
*------------------------------------------------------------------------*/
static struct AclEntry *
-FindList(a_alist, a_name)
- register struct AclEntry *a_alist;
- char *a_name;
-
+FindList(struct AclEntry *a_alist, char *a_name)
{ /*FindList */
while (a_alist) {
*------------------------------------------------------------------------*/
static void
-ChangeList(a_al, a_plus, a_name, a_rights)
- struct Acl *a_al;
- afs_int32 a_plus;
- char *a_name;
- afs_int32 a_rights;
-
+ChangeList(struct Acl *a_al, afs_int32 a_plus, char *a_name,
+ afs_int32 a_rights)
{ /*ChangeList */
struct AclEntry *tlist;
*------------------------------------------------------------------------*/
static int
-PruneList(a_aclPP)
- struct AclEntry **a_aclPP;
-
+PruneList(struct AclEntry **a_aclPP)
{ /*PruneList */
struct AclEntry **lPP;
*------------------------------------------------------------------------*/
static char *
-SkipLine(a_str)
- register char *a_str;
-
+SkipLine(char *a_str)
{ /*SkipLine */
while (*a_str != '\n')
*------------------------------------------------------------------------*/
static struct Acl *
-EmptyAcl()
+EmptyAcl(void)
{ /*EmptyAcl */
- register struct Acl *tp;
+ struct Acl *tp;
tp = (struct Acl *)malloc(sizeof(struct Acl));
tp->nplus = tp->nminus = 0;
*------------------------------------------------------------------------*/
static struct Acl *
-ParseAcl(a_str)
- char *a_str;
-
+ParseAcl(char *a_str)
{ /*ParseAcl */
int nplus, nminus, i, trights;
*------------------------------------------------------------------------*/
static char *
-AclToString(a_acl)
- struct Acl *a_acl;
-
+AclToString(struct Acl *a_acl)
{ /*AclToString */
- static char mydata[MAXSIZE];
- char tstring[MAXSIZE];
+ static char mydata[AFS_PIOCTL_MAXSIZE];
+ char tstring[AFS_PIOCTL_MAXSIZE];
struct AclEntry *tp;
/*
*------------------------------------------------------------------------*/
afs_int32
-uss_acl_SetAccess(a_access, a_clear, a_negative)
- char *a_access;
- int a_clear;
- int a_negative;
-
+uss_acl_SetAccess(char *a_access, int a_clear, int a_negative)
{ /*uss_acl_SetAccess */
- register afs_int32 code;
+ afs_int32 code;
+#ifdef USS_ACL_DB
static char rn[] = "uss_acl_SetAccess";
+#endif
struct Acl *ta;
char *externalizedACL;
int plusp;
afs_int32 rights;
- char tmp_str[MAXSIZE];
- char path_field[MAXSIZE], user_field[64], rights_field[64], *tp;
+ char tmp_str[AFS_PIOCTL_MAXSIZE];
+ char path_field[AFS_PIOCTL_MAXSIZE], user_field[64], rights_field[64], *tp;
int overflow;
plusp = !a_negative;
tp = uss_common_FieldCp(path_field, a_access, ' ', sizeof(path_field),
&overflow);
if (overflow) {
- fprintf(stderr, "%s: * Pathname field too long (max is %d chars)\n",
+ fprintf(stderr, "%s: * Pathname field too long (max is %" AFS_SIZET_FMT " chars)\n",
uss_whoami, sizeof(path_field));
return (-1);
}
* Ask the Cache Manager to give us the externalized ACL for the
* given directory.
*/
- code = uss_fs_GetACL(path_field, tmp_str, MAXSIZE);
+ code = uss_fs_GetACL(path_field, tmp_str, AFS_PIOCTL_MAXSIZE);
if (code) {
- com_err(uss_whoami, code, "while getting access list for %s",
+ afs_com_err(uss_whoami, code, "while getting access list for %s",
path_field);
#ifdef USS_ACL_DB
printf("%s: Error code from uss_fs_GetACL %d, errno %d\n", rn, code,
printf("\t3. Non-existent user or group on ACL.\n");
return (code);
} else {
- com_err(uss_whoami, code, "while setting the access list");
+ afs_com_err(uss_whoami, code, "while setting the access list");
return (code);
}
}
*------------------------------------------------------------------------*/
afs_int32
-uss_acl_SetDiskQuota(a_path, a_q)
- char *a_path;
- int a_q;
-
+uss_acl_SetDiskQuota(char *a_path, int a_q)
{ /*uss_acl_SetDiskQuota */
- register afs_int32 code;
+ afs_int32 code;
+#ifdef USS_ACL_DB
static char rn[] = "uss_acl_SetDiskQuota";
+#endif
uss_VolumeStatus_t *status;
- char *name, *motd, *offmsg;
+ char *motd, *offmsg;
char *input;
- char tmp_str[MAXSIZE];
+ char tmp_str[AFS_PIOCTL_MAXSIZE];
if (uss_verbose)
fprintf(stderr,
status = (uss_VolumeStatus_t *) tmp_str;
status->MinQuota = status->MaxQuota = -1;
- name = motd = offmsg = NULL;
+ motd = offmsg = NULL;
status->MaxQuota = a_q;
input = (char *)status + sizeof(*status);
code = uss_fs_SetVolStat(a_path, tmp_str, sizeof(*status) + 3);
if (code) {
- com_err(uss_whoami, code, "while setting disk quota");
+ afs_com_err(uss_whoami, code, "while setting disk quota");
#ifdef USS_ACL_DB
printf("%s: uss_fs_SetVolStat() error code: %d, errno is %d\n", rn,
code, errno);
*------------------------------------------------------------------------*/
afs_int32
-uss_acl_CleanUp()
+uss_acl_CleanUp(void)
{ /*uss_acl_CleanUp */
- static char rn[] = "uss_acl_CleanUp";
struct uss_subdir *t, *old_t = NULL;
char tmp_str[uss_MAX_SIZE];