Bug 51675 - system-auth - На пробелах в OU падает, версию показать не может
Summary: system-auth - На пробелах в OU падает, версию показать не может
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: alterator-auth (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Evgeny Sinelnikov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-09 14:33 MSK by Anton Shevtsov
Modified: 2024-10-14 12:17 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Shevtsov 2024-10-09 14:33:28 MSK
1. не понимает вложенных ou с пробелами в опции createcomputer

 /usr/sbin/system-auth  write ad DOMAIN.RU $(hostname -s) GIS Administrator Qwerty1 --createcomputer="sub1/sub2/sub3/Last level"

на пробеле развалится, и ни кавычки, ни экранирование не поможет

2. не может показать свою версию (--version)

system-auth --version
getopt: нераспознанный параметр «--version»



исправления этих багов ниже

--- system-auth.sisyphus        2024-10-09 15:52:50.979390095 +0500
+++ system-auth 2024-10-09 16:11:39.317110806 +0500
@@ -15,7 +15,7 @@
 while [[ $# -gt 0 ]]; do
   case "$1" in
     '-d') set -x; shift;;
-    '--createcomputer') shift; OU="createcomputer=$1"; shift;;
+    '--createcomputer') shift; OU="$1"; shift;;
     '--windows2003')  win2003="true"; shift;;
     '--winbind')  use_winbind="true"; shift;;
     '--gpo')  use_gpo="true"; shift;;
@@ -774,7 +774,7 @@
        fi
 
        # Join to domain
-       $net_cmd ads join --use-kerberos=required --no-dns-updates --use-krb5-ccache="$krb_ccache_name" $OU osName="$OS_NAME" osVer="$OS_VER"
+       $net_cmd ads join --use-kerberos=required --no-dns-updates --use-krb5-ccache="$krb_ccache_name" createcomputer="${OU}" osName="$OS_NAME" osVer="$OS_VER"
 
        [ "$?" -ne 0 ] && return 1
 
@@ -829,7 +829,7 @@
 status     show current authentication information
 list       list available authentication schemes
 write      set authentication parameters
---version  show current program version
+version  show current program version
 
 Examples:
 Show current authentication information
@@ -983,7 +983,7 @@
         ;;
       esac
     ;;
-    --version)
+    version)
         rpm -q alterator-auth --qf '%{version}\n'
        ;;
     *)
Comment 1 Repository Robot 2024-10-14 12:17:00 MSK
alterator-auth-0.44.11-alt1 -> sisyphus:

 Mon Oct 14 2024 Andrey Cherepanov <cas@altlinux> 0.44.11-alt1
 - system-auth: added support spaces in OU for registered computers (ALT #51675).
 - system-auth: fixed show version.