From 277fa3d408ce2b89e3381af98def51d138672918 Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Tue, 13 Jan 2015 15:02:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=BF=D1=86=D0=B8=D1=8F=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?cifs=20nomapposix=20=D0=B4=D0=BB=D1=8F=20=D1=8F=D0=B4=D0=B5?= =?UTF-8?q?=D1=80=203.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Без параметра монтирования nomapposix появляются сложности в работе с путями содержащими знак ":" --- pym/client/client.py | 10 +++++++--- pym/client/variables/client.py | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pym/client/client.py b/pym/client/client.py index 2833b94..4387e5b 100644 --- a/pym/client/client.py +++ b/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 @@ -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() diff --git a/pym/client/variables/client.py b/pym/client/variables/client.py index faa69d5..21227b6 100644 --- a/pym/client/variables/client.py +++ b/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")