Index: xpriv.c ================================================================== --- xpriv.c +++ xpriv.c @@ -36,10 +36,20 @@ * window’s ID from the $WINDOWID environment variable * which urxvt sets. after this, a ssh-agent process is * launched. spriv waits until it has opened a socket and * then runs ssh-add without parameters to add the user's * default keys to the session. + * + * after a success key-add has been confirmed, xpriv + * marks the window as “vital” by setting the X property + * “_k_vital” on the window. if the login fails or does + * not complete, safekill.c will still terminate it at + * any time. the vital flag is removed as soon as the + * controlling shell terminates; it does *not* remain for + * the lifetime of the window, so a "temporary" session + * can be created in the current terminal by calling + * `xpriv -a` directly. * * xpriv does its best to clean up after itself, * killing all sensitive processes and their children and * removing the shmem segment when it is no longer in * use, even if exits somewhat abnormally. if you have to @@ -306,11 +316,11 @@ } if(opt[1] != 0) { ++opt; goto read_opt; } } size_t nsz; - const char* basename, *p; + const char* basename = argv[0], *p; for (p = argv[0]; *p!=0; ++p) { if(*p == '/') basename = p + 1; } nsz = p - basename; char shid[nsz + sizeof shmem_prefix + 0];