Hi,
I'm using LispWorks for Linux. How can I set UNIX user privileges,
similar to the shell commands chmod/chown/chgrp?
Do I really have to implement it on my own with the foreign language
interface? I can't find anything about this issue in the
documentation.
Earl.
In article <····························@posting.google.com>, Bob Earl wrote:
> I'm using LispWorks for Linux. How can I set UNIX user privileges,
> similar to the shell commands chmod/chown/chgrp?
>
> Do I really have to implement it on my own with the foreign language
> interface? I can't find anything about this issue in the
> documentation.
How about
(system:call-system "chmod 400 /tmp/blark")
Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."
PGP key ID 0x42B32FC9
········@gmx.net (Bob Earl) writes:
> Hi,
>
> I'm using LispWorks for Linux. How can I set UNIX user privileges,
> similar to the shell commands chmod/chown/chgrp?
I found system::change-mode for useable as chmod
here's an example
CL-USER 35 : 1 > (let ((t1-stat (system:get-file-stat "t1.txt")))
(format nil "perms are ~O" (sys:file-stat-mode t1-stat)))
"perms are 100640"
You can change it with
(system::change-mode "t1.txt" #O100640)
CL-USER 35 : 1 > (let ((t1-stat (system:get-file-stat "t1.txt")))
(format nil "perms are ~O" (sys:file-stat-mode
t1-stat)))
"perms are 100644"
Did not found anything suitable for change-owner or so.
you can bail out of LispWorks this way:
(system:call-system "chown frido.frido t1.txt")
you better check the return -value ;-)
CL-USER 40 : 1 > (let ((t1-stat (system:get-file-stat "t1.txt")))
(format nil "GID now = ~A" (sys:file-stat-group-id t1-stat)))
"GID now = 1000"
>
> Do I really have to implement it on my own with the foreign language
> interface?
No you don't have write it yourself let the system do the job ;-)
> I can't find anything about this issue in the
> documentation.
Well I found it this way:
(apropos "change-g")
(apropos "change-mo")
SYSTEM::CHANGE-MODE -- #<function SYSTEM::CHANGE-MODE 2020CA2A>
SYSTEM::CHANGE-MODE -- #<function SYSTEM::CHANGE-MODE 2020CA2A>
EDITOR::EDITOR-CHANGE-MODE -- #<function EDITOR::EDITOR-CHANGE-MODE 20B59F22>
Well it is internal to system therfor use it at your own risk...
Regards
Friedrich
Friedrich Dominicus <·····@q-software-solutions.com> wrote in message news:<··············@frown.here>...
> I found system::change-mode for useable as chmod
>
> Did not found anything suitable for change-owner or so.
> you can bail out of LispWorks this way:
> (system:call-system "chown frido.frido t1.txt")
> you better check the return -value ;-)
Thanks for your hints. Pretty cool. change-mode does what I was
looking for. Why is this function internal only? UNIX users will need
it frequently, don't you think?
Call-system is a bit tricky in our case: We are running a CL-HTTP
server, and from a security point of view, servers (resp. the user who
runs the server) should not have a shell. I guess call-system will not
work without a valid shell.
Earl.
········@gmx.net (Bob Earl) writes:
> Friedrich Dominicus <·····@q-software-solutions.com> wrote in message news:<··············@frown.here>...
>
> > I found system::change-mode for useable as chmod
> >
> > Did not found anything suitable for change-owner or so.
> > you can bail out of LispWorks this way:
> > (system:call-system "chown frido.frido t1.txt")
> > you better check the return -value ;-)
>
> Thanks for your hints. Pretty cool. change-mode does what I was
> looking for. Why is this function internal only? UNIX users will need
> it frequently, don't you think?
Well every now and than I use chmod. But frequently no ;-)
>
> Call-system is a bit tricky in our case: We are running a CL-HTTP
> server, and from a security point of view, servers (resp. the user who
> runs the server) should not have a shell. I guess call-system will not
> work without a valid shell.
Well that's true. But wrapping C-Functions is quite easy now. But I
guess that's a bit off-topic here.
Regards
Friedrich