Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running Sage.app by someone other than it was installed by #11755

Closed
gvol opened this issue Aug 29, 2011 · 8 comments
Closed

Allow running Sage.app by someone other than it was installed by #11755

gvol opened this issue Aug 29, 2011 · 8 comments

Comments

@gvol
Copy link

gvol commented Aug 29, 2011

Since Sage.app checks if it moved every time upon startup, any user who runs the application needs to be able to write to local/lib/sage-current-location.txt. This files seems to default to 0644 permissions.

We can either change the Sage.app code so that it doesn't need to check every time or make the file world writable.

Relevant comments from #5852:

jdemeyer said:

I also noticed that data/extcode/sage/ext/mac-app/start-sage.sh has its own SAGE_ROOT-detecting code but it probably shouldn't and should use sage-env instead.

leif said:

It seems the MacOS X app wants just the opposite, i.e. to not resolve symbolic links, since the absolute, canonicalized path may frequently change.

Therefore it always creates (on start-up) the same, "constant" symbolic link from /tmp/sage-mac-app to the current, volatile $SAGE_ROOT, which can only work if the application is also actually always built in (a real directory) /tmp/sage-mac-app/ (such that no change of hardcoded paths is necessary).

Depends on #31270

CC: @kcrisman @dimpase

Component: relocation

Keywords: mac app SAGE_ROOT

Issue created by migration from https://trac.sagemath.org/ticket/11755

@gvol gvol added this to the sage-5.11 milestone Aug 29, 2011
@gvol gvol self-assigned this Aug 29, 2011
@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 29, 2011

comment:1

That's a matter of the current umask, but we could of course change the file permission on updates to that file. On the other hand, opening an existing file for writing shouldn't change the permissions in the first place. If the file gets deleted inbetween, an ordinary user would also need write permissions on the directory the file is located / recreated in, i.e. $SAGE_ROOT/local/lib/.

It's not immediately clear to me why an ordinary user would have to move Sage though, just to run the application. (But I don't use apples.)

Allowing the group to write to this file would certainly be better, putting potential users (that move the installation) into that group. (But they still won't be able to actually modify / fix hardcoded paths, which is the whole purpose of sage-current-location.txt, so the installation might actually break if it really moved. A better detection in the code that attempts to update that file is another alternative.)

The whole issue might be related to #5852 (and previously #11707), such that after this ticket is resolved, changing the permissions may no longer be necessary.

@jhpalmieri
Copy link
Member

comment:3

Replying to @nexttime:

It's not immediately clear to me why an ordinary user would have to move Sage though, just to run the application. (But I don't use apples.)

If an ordinary user moves Sage, then presumably they have write permissions to the new SAGE_ROOT/local/lib, so there won't be any problems, will there?

This all happens in the script sage-location, right? If Sage detects that its location has moved, then it tries to update various library and pkg-config files. If the user doesn't have permission to do this, then we could just print a warning ("Have your sysadmin do ..." and/or "Try copying the Sage installation to ...") and either bail out or keep going and hope for the best.

In fact, I posted a patch doing some of this (it doesn't print the warning) at #5155. Perhaps we should try to fix this issue here and deal with the other issues from #5155 there.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

Changed keywords from mac app to mac app SAGE_ROOT

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe
Copy link
Member

mkoeppe commented Jan 21, 2021

Dependencies: #21783

@mkoeppe
Copy link
Member

mkoeppe commented Jan 21, 2021

comment:9

Outdated, should be closed

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Jan 21, 2021
@mkoeppe
Copy link
Member

mkoeppe commented Jan 21, 2021

Changed dependencies from #21783 to #31270

@jhpalmieri
Copy link
Member

comment:11

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants