* In host auth mode, if a user logs in who has no gecos configured, use the login...
authorArt Cancro <ajc@citadel.org>
Wed, 14 Jan 2009 03:00:18 +0000 (03:00 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 14 Jan 2009 03:00:18 +0000 (03:00 +0000)
citadel/modules/vcard/serv_vcard.c
citadel/user_ops.c

index 02681b0217936bc3f4389da45264d05c5f5608bc..899199b6850a05482d0fbff6b4d1b1d4f350a93f 100644 (file)
@@ -997,8 +997,9 @@ void vcard_newuser(struct ctdluser *usbuf) {
 #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) {
+               struct passwd *result = NULL;
+               CtdlLogPrintf(CTDL_DEBUG, "Searching for uid %d\n", usbuf->uid);
+               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);
index 894548cab31326c5ffaaba19121b2ceff9c10440..9c0952cce7602dde0db91f9558690f88da7dcee8 100644 (file)
@@ -1062,14 +1062,7 @@ int create_user(char *newusername, int become_user)
                        uid = pd.pw_uid;
                        if (IsEmptyStr (username))
                        {
-                               CtdlLogPrintf (CTDL_EMERG, 
-                                        "Can't find Realname for user %s [%d] in the Host Auth Database; giving up.\n", 
-                                        newusername, pd.pw_uid);
-                               snprintf(buf, SIZ, 
-                                        "Can't find Realname for user %s [%d] in the Host Auth Database; giving up.\n",
-                                        newusername, pd.pw_uid);
-                               aide_message(buf, "User Creation Failure Notice");
-
+                               safestrncpy(username, pd.pw_name, sizeof username);
                        }
                }
                else {