ALT Linux Bugzilla
– Attachment 19595 Details for
Bug 55948
[FR] Дополнительные Windows-переменные окружения в групповых политиках в Linux окружении
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Доработка функций expand_windows_var и transform_windows_path
utils_windows.py.diff (text/plain), 2.12 KB, created by
itteh
on 2025-09-19 09:14:31 MSK
(
hide
)
Description:
Доработка функций expand_windows_var и transform_windows_path
Filename:
MIME Type:
Creator:
itteh
Created:
2025-09-19 09:14:31 MSK
Size:
2.12 KB
patch
obsolete
>--- a/gpupdate/gpoa/util/windows.py 2025-04-03 11:13:27.000000000 +0400 >+++ b/gpupdate/gpoa/util/windows.py 2025-09-18 16:01:21.695961520 +0400 >@@ -18,6 +18,8 @@ > > > import os >+import re >+import subprocess > from pathlib import Path > from samba import getopt as options > from samba import NTSTATUSError >@@ -317,19 +319,32 @@ > variables['SystemDrive'] = '/' > variables['DesktopDir'] = xdg_get_desktop(username, variables['HOME']) > >+ class_smbcreds = smbcreds() >+ variables['USERDOMAIN'] = class_smbcreds.get_domain() >+ variables['ALLUSERSPROFILE'] = '/usr/local/share' >+ variables['COMPUTERNAME'] = subprocess.run(["hostname", "--short"], capture_output=True, text=True, check=True).stdout.strip() >+ variables['PROGRAMDATA'] = '/usr/local/share' >+ variables['PROGRAMFILES'] = '/usr/bin' >+ variables['PROGRAMFILES(x86)'] = '/usr/bin' >+ variables['WINDIR'] = '/' >+ > if username: > variables['LogonUser'] = username > variables['HOME'] = get_homedir(username) > variables['HOMEPATH'] = get_homedir(username) > >+ variables['USERNAME'] = username >+ variables['USERPROFILE'] = get_homedir(username) >+ > variables['StartMenuDir'] = os.path.join( > variables['HOME'], '.local', 'share', 'applications') > > result = text >+ > for var in variables.keys(): >- result = result.replace('%{}%'.format(var), >- variables[var] if variables[var][-1] == '/' >- else variables[var] +'/') >+ >+ pattern = re.compile(re.escape(f"%{var}%"), re.IGNORECASE) >+ result = pattern.sub(variables[var], result) > > return result > >@@ -338,10 +353,15 @@ > ''' > Try to make Windows path look like UNIX. > ''' >- result = text >+ if not text: >+ return text >+ >+ result = str(text) >+ >+# if text.lower().endswith('.exe'): >+# result = text.lower().replace('\\', '/').replace('.exe', '').rpartition('/')[2] > >- if text.lower().endswith('.exe'): >- result = text.lower().replace('\\', '/').replace('.exe', '').rpartition('/')[2] >+ result = result.replace('\\', '/') > > return result >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55948
:
19521
| 19595 |
19596