Opened 7 years ago

Last modified 7 years ago

#1121 new defect

filename ~user/... is treated as ~/... by truename

Reported by: matt.kaufmann Owned by:
Priority: normal Milestone:
Component: Compiler Version: trunk
Keywords: Cc:

Description

Filenames "~user/..." are treated like "~/...". I'm observing this issue in the latest CCL svn revision, 15972, on linux. However, some sort of check seems to be made that the indicated user exists (even though the user name is ignored for the result). For example:

sloth:~% /projects/acl2/lisps/ccl/ccl-15972
Welcome to Clozure Common Lisp Version 1.10-dev-r15972M-trunk  (LinuxX8664)!
? (truename "~kini")
#P"/v/filer4b/v41q001/kaufmann/"
? (truename "~moore")
#P"/v/filer4b/v41q001/kaufmann/"
? (truename "~nosuchuser")
> Error: Unknown user "nosuchuser" in namestring "~nosuchuser"
> While executing: CCL::TILDE-EXPAND, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 > 

Change History (4)

comment:1 Changed 7 years ago by gb

As a workaround, does setting CCL:*TRUST-PATHS-FROM-ENVIRONMENT* to NIL cause the correct user's home directory to be returned ?

comment:2 Changed 7 years ago by matt.kaufmann

Yes, that works; thanks. I'm tempted to put (setq CCL:*TRUST-PATHS-FROM-ENVIRONMENT* nil) in one of my application's source files (since some ACL2 users might continue to use older versions of CCL for awhile, even if you fix this problem). Does that seem reasonable?

comment:3 follow-up: Changed 7 years ago by gb

Yes, that seems reasonable.

This all has to do with whether ~/ and friends use the value of HOME to find the user's home directory. (The bug is that the code is doing that even for ~user.)

I'm not sure that trusting that env variable is a good idea; some other people think that it is.

comment:4 in reply to: ↑ 3 Changed 7 years ago by matt.kaufmann

Replying to gb:

Yes, that seems reasonable.

This all has to do with whether ~/ and friends use the value of HOME to find the user's home directory. (The bug is that the code is doing that even for ~user.)

I'm not sure that trusting that env variable is a good idea; some other people think that it is.

OK, thanks. So presumably HOME will no longer be used for "~user/...", but I'll make that change so that older CCL versions are OK too.

Note: See TracTickets for help on using tickets.