Исправление утилит для исправления синхронизации доменного профиля

atratsevskiy
Mike Khiretskiy 10 years ago
parent 0957907da2
commit f16b9f706c

@ -0,0 +1,41 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The program of setting and storing the user account in the domain"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="x86 amd64"
DEPEND="~sys-apps/calculate-desktop-3.2.3
!<sys-apps/calculate-client-3.1.0
>=dev-python/python-ldap-2.0[ssl]
>=sys-auth/pam_ldap-180[ssl]
>=sys-auth/nss_ldap-239
sys-apps/keyutils
sys-auth/pam_keystore
sys-auth/pam_client
dev-lang/swig"
RDEPEND="${DEPEND}"
python_install() {
distutils-r1_python_install --install-scripts=/usr/sbin
}
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-client-3.2.3-r5.patch"
}

@ -0,0 +1,158 @@
diff --git pym/client/client.py pym/client/client.py
index 7a4cff6..4387e5b 100644
--- pym/client/client.py
+++ pym/client/client.py
@@ -40,7 +40,7 @@ from calculate.lib.utils.files import (getModeFile, removeDir,
listDirectory,process,find,STDOUT,
sambaPasswordCheck,checkUtils)
from calculate.lib.utils.common import (getpathenv, appendProgramToEnvFile,
- removeProgramToEnvFile)
+ removeProgramToEnvFile, cmpVersion)
from calculate.desktop._cl_keys import getKey, clearKey
from calculate.lib.convertenv import convertEnv
from calculate.lib.encrypt import encrypt
@@ -204,12 +204,12 @@ class commandServer(color_print):
if not pwDialog:
pwDialog = [_("New password"),
_("Retype the new password")]
- pwdA = getpass.getpass(pwDialog[0]+":")
- pwdB = getpass.getpass(pwDialog[1]+":")
+ pwdA = getpass.getpass(pwDialog[0]+_(":"))
+ pwdB = getpass.getpass(pwDialog[1]+_(":"))
if (optStdIn and options.has_key(optStdIn)) or\
(optDialog and options.has_key(optDialog)):
if not pwdA or not (pwdA == pwdB):
- self.printERROR (_("ERROR") + ": " +\
+ self.printERROR (_("ERROR") + _(": ") +\
_("passwords do not match"))
return False
userPwd = pwdA
@@ -264,16 +264,20 @@ class Client(commandServer, encrypt, Desktop):
Подключить samba ресурс
"""
mountCmd = checkUtils('/bin/mount')
+ if cmpVersion(self.clVars.Get('cl_cifs_ver'),"2.05") < 0:
+ nomapposix=""
+ else:
+ nomapposix=",nomapposix"
if not uid is None:
# mount by uid
p = process(mountCmd,"-t","cifs","-o",
- "cache=loose,user=%s,uid=%d,gid=%d,noperm"%(userName,uid,gid),
+ "cache=loose,user=%s,uid=%d,gid=%d,noperm%s"%(userName,uid,gid,nomapposix),
"//%s/%s"%(host,res),rpath,
envdict={"PASSWD":userPwd},stderr=STDOUT)
return p.success()
else:
p = process(mountCmd,"-t","cifs","-o",
- "cache=loose,user=%s"%userName,
+ "cache=loose,user=%s%s"%(userName,nomapposix),
"//%s/%s"%(host,res),rpath,
envdict={"PASSWD":userPwd},stderr=STDOUT)
return p.success()
@@ -953,7 +957,7 @@ class Client(commandServer, encrypt, Desktop):
# \s*<название_службы>\s*|\s*<уроверь запуска>?\s*
p.readlines())))
else:
- raise ClientError(_("ERROR") + ": " + p.read())
+ raise ClientError(_("ERROR") + _(": ") + p.read())
def delDaemonAutostart(self, daemon):
"""
@@ -966,7 +970,7 @@ class Client(commandServer, encrypt, Desktop):
if p.success():
return True
else:
- self.printERROR(_("ERROR") + ": " + p.read())
+ self.printERROR(_("ERROR") + _(": ") + p.read())
self.printERROR(_("Failed to delete from the default runlevel"))
return False
return True
@@ -982,7 +986,7 @@ class Client(commandServer, encrypt, Desktop):
if p.success():
return True
else:
- self.printERROR(_("ERROR") + ": " + p.read())
+ self.printERROR(_("ERROR") + _(": ") + p.read())
self.printERROR(_("Failed to add to the default runlevel"))
return False
@@ -1094,7 +1098,7 @@ class Client(commandServer, encrypt, Desktop):
bindPw = self.getInfoService("unix", "bind_pw")
# check info from server
if not (servDn and unixDn and bindDn and bindPw):
- raise ClientError(_("Info not found on the server") + ": " +\
+ raise ClientError(_("Info not found on the server") + _(": ") +
_("services DN or unix DN or bind DN or bind password"))
self.clVars.Set("os_remote_auth", domain)
return True
@@ -1185,8 +1189,8 @@ class Client(commandServer, encrypt, Desktop):
return True
else:
if not (domain and pwdRemote):
- self.printERROR(_("Variable not found")+\
- ": cl_remote_pw")
+ self.printERROR(_("Variable not found")+
+ _(": ") + "cl_remote_pw")
return False
if not os.path.exists(pathRemote):
os.makedirs(pathRemote)
diff --git pym/client/client_cache.py pym/client/client_cache.py
index dd4e9f2..200d48d 100644
--- pym/client/client_cache.py
+++ pym/client/client_cache.py
@@ -36,13 +36,15 @@ class _shareData(color_print):
if os.access(self.fileName, os.R_OK):
return True
else:
- self.printERROR(_("Failed to read the file")+": "+self.fileName)
+ self.printERROR(_("Failed to read the file")+_(": ") +
+ self.fileName)
return False
elif perm == "WRITE":
if os.access(self.fileName, os.W_OK):
return True
else:
- self.printERROR(_("Failed to write to file")+": "+self.fileName)
+ self.printERROR(_("Failed to write to file")+_(": ") +
+ self.fileName)
return False
def getData(self):
diff --git pym/client/variables/client.py pym/client/variables/client.py
index faa69d5..21227b6 100644
--- pym/client/variables/client.py
+++ pym/client/variables/client.py
@@ -660,3 +660,10 @@ class VariableClClientNscdCache(Variable):
"""
Частота обновления кэша nscd при работе в домене в часах
"""
+
+class VariableClCifsVer(ReadonlyVariable):
+ """
+ Версия модуля CIFS
+ """
+ def get(self):
+ return readFile("/sys/module/cifs/version")
diff --git pym/client/wsdl_client.py pym/client/wsdl_client.py
index dd7af10..f78bf89 100644
--- pym/client/wsdl_client.py
+++ pym/client/wsdl_client.py
@@ -45,7 +45,7 @@ class Wsdl(WsdlBase):
# заголовок метода
'title': __("Domain"),
# иконка для графической консоли
- 'image': 'network-workgroup',
+ 'image': 'network-server,network-workgroup',
# метод присутствует в графической консоли
'gui': True,
# консольная команда
@@ -157,7 +157,7 @@ class Wsdl(WsdlBase):
# заголовок метода
'title': __("Change Password"),
# иконка для графической консоли
- 'image': 'system-users',
+ 'image': 'preferences-system-privacy,system-users',
# метод присутствует в графической консоли
'gui': True,
# пользовательский метода

@ -0,0 +1,26 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
DESCRIPTION="Calculate Utilities meta package"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="x86 amd64"
IUSE="cl_consolegui cl_client cl_desktop cl_console"
RDEPEND="${RDEPEND}
=sys-apps/calculate-install-3.2.3-r15
=sys-apps/calculate-i18n-3.2.3-r4
=sys-apps/calculate-lib-3.2.3-r6
=sys-apps/calculate-core-3.2.3-r5
=sys-apps/calculate-update-3.2.3-r7
cl_client? ( =sys-apps/calculate-client-3.2.3-r5 )
cl_desktop? ( =sys-apps/calculate-desktop-3.2.3-r2 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.3-r4 )
cl_console? ( =sys-apps/calculate-console-3.2.3-r4 )
"
Loading…
Cancel
Save