Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: When managing both Port and ListenAddress in sshd_config, Port *must* precede ListenAddress #68

Closed
trevor-vaughan opened this issue Dec 28, 2013 · 10 comments

Comments

@trevor-vaughan
Copy link
Contributor

Currently, the module simply appends Port to the end of the list which causes sshd to fail to restart.

@raphink
Copy link
Member

raphink commented Jan 6, 2014

Thank you for the report. This might not be very easy to fix, as it will require to implement positioning and add some parameter intelligence to the provider.

@raphink
Copy link
Member

raphink commented Feb 21, 2014

Do you know of other parameters for which order matters in sshd_config?

@trevor-vaughan
Copy link
Contributor Author

As far as I can tell, that's the only set that matters.

On Fri, Feb 21, 2014 at 2:43 AM, Raphaël Pinson notifications@github.comwrote:

Do you know of other parameters for which order matters in sshd_config?

Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-35705661
.

Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com

-- This account not approved for unencrypted proprietary information --

@raphink
Copy link
Member

raphink commented Feb 21, 2014

OK. I can try to see what I can do.

@raphink
Copy link
Member

raphink commented Feb 21, 2014

I had a hard time reproducing the bug with the unit tests, because this already works if you have a commented Port entry before the first ListenAddress entry. Indeed, the current code uncomments existing commented entries, so if you have:

# Port 22
ListenAddress ::

and you set:

sshd_config { 'Port':
  value => '2222',
}

it will uncomment the value, and the order will be fine.

@trevor-vaughan
Copy link
Contributor Author

Fair enough, but if you try it in a Host sub-entry, it won't work.

On Fri, Feb 21, 2014 at 10:28 AM, Raphaël Pinson
notifications@github.comwrote:

I had a hard time reproducing the bug with the unit tests, because this
already works if you have a commented Port entry before the first
ListenAddress entry. Indeed, the current code uncomments existing commented
entries, so if you have:

Port 22

Listenaddress ::

and you set:

sshd_config { 'Port':
value => '2222',
}

it will uncomment the value, and the order will be fine.

Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-35740176
.

Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com

-- This account not approved for unencrypted proprietary information --

@raphink
Copy link
Member

raphink commented Feb 21, 2014

I did commit a patch for the create method as 82d702b

@raphink
Copy link
Member

raphink commented Feb 21, 2014

Having a look at doing that inside Match blocks now.

@trevor-vaughan
Copy link
Contributor Author

+1

Thanks!

Trevor

On Fri, Feb 21, 2014 at 10:32 AM, Raphaël Pinson
notifications@github.comwrote:

Having a look at doing that inside Match blocks now.

Reply to this email directly or view it on GitHubhttps://github.com//issues/68#issuecomment-35740645
.

Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com

-- This account not approved for unencrypted proprietary information --

raphink added a commit that referenced this issue Feb 21, 2014
@raphink
Copy link
Member

raphink commented Feb 21, 2014

Fixed in abb8adc

@raphink raphink closed this as completed Feb 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants