1 --- a/src/tspi/ps/tspps.c.orig 2011-03-24 13:06:14.607907754 -0700
2 +++ b/src/tspi/ps/tspps.c 2011-03-24 13:07:30.668528209 -0700
9 static int user_ps_fd = -1;
10 static MUTEX_DECLARE_INIT(user_ps_lock);
13 char *file_name = NULL, *home_dir = NULL;
15 -#if (defined (__linux) || defined (linux) || defined(__GLIBC__))
16 +#if (defined (__linux) || defined (linux) || defined(__GLIBC__) || defined(SOLARIS))
20 + char pwbuf[PASSWD_BUFSIZE];
23 char buf[PASSWD_BUFSIZE];
26 * in the user's home directory, which may be shared
27 * by multiple systems.
29 - * The directory path on Solaris is /var/tpm/userps/[EUID]/
30 + * The directory path on Solaris is /var/user[USERNAME]/tpm/userps
32 - rc = snprintf(buf, sizeof (buf), "%s/%d", TSS_USER_PS_DIR, euid);
34 + pwp = getpwuid_r(euid, &pw, pwbuf, sizeof (pwbuf));
36 + rc = snprintf(buf, sizeof (buf), "/var/user/%s/tpm/userps",
39 + return TSPERR(TSS_E_INTERNAL_ERROR);
45 if (errno == ENOENT) {
47 /* Create the user's ps directory if it is not there. */
48 - if ((rc = mkdir(buf, 0700)) == -1) {
49 + if ((rc = mkdirp(buf, 0700)) == -1) {
50 LogDebugFn("USER PS: Error creating dir: %s: %s", buf,
52 result = TSPERR(TSS_E_INTERNAL_ERROR);
55 /* Directory exists or has been created, return the path to the file */
57 - rc = snprintf(buf, sizeof (buf), "%s/%d/%s", TSS_USER_PS_DIR, euid,
59 + rc = snprintf(buf, sizeof (buf), "/var/user/%s/tpm/userps/%s",
60 + pwp->pw_name, TSS_USER_PS_FILE);
62 rc = snprintf(buf, sizeof (buf), "%s/%s/%s", home_dir, TSS_USER_PS_DIR,