Changeset 2024
- Timestamp:
- 08/14/08 19:07:23 (4 months ago)
- Files:
-
- trunk/libwzd-core/wzd_ClientThread.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libwzd-core/wzd_ClientThread.c
r2023 r2024 2913 2913 ret = send_message(221,context); 2914 2914 { 2915 const char * groupname = NULL; 2916 wzd_user_t * user; 2917 const char * remote_host; 2918 struct hostent *h; 2915 wzd_user_t * user = NULL; 2916 wzd_group_t * group = NULL; 2917 struct hostent * h = NULL; 2919 2918 char inet_str[256]; 2920 2919 int af = (context->family == WZD_INET6) ? AF_INET6 : AF_INET; … … 2922 2921 user = GetUserByID(context->userid); 2923 2922 2924 if (user->group_num > 0) groupname = GetGroupByID(user->groups[0])->groupname; 2923 if (user && user->group_num > 0) { 2924 group = GetGroupByID(user->groups[0]); 2925 } 2925 2926 inet_str[0] = '\0'; 2926 inet_ntop(af,context->hostip,inet_str,sizeof(inet_str)); 2927 h = gethostbyaddr((char*)&context->hostip,sizeof(context->hostip),af); 2928 if (h==NULL) 2929 remote_host = inet_str; 2930 else 2931 remote_host = h->h_name; 2927 inet_ntop(af, context->hostip, inet_str, sizeof(inet_str)); 2928 h = gethostbyaddr((char*)&context->hostip, sizeof(context->hostip), af); 2932 2929 log_message("LOGOUT","%s (%s) \"%s\" \"%s\" \"%s\"", 2933 remote_host,2934 inet_str,2935 user ->username,2936 (groupname)?groupname:"No Group",2937 user ->tagline2930 h && h->h_name ? h->h_name : "No hostname", 2931 *inet_str ? inet_str : "No IP address", 2932 user && *(user->username) ? user->username : "No username", 2933 group && *(group->groupname) ? group->groupname : "No groupname", 2934 user && *(user->tagline) ? user->tagline : "No tagline" 2938 2935 ); 2939 2936 }
