- feeder: created shared mem seg with 0666 rather than 0660.

In principle 0660 should work (assuming apache belongs to admin group)
    but apparently on some Linux systems it doesn't,
    and the feeder gets "can't attach to shared mem" errors.
- scheduler: print uid/gid info if can't attach to shared mem
- user web: fix bug in team founder transfer form

svn path=/trunk/boinc/; revision=13255
This commit is contained in:
David Anderson 2007-08-01 15:35:08 +00:00
parent 5d2d8dea7a
commit 71fc375d1b
4 changed files with 29 additions and 6 deletions

View File

@ -7591,3 +7591,18 @@ Charlie 31 July 2007
api/ api/
x_opengl.C x_opengl.C
David 1 Aug 2007
- feeder: created shared mem seg with 0666 rather than 0660.
In principle 0660 should work (assuming apache belongs to admin group)
but apparently on some Linux systems it doesn't,
and the feeder gets "can't attach to shared mem" errors.
- scheduler: print uid/gid info if can't attach to shared mem
- user web: fix bug in team founder transfer form
sched/
main.C
html/user/
team_founder_transfer_form.php
lib/
shmem.C

View File

@ -39,7 +39,7 @@ if (new_transfer_request_ok($team, $now)) {
echo "<p>You have already requested to take over the founder echo "<p>You have already requested to take over the founder
position of $team->name. position of $team->name.
"; ";
if (transfer_ok($team, $now) { if (transfer_ok($team, $now)) {
echo "<form method=\"post\" action=\"team_founder_transfer_action.php\"> echo "<form method=\"post\" action=\"team_founder_transfer_action.php\">
<input type=\"hidden\" name=\"action\" value=\"transfer\"> <input type=\"hidden\" name=\"action\" value=\"transfer\">
<input type=\"submit\" value=\"Complete team founder transfer\"> <input type=\"submit\" value=\"Complete team founder transfer\">

View File

@ -162,15 +162,19 @@ int detach_shmem(void* p) {
int create_shmem(key_t key, int size, gid_t gid, void** pp) { int create_shmem(key_t key, int size, gid_t gid, void** pp) {
int id; int id;
// try 0660, then SHM_R|SHM_W // try 0666, then SHM_R|SHM_W
// seems like some platforms require one or the other // seems like some platforms require one or the other
// (this may be superstition) // (this may be superstition)
// //
#ifdef EINSTEIN_AT_HOME // NOTE: in principle it should be 0660, not 0666
// (i.e. Apache should belong to the same group as the
// project admin user, and should therefore be able to access the seg.
// However, this doesn't seem to work on some Linux systems.
// I don't have time to figure this out (31 July 07)
// it's a big headache for anyone it affects,
// and it's not a significant security issue.
//
id = shmget(key, size, IPC_CREAT|0666); id = shmget(key, size, IPC_CREAT|0666);
#else
id = shmget(key, size, IPC_CREAT|0660);
#endif
if (id < 0) { if (id < 0) {
id = shmget(key, size, IPC_CREAT|SHM_R|SHM_W); id = shmget(key, size, IPC_CREAT|SHM_R|SHM_W);
} }

View File

@ -266,6 +266,10 @@ void attach_to_feeder_shmem() {
"Can't attach shmem: %d (feeder not running?)\n", "Can't attach shmem: %d (feeder not running?)\n",
retval retval
); );
log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL,
"uid %d euid %d gid %d eguid%d\n",
getuid(), geteuid(), getgid(), getegid()
);
} else { } else {
ssp = (SCHED_SHMEM*)p; ssp = (SCHED_SHMEM*)p;
retval = ssp->verify(); retval = ssp->verify();