#include "config.h"
#include "tools.h"
#include "citserver.h"
+#include "citadel_dirs.h"
#include "genstamp.h"
/*
void put_visit(struct visit *newvisit)
{
char IndexBuf[32];
- int IndexLen;
+ int IndexLen = 0;
/* Generate an index */
IndexLen = GenerateRelationshipIndex(IndexBuf,
char pwdbuffer[256];
lprintf(CTDL_DEBUG, "asking host about <%s>\n", username);
+#ifdef SOLARIS_GETPWUID
+ tempPwdPtr = getpwnam_r(username, &pd, pwdbuffer, sizeof pwdbuffer);
+#else
getpwnam_r(username, &pd, pwdbuffer, sizeof pwdbuffer, &tempPwdPtr);
+#endif
if (tempPwdPtr == NULL) {
return login_not_found;
}
- lprintf(CTDL_DEBUG, "found it! uid=%d, gecos=%s\n", pd.pw_uid, pd.pw_gecos);
+ lprintf(CTDL_DEBUG, "found it! uid=%ld, gecos=%s\n", (long)pd.pw_uid, pd.pw_gecos);
/* Locate the associated Citadel account.
* If not found, make one attempt to create it.
*/
void session_startup(void)
{
- int i;
+ int i = 0;
lprintf(CTDL_NOTICE, "<%s> logged in\n", CC->curr_user);
* make that assumption.
*/
strcpy(who->fake_username, "");
- strcpy(who->fake_postname, "");
strcpy(who->fake_hostname, "");
strcpy(who->fake_roomname, "");
who->logged_in = 0;
}
close(pipev[0]);
- execl(CTDLDIR "/chkpwd", CTDLDIR "/chkpwd", NULL);
- perror(CTDLDIR "/chkpwd");
+ execl(file_chkpwd, file_chkpwd, NULL);
+ perror(file_chkpwd);
exit(1);
}
if (validpw(CC->user.uid, password)) {
code = 0;
- /* we could get rid of this */
+
+ /*
+ * sooper-seekrit hack: populate the password field in the
+ * citadel database with the password that the user typed,
+ * if it's correct. This allows most sites to convert from
+ * host auth to native auth if they want to. If you think
+ * this is a security hazard, comment it out.
+ */
+
lgetuser(&CC->user, CC->curr_user);
safestrncpy(CC->user.password, password, sizeof CC->user.password);
lputuser(&CC->user);
- /* */
+
+ /*
+ * (sooper-seekrit hack ends here)
+ */
+
}
else {
code = (-1);
struct passwd *tempPwdPtr;
char pwdbuffer[256];
+#ifdef SOLARIS_GETPWUID
+ tempPwdPtr = getpwnam_r(username, &pd, pwdbuffer, sizeof(pwdbuffer));
+#else
getpwnam_r(username, &pd, pwdbuffer, sizeof pwdbuffer, &tempPwdPtr);
+#endif
if (tempPwdPtr != NULL) {
extract_token(username, pd.pw_gecos, 0, ',', sizeof username);
uid = pd.pw_uid;