Lines Matching defs:tmpdir

55 #define USAGE_STRING _("USAGE: seunshare [ -v ] [ -C ] [ -k ] [ -t tmpdir ] [ -h homedir ] [ -Z CONTEXT ] -- executable [args] ")
381 static int cleanup_tmpdir(const char *tmpdir, const char *src,
389 if (asprintf(&cmdbuf, "/usr/bin/rsync --exclude=.X11-unix -utrlHDq --delete '%s/' '%s/'", tmpdir, src) == -1) {
402 if (asprintf(&cmdbuf, "/bin/rm -r '%s/' 2>/dev/null", tmpdir) == -1) {
407 /* this may fail if there's root-owned file left in the runtime tmpdir */
417 if (rmdir(tmpdir) == -1)
418 fprintf(stderr, _("Failed to remove directory %s: %s\n"), tmpdir, strerror(errno));
428 * seunshare will create a tmpdir in /tmp, with root ownership. The parent
436 char *tmpdir = NULL;
469 if (asprintf(&tmpdir, "/tmp/.sandbox-%s-XXXXXX", pwd->pw_name) == -1) {
471 tmpdir = NULL;
474 if (mkdtemp(tmpdir) == NULL) {
480 if (verify_directory(tmpdir, NULL, out_st) < 0) {
484 if (check_owner_uid(0, tmpdir, out_st) < 0)
487 if (check_owner_gid(getgid(), tmpdir, out_st) < 0)
491 if ((fd_t = open(tmpdir, O_RDONLY)) < 0) {
492 fprintf(stderr, _("Failed to open directory %s: %s\n"), tmpdir, strerror(errno));
496 fprintf(stderr, _("Failed to stat directory %s: %s\n"), tmpdir, strerror(errno));
500 fprintf(stderr, _("Error: %s was replaced by a different directory\n"), tmpdir);
504 fprintf(stderr, _("Unable to change mode on %s: %s\n"), tmpdir, strerror(errno));
509 fprintf(stderr, _("Failed to stat directory %s: %s\n"), tmpdir, strerror(errno));
516 fprintf(stderr, _("Failed to set context of the directory %s: %s\n"), tmpdir, strerror(errno));
524 if (rsynccmd(src, tmpdir, &cmdbuf) < 0) {
534 cleanup_tmpdir(tmpdir, src, pwd, 0);
540 free(tmpdir); tmpdir = NULL;
546 return tmpdir;
624 char *tmpdir_s = NULL; /* tmpdir spec'd by user in argv[] */
625 char *tmpdir_r = NULL; /* tmpdir created by seunshare */
634 {"tmpdir", 1, 0, 't'},
698 fprintf(stderr, _("Error: tmpdir and/or homedir required\n %s\n"), USAGE_STRING);
725 /* verify homedir and tmpdir */
734 /* create runtime tmpdir */
778 /* mount homedir and tmpdir, in this order */