web-dev-qa-db-ja.com

dsimportがコンピューターのGeneratedUIDの設定に失敗する

Apple OpenDirectory(10.5サーバーで実行)にマシンを投入しています。

私のスクリプトは次のようなファイルを出力します:

0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Computers 6 dsAttrTypeStandard:RecordName dsAttrTypeStandard:Comment dsAttrTypeStandard:ENetAddress dsAttrTypeStandard:GeneratedUID dsAttrTypeStandard:Keywords dsAttrTypeStandard:RealName 
XXX-1to1-47-Fai:Asset 01015:00\:19\:e3\:3c\:07\:28:1A964A90-ADB1-44D5-BA44-EE3B5C8255CA:1A964A90-ADB1-44D5-BA44-EE3B5C8255CA:XXX-1to1-47-Fai
XXX-1to1-20-Bre:Asset 01012:00\:19\:e3\:3e\:a1\:fb:D3083AFF-8B62-4D74-B483-68BF40F41069:D3083AFF-8B62-4D74-B483-68BF40F41069:XXX-1to1-20-Bre

次に、次のようにインポートします。

dsimport -g machines.txt "/LDAPv3/127.0.0.1" "O" -u diradmin -p diradmin_password -y remote_Host -yrnm diradmin -yrpwd diradmin_password

わからない理由で、設定したGeneratedUIDフィールドのインポートに失敗します。代わりに、それ自体が作成されます。

このような結果を見ると

dscl -u diradmin -p remote_Host -readall /LDAPv3/127.0.0.1/Computers

私は得る

dsAttrTypeNative:Apple-generateduid: 3247AAC8-CB4C-47B0-A97C-167722480C0E
dsAttrTypeNative:Apple-keyword: D3083AFF-8B62-4D74-B483-68BF40F41069
dsAttrTypeNative:Apple-ownerguid: 9DD42971-FD0D-4232-931C-FB42507B3185
dsAttrTypeNative:Apple-realname: XXX-1to1-20-Bre
dsAttrTypeNative:cn: XXX-1to1-20-Bre
dsAttrTypeNative:description:
 Asset 01012
dsAttrTypeNative:gidNumber: 157380
dsAttrTypeNative:macAddress: 00:19:e3:3e:a1:fb
dsAttrTypeNative:objectClass: Apple-computer top
AppleMetaNodeLocation: /LDAPv3/127.0.0.1
Comment:
 Asset 01012
ENetAddress: 00:19:e3:3e:a1:fb
GeneratedUID: 3247AAC8-CB4C-47B0-A97C-167722480C0E
Keywords: D3083AFF-8B62-4D74-B483-68BF40F41069
PasswordPlus: ********
PrimaryGroupID: 157380
RealName: XXX-1to1-20-Bre
RecordName: XXX-1to1-20-Bre
RecordType: dsRecTypeStandard:Computers

最初のレコードの場合、および2番目のレコードの関連部分は、GeneratedUIDフィールドとKeywordsフィールドの両方に対して生成したUUIDをエクスポートするようにしたことに注意してください。

GeneratedUID: 13C81E32-F4C6-433F-AB62-54A801E25180
Keywords: 1A964A90-ADB1-44D5-BA44-EE3B5C8255CA

Dsclを使用して手動で設定を変更できますが、GeneratedUIDを設定したとき(ユーザーやグループなど)は、問題は発生していません。これがなぜであるかについて何か考えはありますか?

[はい、私はあなたが通常、GeneratedUIDが何であるかを気にしないことを知っています。それを知っていると、スクリプトでグループを作成しやすくなります。]

1

上記のようにインポートした場合、上書きモードで次のことがわかりました。

dsimport -g machines.txt "/LDAPv3/127.0.0.1" "O" -u diradmin -p diradmin_password -y remote_Host -yrnm diradmin -yrpwd diradmin_password

その後、マージモードで同じファイルをインポートします。

dsimport -g machines.txt "/LDAPv3/127.0.0.1" "M" -u diradmin -p diradmin_password -y remote_Host -yrnm diradmin -yrpwd diradmin_password

望ましい結果が得られること。 dsimportにバグがあると思わせます。

1