Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / tsm41 / aix_ktc.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 #if defined(AFS_AIX41_ENV)
15 #include <sys/types.h>
16 #include <sys/param.h>
17 #include <stdio.h>
18 #include <locale.h>
19 #include <nl_types.h>
20 #include <pwd.h>
21 #include <netdb.h>
22 #include <sys/socket.h>
23 #include <sys/file.h>
24 #include <errno.h>
25 #include <usersec.h>
26
27 #include <afs/kauth.h>
28 #include <afs/kautils.h>
29
30 #include "aix_auth_prototypes.h"
31
32 #include <afs/ktc.h>
33
34 void
35 aix_ktc_setup_ticket_file(char * userName)
36 {
37 #if defined(AFS_KERBEROS_ENV)
38 struct passwd *pwd;
39
40 setpwent(); /* open the pwd database */
41 pwd = getpwnam(userName);
42 if (pwd) {
43 if (chown(ktc_tkt_string_uid(pwd->pw_uid),
44 pwd->pw_uid, pwd->pw_gid) < 0) {
45 perror("chown: ");
46 }
47 } else {
48 perror("getpwnam : ");
49 }
50 endpwent(); /* close the pwd database */
51 #endif /* AFS_KERBEROS_ENV */
52 }
53
54 #endif /* AFS_AIX41_ENV */