[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/environment (related with bug #28446)



maor@debian.org (Guy Maor) writes:

   > As  you see,  the  file is  sourced, which  means  that the  values of  the
   > variables defined should be properly quoted.
   
   Yes, it is a bug in login that it doesn't do this.

ssh does the same...

It makes  sense, because this way  the file is independent  of the (usually
complex)  quoting conventions of  different shells.   Quoting in  shells is
needed  because of  variables  and substitutions,  and  login (ssh)  cannot
reasobly incorporate a  complete shell parser, so substitution  is not done
and quoting is not useful.

What I mean is that this is not easily classified as a bug in login.
   
   >  Moreover, export instructions
   > are needed inside /etc/environment, unless  one uses the "set -o allexport"
   > instruction of  bash or ksh,  which is almost  unusable as it  triggers bug
   > #23857.
   
   This bug has been fixed upstream (yay!) and I have a new version
   almost ready to upload.

Wow!

If this is the case, one can take the file as login likes it, pass it
through a sed script which changes
	name=value
into
	name='value'
, then set -o allexport, source it, and set +o allexport.

This could be done in Xsession,  or at least suggested in a comment.  Also,
the  ENVIRON_FILE instruction  in login.defs  should be  uncommented.  This
way, login, ssh, any possible shell, and Xsession are happy.

Horrible?
 -=- MIME -=- 

--Boundary_(ID_pORhhmq17R3RO7hsRkwtLw)
Content-type: text/plain; charset=us-ascii
Content-language: EN-US

This report relates to a message you sent with the following header fields:

  Message-id: <87zp9qsat4.fsf@pot.cnuce.cnr.it>
  Date: Tue, 17 Nov 1998 14:33:59 +0100
  From: Francesco Potorti` <F.Potorti@cnuce.cnr.it>
  To: debian-policy@pot.cnuce.cnr.it
  Subject: Re: /etc/environment (related with bug #28446)

Your message cannot be delivered to the following recipients:

  Recipient address: debian-policy@cnuce.cnr.it
  Reason: Not found in directory


--Boundary_(ID_pORhhmq17R3RO7hsRkwtLw)
Content-type: message/DELIVERY-STATUS

Original-envelope-id: 01J4AALJ1MY29KM1KZ@mailsrv.cnuce.cnr.it
Reporting-MTA: dns;mailsrv.cnuce.cnr.it

Action: failed
Status: 5.1.1 (Not found in directory)
Original-recipient: rfc822;debian-policy@cnuce.cnr.it
Final-recipient: rfc822;debian-policy@cnuce.cnr.it

--Boundary_(ID_pORhhmq17R3RO7hsRkwtLw)
Content-type: MESSAGE/RFC822

Return-path: pot@pot.cnuce.cnr.it
Received: from DIRECTORY-DAEMON by mailsrv.cnuce.cnr.it (PMDF V5.2-29 #23415)
 id <01J4AALKHIMK9KM1KZ@mailsrv.cnuce.cnr.it>
 (original mail from pot@pot.cnuce.cnr.it); Tue, 17 Nov 1998 15:50:14 +0100
Received: from fly.cnuce.cnr.it (pot.cnuce.cnr.it [131.114.193.182])
 by mailsrv.cnuce.cnr.it (PMDF V5.2-29 #23415)
 with ESMTP id <01J4A7YYL7DO9KM16U@mailsrv.cnuce.cnr.it> for
 debian-policy@cnuce.cnr.it; Tue, 17 Nov 1998 14:35:34 +0100
Received: by fly.cnuce.cnr.it	id m0zflGc-00089cC
 (Debian Smail-3.2.0.102 1998-Aug-2 #2); Tue, 17 Nov 1998 14:34:02 +0100 (CET)
Date: Tue, 17 Nov 1998 14:33:59 +0100
From: Francesco Potorti` <F.Potorti@cnuce.cnr.it>
Subject: Re: /etc/environment (related with bug #28446)
In-reply-to: maor@debian.org's message of "17 Nov 98 09:08:55 GMT"
To: debian-policy@pot.cnuce.cnr.it
Message-id: <87zp9qsat4.fsf@pot.cnuce.cnr.it>
X-Mailer: Gnus v5.5/Emacs 20.3
Content-transfer-encoding: 7BIT
Lines: 39
References: <[🔎] m0zfO1v-0008BZC@fly.cnuce.cnr.it> <[🔎] 8767ce3cuw.fsf@femto.dyn.ml.org>

maor@debian.org (Guy Maor) writes:

   > As  you see,  the  file is  sourced, which  means  that the  values of  the
   > variables defined should be properly quoted.
   
   Yes, it is a bug in login that it doesn't do this.

ssh does the same...

It makes  sense, because this way  the file is independent  of the (usually
complex)  quoting conventions of  different shells.   Quoting in  shells is
needed  because of  variables  and substitutions,  and  login (ssh)  cannot
reasobly incorporate a  complete shell parser, so substitution  is not done
and quoting is not useful.

What I mean is that this is not easily classified as a bug in login.
   
   >  Moreover, export instructions
   > are needed inside /etc/environment, unless  one uses the "set -o allexport"
   > instruction of  bash or ksh,  which is almost  unusable as it  triggers bug
   > #23857.
   
   This bug has been fixed upstream (yay!) and I have a new version
   almost ready to upload.

Wow!

If this is the case, one can take the file as login likes it, pass it
through a sed script which changes
	name=value
into
	name='value'
, then set -o allexport, source it, and set +o allexport.

This could be done in Xsession,  or at least suggested in a comment.  Also,
the  ENVIRON_FILE instruction  in login.defs  should be  uncommented.  This
way, login, ssh, any possible shell, and Xsession are happy.

Horrible?

--Boundary_(ID_pORhhmq17R3RO7hsRkwtLw)--


Reply to: