#include "uss_procs.h" /*Main uss operations */
#include "uss_kauth.h" /*AuthServer routines */
#include "uss_fs.h" /*CacheManager ops */
+#include "uss_ptserver.h"
+#include "uss_vol.h"
+#include "uss_acl.h"
#include <afs/cmd.h> /*Command line parsing */
#include <afs/cellconfig.h> /*Cell config defs */
#include <afs/kautils.h> /*MAXKTCREALMLEN & MAXKTCNAMELEN */
+#include <afs/pterror.h>
+#include <afs/vlserver.h>
#include <ubik.h>
+extern int yylex(void);
+extern int yyparse (void);
/*
* Label certain things which will be activated at a later time,
* as well as certain semi-implemented features/switches which need
int uss_BulkExpires = 0;
int local_Cell = 1;
-static int DoAdd();
+static int DoAdd(void);
/*-----------------------------------------------------------------------
* static GetCommon
int code; /*Result of ka_LocalCell */
if (strcmp(a_as->name, "help") == 0)
- return;
+ return 0;
if (a_as->parms[AUSS_TEMPLATE].items)
strcpy(Template, a_as->parms[AUSS_TEMPLATE].items->data);
if (a_as->parms[AUSS_VERBOSE].items)
*------------------------------------------------------------------------*/
static int
-SaveRestoreInfo()
+SaveRestoreInfo(void)
{ /*SaveRestoreInfo */
-
+#ifdef USS_DB
static char rn[] = "uss:SaveRestoreInfo"; /*Routine name */
+#endif
register afs_int32 code; /*Return code */
afs_int32 deletedUid; /*Uid to be nuked */
*------------------------------------------------------------------------*/
static int
-DoDelete()
+DoDelete(void)
{ /*DoDelete */
int code; /*Return code */
} /*DelUser */
-
+#if USS_FUTURE_FEATURES
+#if USS_DONT_HIDE_SOME_FEATURES
/*-----------------------------------------------------------------------
* static PurgeVolumes
*
} /*RestoreUser */
+#endif
+#endif
/*-----------------------------------------------------------------------
* static DoBulkAddLine
*------------------------------------------------------------------------*/
static int
-DoBulkAddLine(a_buf, a_tp)
- char *a_buf;
- char *a_tp;
-
+DoBulkAddLine(char *a_buf, char *a_tp)
{ /*DoBulkAddLine */
register int i; /*Loop variable */
+#ifdef USS_DB
static char rn[] = "DoBulkAddLine"; /*Routine name */
+#endif
int overflow; /*Overflow in field copy? */
#ifdef USS_DB
*------------------------------------------------------------------------*/
static int
-DoBulkDeleteLine(a_buf, a_tp)
- char *a_buf;
- char *a_tp;
-
+DoBulkDeleteLine(char *a_buf, char *a_tp)
{ /*DoBulkDeleteLine */
char volField[32]; /*Value of optional vol disposition field */
*------------------------------------------------------------------------*/
static int
-DoBulkPurgeVolumeLine(a_buf, a_tp)
- char *a_buf;
- char *a_tp;
-
+DoBulkPurgeVolumeLine(char *a_buf, char *a_tp)
{ /*DoBulkPurgeVolumeLine */
register int i; /*Loop variable */
*------------------------------------------------------------------------*/
static int
-DoBulkRestoreLine(a_buf, a_tp)
- char *a_buf;
- char *a_tp;
-
+DoBulkRestoreLine(char *a_buf, char *a_tp)
{ /*DoBulkRestoreLine */
register int i; /*Loop variable */
*------------------------------------------------------------------------*/
static int
-DoBulkExecLine(a_buf, a_tp)
- char *a_buf;
- char *a_tp;
-
+DoBulkExecLine(char *a_buf, char *a_tp)
{ /*DoBulkExecLine */
register afs_int32 code; /*Return code */
*------------------------------------------------------------------------*/
static int
-DoAdd()
+DoAdd(void)
{ /*DoAdd */
int code; /*Return code */
*------------------------------------------------------------------------*/
static int
-DoRestore()
+DoRestore(void)
{ /*DoRestore */
return (0);
*------------------------------------------------------------------------*/
void
-InitETTables()
+InitETTables(void)
{ /*InitETTables */
int
-osi_audit()
+osi_audit(void)
{
/* this sucks but it works for now.
*/
#include "AFS_component_version_number.c"
-main(argc, argv)
- int argc;
- char *argv[];
-
+int
+main(int argc, char *argv[])
{ /*Main routine */
register struct cmd_syndesc *cs; /*Command line syntax descriptor */
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(register char *a_str1, register char *a_str2)
{ /*foldcmp */
register char t, u;
*------------------------------------------------------------------------*/
static afs_int32
-Convert(a_rights)
- register char *a_rights;
-
+Convert(register char *a_rights)
{ /*Convert */
register int i, len;
*------------------------------------------------------------------------*/
static struct AclEntry *
-FindList(a_alist, a_name)
- register struct AclEntry *a_alist;
- char *a_name;
-
+FindList(register 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(register char *a_str)
{ /*SkipLine */
while (*a_str != '\n')
*------------------------------------------------------------------------*/
static struct Acl *
-EmptyAcl()
+EmptyAcl(void)
{ /*EmptyAcl */
register struct Acl *tp;
*------------------------------------------------------------------------*/
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];
*------------------------------------------------------------------------*/
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;
+#ifdef USS_ACL_DB
static char rn[] = "uss_acl_SetAccess";
+#endif
struct Acl *ta;
char *externalizedACL;
int plusp;
*------------------------------------------------------------------------*/
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;
+#ifdef USS_ACL_DB
static char rn[] = "uss_acl_SetDiskQuota";
+#endif
uss_VolumeStatus_t *status;
char *name, *motd, *offmsg;
char *input;
*------------------------------------------------------------------------*/
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];
/*
* ------------------------ Exported functions -----------------------
*/
-extern afs_int32 uss_acl_SetAccess();
+extern afs_int32 uss_acl_SetAccess(char *a_access, int a_clear,
+ int a_negative);
/*
* Summary:
* Set the value of the given ACL.
* Lower-level code otherwise.
*/
-extern afs_int32 uss_acl_SetDiskQuota();
+extern afs_int32 uss_acl_SetDiskQuota(char *a_path, int a_q);
/*
* Summary:
* Set the initial disk quota for a user.
* Lower-level code otherwise.
*/
-extern afs_int32 uss_acl_CleanUp();
+extern afs_int32 uss_acl_CleanUp(void);
/*
* Summary:
* Remove the uss_AccountCreator from the various ACLs s/he
*------------------------------------------------------------------------*/
void
-uss_common_Init()
+uss_common_Init(void)
{ /*uss_common_Init */
extern int line; /*Current template line */
*------------------------------------------------------------------------*/
void
-uss_common_Reset()
+uss_common_Reset(void)
{ /*uss_common_Reset */
extern int line; /*Current template line */
*------------------------------------------------------------------------*/
char *
-uss_common_FieldCp(a_to, a_from, a_separator, a_maxChars, a_overflowP)
- char *a_to;
- char *a_from;
- char a_separator;
- int a_maxChars;
- int *a_overflowP;
-
+uss_common_FieldCp(char *a_to, char *a_from, char a_separator,
+ int a_maxChars, int *a_overflowP)
{ /*uss_common_FieldCp */
register int chars_read; /*Number of chars read so far */
/*
* ------------------------ Exported functions -----------------------
*/
-extern void uss_common_Init();
+extern void uss_common_Init(void);
/*
* Summary:
* Set up various common uss variables, especially the saved
* Nothing.
*/
-extern void uss_common_Reset();
+extern void uss_common_Reset(void);
/*
* Summary:
* Reset some common uss variables to their idle or
* Nothing.
*/
-extern char *uss_common_FieldCp();
+extern char *uss_common_FieldCp(char *a_to, char *a_from, char a_separator,
+ int a_maxChars, int *a_overflowP);
/*
* Summary:
* Copy a ``field'', as terminated by the given separator, or
#include <netinet/in.h>
#include <string.h>
+#include <unistd.h>
#include <afs/venus.h>
+#include <rx/rx.h>
+#include <afs/sys_prototypes.h>
#include "uss_common.h"
*------------------------------------------------------------------------*/
static int
-InAFS(a_path)
- register char *a_path;
-
+InAFS(register char *a_path)
{ /*InAFS */
-
- static char rn[] = "uss_fs:InAFS";
register afs_int32 code;
blob.in = NULL;
*------------------------------------------------------------------------*/
static char *
-ParentAndComponent(a_path, a_parentBuff, a_componentPP)
- char *a_path;
- char *a_parentBuff;
- char **a_componentPP;
-
+ParentAndComponent(char *a_path, char *a_parentBuff, char **a_componentPP)
{ /*ParentAndComponent */
-
- static char rn[] = "uss_fs:Parent";
char *rightSlashP;
/*
*------------------------------------------------------------------------*/
static int
-CarefulPioctl(a_path, a_opcode, a_blobP, a_sl)
- char *a_path;
- int a_opcode;
- struct ViceIoctl *a_blobP;
- int a_sl;
-
+CarefulPioctl(char *a_path, int a_opcode, struct ViceIoctl *a_blobP, int a_sl)
{ /*CarefulPioctl */
-
+#ifdef USS_FS_DB
static char rn[] = "uss_fs:CarefulPioctl";
+#endif
register afs_int32 code;
/*
*------------------------------------------------------------------------*/
afs_int32
-uss_fs_GetACL(a_dirPath, a_aclBuff, a_aclBuffBytes)
- char *a_dirPath;
- char *a_aclBuff;
- afs_int32 a_aclBuffBytes;
-
+uss_fs_GetACL(char *a_dirPath, char *a_aclBuff, afs_int32 a_aclBuffBytes)
{ /*uss_fs_GetACL */
-
+#ifdef USS_FS_DB
static char rn[] = "uss_fs_GetACL"; /*Routine name */
+#endif
register afs_int32 code; /*pioctl() result */
blob.in = NULL;
*------------------------------------------------------------------------*/
afs_int32
-uss_fs_SetACL(a_dirPath, a_aclBuff, a_aclBuffBytes)
- char *a_dirPath;
- char *a_aclBuff;
- afs_int32 a_aclBuffBytes;
-
+uss_fs_SetACL(char *a_dirPath, char *a_aclBuff, afs_int32 a_aclBuffBytes)
{ /*uss_fs_SetACL */
-
+#ifdef USS_FS_DB
static char rn[] = "uss_fs_SetACL"; /*Routine name */
+#endif
register afs_int32 code; /*pioctl() result */
blob.in = a_aclBuff;
*------------------------------------------------------------------------*/
afs_int32
-uss_fs_GetVolStat(a_mountpoint, a_volStatBuff, a_volStatBuffBytes)
- char *a_mountpoint;
- char *a_volStatBuff;
- afs_int32 a_volStatBuffBytes;
-
+uss_fs_GetVolStat(char *a_mountpoint, char *a_volStatBuff,
+ afs_int32 a_volStatBuffBytes)
{ /*uss_fs_GetVolStat */
-
+#ifdef USS_FS_DB
static char rn[] = "uss_fs_GetVolStat"; /*Routine name */
+#endif
register afs_int32 code; /*pioctl() result */
blob.in = NULL;
*------------------------------------------------------------------------*/
afs_int32
-uss_fs_SetVolStat(a_mountpoint, a_volStatBuff, a_volStatBuffBytes)
- char *a_mountpoint;
- char *a_volStatBuff;
- afs_int32 a_volStatBuffBytes;
-
+uss_fs_SetVolStat(char *a_mountpoint, char *a_volStatBuff,
+ afs_int32 a_volStatBuffBytes)
{ /*uss_fs_SetVolStat */
-
+#ifdef USS_FS_DB
static char rn[] = "uss_fs_SetVolStat"; /*Routine name */
+#endif
register afs_int32 code; /*pioctl() result */
blob.in = a_volStatBuff;
*------------------------------------------------------------------------*/
afs_int32
-uss_fs_CkBackups()
+uss_fs_CkBackups(void)
{ /*uss_fs_CkBackups */
-
+#ifdef USS_FS_DB
static char rn[] = "uss_fs_CkBackups"; /*Routine name */
+#endif
register afs_int32 code; /*pioctl() result */
blob.in = NULL;
*------------------------------------------------------------------------*/
afs_int32
-uss_fs_MkMountPoint(a_volname, a_cellname, a_rw, a_mountpoint)
- char *a_volname;
- char *a_cellname;
- afs_int32 a_rw;
- char *a_mountpoint;
-
+uss_fs_MkMountPoint(char *a_volname, char *a_cellname, afs_int32 a_rw,
+ char *a_mountpoint)
{ /*uss_fs_MkMountPoint */
extern int local_Cell;
static char rn[] = "uss_fs_MkMountPoint"; /*Routine name */
*------------------------------------------------------------------------*/
afs_int32
-uss_fs_RmMountPoint(a_mountpoint)
- char *a_mountpoint;
-
+uss_fs_RmMountPoint(char *a_mountpoint)
{ /*uss_fs_RmMountPoint */
-
static char rn[] = "uss_fs_RmMountPoint"; /*Routine name */
register afs_int32 code; /*pioctl() result */
char *parentDirP; /*Ptr to parent */
* permissions list,) destroy all tokens, and then re-register the good ones.
* Ugly, but it works.
*/
-uss_fs_UnlogToken(celln)
- char *celln;
+int
+uss_fs_UnlogToken(char *celln)
{
- unsigned count = 0, index, index2;
+ unsigned int count = 0, index, index2;
afs_int32 code = 0, cnt = 0;
struct ktc_principal serviceName;
struct tokenInfo *tokenInfoP, *tp;
}
}
}
- if (code = ktc_ForgetAllTokens()) {
+ if ((code = ktc_ForgetAllTokens())) {
printf("uss_fs_UnlogToken: could not discard tickets, code %d\n",
code);
exit(1);
/*
* ------------------------ Exported functions -----------------------
*/
-extern afs_int32 uss_fs_GetACL();
+extern afs_int32 uss_fs_GetACL(char *a_dirPath, char *a_aclBuff,
+ afs_int32 a_aclBuffBytes);
/*
* Summary:
* Given the pathname for a directory, return its ACL.
* -1 otherwise, with errno set to the error.
*/
-extern afs_int32 uss_fs_SetACL();
+extern afs_int32 uss_fs_SetACL(char *a_dirPath, char *a_aclBuff,
+ afs_int32 a_aclBuffBytes);
/*
* Summary:
* Set the ACL on the specified directory.
* -1 otherwise, with errno set to the error.
*/
-extern afs_int32 uss_fs_GetVolStat();
+extern afs_int32 uss_fs_GetVolStat(char *a_mountpoint, char *a_volStatBuff,
+ afs_int32 a_volStatBuffBytes);
/*
* Summary:
* Given the pathname of an AFS mountpoint, find out what you
* -1 otherwise, with errno set to the error.
*/
-extern afs_int32 uss_fs_SetVolStat();
+extern afs_int32 uss_fs_SetVolStat(char *a_mountpoint, char *a_volStatBuff,
+ afs_int32 a_volStatBuffBytes);
/*
* Summary:
* Given the pathname of an AFS mountpoint, set the status info
* -1 otherwise, with errno set to the error.
*/
-extern afs_int32 uss_fs_CkBackups();
+extern afs_int32 uss_fs_CkBackups(void);
/*
* Summary:
* Make sure the CacheManager doesn't have any stale volume
* -1 otherwise, with errno set to the error.
*/
-extern afs_int32 uss_fs_MkMountPoint();
+extern afs_int32 uss_fs_MkMountPoint(char *a_volname, char *a_cellname,
+ afs_int32 a_rw, char *a_mountpoint);
/*
* Summary: *NEW*
* Given the name of the volume, the cell it lives in,
* -1 otherwise, with errno set to the error.
*/
-extern afs_int32 uss_fs_RmMountPoint();
+extern afs_int32 uss_fs_RmMountPoint(char *a_mountpoint);
/*
* Summary:
* Delete the given mountpoint.
* -1 otherwise, with errno set to the error.
*/
+extern int uss_fs_UnlogToken(char *celln);
+
#endif /* _USS_FS_H_ */
#include <afs/com_err.h>
#include <afs/kautils.h> /*MAXKTCREALMLEN*/
#include <afs/kaport.h> /* pack_long */
+#include <afs/kauth.h>
#define uss_kauth_MAX_SIZE 2048
#undef USS_KAUTH_DB
/*
*-----------------------------------------------------------------------*/
afs_int32
-uss_kauth_InitAccountCreator()
+uss_kauth_InitAccountCreator(void)
{ /*uss_kauth_InitAccountCreator */
char *name;
int Pipe = 0;
static char *
-getpipepass()
+getpipepass(void)
{
static char gpbuf[BUFSIZ];
/* read a password from stdin, stop on \n or eof */
afs_int32
-InitThisModule()
+InitThisModule(void)
{ /*InitThisModule */
-
+#ifdef USS_KAUTH_DB
static char rn[] = "uss_kauth:InitThisModule";
+#endif
register afs_int32 code;
- char *name, prompt[2 * MAXKTCNAMELEN + 20];
+ char prompt[2 * MAXKTCNAMELEN + 20];
char *reasonString, longPassBuff[1024], shortPassBuff[9];
struct ktc_encryptionKey key;
struct ktc_token token, tok;
strcpy(Name.name, "afs");
Name.instance[0] = '\0';
strncpy(Name.cell, uss_Cell, sizeof(Name.cell));
- if (code =
- ktc_GetToken(&Name, &token, sizeof(struct ktc_token), &tok)) {
+ if ((code =
+ ktc_GetToken(&Name, &token, sizeof(struct ktc_token), &tok))) {
code =
ka_UserAuthenticateLife(0, uss_AccountCreator,
CreatorInstance, uss_Cell,
*------------------------------------------------------------------------*/
afs_int32
-uss_kauth_AddUser(a_user, a_passwd)
- char *a_user;
- char *a_passwd;
-
+uss_kauth_AddUser(char *a_user, char *a_passwd)
{ /*uss_kauth_AddUser */
-
+#ifdef USS_KAUTH_DB
static char rn[] = "uss_kauth_AddUser"; /*Routine name */
- struct ktc_encryptionKey key;
+#endif
+ struct ktc_encryptionKey ktc_key;
+ EncryptionKey key;
afs_int32 code;
if (uss_SkipKaserver) {
* Given the (unencrypted) password and cell, generate a key to
* pass to the AuthServer.
*/
- ka_StringToKey(a_passwd, uss_Cell, &key);
+ ka_StringToKey(a_passwd, uss_Cell, &ktc_key);
+ memcpy(&key, &ktc_key, sizeof(key)); /* XXX - we could just cast */
+
if (!uss_DryRun) {
if (uss_verbose)
fprintf(stderr, "Adding user '%s' to the Authentication DB\n",
"%s: KAM_CreateUser: user='%s', CreatorInstance='%s', %d bytes\n",
rn, a_user, CreatorInstance, strlen(CreatorInstance));
#endif /* USS_KAUTH_DB_INSTANCE */
- code = ubik_Call(KAM_CreateUser, uconn_kauthP, 0, a_user, UserInstance, /*set by CheckUsername() */
- key);
+ code = ubik_KAM_CreateUser(uconn_kauthP, 0, a_user,
+ UserInstance, /*set by CheckUsername() */
+ key);
if (code) {
if (code == KAEXIST) {
if (uss_verbose)
*------------------------------------------------------------------------*/
afs_int32
-uss_kauth_DelUser(a_user)
- char *a_user;
-
+uss_kauth_DelUser(char *a_user)
{ /*uss_kauth_DelUser */
-
+#ifdef USS_KAUTH_DB
static char rn[] = "uss_kauth_DelUser"; /*Routine name */
+#endif
register afs_int32 code; /*Return code */
if (uss_SkipKaserver) {
#endif /* USS_KAUTH_DB_INSTANCE */
if (uss_verbose)
printf("Deleting user '%s' from Authentication DB\n", a_user);
- code = ubik_Call(KAM_DeleteUser, /*Procedure to call */
+ code = ubik_KAM_DeleteUser(
uconn_kauthP, /*Ubik client connection struct */
0, /*Flags */
a_user, /*User name to delete */
*------------------------------------------------------------------------*/
afs_int32
-uss_kauth_CheckUserName()
+uss_kauth_CheckUserName(void)
{ /*uss_kauth_CheckUserName */
-
+#ifdef USS_KAUTH_DB
static char rn[] = "uss_kauth_CheckUserName"; /*Routine name */
+#endif
register afs_int32 code; /*Return code */
if (uss_SkipKaserver) {
*/
afs_int32
-uss_kauth_SetFields(username, expirestring, reuse, failures, lockout)
- char *reuse;
- char *username;
- char *expirestring;
- char *failures;
- char *lockout;
+uss_kauth_SetFields(char *username, char *expirestring, char *reuse,
+ char *failures, char *lockout)
{
+#ifdef USS_KAUTH_DB
static char rn[] = "uss_kauth_SetFields";
+#endif
afs_int32 code;
char misc_auth_bytes[4];
int i;
/*
* ------------------------ Exported functions -----------------------
*/
-extern afs_int32 uss_kauth_InitAccountCreator();
+extern afs_int32 uss_kauth_InitAccountCreator(void);
/*
* Summary:
* Initialize the variable uss_AccountCreator().
* 1 if couldn't get user name from getpwuid().
*/
-extern afs_int32 uss_kauth_AddUser();
+extern afs_int32 uss_kauth_AddUser(char *, char *);
/*
* Summary:
* Register the given user with the Authentication Server.
* Code returned from a lower-level call.
*/
-extern afs_int32 uss_kauth_DelUser();
+extern afs_int32 uss_kauth_DelUser(char *);
/*
* Summary:
* Delete the given user from the Authentication Database.
* Code returned from a lower-level call.
*/
-extern afs_int32 uss_kauth_CheckUserName();
+extern afs_int32 uss_kauth_CheckUserName(void);
/*
* Summary:
* Make sure the parsed user name is a legal one.
#endif
#include <string.h>
-
+#include <stdarg.h>
+
#include <afs/kautils.h> /*MAXKTCREALMLEN*/
#undef USS_PROCS_DB
#undef USS_PROCS_DB_INSTANCE
char temp[1000];
extern int line;
-static int Copy();
-static int Echo();
+static int Copy(char *a_from, char *a_to, int a_mode);
+static int Echo(char *a_s, char *a_f, int a_mode);
/*-----------------------------------------------------------------------
* EXPORTED uss_procs_BuildDir
*------------------------------------------------------------------------*/
afs_int32
-uss_procs_BuildDir(a_path, a_mode, a_owner, a_access)
- char *a_path;
- char *a_mode;
- char *a_owner;
- char *a_access;
-
+uss_procs_BuildDir(char *a_path, char *a_mode, char *a_owner, char *a_access)
{ /*uss_procs_BuildDir */
int m, o;
*------------------------------------------------------------------------*/
afs_int32
-uss_procs_CpFile(a_path, a_mode, a_owner, a_proto)
- char *a_path;
- char *a_mode;
- char *a_owner;
- char *a_proto;
-
+uss_procs_CpFile(char *a_path, char *a_mode, char *a_owner, char *a_proto)
{ /*uss_procs_CpFile */
int m, o;
*------------------------------------------------------------------------*/
afs_int32
-uss_procs_EchoToFile(a_path, a_mode, a_owner, a_content)
- char *a_path;
- char *a_mode;
- char *a_owner;
- char *a_content;
-
+uss_procs_EchoToFile(char *a_path, char *a_mode, char *a_owner,
+ char *a_content)
{ /*uss_procs_EchoToFile */
int m, o;
*------------------------------------------------------------------------*/
afs_int32
-uss_procs_Exec(a_command)
- char *a_command;
-
+uss_procs_Exec(char *a_command)
{ /*uss_procs_Exec */
if (uss_verbose)
*------------------------------------------------------------------------*/
afs_int32
-uss_procs_SetLink(a_path1, a_path2, a_type)
- char *a_path1;
- char *a_path2;
- char a_type;
-
+uss_procs_SetLink(char *a_path1, char *a_path2, char a_type)
{ /*uss_procs_SetLink */
struct stat stbuf;
*------------------------------------------------------------------------*/
int
-uss_procs_GetOwner(a_ownerStr)
- char *a_ownerStr;
-
+uss_procs_GetOwner(char *a_ownerStr)
{ /*uss_procs_GetOwner */
struct passwd *pw; /*Ptr to password file entry */
*------------------------------------------------------------------------*/
static int
-Copy(a_from, a_to, a_mode)
- char *a_from;
- char *a_to;
- int a_mode;
-
+Copy(char *a_from, char *a_to, int a_mode)
{ /*Copy */
register int fd1, fd2;
strerror(errno));
return (1);
}
- if (rc = close(fd2))
+ if ((rc = close(fd2)))
uss_procs_PrintErr(line, "Warning: Failed to close '%s': %s\n",
a_from, strerror(errno));
return (0);
*------------------------------------------------------------------------*/
static int
-Echo(a_s, a_f, a_mode)
- char *a_s;
- char *a_f;
- int a_mode;
-
+Echo(char *a_s, char *a_f, int a_mode)
{ /*Echo */
register int fd;
*------------------------------------------------------------------------*/
afs_int32
-uss_procs_PickADir(path, cp)
- char *path;
- char *cp;
-
+uss_procs_PickADir(char *path, char *cp)
{ /*uss_procs_PickADir */
char cd[300]; /*Current directory for search */
*------------------------------------------------------------------------*/
int
-uss_procs_AddToDirPool(a_dirToAdd)
- char *a_dirToAdd;
+uss_procs_AddToDirPool(char *a_dirToAdd)
{
if (uss_NumGroups > 99) {
return (-1);
*------------------------------------------------------------------------*/
FILE *
-uss_procs_FindAndOpen(a_fileToOpen)
- char *a_fileToOpen;
-
+uss_procs_FindAndOpen(char *a_fileToOpen)
{ /*uss_procs_FindAndOpen */
#define NUM_TPL_PATHS 3
*------------------------------------------------------------------------*/
void
-uss_procs_PrintErr(a_lineNum, a_fmt, a_1, a_2, a_3, a_4, a_5)
- int a_lineNum;
- char *a_fmt;
- char *a_1;
- char *a_2;
- char *a_3;
- char *a_4;
- char *a_5;
-
+uss_procs_PrintErr(int a_lineNum, char *a_fmt, ... )
{ /*uss_procs_PrintErr */
-
+ va_list ap;
+
+ va_start(ap, a_fmt);
uss_syntax_err++;
fprintf(stderr, "%s: Template file, line %d: ", uss_whoami, a_lineNum);
- fprintf(stderr, a_fmt, a_1, a_2, a_3, a_4, a_5);
-
+ vfprintf(stderr, a_fmt, ap);
+ va_end(ap);
} /*uss_procs_PrintErr */
/*
* ------------------------ Exported functions -----------------------
*/
-extern afs_int32 uss_procs_BuildDir();
+extern afs_int32 uss_procs_BuildDir(char *a_path, char *a_mode,
+ char *a_owner, char *a_access);
/*
* Summary:
* Create and fully set up a directory for the user.
* Other error code if problem occurred in lower-level call.
*/
-extern afs_int32 uss_procs_CpFile();
+extern afs_int32 uss_procs_CpFile(char *a_path, char *a_mode,
+ char *a_owner, char *a_proto);
/*
* Summary:
* Copy the given file to the user's directory.
* Other error code if problem occurred in lower-level call.
*/
-extern afs_int32 uss_procs_EchoToFile();
+extern afs_int32 uss_procs_EchoToFile(char *a_path, char *a_mode,
+ char *a_owner, char *a_content);
/*
* Summary:
* Put the specified contents into the given file.
* Other error code if problem occurred in lower-level call.
*/
-extern afs_int32 uss_procs_Exec();
+extern afs_int32 uss_procs_Exec(char *a_command);
/*
* Summary:
* Execute the given Unix command.
* Other error code if problem occurred in lower-level call.
*/
-extern afs_int32 uss_procs_SetLink();
+extern afs_int32 uss_procs_SetLink(char *a_path1, char *a_path2,
+ char a_type);
/*
* Summary:
* Create either the given symbolic or hard link.
* Other error code if problem occurred in lower-level call.
*/
-extern int uss_procs_AddToDirPool();
+extern int uss_procs_AddToDirPool(char *a_dirToAdd);
/*
* Summary:
* Add the given pathname to the $AUTH directory pool
* Result of addition.
*/
-extern FILE *uss_procs_FindAndOpen();
+extern FILE *uss_procs_FindAndOpen(char *a_fileToOpen);
/*
* Summary:
* Given a template filename, get that file open and return the
* NULL otherwise.
*/
-extern void uss_procs_PrintErr();
+extern void uss_procs_PrintErr(int a_lineNum, char *a_fmt, ... );
/*
* Summary:
* Print out an error connected with template file parsing.
* Args:
* int a_lineNum : Template file line number having the error.
* char *a_fmt : Format string to use.
- * char *a_1 : First arg to print.
- * char *a_2 : Second ...
- * char *a_3 : Third ...
- * char *a_4 : Fourth ...
- * char *a_5 : Fifth ...
*
* Returns:
* Nothing.
*/
-extern int uss_procs_GetOwner();
+extern int uss_procs_GetOwner(char *a_ownerStr);
/*
* Summary:
* Translate the owner string to the owner uid.
#include "uss_ptserver.h" /*Module interface */
#include <afs/ptclient.h> /*Protection Server client interface */
#include <afs/pterror.h> /*Protection Server error codes */
+#include <afs/ptuser.h>
#include <afs/com_err.h> /*Error code xlation */
*------------------------------------------------------------------------*/
static afs_int32
-InitThisModule()
+InitThisModule(void)
{ /*InitThisModule */
static char rn[] = "uss_ptserver:InitThisModule"; /*Routine name */
*------------------------------------------------------------------------*/
afs_int32
-uss_ptserver_AddUser(a_user, a_uid)
- char *a_user;
- char *a_uid;
-
+uss_ptserver_AddUser(char *a_user, char *a_uid)
{ /*uss_ptserver_AddUser */
afs_int32 code; /*Various return codes */
* ID known for the user name.
*/
mappedUserID = id;
- if (code = pr_SNameToId(a_user, &mappedUserID)) {
+ if ((code = pr_SNameToId(a_user, &mappedUserID))) {
afs_com_err(uss_whoami, code,
"while getting uid from Protection Server");
return (code);
*------------------------------------------------------------------------*/
afs_int32
-uss_ptserver_DelUser(a_name)
- char *a_name;
-
+uss_ptserver_DelUser(char *a_name)
{ /*uss_ptserver_DelUser */
afs_int32 code; /*Various return codes */
*------------------------------------------------------------------------*/
afs_int32
-uss_ptserver_XlateUser(a_user, a_uidP)
- char *a_user;
- afs_int32 *a_uidP;
-
+uss_ptserver_XlateUser(char *a_user, afs_int32 *a_uidP)
{ /*uss_ptserver_XlateUser */
-
+#ifdef USS_PTSERVER_DB
static char rn[] = "uss_ptserver_XlateUser"; /*Routine name */
+#endif
register afs_int32 code; /*Various return codes */
if (uss_verbose)
/*
* ------------------------ Exported functions -----------------------
*/
-extern afs_int32 uss_ptserver_AddUser();
+extern afs_int32 uss_ptserver_AddUser(char *a_user, char *a_uid);
/*
* Summary:
* Register the given user with the Protection Server.
* Code returned from a lower-level call.
*/
-extern afs_int32 uss_ptserver_DelUser();
+extern afs_int32 uss_ptserver_DelUser(char *a_name);
/*
* Summary:
* Delete the given user from the Protection Server.
* Code returned from a lower-level call.
*/
-extern afs_int32 uss_ptserver_XlateUser();
+extern afs_int32 uss_ptserver_XlateUser(char *a_user, afs_int32 *a_uidP);
/*
* Summary:
* Ask the Protection Server to translate the given user
#include "uss_common.h" /*Common definitions */
#include "uss_procs.h" /*Defs from procs module */
#include "uss_fs.h" /*CacheManager ops */
+#include "uss_acl.h"
#include <sys/stat.h>
#include <pwd.h>
#include <netdb.h>
#include <string.h>
+#include <afs/com_err.h>
#include <afs/vlserver.h>
+#include <afs/vldbint.h>
#include <afs/auth.h>
#include <afs/cellconfig.h>
#include <rx/rx_globals.h>
#include <afs/volser.h>
#include <afs/volint.h>
#include <afs/keys.h>
+#include <afs/afsutil.h>
#include <ubik.h>
-extern struct rx_connection *UV_Bind();
extern int line;
-extern int VL_GetEntryByID();
-extern char *hostutil_GetNameByINet();
-
/*
* ---------------------- Private definitions ---------------------
*------------------------------------------------------------------------*/
static afs_int32
-InitThisModule(a_noAuthFlag, a_confDir, a_cellName)
- int a_noAuthFlag;
- char *a_confDir;
- char *a_cellName;
-
+InitThisModule(int a_noAuthFlag, char *a_confDir, char *a_cellName)
{ /*InitThisModule */
-
+#ifdef USS_VOL_DB
static char rn[] = "uss_vol:InitThisModule";
+#endif
register afs_int32 code; /*Return code */
struct afsconf_dir *tdir; /*Ptr to conf dir info */
struct afsconf_cell info; /*Info about chosen cell */
* As advertised.
*------------------------------------------------------------------------*/
-char *hostutil_GetNameByINet();
-
static void
-HostIDToHostName(a_hostID, a_hostName)
- afs_int32 a_hostID;
- char *a_hostName;
-
+HostIDToHostName(afs_int32 a_hostID, char *a_hostName)
{ /*HostIDToHostName */
strcpy(a_hostName, hostutil_GetNameByINet(a_hostID));
*------------------------------------------------------------------------*/
static afs_int32
-PartIDToPartName(a_partID, a_partName)
- afs_int32 a_partID;
- char *a_partName;
-
+PartIDToPartName(afs_int32 a_partID, char *a_partName)
{ /*PartIDToPartName */
-
+#ifdef USS_VOL_DB
static char rn[] = "PartIDToPartName";
-
+#endif
#ifdef USS_VOL_DB
printf("[%s] Translating partition id %d to its name\n", rn, a_partID);
#endif /* USS_VOL_DB */
*------------------------------------------------------------------------*/
afs_int32
-uss_vol_GetServer(a_name)
- char *a_name;
-
+uss_vol_GetServer(char *a_name)
{ /*uss_vol_GetServer */
register struct hostent *th;
} /*uss_vol_GetServer */
+/* XXX - This function is unused, and could be deleted */
+#if 0
/*------------------------------------------------------------------------
* static GetVolumeType
*
*------------------------------------------------------------------------*/
static afs_int32
-GetVolumeType(a_type)
- char *a_type;
-
+GetVolumeType(char *a_type)
{ /*GetVolumeType */
if (!strcmp(a_type, "ro"))
return (-1);
} /*GetVolumeType */
-
+#endif
/*------------------------------------------------------------------------
* EXPORTED uss_Vol_GetPartitionID
*------------------------------------------------------------------------*/
afs_int32
-uss_vol_GetPartitionID(a_name)
- char *a_name;
-
+uss_vol_GetPartitionID(char *a_name)
{ /*uss_vol_GetPartitionID */
register char tc;
*------------------------------------------------------------------------*/
static int
-CheckDoubleMount(a_mp, a_oldmp)
- char *a_mp;
- char *a_oldmp;
-
+CheckDoubleMount(char *a_mp, char *a_oldmp)
{ /*CheckDoubleMount */
+#ifdef USS_VOL_DB
static char rn[] = "uss_vol:CheckDoubleMount";
+#endif
int start, len, mlen, tlen;
int i = 0;
struct passwd *pws;
*------------------------------------------------------------------------*/
afs_int32
-uss_vol_CreateVol(a_volname, a_server, a_partition, a_quota, a_mpoint,
- a_owner, a_acl)
- char *a_volname;
- char *a_server;
- char *a_partition;
- char *a_quota;
- char *a_mpoint;
- char *a_owner;
- char *a_acl;
-
+uss_vol_CreateVol(char *a_volname, char *a_server, char *a_partition,
+ char *a_quota, char *a_mpoint, char *a_owner,
+ char *a_acl)
{ /*uss_vol_CreateVol */
-
+#ifdef USS_VOL_DB
static char rn[] = "uss_vol_CreateVol"; /*Routine name */
+#endif
afs_int32 pname; /*Partition name */
afs_int32 volid, code; /*Volume ID, return code */
afs_int32 saddr; /*Socket info for server */
* Set the volume disk quota.
*/
if (!uss_DryRun) {
- if (code = uss_acl_SetDiskQuota(a_mpoint, atoi(a_quota)))
+ if ((code = uss_acl_SetDiskQuota(a_mpoint, atoi(a_quota))))
return (code);
} /*Dry run */
else {
*------------------------------------------------------------------------*/
afs_int32
-uss_vol_DeleteVol(a_volName, a_volID, a_servName, a_servID, a_partName,
- a_partID)
- char *a_volName;
- afs_int32 a_volID;
- char *a_servName;
- afs_int32 a_servID;
- char *a_partName;
- afs_int32 a_partID;
-
+uss_vol_DeleteVol(char *a_volName, afs_int32 a_volID, char *a_servName,
+ afs_int32 a_servID, char *a_partName, afs_int32 a_partID)
{ /*uss_vol_DeleteVol */
static char rn[] = "uss_vol_DeleteVol"; /*Routine name */
*------------------------------------------------------------------------*/
static afs_int32
-GetServerAndPart(a_vldbEntryP, a_servIDP, a_partIDP)
- struct vldbentry *a_vldbEntryP;
- afs_int32 *a_servIDP;
- afs_int32 *a_partIDP;
-
+GetServerAndPart(struct vldbentry *a_vldbEntryP, afs_int32 *a_servIDP,
+ afs_int32 *a_partIDP)
{ /*GetServerAndPart */
/*
*------------------------------------------------------------------------*/
afs_int32
-uss_vol_GetVolInfoFromMountPoint(a_mountpoint)
- char *a_mountpoint;
-
+uss_vol_GetVolInfoFromMountPoint(char *a_mountpoint)
{ /*uss_vol_GetVolInfoFromMountPoint */
-
+#ifdef USS_VOL_DB
static char rn[] = "uss_vol_GetVolInfoFromMountPoint";
+#endif
register afs_int32 code; /*Return code */
uss_VolumeStatus_t *statusP; /*Ptr to returned status */
afs_int32 volID; /*Volume ID */
if (code)
return (code);
}
- code = ubik_Call(VL_GetEntryByID, uconn_vldbP, 0, volID, -1, &vldbEntry);
+ code = ubik_VL_GetEntryByID( uconn_vldbP, 0, volID, -1, &vldbEntry);
if (code) {
printf("%s: Can't fetch VLDB entry for volume ID %d\n", uss_whoami,
volID);
/*
* ------------------------ Exported functions -----------------------
*/
-extern afs_int32 uss_vol_GetServer();
+extern afs_int32 uss_vol_GetServer(char *a_name);
/*
* Summary:
* Given the string name of a desired host, find its address.
* Host address in network byte order.
*/
-extern afs_int32 uss_vol_GetPartitionID();
+extern afs_int32 uss_vol_GetPartitionID(char *a_name);
/*
* Summary:
* Get partition id from a name.
* Numeric partition name, or -1 on failure.
*/
-extern afs_int32 uss_vol_CreateVol();
+extern afs_int32 uss_vol_CreateVol(char *a_volname, char *a_server,
+ char *a_partition, char *a_quota,
+ char *a_mpoint, char *a_owner,
+ char *a_acl);
/*
* Summary:
* Create a volume, set its disk quota, and mount it at the
* Other error code if problem occurred in lower-level call.
*/
-extern afs_int32 uss_vol_DeleteVol();
+extern afs_int32 uss_vol_DeleteVol(char *a_volName, afs_int32 a_volID,
+ char *a_servName, afs_int32 a_servID,
+ char *a_partName, afs_int32 a_partID);
/*
* Summary:
* Delete the given volume.
* Other error code if problem occurred in lower-level call.
*/
-extern afs_int32 uss_vol_GetVolInfoFromMountPoint();
+extern afs_int32 uss_vol_GetVolInfoFromMountPoint(char *a_mountpoint);
/*
* Summary:
* Given a mountpoint, pull out the name of the volume mounted
* Other error code if problem occurred in lower-level call.
*/
+#if 0
extern afs_int32 uss_vol_DeleteMountPoint();
/*
* Summary:
* 1 if there was a problem in the routine itself, or
* Other error code if problem occurred in lower-level call.
*/
-
+#endif
#endif /* _USS_VOL_H_ */