On Wed, Jun 8, 2016 at 5:10 AM, leif <not.rea...@online.de> wrote:
> Jeroen Demeyer wrote:
>> On 2016-06-08 00:14, William Stein wrote:
>>> On Tue, Jun 7, 2016 at 6:12 PM, Francois Bissey
>>> <francois.bis...@canterbury.ac.nz> wrote:
>>>> The version from the sage-on-gentoo overlay has been hacked to
>>>> explicitly
>>>> write data generated by the user in ~/.sympow. If indeed you make a
>>>> system
>>>> wide install where the user cannot write it will certainly fail.
>>>
>>> This is indeed exactly why it fails for me (silently from within sage
>>> and with a segfault from the command line).
>>
>> So sympow *segfaults* if it cannot open a file?
>
> That's pretty easy to achieve:
>
>   fp=fopen("/youre/not/allowed/to/access/this/folder/foo","w");
>   /* don't check the return value */
>   fwrite("booom!",1,6,fp);
>
> You'll normally get a warning because frwite() etc. carry the
> warn_unused_result attribute, but not for fopen() since NULL is assigned
> to fp in case it fails.
>
>
> -leif

Thanks.  Here is the *actual* code from sympow:

 fclose(F); printf("Left with %i entries in param_data\n",i);
 F=fopen("datafiles/param_data","w");
 ...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to