bozo: Add KeyFileExt and rxkad.keytab to access rights check
[openafs.git] / src / util / test / dirpath_test.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13
14 #include <stdio.h>
15 #include <afs/afsutil.h>
16
17 main(int argc, char *argv[])
18 {
19     char *pbuf;
20     unsigned dirpathStatus;
21
22     /* Initialize dirpaths */
23
24     dirpathStatus = initAFSDirPath();
25
26     if (!(dirpathStatus & AFSDIR_CLIENT_PATHS_OK)) {
27         printf
28             ("\n%s: Unable to obtain AFS client configuration directory...using temp.\n",
29              argv[0]);
30     }
31
32     if (!(dirpathStatus & AFSDIR_SERVER_PATHS_OK)) {
33         printf
34             ("\n%s: Unable to obtain AFS server configuration directory...using temp.\n",
35              argv[0]);
36     }
37
38     /* Now print out all dir paths */
39
40     printf("\n");
41     printf("AFSDIR_USR_DIRPATH = %s\n", AFSDIR_USR_DIRPATH);
42     printf("\n");
43     printf("\n");
44     printf("AFSDIR_SERVER_AFS_DIRPATH = %s\n", AFSDIR_SERVER_AFS_DIRPATH);
45     printf("AFSDIR_SERVER_ETC_DIRPATH = %s\n", AFSDIR_SERVER_ETC_DIRPATH);
46     printf("AFSDIR_SERVER_BIN_DIRPATH = %s\n", AFSDIR_SERVER_BIN_DIRPATH);
47     printf("AFSDIR_SERVER_CORES_DIRPATH  = %s\n",
48            AFSDIR_SERVER_CORES_DIRPATH);
49     printf("AFSDIR_SERVER_DB_DIRPATH  = %s\n", AFSDIR_SERVER_DB_DIRPATH);
50     printf("AFSDIR_SERVER_LOGS_DIRPATH  = %s\n", AFSDIR_SERVER_LOGS_DIRPATH);
51     printf("AFSDIR_SERVER_LOCAL_DIRPATH  = %s\n",
52            AFSDIR_SERVER_LOCAL_DIRPATH);
53     printf("AFSDIR_SERVER_BACKUP_DIRPATH = %s\n",
54            AFSDIR_SERVER_BACKUP_DIRPATH);
55     printf("\n");
56     printf("\n");
57     printf("AFSDIR_CLIENT_VICE_DIRPATH  = %s\n", AFSDIR_CLIENT_VICE_DIRPATH);
58     printf("AFSDIR_CLIENT_ETC_DIRPATH  = %s\n", AFSDIR_CLIENT_ETC_DIRPATH);
59     printf("\n");
60     printf("\n");
61     printf("AFSDIR_SERVER_THISCELL_FILEPATH  = %s\n",
62            AFSDIR_SERVER_THISCELL_FILEPATH);
63     printf("AFSDIR_SERVER_CELLSERVDB_FILEPATH  = %s\n",
64            AFSDIR_SERVER_CELLSERVDB_FILEPATH);
65     printf("AFSDIR_SERVER_KEY_FILEPATH = %s\n",
66            AFSDIR_SERVER_KEY_FILEPATH);
67     printf("AFSDIR_SERVER_EXT_KEY_FILEPATH = %s\n",
68            AFSDIR_SERVER_EXT_KEY_FILEPATH);
69     printf("AFSDIR_SERVER_ULIST_FILEPATH = %s\n",
70            AFSDIR_SERVER_ULIST_FILEPATH);
71     printf("AFSDIR_SERVER_NOAUTH_FILEPATH = %s\n",
72            AFSDIR_SERVER_NOAUTH_FILEPATH);
73     printf("AFSDIR_SERVER_BUDBLOG_FILEPATH = %s\n",
74            AFSDIR_SERVER_BUDBLOG_FILEPATH);
75     printf("AFSDIR_SERVER_TAPECONFIG_FILEPATH  = %s\n",
76            AFSDIR_SERVER_TAPECONFIG_FILEPATH);
77     printf("AFSDIR_SERVER_KALOGDB_FILEPATH  = %s\n",
78            AFSDIR_SERVER_KALOGDB_FILEPATH);
79     printf("AFSDIR_SERVER_KADB_FILEPATH  = %s\n",
80            AFSDIR_SERVER_KADB_FILEPATH);
81     printf("AFSDIR_SERVER_KALOG_FILEPATH  = %s\n",
82            AFSDIR_SERVER_KALOG_FILEPATH);
83     printf("AFSDIR_SERVER_NTPD_FILEPATH  = %s\n",
84            AFSDIR_SERVER_NTPD_FILEPATH);
85     printf("AFSDIR_SERVER_PRDB_FILEPATH  = %s\n",
86            AFSDIR_SERVER_PRDB_FILEPATH);
87     printf("AFSDIR_SERVER_PTLOG_FILEPATH  = %s\n",
88            AFSDIR_SERVER_PTLOG_FILEPATH);
89     printf("AFSDIR_SERVER_KCONF_FILEPATH  = %s\n",
90            AFSDIR_SERVER_KCONF_FILEPATH);
91     printf("AFSDIR_SERVER_VLDB_FILEPATH  = %s\n",
92            AFSDIR_SERVER_VLDB_FILEPATH);
93     printf("AFSDIR_SERVER_VLOG_FILEPATH  = %s\n",
94            AFSDIR_SERVER_VLOG_FILEPATH);
95     printf("AFSDIR_SERVER_CORELOG_FILEPATH  = %s\n",
96            AFSDIR_SERVER_CORELOG_FILEPATH);
97     printf("AFSDIR_SERVER_SLVGLOG_FILEPATH  = %s\n",
98            AFSDIR_SERVER_SLVGLOG_FILEPATH);
99     printf("AFSDIR_SERVER_SALVAGER_FILEPATH  = %s\n",
100            AFSDIR_SERVER_SALVAGER_FILEPATH);
101     printf("AFSDIR_SERVER_BOZCONF_FILEPATH = %s\n",
102            AFSDIR_SERVER_BOZCONF_FILEPATH);
103     printf("AFSDIR_SERVER_BOZINIT_FILEPATH = %s\n",
104            AFSDIR_SERVER_BOZINIT_FILEPATH);
105     printf("AFSDIR_SERVER_BOZLOG_FILEPATH = %s\n",
106            AFSDIR_SERVER_BOZLOG_FILEPATH);
107     printf("AFSDIR_SERVER_BOSVR_FILEPATH = %s\n",
108            AFSDIR_SERVER_BOSVR_FILEPATH);
109     printf("AFSDIR_SERVER_VOLSERLOG_FILEPATH = %s\n",
110            AFSDIR_SERVER_VOLSERLOG_FILEPATH);
111     printf("AFSDIR_SERVER_ROOTVOL_FILEPATH = %s\n",
112            AFSDIR_SERVER_ROOTVOL_FILEPATH);
113     printf("AFSDIR_SERVER_HOSTDUMP_FILEPATH = %s\n",
114            AFSDIR_SERVER_HOSTDUMP_FILEPATH);
115     printf("AFSDIR_SERVER_CLNTDUMP_FILEPATH = %s\n",
116            AFSDIR_SERVER_CLNTDUMP_FILEPATH);
117     printf("AFSDIR_SERVER_CBKDUMP_FILEPATH = %s\n",
118            AFSDIR_SERVER_CBKDUMP_FILEPATH);
119     printf("AFSDIR_SERVER_OLDSYSID_FILEPATH = %s\n",
120            AFSDIR_SERVER_OLDSYSID_FILEPATH);
121     printf("AFSDIR_SERVER_SYSID_FILEPATH = %s\n",
122            AFSDIR_SERVER_SYSID_FILEPATH);
123     printf("AFSDIR_SERVER_FILELOG_FILEPATH = %s\n",
124            AFSDIR_SERVER_FILELOG_FILEPATH);
125     printf("AFSDIR_SERVER_AUDIT_FILEPATH = %s\n",
126            AFSDIR_SERVER_AUDIT_FILEPATH);
127     printf("AFSDIR_SERVER_KRB_EXCL_FILEPATH  = %s\n",
128            AFSDIR_SERVER_KRB_EXCL_FILEPATH);
129     printf("\n");
130     printf("\n");
131     printf("AFSDIR_CLIENT_THISCELL_FILEPATH = %s\n",
132            AFSDIR_CLIENT_THISCELL_FILEPATH);
133     printf("AFSDIR_CLIENT_CELLSERVDB_FILEPATH = %s\n",
134            AFSDIR_CLIENT_CELLSERVDB_FILEPATH);
135     printf("\n");
136     printf("\n");
137
138     /* test local path construction functions */
139
140 #ifdef AFS_NT40_ENV
141     printf("ConstructLocalPath(\"C:/fred\", \"/reldir\", &pbuf) = ");
142     ConstructLocalPath("C:/fred", "/reldir", &pbuf);
143     printf("%s\n", pbuf);
144     free(pbuf);
145     printf("\n");
146 #endif
147
148     printf("ConstructLocalPath(\"/fred\", \"/reldir\", &pbuf) = ");
149     ConstructLocalPath("/fred", "/reldir", &pbuf);
150     printf("%s\n", pbuf);
151     free(pbuf);
152     printf("\n");
153
154     printf("ConstructLocalPath(\"fred\", \"/reldir\", &pbuf) = ");
155     ConstructLocalPath("fred", "/reldir", &pbuf);
156     printf("%s\n", pbuf);
157     free(pbuf);
158     printf("\n");
159
160     printf("ConstructLocalBinPath(\"/fred\", &pbuf) = ");
161     ConstructLocalBinPath("/fred", &pbuf);
162     printf("%s\n", pbuf);
163     free(pbuf);
164     printf("\n");
165
166     printf("ConstructLocalBinPath(\"fred\", &pbuf) = ");
167     ConstructLocalBinPath("fred", &pbuf);
168     printf("%s\n", pbuf);
169     free(pbuf);
170     printf("\n");
171
172     printf("ConstructLocalLogPath(\"/fred\", &pbuf) = ");
173     ConstructLocalLogPath("/fred", &pbuf);
174     printf("%s\n", pbuf);
175     free(pbuf);
176     printf("\n");
177
178     printf("ConstructLocalLogPath(\"fred\", &pbuf) = ");
179     ConstructLocalLogPath("fred", &pbuf);
180     printf("%s\n", pbuf);
181     free(pbuf);
182     printf("\n");
183
184     printf("gettmpdir() = %s\n", gettmpdir());
185     printf("\n");
186
187     printf("That's all folks!\n");
188
189     return (0);
190 }