Bug #39628
Fix function for storing SIDs
Description
Observed on customer box that a cifs.save() call was not removed when migrated to middleware. This crashes the script and prevents smb4.conf from being generated. This is a one line change and should go into both 11.2 and 11.1-U6.
Jul 24 10:13:12 nv-nas3 ActiveDirectory: /usr/local/bin/python /usr/local/bin/midclt call notifier.start cifs
Jul 24 10:13:16 localhost [generate_smb4_conf:178] The following exception occured while trying to set database SID: 'Struct' object has no attribute 'save'
Jul 24 10:13:16 localhost [generate_smb4_conf:12] Traceback (most recent call last):
Jul 24 10:13:16 localhost [generate_smb4_conf:12] File "/usr/local/libexec/nas/generate_smb4_conf.py", line 173, in smb4_set_database_SID
Jul 24 10:13:16 localhost [generate_smb4_conf:12] cifs.save()
Jul 24 10:13:16 localhost [generate_smb4_conf:12] AttributeError: 'Struct' object has no attribute 'save'
Jul 24 10:13:16 localhost [generate_smb4_conf:178] The following exception occured while trying to set database SID: 'Struct' object has no attribute 'save'
Jul 24 10:13:16 localhost [generate_smb4_conf:12] Traceback (most recent call last):
Jul 24 10:13:16 localhost [generate_smb4_conf:12] File "/usr/local/libexec/nas/generate_smb4_conf.py", line 173, in smb4_set_database_SID
Jul 24 10:13:16 localhost [generate_smb4_conf:12] cifs.save()
Jul 24 10:13:16 localhost [generate_smb4_conf:12] AttributeError: 'Struct' object has no attribute 'save'
Related issues
History
#1
Updated by John Hixson over 2 years ago
- Assignee changed from Release Council to Andrew Walker
Andrew, can you fix this? cifs.save() will need to be replaced with with the equivalent new world order method of saving this value to the database.
#2
Updated by Dru Lavigne over 2 years ago
- Target version changed from 11.2-RC2 to 11.1-U6
#3
Updated by Andrew Walker over 2 years ago
PR against Master - https://github.com/freenas/freenas/pull/1597
#4
Updated by Andrew Walker over 2 years ago
Related issue: https://redmine.ixsystems.com/issues/28063
#5
Updated by Dru Lavigne over 2 years ago
- Related to Bug #28063: Write local SID to correct DB file added
#6
Updated by Dru Lavigne over 2 years ago
Stable PR: https://github.com/freenas/freenas/pull/1598
#7
Updated by Andrew Walker over 2 years ago
Method to test:
1) clear sid from freenas-v1.db
sqlite3 /data/freenas-v1.db 'UPDATE services_cifs SET cifs_SID = "";'
2) run the smb4.conf generation script
/usr/local/libexec/nas/generate_smb4_conf.py
3) Verify that the SID was written to the db file correctly
sqlite3 /data/freenas-v1.db "SELECT cifs_SID from services_cifs;"
#8
Updated by Dru Lavigne over 2 years ago
- Status changed from Unscreened to In Progress
#10
Updated by Dru Lavigne over 2 years ago
- Subject changed from remove leftover save() method from generate_smb4_conf.py to Fix function for storing SIDs
- Status changed from In Progress to Ready for Testing
- Needs Doc changed from Yes to No
- Needs Merging changed from Yes to No
#11
Updated by Bonnie Follweiler over 2 years ago
#12
Updated by Bonnie Follweiler over 2 years ago
- Status changed from Ready for Testing to Passed Testing
- Needs QA changed from Yes to No
Test Passed
#13
Updated by Dru Lavigne over 2 years ago
- Status changed from Passed Testing to Done