2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * Common definitions & global variables for the AFS user
16 #ifndef _USS_COMMON_H_
17 #define _USS_COMMON_H_ 1
20 * --------------------- Required definitions ---------------------
22 #include <sys/param.h> /*Ditto*/
23 #include <stdio.h> /*I/O stuff*/
24 #include <afs/afsutil.h>
28 * --------------------- Exported definitions ---------------------
32 * Should we use static declarations or malloc()s?
38 #define uss_MAX_ARG 25
39 #define uss_MAX_ARG_SIZE 50
40 #define uss_MAX_ENTRY 400
41 #define uss_PATH_SIZE AFSDIR_PATH_MAX
42 #define uss_MAX_SIZE 2048
44 #define uss_DEFAULT_PASSWORD "changeme"
47 * Capacities for the exported variables.
51 #define uss_ServerLen 64
52 #define uss_PartitionLen 16
53 #define uss_MountPointLen 300
54 #define uss_RealNameLen 100
56 #define uss_PwdPathLen 300
57 #define uss_PwdFormatLen 100
58 #define uss_RestoreDirLen 300
59 #define uss_VolumeLen 300
60 #define uss_DirPoolLen 300
62 #if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
63 extern char *sys_errlist[];
67 * We have to chain every directory that we make in order to be
68 * able to come back in the reverse order and remove creator's
69 * access to each directory.
72 struct uss_subdir *previous; /*Back ptr*/
73 char *path; /*Pathname to dir*/
74 char *finalACL; /*Final ACL for dir*/
78 * This is extracted from afsint.h, which can't be included because it
79 * redefines some stuff from kauth.h.
81 struct uss_VolumeStatus {
91 afs_int32 BlocksInUse;
92 afs_int32 PartBlocksAvail;
93 afs_int32 PartMaxBlocks;
96 typedef struct uss_VolumeStatus uss_VolumeStatus_t;
100 * ---------------------- Exported variables ----------------------
102 extern char uss_User[]; /*User's account name*/
103 extern char uss_Uid[]; /*User's uid*/
104 extern char uss_Server[]; /*FileServer hosting user's volume*/
105 extern char uss_Partition[]; /*FileServer partition for above*/
106 extern char uss_MountPoint[]; /*Mountpoint for user's volume*/
107 extern char uss_RealName[]; /*User's full name*/
108 extern char uss_Pwd[]; /*User's password*/
109 extern char uss_PwdPath[]; /*Current pathname to password file*/
110 extern char uss_PwdPath_Saved[]; /*Saved pathname to password file*/
111 extern char uss_PwdFormat[]; /*Current password entry format*/
112 extern char uss_PwdFormat_Saved[]; /*Saved password entry format*/
113 extern char uss_RestoreDir[]; /*Current directory for restore info*/
114 extern char uss_RestoreDir_Saved[]; /*Saved directory for restore info*/
115 extern char uss_Auto[]; /*Current choice of AUTO value*/
116 extern char uss_Var[][uss_MAX_ARG_SIZE]; /*$1, $2, ... command variables*/
117 extern int uss_VarMax; /*Largest index in above*/
118 extern char uss_Volume[]; /*Name of user's volume*/
119 extern afs_int32 uss_VolumeID; /*Numerical volume ID*/
120 extern afs_int32 uss_ServerID; /*Numerical server ID*/
121 extern afs_int32 uss_PartitionID; /*Numerical partition ID*/
122 extern char uss_DirPool[][uss_DirPoolLen]; /*List of all acceptable subdirs*/
124 extern int uss_NumGroups; /*Number of $AUTO entries*/
125 extern int uss_SaveVolume; /*Save current user volume?*/
126 extern int uss_SaveVolume_Saved; /*Saved value of above*/
127 extern int uss_DryRun; /*Is this a dry run?*/
128 extern int uss_Overwrite; /*Overwrite user files?*/
129 extern int uss_SkipKaserver; /*Ignore calls to Kaserver*/
130 extern int uss_OverwriteThisOne; /*Overwrite on this pass?*/
131 extern char uss_Administrator[]; /*Name of admin account*/
132 extern char uss_AccountCreator[]; /*Principal running this program*/
133 extern afs_int32 uss_DesiredUID; /*UID to assign the user*/
134 extern afs_int32 uss_Expires; /*Password lifetime*/
135 extern char uss_Cell[]; /*Cell in which account lives*/
136 extern char uss_ConfDir[]; /*Config directory*/
137 extern int uss_verbose; /*Should we be verbose?*/
138 extern int uss_ignoreFlag; /*Ignore yyparse errors?*/
139 extern char uss_whoami[]; /*Program name used*/
140 extern int uss_syntax_err; /*YACC syntax error?*/
141 extern struct uss_subdir *uss_currentDir; /*Current directory*/
145 * ------------------------ Exported functions -----------------------
147 extern void uss_common_Init();
150 * Set up various common uss variables, especially the saved
160 extern void uss_common_Reset();
163 * Reset some common uss variables to their idle or
173 extern char *uss_common_FieldCp();
176 * Copy a ``field'', as terminated by the given separator, or
177 * up to a certain specified length. Gripe if there was an
181 * char *a_to : Destination of the copy.
182 * char *a_from : Source of the copy.
183 * char a_separator : Separator character to look for.
184 * int a_maxChars : Max chars to copy.
185 * int *a_overflowP : Was there an overflow?
188 * Ptr to the next location to read from.
191 #endif /* _USS_COMMON_H_ */