WeBWorK Main Forum

chown errors

chown errors

by Christian McHugh -
Number of replies: 2
I've started getting chown errors:

Warning messages

* Can't do
chown(-1,1066,/opt/webworkCourses/NSieben_136/html/tmp/gif/professor-4072-set07FunctionGraphsprob1image2-(log(x)/):
Operation not permitted at [PG]/lib/WeBWorK/PG/IO.pm line 204


As I understand it, the webserver has generated a tmp image and after browsing around and then returning to the problem this error occurs. Since this whole operation takes place from the web interface, it seems that the webserver would need access permissions. However, the web server already has permission:

/opt/webworkCourses/NSieben_136/html/tmp/gif/professor-4072-set07FunctionGraphsprob1image2-(log(x)# ls -la
total 381
drwxrwsr-x+ 2 www-data www-data 512 2009-01-24 00:48 .
drwxrwxr-x+ 379 www-data cefns_webwork_admin 371712 2009-01-26 02:12 ..
-rwxrwxrwx+ 1 www-data www-data 1960 2009-01-21 21:32 log(2)).png
-rwxrwxrwx+ 1 www-data www-data 1764 2009-01-24 00:48 log(3)).png


So I'm kind of stumped. Does anyone have any ideas?
In reply to Christian McHugh

Re: chown errors

by Davide Cervone -
Yes, I suspect that this is one of the NAU graphing problems where the student answer is being replaced by a graph of the function he or she entered. The file name of that graph has the student's function appended to it (so that image caching won't get in the way of displaying the new graph). Note that your image name seems to include division slashes, which the filing system interprets as directory separators. The code for the problem needs to be modified to avoid such situations. Perhaps adding an MD5 checksum would be a better choice than adding the formula itself? Or at least "dangerous" characters could be removed or replaced by some numeric equivalent.

Davide
In reply to Christian McHugh

Re: chown errors

by Davide Cervone -
You could use Digest::MD5::md5_base64() to encode the student answer when appending it to the image name, but in order to make this work, you would need to add Digest to the ${pg}{modules} list in global.conf as a second name in one of the already present modules, say the WWPlot module.

Davide