Fix -exit patch rebasing mistake
[pkg-k5-afs_openafs.git] / src / tsm41 / aix_ktc.c
blobbbfc0c0446a4e8a88eb5fb06acc73cdb8651a78a
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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 */
10 #include <afsconfig.h>
11 #include <afs/param.h>
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>
27 #include <afs/kauth.h>
28 #include <afs/kautils.h>
30 #include "aix_auth_prototypes.h"
32 #include <afs/ktc.h>
34 void
35 aix_ktc_setup_ticket_file(char * userName)
37 #if defined(AFS_KERBEROS_ENV)
38 struct passwd *pwd;
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: ");
47 } else {
48 perror("getpwnam : ");
50 endpwent(); /* close the pwd database */
51 #endif /* AFS_KERBEROS_ENV */
54 #endif /* AFS_AIX41_ENV */