From: SourceForge.net <no...@so...> - 2010-03-02 09:26:29
|
Bugs item #2959335, was opened at 2010-02-26 11:56 Message generated for change (Comment added) made by ampy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2959335&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ander-skirnir (ander-skirnir) Assigned to: Arseny Slobodyuk (ampy) Summary: no posix:uid on windows (required by asdf) Initial Comment: asdf package requires uid symbol from posix, but its not exporting on win32 at all. so, to load asdf on clisp from win32 now u have to do that: (in-package #:posix) (export '(uid)) (in-package #:cl-user) (load "asdf\\asdf.lisp") to fix it, u can just add #+win32 (export '(uid)) to the syscalls\\posix.lisp ---------------------------------------------------------------------- >Comment By: Arseny Slobodyuk (ampy) Date: 2010-03-02 19:26 Message: I have investigated a little futher. Although Windows has posix compatibility layer (posix subsystem), there's seems no way to get integer userid, so, in fact the layer is incomplete. I dealt with, for example, Microsoft SFU (Services For Unix) - the mapping between users and uids, groups and uids (for NFS) is defined by administrator in the dedicated table. Same with Hummingbird NFS server. Is it a global trend to make Lisp C-posix-conforming? There will be difficulties, but I believe there's freedom in such a mapping and it could be done automatically. ---------------------------------------------------------------------- Comment By: Arseny Slobodyuk (ampy) Date: 2010-03-02 10:18 Message: Correcting myself: clisp/win32 is already depends on advapi32. ---------------------------------------------------------------------- Comment By: Arseny Slobodyuk (ampy) Date: 2010-03-02 10:07 Message: Not that I like the idea, but, having conforming CL we could translate UUID to the large integer. Or (for the goal described here) get a hash from string of UUID or username. Using GetTokenInformation (thanks for the hint, Sam) will make CLISP dependent on yet another dll (its in the Advapi32.lib, getting USERNAME is much simpler), affecting load time and memory demands - is it acceptable? Which could be another uses of such a functions? ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-03-02 05:09 Message: even worse -- "" is not a valid pathname component. win32 _does_ support multiple users, so the issue _is_ relevant (and if it is not, asdf maintainers should handle that). ---------------------------------------------------------------------- Comment By: Reini Urban (rurban) Date: 2010-03-02 05:04 Message: I remember: The uid is used in asdf for site-location to discriminate the .fas cache for different users, which is not relevent for win32. If you are concerned about a deleted USERNAME env submit a uid patch to asdf, like #+win32 (defun uid () (or (getenv "USERNAME") "")) ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-03-02 04:56 Message: asdf uses getuid in resolve-relative-location-component as a pathname component. getenv is no good - it may return NIL which may screw sharing up. I think returning a struct based on OpenProcessToken+GetTokenInformation->UUID and defining a print-object method on it is the best approach. ---------------------------------------------------------------------- Comment By: Reini Urban (rurban) Date: 2010-03-02 03:55 Message: I would prefer a simple #+win32 (defun uid () (getenv "USERNAME")) #+win32 (defun euid () (getenv "USERNAME")) and not using the GUID as arseny suggested. I don't know if the asdf uid is used as number, e.g. format, or used for numerical sorting. But asdf should add this patch, as one cannot force windows to return such a number, only a string. Windows is no posix, as everyone knows. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-03-02 01:35 Message: ander-skirnir: what is the original use case for this function? what is the expected contract? I don't think getenv is the right way here. I think OpenProcessToken+GetTokenInformation is the way to go. Arseny, I don't think string return value is a good idea - we should return a structure of 3 integers and a byte vector or maybe 5 integers. you can also provide a printer function which would produce the string you describe. Would you like to handle this issue? Thanks! ---------------------------------------------------------------------- Comment By: Arseny Slobodyuk (ampy) Date: 2010-02-28 10:40 Message: I believe on Windows, user's and group's UUID corresponds userid and groupid in UNIX. But UUID is a structure typedef struct _GUID { DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[8]; } GUID; which can be represented as string like {4208fb66-e22a-11d1-a7d7-00a0c982c00d}. This UUIDS however are unique - different on different computers. I dont know how it could help. Possibly "int getuid() {return 0;}" will do? ---------------------------------------------------------------------- Comment By: ander-skirnir (ander-skirnir) Date: 2010-02-28 09:41 Message: quote from some forum: "You can access the Windows environment variable %USERNAME%. You didn't mention how you want to access it though. Batch file? Command Prompt? C/C++? With C/C++ you can use the getenv() function to retrieve specific environment variable values." useful discuss: http://stackoverflow.com/questions/1594746/win32-equivalent-of-getuid ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2010-02-27 02:16 Message: how do we implement uid on windows? what's the windows analogue of getuid/geteuid/getgid &c? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2959335&group_id=1355 |