Re: sage -t

6 views
Skip to first unread message

Jan Groenewald

unread,
Sep 1, 2009, 9:37:40 AM9/1/09
to sage-s...@googlegroups.com, di...@aims.ac.za
Hi All,

I have a system-wide sage install for all users.
The source lives in /usr/local/src and all of it is owned
by root.root. I chown it after install so that it does not
have another user's permissions. A user had this problem:

On Tue, Sep 01, 2009 at 02:41:54PM +0200, Dirk Laurie wrote:
> dirk@birlehlou:~/.sage$ sage -t dpl.sage
> init.sage does not exist ... creating
> Traceback (most recent call last):
> File "/usr/local/src/sage-4.1.1/local/bin/sage-test", line 49, in <module>
> os.makedirs(TMP)
> File "/usr/local/src/sage-4.1.1/local/lib/python/os.py", line 157, in makedirs
> mkdir(name, mode)
> OSError: [Errno 13] Permission denied: '/usr/local/src/sage-4.1.1/tmp/tmp'
> dirk@birlehlou:~/.sage$ sudo sage -t dpl.sage
> [sudo] password for dirk:
> Sorry, try again.
> [sudo] password for dirk:
> dirk is not in the sudoers file. This incident will be reported.

Is "sage -t" used for testing one's own code?
Should /usr/local/src/sage-4.1.1/tmp/tmp be world-writeable?
Is there then any control on the space used?

regards,
Jan

--
.~.
/V\ Jan Groenewald
/( )\ www.aims.ac.za
^^-^^

Message has been deleted

William A. Stein

unread,
Sep 1, 2009, 9:33:59 PM9/1/09
to sage-s...@googlegroups.com

On Sep 1, 2009, at 6:24 PM, Minh Nguyen wrote:

>
> Hi Jan,
>
> On Tue, Sep 1, 2009 at 11:37 PM, Jan Groenewald<j...@aims.ac.za> wrote:
>
> <SNIP>
>
>> Is "sage -t" used for testing one's own code?
>
> Yes.
>
>
>> Should /usr/local/src/sage-4.1.1/tmp/tmp be world-writeable?
>
> No since from a security point of view you don't want regular users to
> write anything there. Think of that tmp directory as being for the
> root user or anyone in the sudoer group to write temporary stuff. By
> default, testing your custom Sage script with
>
> sage -t /path/to/my/script.sage
>
> using a system-wide Sage installation would result in a permission
> error. If you want to test your own Sage script, you can install Sage
> under your own home directory or test the script as root or using
> sudo.


Note that this should be considered a workaround. It should be
considered a bug that users without write permissions to the Sage
install directory can't test their scripts.

It would be much better for Sage to use temp space in DOT_SAGE, i.e.,
$HOME/.sage/temp by default.

William

>
>> Is there then any control on the space used?
>
> I don't understand this question.
>
> --
> Regards
> Minh Van Nguyen
>
> >

Jan Groenewald

unread,
Sep 2, 2009, 12:27:12 AM9/2/09
to sage-s...@googlegroups.com
Hi

On Wed, Sep 02, 2009 at 11:24:25AM +1000, Minh Nguyen wrote:
> > Is there then any control on the space used?

If they did have write (unadvisable) they could fill the disk
space with logs.

Jan Groenewald

unread,
Sep 2, 2009, 12:31:56 AM9/2/09
to sage-s...@googlegroups.com, di...@aims.ac.za
Hi

On Tue, Sep 01, 2009 at 06:33:59PM -0700, William A. Stein wrote:
> Note that this should be considered a workaround. It should be
> considered a bug that users without write permissions to the Sage
> install directory can't test their scripts.
> It would be much better for Sage to use temp space in DOT_SAGE, i.e.,
> $HOME/.sage/temp by default.

Is there a ticket to fix this? .sage sounds good.

Quickly building a local sage is not even a workaround, it is not feasible.
I know the single user, so will change permissions on the directory in the
syste-wide install. It will only affect the local desktop, out of 127
desktops imaged from a central image.

Every time I image it will be overwritten. I can exclude it, but it is probably
better to clear it periodically. Is anything written there important to keep?

Message has been deleted

Jason Grout

unread,
Sep 2, 2009, 5:20:41 PM9/2/09
to sage-s...@googlegroups.com
Minh Nguyen wrote:
> Hi Jan,
>
> On Wed, Sep 2, 2009 at 2:31 PM, Jan Groenewald<j...@aims.ac.za> wrote:
>
> <SNIP>
>
>> Is there a ticket to fix this? .sage sounds good.
>
> This issue is now ticket #6861
>
> http://trac.sagemath.org/sage_trac/ticket/6861
>


I posted a one-line patch to
http://trac.sagemath.org/sage_trac/ticket/6861. I don't have a
system-wide install to test it, though. Can someone test/review the
patch? I know almost nothing about the doctest system, so I don't know
if this breaks something crucial.

(Also, until this gets into the release, you might tell the user to set
the SAGE_TESTDIR environment variable before running sage -t)

Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages