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 * Interface to the basic procedures for the AFS user account
17 #define _USS_PROCS_H_ 1
20 * --------------------- Required definitions ---------------------
22 #include "uss_common.h" /*Commons uss definitions */
26 * --------------------- Exported definitions ---------------------
28 #define uss_procs_YOUNG 1
29 #define uss_procs_ANCIENT 2
33 * ------------------------ Exported functions -----------------------
35 extern afs_int32 uss_procs_BuildDir(char *a_path, char *a_mode,
36 char *a_owner, char *a_access);
39 * Create and fully set up a directory for the user.
42 * char *a_path : Pathname of directory to create.
43 * char *a_mode : Unix mode to set for directory.
44 * char *a_owner : Directory's owner.
45 * char *a_access : ACL to set on the directory.
48 * 0 if everything went well,
49 * 1 if there was a problem in the routine itself, or
50 * Other error code if problem occurred in lower-level call.
53 extern afs_int32 uss_procs_CpFile(char *a_path, char *a_mode,
54 char *a_owner, char *a_proto);
57 * Copy the given file to the user's directory.
60 * char *a_path : Pathname of file to create.
61 * char *a_mode : Unix mode to set for file.
62 * char *a_owner : File's owner.
63 * char *a_proto : Prototype to copy from.
66 * 0 if everything went well,
67 * 1 if there was a problem in the routine itself, or
68 * Other error code if problem occurred in lower-level call.
71 extern afs_int32 uss_procs_EchoToFile(char *a_path, char *a_mode,
72 char *a_owner, char *a_content);
75 * Put the specified contents into the given file.
78 * a_path : Pathname of file to fill in.
79 * a_mode : Unix mode to set for file.
80 * a_owner : File's owner.
81 * a_content : Value to insert into file.
84 * 0 if everything went well,
85 * 1 if there was a problem in the routine itself, or
86 * Other error code if problem occurred in lower-level call.
89 extern afs_int32 uss_procs_Exec(char *a_command);
92 * Execute the given Unix command.
95 * char *a_command : Unix command to execute.
98 * 0 if everything went well,
99 * 1 if there was a problem in the routine itself, or
100 * Other error code if problem occurred in lower-level call.
103 extern afs_int32 uss_procs_SetLink(char *a_path1, char *a_path2,
107 * Create either the given symbolic or hard link.
110 * char *a_path1 : Name of the link itself.
111 * char *a_path2 : Name of what the link points to.
112 * char a_type : Specifies either a symbolic or hard link.
115 * 0 if everything went well,
116 * 1 if there was a problem in the routine itself, or
117 * Other error code if problem occurred in lower-level call.
120 extern int uss_procs_AddToDirPool(char *a_dirToAdd);
123 * Add the given pathname to the $AUTH directory pool
126 * char *a_dirToAdd : Name of directory to add.
129 * Result of addition.
132 extern FILE *uss_procs_FindAndOpen(char *a_fileToOpen);
135 * Given a template filename, get that file open and return the
136 * file descriptor. If a full pathname is given, try to open it
137 * directly. Otherwise, use the default pathname prefixes.
140 * char *a_fileToOpen : Name of file to open.
143 * The file descriptor for the open file (if it could be done),
147 extern void uss_procs_PrintErr(int a_lineNum, char *a_fmt, ... );
150 * Print out an error connected with template file parsing.
153 * int a_lineNum : Template file line number having the error.
154 * char *a_fmt : Format string to use.
160 extern int uss_procs_GetOwner(char *a_ownerStr);
163 * Translate the owner string to the owner uid.
166 * char *a_ownerStr : Name of the owner.
172 extern afs_int32 uss_procs_PickADir(char *path, char *cp);
175 * Tries to replace $AUTO by a subdir. Subdirs are given by means
176 * of "G" in the configuration file. Each of the directories is
177 * examined, and the one with the inimum number of entries is
185 * 0 if everything went well,
186 * -1 if there was a problem.
189 #endif /* _USS_PROCS_H_ */