Bug #2832

Samba machine accounts not migrated

Added by Davide Principi over 5 years ago. Updated about 5 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-samba
Target version:v6.5
Security class: Resolution:
Affected version:v6.5-final NEEDINFO:No

Description

The workstations account were not migrated: in /var/log/messages

Jul 31 17:50:48 srvng /etc/e-smith/events/migration-import/S30nethserver-samba-migrate-sam[25635]: /var/lib/nethserver/db/accounts: OLD fc4$=(undefined)
Jul 31 17:50:48 srvng /etc/e-smith/events/migration-import/S30nethserver-samba-migrate-sam[25635]: /var/lib/nethserver/db/accounts: NEW fc4$=machine
Jul 31 17:50:48 srvng /etc/e-smith/events/migration-import/S30nethserver-samba-migrate-sam[25635]: /var/lib/nethserver/db/accounts: OLD fc4$=machine
Jul 31 17:50:48 srvng /etc/e-smith/events/migration-import/S30nethserver-samba-migrate-sam[25635]: /var/lib/nethserver/db/accounts: NEW fc4$=machine|Uid|
Jul 31 17:50:48 srvng esmith::event[25701]: Event: nethserver-samba-machine-create fc4$
Jul 31 17:50:48 srvng esmith::event[25701]: Use of uninitialized value in numeric gt (>) at /usr/share/perl5/Authen/SASL/Perl.pm line 130.
Jul 31 17:50:48 srvng esmith::event[25701]: [ERROR] Could not read fc4$ Uid prop!
Jul 31 17:50:48 srvng esmith::event[25701]: Action: /etc/e-smith/events/nethserver-samba-machine-create/S10nethserver-samba-machine-create FAILED: 255 [0.140711]
Jul 31 17:50:48 srvng esmith::event[25701]: Event: nethserver-samba-machine-create FAILED
Jul 31 17:50:48 srvng esmith::event[55254]: [ERROR] failed to add machine account fc4$ in SAM db

The accounts were created on a NethService 7.x system (SME Server 7).


Related issues

Related to NethServer 6 - Bug #2806: Samba SAM db migration fails on group_mapping.ldb CLOSED
Related to NethServer 6 - Enhancement #2803: Edit workgroup name when role is Workstation CLOSED

Associated revisions

Revision 065cdd9d
Added by Davide Principi over 5 years ago

nethserver-samba-machine-create: allocate Uid, if not given. Refs #2832

Revision 134bb79a
Added by Davide Principi over 5 years ago

nethserver-samba-migrate-sam: read machine uid from smbpasswd if Uid prop is missing. Refs #2832

History

#1 Updated by Davide Principi over 5 years ago

  • Related to Bug #2806: Samba SAM db migration fails on group_mapping.ldb added

#2 Updated by Davide Principi over 5 years ago

This seems related to #2806. The source accounts DB has an old format (SME7) where Uid prop is not present for machine accounts.

Workaround: set Uid props manually, then re-run the nethserver-samba-migrate-sam action.

#3 Updated by Davide Principi over 5 years ago

  • Category set to nethserver-samba
  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

#4 Updated by Davide Principi over 5 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

#5 Updated by Davide Principi over 5 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Modified

Use uid from source smbpasswd file, if Uid prop is missing in source Accounts DB.

QA notes
If a NethService 7x backup is missing, simulate the missing Uid prop by tweaking the source Accounts DB. For instance you can adjust it with vi or the following command:

db /var/lib/migration/home/e-smith/db/accounts setprop <MACHINENAME> Uid ''

Record example:

mymachine$=machine

#6 Updated by Davide Principi over 5 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-samba-1.4.5-1.14git5c2b63f.ns6.noarch.rpm

#7 Updated by Davide Principi over 5 years ago

#8 Updated by Giacomo Sanchietti over 5 years ago

  • Subject changed from Samba Workstation accounts not migrated to Samba Workstation machine accounts not migrated

#9 Updated by Giacomo Sanchietti over 5 years ago

  • Subject changed from Samba Workstation machine accounts not migrated to Samba machine accounts not migrated

#10 Updated by Giacomo Sanchietti over 5 years ago

  • Assignee set to Giacomo Sanchietti

#11 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from ON_QA to TRIAGED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 20

The machine account is not migrate inside the accounts db neither inside samba db (ldap or pdbedit).

#12 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from TRIAGED to MODIFIED
  • % Done changed from 20 to 60

#13 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 60 to 70

Machine's accounts are migrated only if the old server is configured in PDC mode.

#14 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

The account is correctly migrated if server role is PDC:

[root@localhost ~]# db accounts show mymachine$
mymachine$=machine
    Uid=5006
[root@localhost ~]# db configuration show smb 
smb=service
    AdsLdapAccountsBranch=
    AdsRealm=
    DeadTime=10080
    LogonDrive=X:
    NetbiosAliasList=TEST
    OsLevel=35
    RoamingProfiles=no
    ServerRole=PDC
    Sid=S-1-5-21-15772789-4259746978-2344231576
    TCPPorts=139,445
    UseClientDriver=yes
    UseCups=enabled
    WinsServerIP=
    WinsServerStatus=disabled
    Workgroup=MITEL-NETWORKS
    access=private
    status=enabled

#15 Updated by Giacomo Sanchietti about 5 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Package in nethserver-updates:
  • nethserver-samba-1.4.6-1.ns6.noarch.rpm

Also available in: Atom PDF