diff options
author | Gerald Carter <jerry@samba.org> | 2003-06-06 22:33:43 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-06-06 22:33:43 +0000 |
commit | 71298881c4a630666c1a14be99048f8f86e48162 (patch) | |
tree | 2dfcf72ea73b1abffa32cd3717f929174bea9474 /source3/smbd | |
parent | 40eacb1648307c0523b6b3581e8f15322f75eb42 (diff) | |
download | samba-71298881c4a630666c1a14be99048f8f86e48162.tar.gz samba-71298881c4a630666c1a14be99048f8f86e48162.tar.bz2 samba-71298881c4a630666c1a14be99048f8f86e48162.zip |
* add in David Lee's utmp patch (defaults to on if available)
* one more try at fixing builds when --with-ldap=no
(This used to be commit b516ab7bdef6b6b2b7f0df8966dbd4c329f46a92)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/session.c | 6 | ||||
-rw-r--r-- | source3/smbd/utmp.c | 23 |
2 files changed, 18 insertions, 11 deletions
diff --git a/source3/smbd/session.c b/source3/smbd/session.c index b7f3bc43e7..4d8826d332 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -66,7 +66,6 @@ BOOL session_claim(user_struct *vuser) data.dptr = NULL; data.dsize = 0; -#if WITH_UTMP if (lp_utmp()) { for (i=1;i<MAX_SESSION_ID;i++) { slprintf(keystr, sizeof(keystr)-1, "ID/%d", i); @@ -84,7 +83,6 @@ BOOL session_claim(user_struct *vuser) slprintf(sessionid.id_str, sizeof(sessionid.id_str)-1, SESSION_UTMP_TEMPLATE, i); tdb_store_flag = TDB_MODIFY; } else -#endif { slprintf(keystr, sizeof(keystr)-1, "ID/%lu/%u", (long unsigned int)sys_getpid(), @@ -137,13 +135,11 @@ BOOL session_claim(user_struct *vuser) return False; } -#if WITH_UTMP if (lp_utmp()) { sys_utmp_claim(sessionid.username, sessionid.hostname, client_ip, sessionid.id_str, sessionid.id_num); } -#endif vuser->session_keystr = strdup(keystr); if (!vuser->session_keystr) { @@ -181,13 +177,11 @@ void session_yield(user_struct *vuser) SAFE_FREE(dbuf.dptr); -#if WITH_UTMP if (lp_utmp()) { sys_utmp_yield(sessionid.username, sessionid.hostname, client_ip, sessionid.id_str, sessionid.id_num); } -#endif smb_pam_close_session(sessionid.username, sessionid.id_str, sessionid.hostname); diff --git a/source3/smbd/utmp.c b/source3/smbd/utmp.c index 2c5a1abc82..9833a11f2d 100644 --- a/source3/smbd/utmp.c +++ b/source3/smbd/utmp.c @@ -21,8 +21,6 @@ #include "includes.h" -#ifdef WITH_UTMP - /**************************************************************************** Reflect connection status in utmp/wtmp files. T.D.Lee@durham.ac.uk September 1999 @@ -110,6 +108,23 @@ Notes: ****************************************************************************/ +#ifndef WITH_UTMP +/* + * Not WITH_UTMP? Simply supply dummy routines. + */ + +void sys_utmp_claim(const char *username, const char *hostname, + struct in_addr *ipaddr, + const char *id_str, int id_num) +{} + +void sys_utmp_yield(const char *username, const char *hostname, + struct in_addr *ipaddr, + const char *id_str, int id_num) +{} + +#else /* WITH_UTMP */ + #include <utmp.h> #ifdef HAVE_UTMPX_H @@ -571,6 +586,4 @@ void sys_utmp_claim(const char *username, const char *hostname, sys_utmp_update(&u, hostname, True); } -#else /* WITH_UTMP */ - void dummy_utmp(void) {} -#endif +#endif /* WITH_UTMP */ |