Project

General

Profile

Bug #69555

Fix handling of invalid smb4.conf auxiliary parameters

Added by Anthony Takata 7 months ago. Updated 5 months ago.

Status:
Done
Priority:
No priority
Assignee:
Andrew Walker
Category:
Services
Target version:
Severity:
Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

I noticed this after upgrading to the latest nightly from a build back in Oct '18, but apparently if there are empty lines (or, at least, lines that do not have a : in them) the smb4_share.conf file will fail to be generated.

This occurs in File "/tmp/mako/usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4_share.conf.py", line 150, in parse_db_config
pc[share["name"]].update({param_kv0: param_kv1})
Since an empty string split on = does not have a second index, this breaks.

One solution would be to check if it actually has two items in the array before trying the update, since terms without an = sign are probably invalid anyways.

This issue is particularly insidious because blank lines are (naturally) allowed in samba.conf (as well as comments) but any user attempting to use them will invisibly cause their configs to fail generation.
Granted it's hidden away under an Advanced toggle, but it is still unexpected behavior.

SMB4.png (43.3 KB) SMB4.png Jeff Ervin, 03/22/2019 07:05 AM
62379

History

#1 Updated by Dru Lavigne 7 months ago

  • Private changed from No to Yes
  • Reason for Blocked set to Need additional information from Author

Anthony: please attach a debug (System -> Advanced -> Save debug) to this ticket.

#2 Updated by Anthony Takata 7 months ago

  • File debug-freenas-20190116002702.tgz added

Attaching debug log of a secondary installation that's less busy (and not attached to a domain)

#3 Updated by Dru Lavigne 7 months ago

  • Assignee changed from Release Council to William Grzybowski
  • Reason for Blocked deleted (Need additional information from Author)

#4 Updated by William Grzybowski 7 months ago

  • Assignee changed from William Grzybowski to Andrew Walker
  • Target version changed from Backlog to 11.3
  • Severity changed from New to Medium

#5 Updated by Bug Clerk 7 months ago

  • Status changed from Unscreened to In Progress

#6 Updated by Bug Clerk 7 months ago

  • Status changed from In Progress to Ready for Testing

#7 Updated by Dru Lavigne 7 months ago

  • File deleted (debug-freenas-20190116002702.tgz)

#8 Updated by Dru Lavigne 7 months ago

  • Target version changed from 11.3 to 11.3-BETA1
  • Private changed from Yes to No
  • Needs Merging changed from Yes to No

#9 Updated by Dru Lavigne 7 months ago

  • Subject changed from Empty lines in Samba Auxiliary Parameters causes conf generation failure to Fix handling of invalid smb4.conf auxiliary parameters
  • Needs Doc changed from Yes to No

#10 Updated by Dru Lavigne 6 months ago

  • Category changed from Middleware to Services

#14 Updated by Jeff Ervin 5 months ago

  • File SMB4.png SMB4.png added
  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No
62379

Test Passed FreeNAS-11.3-MASTER-201903211102

Criteria followed, but Andrew checked the result to be sure, and it passes

#15 Updated by Dru Lavigne 5 months ago

  • Status changed from Passed Testing to Done

#16 Updated by Dru Lavigne 5 months ago

  • Target version changed from 11.3-BETA1 to 11.3-ALPHA1

Also available in: Atom PDF