MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / setScreenDir

Method setScreenDir

src/util_exec.cpp:362–387  ·  view source on GitHub ↗

NOTE: This routine is called only if 'screen' is setuid. In Ubuntu 9.10, an unprivileged 'screen' (no setuid) will ckpt and restart fine if SCREENDIR is set to the file $USER/tmp4 when $USER/tmp4 doesn't exist Arguably this is a bug in screen-4.0. Should we take advantage of it?

Source from the content-addressed store, hash-verified

360// fine if SCREENDIR is set to the file $USER/tmp4 when $USER/tmp4 doesn't exist
361// Arguably this is a bug in screen-4.0. Should we take advantage of it?
362void
363Util::setScreenDir()
364{
365 if (getenv("SCREENDIR") == NULL) {
366 // This will flash by, but the user will see it again on exiting screen.
367 JASSERT_STDERR <<
368 "*** WARNING: Environment variable SCREENDIR is not set!\n"
369 << "*** Set this to a safe location, and if restarting on\n"
370 << "*** a new host, copy your SCREENDIR directory there.\n"
371 << "*** DMTCP will use"
372 " $DMTCP_TMPDIR/dmtcp-USER@HOST/uscreens for now,\n"
373 << "*** but this directory may not survive a re-boot!\n"
374 << "*** As of DMTCP-1.2.3, emacs23 not yet supported\n"
375 << "*** inside screen. Please use emacs22 for now. This\n"
376 << "*** will be fixed in a future version of DMTCP.\n\n";
377 setenv("SCREENDIR", getScreenDir().c_str(), 1);
378 } else {
379 if (access(getenv("SCREENDIR"), R_OK | W_OK | X_OK) != 0) {
380 JASSERT_STDERR << "*** WARNING: Environment variable SCREENDIR is set\n"
381 << "*** to directory with improper permissions.\n"
382 << "*** Please use a SCREENDIR with permission 700."
383 << " [ SCREENDIR = " << getenv("SCREENDIR") << " ]\n"
384 << "*** Continuing anyway, and hoping for the best.\n";
385 }
386 }
387}
388
389bool
390Util::isSetuid(const char *filename)

Callers

nothing calls this directly

Calls 2

getScreenDirFunction · 0.85
accessFunction · 0.85

Tested by

no test coverage detected