Modify

Opened 8 years ago

Last modified 3 years ago

#6992 new enhancement

Dropbear configuration values - please use lowercase for uniformity

Reported by: porter.adam@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: Cc: maddes

Description

Currently every UCI file in /etc/config uses lowercase parameters, except dropbear. This causes a bit of confusion when users would, for example, try to set the port... for every other feature, port is "port", yet dropbear is "Port".It would be useful if dropbear used values which matched the UCI syntax of every other feature.

In addition, the PasswordAuth default in UCI is "on", whereas the init script is looking for a boolean 1 or 0.

I've attached a patch.

Attachments (2)

dropbear.patch (1.6 KB) - added by anonymous 8 years ago.
dropbear_uci_lower_case_options_new_trunk.patch (865 bytes) - added by maddes 7 years ago.
-p0 patch for trunk to convert options, that are only in trunk, into lowercase

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by anonymous

comment:1 Changed 8 years ago by anonymous

Changing them to lower case would be ok, but the change must convert the old values to new values.

Example:
Check if "Port" exists, read it, remove it and store it as "port".

comment:2 Changed 8 years ago by maddes

  • Component changed from packages to base system

Last comment was from me.
I saw a similar "transformation" code in another script, but can't remember which one.
IIRC it was a script from trunk directly, not packages.

comment:3 Changed 8 years ago by maddes

Possible transformation code:

	# C) banner file
	local oldvalue
	local bannerfile
	config_get oldvalue "${section}" BannerFile
	config_get bannerfile "${section}" bannerfile
	[ -z "$bannerfile" ] && [ -n "$oldvalue" ] && {
		config_set "${section}" bannerfile "$bannerfile"
		uci_set "$NAME" "${section}" bannerfile "$bannerfile"
	}
	[ -n "$oldvalue" ] && {
		config_unset "${section}" BannerFile
		uci_remove "$NAME" "${section}" BannerFile
		uci_commit "$NAME"
	}
	[ -f "$bannerfile" ] || bannerfile=''
  • Only if the new setting is empty and the old setting is set, then the new uci setting is set with the old value.
  • If the old setting is set, then it is deleted and the changes committed.
  • Final solution should only commit once per section via local variable.

If setting and committing values from init scripts is seen as too critical (as other dropbear uci changes from the user will also be committed), then old settings should only be read as a fallback:

	# C) banner file
	local bannerfile
	config_get bannerfile "${section}" bannerfile
	[ -z "$bannerfile" ] && config_get bannerfile "${section}" BannerFile
	[ -f "$bannerfile" ] || bannerfile=''

Otherwise do a harsh change to lower case without any transformation code.

Or do a conversion on "firstboot".

comment:4 Changed 7 years ago by maddes

  • Cc maddes added

comment:5 Changed 7 years ago by porter.adam@…

Perhaps the conversion could be done with uci-defaults, much like the migration script jow made for the rtl8366 driver mod which required vlan0->vlan1 in /etc/config/network.

/changeset/22625.html

comment:6 Changed 7 years ago by maddes

I think this should be handled in two parts:

  1. Make all options that are not in Backfire lowercase as trunk is "in Development". For this I attached the following patch.
  2. Find a way to get the old options converted.

Changed 7 years ago by maddes

-p0 patch for trunk to convert options, that are only in trunk, into lowercase

comment:7 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:8 Changed 3 years ago by jogo

  • Milestone changed from Barrier Breaker 14.07 to Chaos Calmer (trunk)
  • Type changed from defect to enhancement

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.