Index | Thread | Search

From:
Jeremy Mates <jmates@thrig.me>
Subject:
su, doas inconsistent handling of duplicate environment variables
To:
tech@openbsd.org
Date:
Wed, 7 Feb 2024 01:03:50 +0000

Download raw body.

Thread
  • Jeremy Mates:

    su, doas inconsistent handling of duplicate environment variables

Assuming a doas.conf with "keepenv" somewhere appropriate, the first
of any dupliate is selected by doas, while the last is selected by
su. Should this be made consistent between the two? (Shells and
languages also vary here, though I haven't found any that pick only
the middle, yet.)

	$ dupenv FOO=first FOO=middle FOO=last env | grep FOO
	FOO=first
	FOO=middle
	FOO=last
	$ dupenv FOO=first FOO=middle FOO=last doas env | grep FOO
	FOO=first
	$ dupenv FOO=first FOO=middle FOO=last su
	Password:
	$ env | grep FOO
	FOO=last