Bug 2329 - Authorized keys environment parsing error
Summary: Authorized keys environment parsing error
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All All
: P5 normal
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_6_9
  Show dependency treegraph
 
Reported: 2014-12-24 08:43 AEDT by coladict
Modified: 2015-11-01 12:30 AEDT (History)
3 users (show)

See Also:


Attachments
Untested patch, but should work (2.60 KB, patch)
2014-12-24 08:43 AEDT, coladict
no flags Details | Diff
revised diff (1.26 KB, patch)
2015-04-17 15:42 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description coladict 2014-12-24 08:43:29 AEDT
Created attachment 2520 [details]
Untested patch, but should work

When there is an environment setting in the authorized keys file and setting them is disabled it results in a parsing error, rather than simply ignoring the option.
I tried writing a workaround, but I won't have a second computer to properly test it any time soon, so I didn't even try to compile it. Also I would be doing it that on the Ubuntu sources, which have different line numbers, but the code in that area is the same, unchanged between the platforms.
If it doesn't work, at the very least it shows where the problem is.
Comment 1 Damien Miller 2015-04-17 15:42:53 AEST
Created attachment 2592 [details]
revised diff

IMO it's better to delay the test of permit_env until after the environment variable is fully parsed. This will prevent it from getting desynchronised and better alert on errors.
Comment 2 Damien Miller 2015-05-01 13:31:19 AEST
patch applied. This will be in openssh-6.9
Comment 3 Damien Miller 2015-08-11 23:03:14 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1
Comment 4 Christoph Anton Mitterer 2015-11-01 12:30:37 AEDT
The changelog entry for this reads:
>sshd(8): make parsing of authorized_keys "environment=" options
>independent of PermitUserEnv being enabled;

which kinda sounds as if "environment=" would be applied even if PermitUserEnvironment=no... but this isn't the case here, is it?