Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-20 Thread Jörg F . Wittenberger
On Mar 18 2013, Felix wrote: From: Peter Bex Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Mon, 18 Mar 2013 21:22:12 +0100 On Mon, Mar 18, 2013 at 02:03:41PM -0400, Mario Domenech Goulart wrote: Maybe I'm too paranoid? Or missing something? No, y

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-19 Thread Jim Ursetto
The following eggs in SVN use ##sys#expand-home-path, since this functionality is useful but was never exported as an official API: openssl osxattr posix-extras sql-de-lite sqlite3 vfs To be fair, three of those are mine. Jim On Mar 19, 2013, at 8:48 PM, Mario Domenech Goulart wrote: > Hi John

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-19 Thread John Cowan
Mario Domenech Goulart scripsit: > IMO, in this case we should just remove ##sys#expand-home-path, since it > is an internal procedure. Users should not rely on stability of the > internal API. By keeping ##sys#expand-home-path as an identity > procedure, we'd be just polluting the core and addi

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-19 Thread Mario Domenech Goulart
Hi John, On Tue, 19 Mar 2013 22:01:45 -0400 John Cowan wrote: > Mario Domenech Goulart scripsit: > >> b. Drop ##sys#expand-home-path. Do not implicitly expand ~ and >>environment variables in pathnames. Provide a procedure to expand ~ >>in pathnames. That's what this patch implements.

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-19 Thread John Cowan
Mario Domenech Goulart scripsit: > b. Drop ##sys#expand-home-path. Do not implicitly expand ~ and >environment variables in pathnames. Provide a procedure to expand ~ >in pathnames. That's what this patch implements. I suggest: b2. Keep ##sys#expand-home-path, but make it the identi

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-19 Thread Mario Domenech Goulart
Hi, On Tue, 19 Mar 2013 16:44:24 +0100 Peter Bex wrote: > On Fri, Mar 15, 2013 at 07:58:02AM +0100, Florian Zumbiehl wrote: >> Remove ##sys#expand-home-path as shell expansion has no place in a filesystem >> API. > > I've moved the ~ behaviour to a new procedure in "utils" called "ep" and > upda

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-19 Thread John Cowan
Peter Bex scripsit: > BTW: This behaviour isn't really compatible with the shell's, since it > disallows strings formatted like ~username from being expanded to that > user's homedir. I don't think that behavior is worth emulating. For one thing, machines are far less likely to be multi-user now

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-19 Thread Peter Bex
On Fri, Mar 15, 2013 at 07:58:02AM +0100, Florian Zumbiehl wrote: > Remove ##sys#expand-home-path as shell expansion has no place in a filesystem > API. I've moved the ~ behaviour to a new procedure in "utils" called "ep" and updated the NEWS file and docs. The signed off patch is attached. I'm

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Peter Bex
On Mon, Mar 18, 2013 at 10:05:46PM +0100, Felix wrote: > I disagree. We can still try to make the core system practical, > instead of a mindless API server for low-level facilities wrapped in > s-expression syntax. Nobody's arguing for that. Abstraction (the right kind!) is what makes Scheme so p

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Felix
From: Mario Domenech Goulart Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Mon, 18 Mar 2013 13:02:01 -0400 > Hi Matt, > > On Mon, 18 Mar 2013 08:45:17 -0700 Matt Welland wrote: > >> Please please keep the expansion of ~. >> Pragmatic

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Felix
> > Note that you need to know that `absolute-pathname?' does not expand ~. No, it doesn't because it is not a file-system operation. It is a string operation. cheers, felix ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Felix
From: Peter Bex Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Mon, 18 Mar 2013 21:22:12 +0100 > On Mon, Mar 18, 2013 at 02:03:41PM -0400, Mario Domenech Goulart wrote: >> Maybe I'm too paranoid? Or missing something? > > No, you're

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Peter Bex
On Mon, Mar 18, 2013 at 02:03:41PM -0400, Mario Domenech Goulart wrote: > Maybe I'm too paranoid? Or missing something? No, you're spot on. I think given a choice, we should always err on the side of security and adhere to the Principle Of Least Astonishment. For convenient scripting, a "dwim"

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Mario Domenech Goulart
Hi John, On Mon, 18 Mar 2013 16:01:24 -0400 John Cowan wrote: > Mario Domenech Goulart scripsit: > >> $ mkdir '~' > > While this is certainly Posix-legal, my opinion is that anyone who does > it deserves to lose. Indeed, but the actual point is that a malicious user can create such a director

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread John Cowan
Mario Domenech Goulart scripsit: > $ mkdir '~' While this is certainly Posix-legal, my opinion is that anyone who does it deserves to lose. In the Real World, Posix systems often have portions of the filesystem that are not fully Posix-compliant. -- In politics, obedience and support Jo

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Florian Zumbiehl
Hi, > If we keep the ~-expansion, any safe code that use the filesystem API > will have to resort to tricks like > > (operation (if (absolute-pathname? the-path) > the-path > (make-pathname (current-directory) the-path))) > > to guard against input that would

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Mario Domenech Goulart
Hi Felix, On Mon, 18 Mar 2013 11:25:02 -0400 (EDT) Felix wrote: > From: Mario Domenech Goulart > Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. > Date: Mon, 18 Mar 2013 10:33:49 -0400 > >> >> Making robust software in shell scripting langu

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Mario Domenech Goulart
Hi Matt, On Mon, 18 Mar 2013 08:45:17 -0700 Matt Welland wrote: > Please please keep the expansion of ~. > Pragmatically speaking what is at risk? Here's a simple example: $ mkdir some-dir $ cd some-dir/ $ mkdir '~' $ echo data > '~/some-file' $ echo 'very important data' > ~/some-

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Felix
From: Mario Domenech Goulart Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Mon, 18 Mar 2013 10:33:49 -0400 > > Making robust software in shell scripting languages is hard, and one of > the reasons it is hard is that shells perform a lot of &q

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Matt Welland
-home-path. From: Mario Domenech Goulart Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Mon, 18 Mar 2013 10:33:49 -0400 > > Making robust software in shell scripting languages is hard, and one of > the reasons it is hard is that shells perform

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Mario Domenech Goulart
Hi, On Mon, 18 Mar 2013 14:30:13 + Alaric Snell-Pym wrote: > On 03/16/2013 05:18 PM, Florian Zumbiehl wrote: >> >>> having a "clean file-system API", whatever that means. >> >> I think primarily that you can read a directory and use the filenames you >> get back for opening the files in tha

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-18 Thread Alaric Snell-Pym
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/16/2013 05:18 PM, Florian Zumbiehl wrote: > Hi, > >> having a "clean file-system API", whatever that means. > > I think primarily that you can read a directory and use the filenames you > get back for opening the files in that directory rather th

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-16 Thread Florian Zumbiehl
Hi, > having a "clean file-system API", whatever that means. I think primarily that you can read a directory and use the filenames you get back for opening the files in that directory rather than being surprised with some other file or an exception? Or not re-expanding command line arguments tha

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-16 Thread Felix
> One option may be to create an egg that modifies and exports all the > affected code. For example: > > (define (with-input-from-file str thunk . mode) > (apply core:with-input-from-file (expand-path str) thunk mode)) > > And then you can import the module with or without a prefix if you > wan

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-16 Thread Felix
>> >> But let's not forget convenience... > > I don't think (with-input-from-file (expand-path "~/foo") read) is less > convenient than (with-input-from-file "~/foo" read expand-path: #t) You misunderstood - I'm not proposing adding flags. The variable-name expansion ("$...") is admittedly ugly

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Jim Ursetto
On Mar 15, 2013, at 3:35 PM, Peter Bex wrote: > > Finally, a flag would also need to go everywhere a path is accessed > (including file-open, directory, directory?, call-with-input-file, etc...) > unless you make it a parameter (which would be slower, if I'm not > mistaken). Oops, I see you alrea

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Jim Ursetto
On Mar 15, 2013, at 3:35 PM, Peter Bex wrote: > On Fri, Mar 15, 2013 at 09:30:43PM +0100, Felix wrote: >> From: Peter Bex >>> I agree we can't immediately do it, but we should strive towards a clean, >>> safe API in the long run. Just keeping it around is not an option either. >>> Adding more pa

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Peter Bex
On Fri, Mar 15, 2013 at 09:30:43PM +0100, Felix wrote: > From: Peter Bex > > I agree we can't immediately do it, but we should strive towards a clean, > > safe API in the long run. Just keeping it around is not an option either. > > Adding more parameters or options is ugly, IMHO. > > But let's

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Felix
From: Peter Bex Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Fri, 15 Mar 2013 10:01:42 +0100 > On Fri, Mar 15, 2013 at 09:36:01AM +0100, Christian Kellermann wrote: >> * Florian Zumbiehl [130315 07:58]: >> > Remove ##sys#expand-home-path as s

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Felix
From: Jim Ursetto Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Fri, 15 Mar 2013 03:03:31 -0500 > On Mar 15, 2013, at 2:21 AM, Felix wrote: > >> From: Florian Zumbiehl >> Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Alaric Snell-Pym
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/15/2013 09:01 AM, Peter Bex wrote: > On Fri, Mar 15, 2013 at 09:36:01AM +0100, Christian Kellermann wrote: >> * Florian Zumbiehl [130315 07:58]: >>> Remove ##sys#expand-home-path as shell expansion has no place in a >>> filesystem >>> API. >> >

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Peter Bex
On Fri, Mar 15, 2013 at 09:36:01AM +0100, Christian Kellermann wrote: > * Florian Zumbiehl [130315 07:58]: > > Remove ##sys#expand-home-path as shell expansion has no place in a > > filesystem > > API. > > I'd rather prefer a "no-shell-expansion" feature than breaking the > current behaviour. Th

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Christian Kellermann
* Florian Zumbiehl [130315 07:58]: > Remove ##sys#expand-home-path as shell expansion has no place in a filesystem > API. I'd rather prefer a "no-shell-expansion" feature than breaking the current behaviour. This way programmers can choose when they need a "dumb" implementation (because the name

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Peter Bex
On Fri, Mar 15, 2013 at 02:55:10AM -0500, Jim Ursetto wrote: > Although this is more secure in the weird case that you > have filenames starting with ~ or containing $, I think it would > potentially break existing code, especially scripts > (I have used the ~/ shortcut myself in scripts when openi

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Jim Ursetto
On Mar 15, 2013, at 2:21 AM, Felix wrote: > From: Florian Zumbiehl > Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. > Date: Fri, 15 Mar 2013 07:58:02 +0100 > >> Remove ##sys#expand-home-path as shell expansion has no place in a filesystem >>

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Jim Ursetto
On Mar 15, 2013, at 2:21 AM, Felix wrote: > From: Florian Zumbiehl > Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. > Date: Fri, 15 Mar 2013 07:58:02 +0100 > >> Remove ##sys#expand-home-path as shell expansion has no place in a filesystem >>

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Felix
From: Florian Zumbiehl Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path. Date: Fri, 15 Mar 2013 07:58:02 +0100 > Remove ##sys#expand-home-path as shell expansion has no place in a filesystem > API. Can't we just leave it in there? At least for "load

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-15 Thread Jim Ursetto
On Mar 15, 2013, at 1:04 AM, Florian Zumbiehl wrote: > Remove ##sys#expand-home-path as shell expansion has no place in a filesystem > API. Definitely not happening. ;) Jim ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.non

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-14 Thread Florian Zumbiehl
Remove ##sys#expand-home-path as shell expansion has no place in a filesystem API. --- New version of the patch, the previous version was broken. eval.scm |2 - files.scm| 14 +++ library.scm | 123 +- posix-comm

[Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.

2013-03-14 Thread Florian Zumbiehl
Remove ##sys#expand-home-path as shell expansion has no place in a filesystem API. --- Feel free to disagree--I thought it's better to start with an actual patch than with with a purely theoretical discussion of the issue. eval.scm |2 - files.scm|3 +- library.scm |