year update and moved some stuff to os_calls.c

ulab-original
jsorg71 19 years ago
parent 2990d6daa7
commit b1b3ff9e7d

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
authenticate user
@ -22,60 +22,51 @@
#include "sesman.h"
#define _XOPEN_SOURCE
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
extern struct config_sesman g_cfg;
/******************************************************************************/
/* returns non zero if allowed */
int DEFAULT_CC
access_login_allowed(char* user)
{
int i;
struct group* groups;
struct passwd* pwd;
int gid;
int ok;
if ((0==g_strncmp(user, "root",5)) && (0==g_cfg.sec.allow_root))
if ((0 == g_strncmp(user, "root", 5)) && (0 == g_cfg.sec.allow_root))
{
log_message(LOG_LEVEL_WARNING, "ROOT login attempted, but root login is disabled");
log_message(LOG_LEVEL_WARNING,
"ROOT login attempted, but root login is disabled");
return 0;
}
if (0==g_cfg.sec.ts_users_enable)
if (0 == g_cfg.sec.ts_users_enable)
{
LOG_DBG("Terminal Server Users group is disabled, allowing authentication",1);
LOG_DBG("Terminal Server Users group is disabled, allowing authentication",
1);
return 1;
}
groups = getgrgid(g_cfg.sec.ts_users);
if (0==groups)
if (0 != g_getuser_info(user, &gid, 0, 0, 0, 0))
{
log_message(LOG_LEVEL_ERROR,"Cannot read group info! - login denied");
log_message(LOG_LEVEL_ERROR, "Cannot read user info! - login denied");
return 0;
}
pwd = getpwnam(user);
if (0==pwd)
if (g_cfg.sec.ts_users == gid)
{
log_message(LOG_LEVEL_ERROR, "Cannot read user info! - login denied");
return 0;
LOG_DBG("ts_users is user's primary group", 1);
return 1;
}
if (g_cfg.sec.ts_users==pwd->pw_gid)
if (0 != g_check_user_in_group(user, g_cfg.sec.ts_users, &ok))
{
LOG_DBG("ts_users is user's primary group",1);
return 1;
log_message(LOG_LEVEL_ERROR, "Cannot read group info! - login denied");
return 0;
}
i=0;
while (0!=groups->gr_mem[i])
if (ok)
{
LOG_DBG("user: %s", groups->gr_mem[i]);
if (0==g_strcmp(groups->gr_mem[i], user)) return 1;
i++;
return 1;
}
log_message(LOG_LEVEL_INFO, "login denied for user %s", user);

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager - access control header
*/

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager - main header
*/

@ -14,14 +14,11 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager - read config file
*/
#include "sys/types.h"
#include "grp.h"
#include "arch.h"
#include "list.h"
#include "file.h"
@ -31,9 +28,9 @@
static int APP_CC
text2bool(char* s)
{
if (0 == g_strncasecmp(s, "1", 1) ||
0 == g_strncasecmp(s, "true", 4) ||
0 == g_strncasecmp(s, "yes", 3))
if (0 == g_strcasecmp(s, "1") ||
0 == g_strcasecmp(s, "true") ||
0 == g_strcasecmp(s, "yes"))
{
return 1;
}
@ -96,43 +93,43 @@ config_read_globals(int file, struct config_sesman* cf, struct list* param_n,
list_clear(param_n);
/* resetting the struct */
cf->listen_port[0]='\0';
cf->enable_user_wm=0;
cf->user_wm[0]='\0';
cf->default_wm[0]='\0';
cf->listen_port[0] = '\0';
cf->enable_user_wm = 0;
cf->user_wm[0] = '\0';
cf->default_wm[0] = '\0';
file_read_section(file, SESMAN_CFG_GLOBALS, param_n, param_v);
for (i = 0; i < param_n->count; i++)
{
buf = (char*)list_get_item(param_n, i);
if (0 == g_strncasecmp(buf, SESMAN_CFG_DEFWM, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_DEFWM))
{
g_strncpy(cf->default_wm, (char*)list_get_item(param_v, i), 31);
}
else if (0 == g_strncasecmp(buf, SESMAN_CFG_USERWM, 20))
else if (0 == g_strcasecmp(buf, SESMAN_CFG_USERWM))
{
g_strncpy(cf->user_wm, (char*)list_get_item(param_v, i), 31);
}
else if (0 == g_strncasecmp(buf, SESMAN_CFG_ENABLE_USERWM, 20))
else if (0 == g_strcasecmp(buf, SESMAN_CFG_ENABLE_USERWM))
{
cf->enable_user_wm = text2bool((char*) list_get_item(param_v, i));
cf->enable_user_wm = text2bool((char*)list_get_item(param_v, i));
}
else if (0 == g_strncasecmp(buf, SESMAN_CFG_PORT, 20))
else if (0 == g_strcasecmp(buf, SESMAN_CFG_PORT))
{
g_strncpy(cf->listen_port, (char*)list_get_item(param_v, i), 15);
}
}
/* checking for missing required parameters */
if ('\0'==cf->listen_port[0])
if ('\0' == cf->listen_port[0])
{
g_strncpy(cf->listen_port, "3350", 5);
}
if ('\0'==cf->user_wm[0])
if ('\0' == cf->user_wm[0])
{
cf->enable_user_wm=0;
cf->enable_user_wm = 0;
}
if ('\0'==cf->default_wm[0])
if ('\0' == cf->default_wm[0])
{
g_strncpy(cf->default_wm, "startwm.sh", 11);
}
@ -170,25 +167,25 @@ config_read_logging(int file, struct log_config* lc, struct list* param_n,
for (i = 0; i < param_n->count; i++)
{
buf = (char*)list_get_item(param_n, i);
if (0 == g_strncasecmp(buf, SESMAN_CFG_LOG_FILE, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_FILE))
{
lc->log_file = g_strdup((char*)list_get_item(param_v, i));
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_LOG_LEVEL, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_LEVEL))
{
lc->log_level = log_text2level((char*)list_get_item(param_v, i));
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_LOG_ENABLE_SYSLOG, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_ENABLE_SYSLOG))
{
lc->enable_syslog = text2bool((char*)list_get_item(param_v, i));
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_LOG_SYSLOG_LEVEL, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_SYSLOG_LEVEL))
{
lc->syslog_level = log_text2level((char*)list_get_item(param_v, i));
}
}
if (0==lc->log_file)
if (0 == lc->log_file)
{
lc->log_file=g_strdup("./sesman.log");
}
@ -204,45 +201,44 @@ config_read_logging(int file, struct log_config* lc, struct list* param_n,
/******************************************************************************/
int DEFAULT_CC
config_read_security(int file, struct config_security* sc, struct list* param_n,
config_read_security(int file, struct config_security* sc,
struct list* param_n,
struct list* param_v)
{
int i;
int gid;
char* buf;
struct group* g;
list_clear(param_v);
list_clear(param_n);
/* setting defaults */
sc->allow_root=0;
sc->ts_users_enable=0;
sc->ts_admins_enable=0;
sc->allow_root = 0;
sc->ts_users_enable = 0;
sc->ts_admins_enable = 0;
file_read_section(file, SESMAN_CFG_SECURITY, param_n, param_v);
for (i = 0; i < param_n->count; i++)
{
buf = (char*)list_get_item(param_n, i);
if (0 == g_strncasecmp(buf, SESMAN_CFG_SEC_ALLOW_ROOT, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ALLOW_ROOT))
{
sc->allow_root = text2bool((char*)list_get_item(param_v, i));
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_SEC_USR_GROUP, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_USR_GROUP))
{
g=getgrnam((char*)list_get_item(param_v, i));
if (0!=g)
if (g_getgroup_info((char*)list_get_item(param_v, i), &gid) == 0)
{
sc->ts_users_enable=1;
sc->ts_users=g->gr_gid;
sc->ts_users_enable = 1;
sc->ts_users = gid;
}
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_SEC_ADM_GROUP, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ADM_GROUP))
{
g=getgrnam((char*)list_get_item(param_v, i));
if (0!=g)
if (g_getgroup_info((char*)list_get_item(param_v, i), &gid) == 0)
{
sc->ts_admins_enable=1;
sc->ts_admins=g->gr_gid;
sc->ts_admins_enable = 1;
sc->ts_admins = gid;
}
}
}
@ -291,19 +287,19 @@ config_read_sessions(int file, struct config_sessions* se, struct list* param_n,
for (i = 0; i < param_n->count; i++)
{
buf = (char*)list_get_item(param_n, i);
if (0 == g_strncasecmp(buf, SESMAN_CFG_SESS_MAX, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_MAX))
{
se->max_sessions = g_atoi((char*)list_get_item(param_v, i));
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_SESS_KILL_DISC, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_KILL_DISC))
{
se->kill_disconnected = text2bool((char*)list_get_item(param_v, i));
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_SESS_IDLE_LIMIT, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_IDLE_LIMIT))
{
se->max_idle_time=g_atoi((char*)list_get_item(param_v, i));
}
if (0 == g_strncasecmp(buf, SESMAN_CFG_SESS_DISC_LIMIT, 20))
if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_DISC_LIMIT))
{
se->max_disc_time=g_atoi((char*)list_get_item(param_v, i));
}

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager - read config file
*/
@ -22,7 +22,6 @@
#ifndef CONFIG_H
#define CONFIG_H
#include "sys/types.h"
#include "arch.h"
#include "list.h"
#include "log.h"
@ -79,13 +78,13 @@ struct config_security
* @brief Terminal Server Users group
*/
int ts_users_enable;
gid_t ts_users;
int ts_users;
/**
* @var ts_admins
* @brief Terminal Server Adminnistrators group
*/
int ts_admins_enable;
gid_t ts_admins;
int ts_admins;
};
/**
@ -189,7 +188,8 @@ config_read(struct config_sesman* cfg);
*
*/
int DEFAULT_CC
config_read_globals(int file, struct config_sesman* cf, struct list* param_n, struct list* param_v);
config_read_globals(int file, struct config_sesman* cf,
struct list* param_n, struct list* param_v);
/**
*
@ -201,7 +201,8 @@ config_read_globals(int file, struct config_sesman* cf, struct list* param_n, st
*
*/
int DEFAULT_CC
config_read_logging(int file, struct log_config* lc, struct list* param_n, struct list* param_v);
config_read_logging(int file, struct log_config* lc, struct list* param_n,
struct list* param_v);
/**
*
@ -213,7 +214,8 @@ config_read_logging(int file, struct log_config* lc, struct list* param_n, struc
*
*/
int DEFAULT_CC
config_read_security(int file, struct config_security* sc, struct list* param_n, struct list* param_v);
config_read_security(int file, struct config_security* sc,
struct list* param_n, struct list* param_v);
/**
*
@ -225,6 +227,7 @@ config_read_security(int file, struct config_security* sc, struct list* param_n,
*
*/
int DEFAULT_CC
config_read_sessions(int file, struct config_sessions* ss, struct list* param_n, struct list* param_v);
config_read_sessions(int file, struct config_sessions* ss,
struct list* param_n, struct list* param_v);
#endif

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only
@ -23,12 +23,6 @@
#include "sesman.h"
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
int g_sck;
int g_pid;
unsigned char g_fixedkey[8] = { 23, 82, 107, 6, 35, 78, 88, 7 };
@ -162,9 +156,10 @@ sesman_main_loop()
else
{
g_printf("pre auth");
if (1==access_login_allowed(user))
if (1 == access_login_allowed(user))
{
log_message(LOG_LEVEL_INFO, "granted TS access to user %s", user);
log_message(LOG_LEVEL_INFO,
"granted TS access to user %s", user);
if (0 == code)
{
log_message(LOG_LEVEL_INFO, "starting Xvnc session...");
@ -180,7 +175,7 @@ sesman_main_loop()
}
else
{
display=0;
display = 0;
}
}
if (display == 0)
@ -231,23 +226,25 @@ main(int argc, char** argv)
{
int fd;
int error;
int daemon=1;
int daemon = 1;
int pid;
char pid_s[8];
if (1==argc)
if (1 == argc)
{
/* no options on command line. normal startup */
g_printf("starting sesman...\n");
daemon=1;
daemon = 1;
}
else if ( (2==argc) && ( (0 == g_strncasecmp(argv[1],"--nodaemon",11)) || (0 == g_strncasecmp(argv[1],"-n",11)) ) )
else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--nodaemon")) ||
(0 == g_strcasecmp(argv[1], "-n")) ) )
{
/* starts sesman not daemonized */
g_printf("starting sesman in foregroud...\n");
daemon=0;
}
else if ( (2==argc) && ( (0 == g_strncasecmp(argv[1],"--help",7)) || (0 == g_strncasecmp(argv[1],"-h",2)) ) )
else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--help")) ||
(0 == g_strcasecmp(argv[1], "-h"))))
{
/* help screen */
g_printf("sesman - xrdp session manager\n\n");
@ -259,13 +256,15 @@ main(int argc, char** argv)
g_printf("if no command is specified, sesman is started in background");
g_exit(0);
}
else if ( (2==argc) && ( (0 == g_strncasecmp(argv[1],"--kill",11)) || (0 == g_strncasecmp(argv[1],"-k",11)) ) )
else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--kill")) ||
(0 == g_strcasecmp(argv[1], "-k"))))
{
/* killing running sesman */
/* check if sesman is running */
if (!g_file_exist(SESMAN_PID_FILE))
{
g_printf("sesman is not running (pid file not found - %s)\n", SESMAN_PID_FILE);
g_printf("sesman is not running (pid file not found - %s)\n",
SESMAN_PID_FILE);
g_exit(1);
}
@ -273,17 +272,17 @@ main(int argc, char** argv)
if (-1 == fd)
{
g_printf("error opening pid file: %s\n", strerror(errno));
g_printf("error opening pid file: %s\n", g_get_strerror());
return 1;
}
error = g_file_read(fd, pid_s, 7);
sscanf(pid_s, "%i", &pid);
pid = g_atoi(pid_s);
error = g_sigterm(pid);
if (0 != error)
{
g_printf("error killing sesman: %s\n", strerror(errno));
g_printf("error killing sesman: %s\n", g_get_strerror());
}
else
{
@ -301,7 +300,6 @@ main(int argc, char** argv)
g_exit(1);
}
if (g_file_exist(SESMAN_PID_FILE))
{
g_printf("sesman is already running.\n");
@ -314,13 +312,14 @@ main(int argc, char** argv)
/* reading config */
if (0 != config_read(&g_cfg))
{
g_printf("error reading config: %s\nquitting.\n", strerror(errno));
g_printf("error reading config: %s\nquitting.\n", g_get_strerror());
g_exit(1);
}
/* starting logging subsystem */
error = log_start(g_cfg.log.program_name, g_cfg.log.log_file, g_cfg.log.log_level,
g_cfg.log.enable_syslog, g_cfg.log.syslog_level);
error = log_start(g_cfg.log.program_name, g_cfg.log.log_file,
g_cfg.log.log_level, g_cfg.log.enable_syslog,
g_cfg.log.syslog_level);
if (error != LOG_STARTUP_OK)
{
@ -328,8 +327,10 @@ main(int argc, char** argv)
{
case LOG_ERROR_MALLOC:
g_printf("error on malloc. cannot start logging. quitting.\n");
break;
case LOG_ERROR_FILE_OPEN:
g_printf("error opening log file. quitting.\n");
break;
}
g_exit(1);
}
@ -368,7 +369,8 @@ main(int argc, char** argv)
fd = g_file_open(SESMAN_PID_FILE);
if (-1 == fd)
{
log_message(LOG_LEVEL_ERROR, "error opening pid file: %s", strerror(errno));
log_message(LOG_LEVEL_ERROR, "error opening pid file: %s",
g_get_strerror());
log_end();
g_exit(1);
}

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager - main header
*/

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only

@ -14,15 +14,13 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only
*/
#include <stdlib.h>
#include "sesman.h"
extern unsigned char g_fixedkey[8];
@ -140,22 +138,25 @@ session_start(int width, int height, int bpp, char* username, char* password,
/* check to limit concurrent sessions */
if (g_session_count >= g_cfg.sess.max_sessions)
{
log_message(LOG_LEVEL_INFO, "max concurrent session limit exceeded. login for user %s denied", username);
log_message(LOG_LEVEL_INFO, "max concurrent session limit exceeded. login \
for user %s denied", username);
return 0;
}
#ifndef OLDSESSION
temp=malloc(sizeof(struct session_chain));
temp = (struct session_chain*)g_malloc(sizeof(struct session_chain), 0);
if (temp == 0)
{
log_message(LOG_LEVEL_ERROR, "cannot create new chain element - user %s", username);
log_message(LOG_LEVEL_ERROR, "cannot create new chain element - user %s",
username);
return 0;
}
temp->item = malloc(sizeof(struct session_item));
temp->item = (struct session_item*)g_malloc(sizeof(struct session_item), 0);
if (temp->item == 0)
{
free(temp);
log_message(LOG_LEVEL_ERROR, "cannot create new session item - user %s", username);
g_free(temp);
log_message(LOG_LEVEL_ERROR, "cannot create new session item - user %s",
username);
return 0;
}
#endif
@ -215,7 +216,8 @@ session_start(int width, int height, int bpp, char* username, char* password,
g_execlp3("xterm", "xterm", 0);
/* should not get here */
}
log_message(LOG_LEVEL_ALWAYS,"error starting window manager %s - pid %d", username, g_getpid());
log_message(LOG_LEVEL_ALWAYS,"error starting window manager %s - pid %d",
username, g_getpid());
g_exit(0);
}
else /* parent */
@ -240,11 +242,13 @@ session_start(int width, int height, int bpp, char* username, char* password,
}
else
{
log_message(LOG_LEVEL_ALWAYS, "bad session type - user %s - pid %d", username, g_getpid());
log_message(LOG_LEVEL_ALWAYS, "bad session type - user %s - pid %d",
username, g_getpid());
g_exit(1);
}
/* should not get here */
log_message(LOG_LEVEL_ALWAYS,"error doing execve for user %s - pid %d",username,g_getpid());
log_message(LOG_LEVEL_ALWAYS,"error doing execve for user %s - pid %d",
username, g_getpid());
g_exit(1);
}
else /* parent */
@ -281,22 +285,22 @@ session_start(int width, int height, int bpp, char* username, char* password,
{
g_session_items[display].type=SESMAN_SESSION_TYPE_XRDP;
}*/
g_session_items[display].type=type;
g_session_items[display].status=SESMAN_SESSION_STATUS_ACTIVE;
g_session_items[display].type = type;
g_session_items[display].status = SESMAN_SESSION_STATUS_ACTIVE;
g_session_count++;
#else
temp->item->pid=pid;
temp->item->display=display;
temp->item->width=width;
temp->item->height=height;
temp->item->bpp=bpp;
temp->item->data=data;
temp->item->pid = pid;
temp->item->display = display;
temp->item->width = width;
temp->item->height = height;
temp->item->bpp = bpp;
temp->item->data = data;
g_strncpy(temp->item->name, username, 255);
temp->item->connect_time=g_time1();
temp->item->disconnect_time=(time_t) 0;
temp->item->idle_time=(time_t) 0;
temp->item->connect_time = g_time1();
temp->item->disconnect_time = 0;
temp->item->idle_time = 0;
/* if (type==0)
{
@ -375,10 +379,12 @@ session_kill(int pid)
{
if (tmp->item == 0)
{
log_message(LOG_LEVEL_ERROR, "session descriptor for pid %d is null!", pid);
log_message(LOG_LEVEL_ERROR, "session descriptor for pid %d is null!",
pid);
if (prev == 0)
{
/* prev does no exist, so it's the first element - so we set g_sessions */
/* prev does no exist, so it's the first element - so we set
g_sessions */
g_sessions = tmp->next;
}
else
@ -392,18 +398,20 @@ session_kill(int pid)
if (tmp->item->pid == pid)
{
/* deleting the session */
log_message(LOG_LEVEL_INFO, "session %d - user %s - terminated", tmp->item->pid, tmp->item->name);
free(tmp->item);
log_message(LOG_LEVEL_INFO, "session %d - user %s - terminated",
tmp->item->pid, tmp->item->name);
g_free(tmp->item);
if (prev == 0)
{
/* prev does no exist, so it's the first element - so we set g_sessions */
/* prev does no exist, so it's the first element - so we set
g_sessions */
g_sessions = tmp->next;
}
else
{
prev->next = tmp->next;
}
free(tmp);
g_free(tmp);
g_session_count--;
/*THREAD-FIX release chain lock */
return SESMAN_SESSION_KILL_OK;
@ -425,12 +433,13 @@ session_get_bypid(int pid)
struct session_chain* tmp;
/*THREAD-FIX require chain lock */
tmp=g_sessions;
tmp = g_sessions;
while (tmp != 0)
{
if (tmp->item == 0)
{
log_message(LOG_LEVEL_ERROR, "session descriptor for pid %d is null!", pid);
log_message(LOG_LEVEL_ERROR, "session descriptor for pid %d is null!",
pid);
/*THREAD-FIX release chain lock */
return 0;
}

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only
@ -53,9 +53,9 @@ struct session_item
unsigned char type;
/* time data */
time_t connect_time;
time_t disconnect_time;
time_t idle_time;
int connect_time;
int disconnect_time;
int idle_time;
};
struct session_chain

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only
@ -38,7 +38,7 @@ extern struct config_sesman g_cfg;
void DEFAULT_CC
sig_sesman_shutdown(int sig)
{
log_message(LOG_LEVEL_INFO, "shutting down sesman %d",1);
log_message(LOG_LEVEL_INFO, "shutting down sesman %d", 1);
if (g_getpid() != g_pid)
{

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
session manager
linux only

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
authenticate user

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
authenticate user using kerberos

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
authenticate user

@ -14,7 +14,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2005
Copyright (C) Jay Sorg 2005-2006
authenticate user

Loading…
Cancel
Save