* added a.n.o patches for solaris compatibility
[citadel.git] / citadel / modules / vcard / serv_vcard.c
index 83f22d1fc41c89ddd98f131fd2b27618513df3fc..2f126f40852b3cae4e2e44225c715c6f1ab26064 100644 (file)
@@ -996,10 +996,14 @@ void vcard_newuser(struct ctdluser *usbuf) {
        /* If using host auth mode, we add an email address based on the login */
        if (config.c_auth_mode == AUTHMODE_HOST) {
                struct passwd pwd;
-               struct passwd **result = NULL;
                char pwd_buffer[SIZ];
-
+               
+#ifdef SOLARIS_GETPWUID
+               if (getpwuid_r(usbuf->uid, &pwd, pwd_buffer, sizeof pwd_buffer) != NULL) {
+#else // SOLARIS_GETPWUID
+               struct passwd **result = NULL;
                if (getpwuid_r(usbuf->uid, &pwd, pwd_buffer, sizeof pwd_buffer, result) == 0) {
+#endif // HAVE_GETPWUID_R
                        snprintf(buf, sizeof buf, "%s@%s", pwd.pw_name, config.c_fqdn);
                        vcard_add_prop(v, "email;internet", buf);
                }