Merge remote-tracking branch 'origin/master' into master3.1.6

Conflicts:
	client/cl_client.py
	setup.py
master3.3
Mike khiretskiy 11 years ago
commit 55fe40247b

File diff suppressed because it is too large Load Diff

@ -15,7 +15,7 @@
# limitations under the License.
__app__ = 'calculate-client'
__version__ = '3.1.4'
__version__ = '3.1.6'
import os
import sys

@ -0,0 +1,50 @@
# Calculate chmod=0755
#!/bin/bash
source /lib/rc/sh/functions.sh
variable_value()
{
local varname=$1
/usr/sbin/cl-core-variables-show --only-value $varname
}
ONLINE_USERS="`variable_value desktop.cl_desktop_online_user`"
# если есть пользователи в сеансе или выполняется выход
if [[ -n $ONLINE_USERS ]] || pgrep -f 'xdm/xdm --logout' &>/dev/null
then
# есть пользователи в сеансе
if [[ -n $ONLINE_USERS ]]
then
ebegin "Logout users"
# переменная online_data возвращает строки пользователь,дисплей
for user_disp in $(variable_value desktop.cl_desktop_online_data | sed -r "s/;/ /g")
do
user=$(echo $user_disp | cut -d, -f1)
disp=$(echo $user_disp | cut -d, -f2)
# завершаем сессию пользователя
/usr/sbin/cl-core --method desktop_logout $user &>/dev/null
# удаляем запить о пользователе
/usr/bin/sessreg -d -l :$disp $user &>/dev/null
# выполняем принудительный выход из сеанса
USER="$user" /usr/share/calculate/xdm/xdm --logout &>/dev/null &
done
eend 0
fi
# ожидаение завершения процесса выхода пользователя из сеанса
if pgrep -f 'xdm/xdm --logout' &>/dev/null
then
ebegin "Please wait for complete logout"
for i in {1..500}
do
if pgrep -f 'xdm/xdm --logout' &>/dev/null
then
sleep 1
else
break
fi
done
eend 0
fi
fi

@ -1,59 +0,0 @@
// Copyright 2007-2010 Calculate Ltd. http://www.calculate-linux.org
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <stdio.h>
// для пароля
#include <sys/types.h>
// для strcpy strlen
#include <string.h>
// для работы с ключами
#include <keyutils.h>
char* getKey(char *login)
{
char buffer[255];
memset(buffer,0,sizeof(buffer));
int ret;
// ищем номер пользовательского ключа
ret = request_key("user", login, NULL, 0);
if (ret < 0)
{
// printf ("id_key not found\n");
return "";
};
// Возвращаем значение ключа
ret = keyctl_read(ret, buffer, sizeof(buffer));
if (ret < 0)
{
// printf("error keyctl_read\n");
return "";
};
return buffer;
};
int clearKey(char *login)
{
char *buffer;
buffer = "XXXXXXXX";
key_serial_t dest;
dest = KEY_SPEC_USER_SESSION_KEYRING;
if (add_key("user", login, buffer, strlen(buffer), dest)!=-1)
return 0;
else
return 1;
};

@ -1,7 +0,0 @@
%module cl_keys
%inline %{
/* Put header files here or function declarations like below */
extern char* getKey(char*);
extern int clearKey(char*);
%}
%include cl_keys.c

@ -28,12 +28,12 @@ from distutils.command.install_data import install_data
data_files = []
data_files += [('/etc/init.d', ['data/client'])]
data_files += ([('/usr/share/calculate/xdm/login.d',
['data/login.d/10client'])] +
[('/usr/share/calculate/xdm/logout.d',
['data/logout.d/10client'])] +
[('/usr/share/calculate/xdm/', ['data/wait_domain'])])
data_files += [('/usr/sbin', ['data/logout'])]
data_files += [('/usr/share/calculate/xdm/login.d',
['data/login.d/10client'])] +\
[('/usr/share/calculate/xdm/logout.d',
['data/logout.d/10client'])] +\
[('/usr/share/calculate/xdm/',['data/wait_domain'])]
def __scanDir(scanDir, prefix, replace_dirname, dirData, flagDir=False):
"""Scan directory"""
@ -71,8 +71,14 @@ def create_data_files(data_dirs, prefix="", replace_dirname=""):
class cl_install_data(install_data):
def run(self):
install_data.run(self)
<<<<<<< HEAD
data_file = [("/etc/init.d/client", 0755),
("/usr/share/calculate/xdm/wait_domain", 0755)]
=======
data_file = [("/etc/init.d/client",0755),
("/usr/sbin/logout",0755),
("/usr/share/calculate/xdm/wait_domain",0755)]
>>>>>>> origin/master
fileNames = map(lambda x: os.path.split(x[0])[1], data_file)
listNames = map(lambda x: filter(lambda y: y, x[0].split("/")),
data_file)
@ -99,19 +105,15 @@ class cl_install_data(install_data):
setup(
name=__app__,
version=__version__,
description="Mounting resources and synchronize the user profile",
author="Calculate Ltd.",
author_email="support@calculate.ru",
url="http://calculate-linux.org",
license="http://www.apache.org/licenses/LICENSE-2.0",
package_dir={'calculate.client': "client"},
packages=['calculate.client', 'calculate.client.utils',
'calculate.client.variables'],
data_files=data_files,
ext_modules=[Extension('calculate.client._cl_keys',
library_dirs=['/usr/lib'],
libraries=['keyutils'],
sources=['./lib/cl_keys.i', './lib/cl_keys.c'])],
name = __app__,
version = __version__,
description = "Mounting resources and synchronize the user profile",
author = "Calculate Ltd.",
author_email = "support@calculate.ru",
url = "http://calculate-linux.org",
license = "http://www.apache.org/licenses/LICENSE-2.0",
package_dir = {'calculate.client': "client"},
packages = ['calculate.client','calculate.client.utils',
'calculate.client.variables'],
data_files = data_files,
cmdclass={'install_data': cl_install_data})

Loading…
Cancel
Save