X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fvcard%2Fserv_vcard.c;h=2f126f40852b3cae4e2e44225c715c6f1ab26064;hb=7c39a084e6dc12050cc3827e93cce62bb34b8d36;hp=83f22d1fc41c89ddd98f131fd2b27618513df3fc;hpb=d0a6f3a795db5fb278316acf068019d71845d1fa;p=citadel.git diff --git a/citadel/modules/vcard/serv_vcard.c b/citadel/modules/vcard/serv_vcard.c index 83f22d1fc..2f126f408 100644 --- a/citadel/modules/vcard/serv_vcard.c +++ b/citadel/modules/vcard/serv_vcard.c @@ -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); }