|
|
|
@ -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()
|
|
|
|
|