OK, turing.

<- leave blank

Sun Jan 24 00:26:30 EST 2021

def get_formatted_offset(timestamp)
  start_time = 1374558778
  #start_time + 18873837s == -20m 30s
  sign = ""

  offset = 0.0001075563 * (timestamp - start_time)

  if timestamp > start_time
    sign = "-"
  else
    sign = "+"
  end

  h = (offset / 3600.0).to_i
  offset = offset - (h * 3600)
  m = (offset / 60.0).to_i
  offset = offset - (m * 60)
  s = (offset % 60.0).round(0)

  return "#{sign}=0:0:0 #{'%02d' % h}:#{'%02d' % m}:#{'%02d' % s}"
end


Sat Jan 23 23:12:21 EST 2021
diff -r c3112194cb3a sys/src/cmd/5l/asm.c
--- a/sys/src/cmd/5l/asm.c Sat Jan 23 20:03:07 2021 -0800
+++ b/sys/src/cmd/5l/asm.c Sat Jan 23 20:12:21 2021 -0800
@@ -785,7 +785,10 @@

	case 8: /* sll $c,[R],R -> mov (R<<$c),R */
		aclass(&p->from);
- o1 = oprrr(p->as, p->scond);
+ if((p->as == ASRL || p->as == ASRA) && instoffset == 0)
+ o1 = oprrr(ASLL, p->scond);
+ else
+ o1 = oprrr(p->as, p->scond);
		r = p->reg;
		if(r == NREG)
			r = p->to.reg;


Sat Jan 23 20:20:17 EST 2021
#include <u.h>
#include <libc.h>

static char*
tf(int b)
{
	return b ? "true" : "false";
}

void
main(void)
{
	uvlong i1 = 0xffffffffffffffffULL;
	double *f1 = (double*)&i1;
	double f2 = -*f1;
	uvlong i2 = *(uvlong*)&f2;
	print("f1=%f(%#ullx) (< 0: %s), f2=%f(%#ullx) (<0: %s)\n",
		*f1, i1, tf(*f1 < 0), f2, i2, tf(f2 < 0));
}


Sat Jan 23 19:33:52 EST 2021
diff -r d414d0d5c557 sys/src/cmd/upas/q/runq.c
--- a/sys/src/cmd/upas/q/runq.c Sat Jan 23 16:05:21 2021 -0800
+++ b/sys/src/cmd/upas/q/runq.c Sun Jan 24 01:33:52 2021 +0100
@@ -36,6 +36,7 @@
 void logit(char*, Wdir*, char*, char**);
 void doload(int);

+#define HUNK 32
 char *cmd;
 char *root;
 int debug;
@@ -151,12 +152,14 @@
	long i, n;


- if((fd = open(".", OREAD)) == -1)
- warning("opening %s", root);
+ fd = open(".", OREAD);
+ if(fd == -1){
+ warning("reading %s", root);
		return;
	}
- if((n = dirreadall(fd, &db)) == -1){
- warning("reading %s: ", root);
+ n = dirreadall(fd, &db);
+ if(n == 0){
+ close(fd);
		return;
	}
	for(i=0; i<n; i++){
@@ -176,6 +179,8 @@
 void
 dodir(char *name)
 {
+// curdir = name;
+
	if(chdir(name) < 0){
		warning("cd to %s", name);
		return;
@@ -692,3 +697,4 @@
	}
	syslog(0, runqlog, "%s", buf);
 }
+


Sat Jan 23 19:32:30 EST 2021
#include "common.h"
#include <ctype.h>

typedef struct Job Job;
typedef struct Wdir Wdir;

struct Wdir {
	Dir *d;
	int nd;
	char *name;
};

struct Job {
	Job *next;
	int pid;
	int ac;
	int dfd;
	char **av;
	char *buf; /* backing for av */
	Wdir *wdir; /* work dir */
	Dir *dp; /* not owned */
	Mlock *l;
	Biobuf *b;
};

void doalldirs(void);
void dodir(char*);
Job* dofile(Wdir*, Dir*);
Job* donefile(Job*, Waitmsg*);
void freejob(Job*);
void rundir(char*);
char* file(char*, char);
void warning(char*, void*);
void error(char*, void*);
int returnmail(char**, Wdir*, char*, char*);
void logit(char*, Wdir*, char*, char**);
void doload(int);

#define HUNK 32
char *cmd;
char *root;
int debug;
int giveup = 2*24*60*60;
int limit;

char *runqlog = "runq";

char **badsys; /* array of recalcitrant systems */
int nbad;
int njob = 1; /* number of concurrent jobs to invoke */
int Eflag; /* ignore E.xxxxxx dates */
int Rflag; /* no giving up, ever */
int aflag; /* do all dirs */

void
usage(void)
{
	fprint(2, "usage: runq [-dE] [-q dir] [-l load] [-t time] [-r nfiles] [-n
	nprocs] q-root cmd\n");
	exits("usage");
}

void
main(int argc, char **argv)
{
	char *qdir;

	qdir = 0;

	ARGBEGIN{
	case 'E':
		Eflag++;
		break;
	case 'R': /* no giving up -- just leave stuff in the queue */
		Rflag++;
		break;
	case 'd':
		debug++;
		break;
	case 'r':
		limit = atoi(EARGF(usage()));
		break;
	case 't':
		giveup = 60*60*atoi(EARGF(usage()));
		break;
	case 'q':
		qdir = EARGF(usage());
		break;
	case 'a':
		aflag++;
		break;
	case 'n':
		njob = atoi(EARGF(usage()));
		if(njob == 0)
			usage();
		break;
	default:
		usage();
		break;
	}ARGEND;

	if(argc != 2)
		usage();

	if(!aflag && qdir == nil){
		qdir = getuser();
		if(qdir == nil)
			error("unknown user", 0);
	}
	root = argv[0];
	cmd = argv[1];

	if(chdir(root) < 0)
		error("can't cd to %s", root);

	if(aflag)
		doalldirs();
	else
		dodir(qdir);
	exits(0);
}

int
emptydir(char *name)
{
	int fd;
	long n;
	char buf[2048];

	fd = open(name, OREAD);
	if(fd < 0)
		return 1;
	n = read(fd, buf, sizeof(buf));
	close(fd);
	if(n <= 0) {
		if(debug)
			fprint(2, "removing directory %s\n", name);
		syslog(0, runqlog, "rmdir %s", name);
		remove(name);
		return 1;
	}
	return 0;
}

/*
 * run all user directories, must be bootes (or root on unix) to do this
 */
void
doalldirs(void)
{
	Dir *db;
	int fd;
	long i, n;


	fd = open(".", OREAD);
	if(fd == -1){
		warning("reading %s", root);
		return;
	}
	n = dirreadall(fd, &db);
	if(n == 0){
		close(fd);
		return;
	}
	for(i=0; i<n; i++){
		if((db[i].qid.type & QTDIR) == 0)
			continue;
		if(emptydir(db[i].name))
			continue;
		dodir(db[i].name);
	}
	free(db);
	close(fd);
}

/*
 * cd to a user directory and run it
 */
void
dodir(char *name)
{
// curdir = name;

	if(chdir(name) < 0){
		warning("cd to %s", name);
		return;
	}
	if(debug)
		fprint(2, "running %s\n", name);
	rundir(name);
	chdir("..");
}

/*
 * run the current directory
 */
void
rundir(char *name)
{
	int nlive, fidx, fd, found;
	Job *hd, *j, **p;
	Waitmsg *w;
	Wdir wd;

	fd = open(".", OREAD);
	if(fd == -1){
		warning("reading %s", name);
		return;
	}
	fidx= 0;
	hd = nil;
	nlive = 0;
	wd.name = name;
	wd.nd = dirreadall(fd, &wd.d);
	while(nlive > 0 || fidx< wd.nd){
		while(fidx< wd.nd && nlive < njob){
			if(strncmp(wd.d[fidx].name, "C.", 2) != 0){
				fidx++;
				continue;
			}
			if((j = dofile(&wd, &wd.d[fidx])) != nil){
				nlive++;
				j->next = hd;
				hd = j;
			}
			fidx++;
		}
		if(nlive == 0){
			fprint(2, "nothing live\n");
			break;
		}
rescan:
		if((w = wait()) == nil){
			syslog(0, "runq", "wait error: %r");
			break;
		}
		found = 0;
		for(p = &hd; *p != nil; p = &(*p)->next){
			if(w->pid == (*p)->pid){
				*p = donefile(*p, w);
				found++;
				nlive--;
				break;
			}
		}
		free(w);
		if(!found)
			goto rescan;
	}
	assert(hd == nil);
	free(wd.d);
	close(fd);
}

/*
 * free files matching name in the current directory
 */
void
remmatch(Wdir *w, char *name)
{
	long i;

	syslog(0, runqlog, "removing %s/%s", w->name, name);

	for(i=0; i<w->nd; i++){
		if(strcmp(&w->d[i].name[1], &name[1]) == 0)
			remove(w->d[i].name);
	}

	/* error file (may have) appeared after we read the directory */
	/* stomp on data file in case of phase error */
	remove(file(name, 'D'));
	remove(file(name, 'E'));
}

/*
 * like trylock, but we've already got the lock on fd,
 * and don't want an L. lock file.
 */
static Mlock *
keeplockalive(char *path, int fd)
{
	char buf[1];
	Mlock *l;

	l = malloc(sizeof(Mlock));
	if(l == 0)
		return 0;
	l->fd = fd;
	snprint(l->name, sizeof l->name, "%s", path);

	/* fork process to keep lock alive until sysunlock(l) */
	switch(l->pid = rfork(RFPROC)){
	default:
		break;
	case 0:
		fd = l->fd;
		for(;;){
			sleep(1000*60);
			if(pread(fd, buf, 1, 0) < 0)
				break;
		}
		_exits(0);
	}
	return l;
}

/*
 * Launch trying a message, returning a job
 * tracks the running pid.
 */
Job*
dofile(Wdir *w, Dir *dp)
{
	int dtime, efd, i, etime;
	Job *j;
	Dir *d;
	char *cp;

	if(debug)
		fprint(2, "dofile %s\n", dp->name);
	/*
	 * if no data file or empty control or data file, just clean up
	 * the empty control file must be 15 minutes old, to minimize the
	 * chance of a race.
	 */
	d = dirstat(file(dp->name, 'D'));
	if(d == nil){
		syslog(0, runqlog, "no data file for %s", dp->name);
		remmatch(w, dp->name);
		return nil;
	}
	if(dp->length == 0){
		if(time(0)-dp->mtime > 15*60){
			syslog(0, runqlog, "empty ctl file for %s", dp->name);
			remmatch(w, dp->name);
		}
		return nil;
	}
	dtime = d->mtime;
	free(d);

	/*
	 * retry times depend on the age of the errors file
	 */
	if(!Eflag && (d = dirstat(file(dp->name, 'E'))) != nil){
		etime = d->mtime;
		free(d);
		if(etime - dtime < 60*60){
			/* up to the first hour, try every 15 minutes */
			if(time(0) - etime < 15*60)
				return nil;
		} else {
			/* after the first hour, try once an hour */
			if(time(0) - etime < 60*60)
				return nil;
		}
	}

	/*
	 * open control and data
	 */
	j = malloc(sizeof(Job));
	if(j == nil)
		return nil;
	memset(j, 0, sizeof(Job));
	j->dp = dp;
	j->dfd = -1;
	j->b = sysopen(file(dp->name, 'C'), "rl", 0660);
	if(j->b == 0) {
		if(debug)
			fprint(2, "can't open %s: %r\n", file(dp->name, 'C'));
		return nil;
	}
	j->dfd = open(file(dp->name, 'D'), OREAD);
	if(j->dfd < 0){
		if(debug)
			fprint(2, "can't open %s: %r\n", file(dp->name, 'D'));
		freejob(j);
		return nil;
	}

	/*
	 * make arg list
	 * - read args into (malloc'd) buffer
	 * - malloc a vector and copy pointers to args into it
	 */
	j->wdir = w;
	j->buf = malloc(dp->length+1);
	if(j->buf == nil){
		warning("buffer allocation", 0);
		freejob(j);
		return nil;
	}
	if(Bread(j->b, j->buf, dp->length) != dp->length){
		warning("reading control file %s\n", dp->name);
		freejob(j);
		return nil;
	}
	j->buf[dp->length] = 0;
	j->av = malloc(2*sizeof(char*));
	if(j->av == 0){
		warning("argv allocation", 0);
		freejob(j);
		return nil;
	}
	for(j->ac = 1, cp = j->buf; *cp; j->ac++){
		while(isspace(*cp))
			*cp++ = 0;
		if(*cp == 0)
			break;

		j->av = realloc(j->av, (j->ac+2)*sizeof(char*));
		if(j->av == 0){
			warning("argv allocation", 0);
		}
		j->av[j->ac] = cp;
		while(*cp && !isspace(*cp)){
			if(*cp++ == '"'){
				while(*cp && *cp != '"')
					cp++;
				if(*cp)
					cp++;
			}
		}
	}
	j->av[0] = cmd;
	j->av[j->ac] = 0;

	if(!Eflag &&time(0) - dtime > giveup){
		if(returnmail(j->av, w, dp->name, "Giveup") != 0)
			logit("returnmail failed", w, dp->name, j->av);
		remmatch(w, dp->name);
		goto done;
	}

	for(i = 0; i < nbad; i++){
		if(j->ac > 3 && strcmp(j->av[3], badsys[i]) == 0)
			goto done;
	}

	/*
	 * Ken's fs, for example, gives us 5 minutes of inactivity before
	 * the lock goes stale, so we have to keep reading it.
	 */
	j->l = keeplockalive(file(dp->name, 'C'), Bfildes(j->b));

	/*
	 * transfer
	 */
	j->pid = fork();
	switch(j->pid){
	case -1:
		sysunlock(j->l);
		sysunlockfile(Bfildes(j->b));
		syslog(0, runqlog, "out of procs");
		exits(0);
	case 0:
		if(debug) {
			fprint(2, "Starting %s\n", cmd);
			for(i = 0; j->av[i]; i++)
				fprint(2, " %s", j->av[i]);
			fprint(2, "\n");
		}
		logit("execing", w, dp->name, j->av);
		close(0);
		dup(j->dfd, 0);
		close(j->dfd);
		close(2);
		efd = open(file(dp->name, 'E'), OWRITE);
		if(efd < 0){
			if(debug)
				syslog(0, "runq", "open %s as %s: %r",
				file(dp->name,'E'), getuser());
			efd = create(file(dp->name, 'E'), OWRITE, 0666);
			if(efd < 0){
				if(debug) syslog(0, "runq", "create %s as %s: %r",
				file(dp->name, 'E'), getuser());
				exits("could not open error file - Retry");
			}
		}
		seek(efd, 0, 2);
		exec(cmd, j->av);
		error("can't exec %s", cmd);
		break;
	default:
		return j;
	}
done:
	freejob(j);
	return nil;
}

/*
 * Handle the completion of a job.
 * Wait for the pid, check its status,
 * and then pop the job off the list.
 * Return the next running job.
 */
Job*
donefile(Job *j, Waitmsg *wm)
{
	Job *n;

	if(debug)
		fprint(2, "wm->pid %d wm->msg == %s\n", wm->pid,
		wm->msg);

	if(wm->msg[0]){
		if(debug)
			fprint(2, "[%d] wm->msg == %s\n", getpid(),
			wm->msg);
		if(!Rflag && strstr(wm->msg, "Retry")==0){
			/* return the message and remove it */
			if(returnmail(j->av, j->wdir, j->dp->name,
			wm->msg) != 0)
				logit("returnmail failed", j->wdir,
				j->dp->name, j->av);
			remmatch(j->wdir, j->dp->name);
		} else {
			/* add sys to bad list and try again later */
			nbad++;
			badsys = realloc(badsys, nbad*sizeof(char*));
			badsys[nbad-1] = strdup(j->av[3]);
		}
	} else {
		/* it worked remove the message */
		remmatch(j->wdir, j->dp->name);
	}
	n = j->next;
	freejob(j);
	return n;
}

/*
 * Release resources associated with
 * a job.
 */
void
freejob(Job *j)
{
	if(j->b != nil){
		sysunlockfile(Bfildes(j->b));
		Bterm(j->b);
	}
	if(j->dfd != -1)
		close(j->dfd);
	if(j->l != nil)
		sysunlock(j->l);
	free(j->buf);
	free(j->av);
	free(j);
}


/*
 * return a name starting with the given character
 */
char*
file(char *name, char type)
{
	static char nname[Elemlen+1];

	strncpy(nname, name, Elemlen);
	nname[Elemlen] = 0;
	nname[0] = type;
	return nname;
}

/*
 * send back the mail with an error message
 *
 * return 0 if successful
 */
int
returnmail(char **av, Wdir *w, char *name, char *msg)
{
	char buf[256], attachment[Pathlen], *sender;
	int i, fd, pfd[2];
	long n;
	Waitmsg *wm;
	String *s;

	if(av[1] == 0 || av[2] == 0){
		logit("runq - dumping bad file", w, name, av);
		return 0;
	}

	s = unescapespecial(s_copy(av[2]));
	sender = s_to_c(s);

	if(!returnable(sender) || strcmp(sender, "postmaster") == 0) {
		logit("runq - dumping p to p mail", w, name, av);
		return 0;
	}

	if(pipe(pfd) < 0){
		logit("runq - pipe failed", w, name, av);
		return -1;
	}

	switch(rfork(RFFDG|RFPROC|RFENVG)){
	case -1:
		logit("runq - fork failed", w, name, av);
		return -1;
	case 0:
		logit("returning", w, name, av);
		close(pfd[1]);
		close(0);
		dup(pfd[0], 0);
		close(pfd[0]);
		putenv("upasname", "/dev/null");
		snprint(buf, sizeof(buf), "%s/marshal", UPASBIN);
		snprint(attachment, sizeof(attachment), "%s", file(name, 'D'));
		execl(buf, "send", "-A", attachment, "-s", "permanent failure",
		sender, nil);
		error("can't exec", 0);
		break;
	default:
		break;
	}

	close(pfd[0]);
	fprint(pfd[1], "\n"); /* get out of headers */
	if(av[1]){
		fprint(pfd[1], "Your request ``%.20s ", av[1]);
		for(n = 3; av[n]; n++)
			fprint(pfd[1], "%s ", av[n]);
	}
	fprint(pfd[1], "'' failed (code %s).\nThe symptom was:\n\n", msg);
	fd = open(file(name, 'E'), OREAD);
	if(fd >= 0){
		for(;;){
			n = read(fd, buf, sizeof(buf));
			if(n <= 0)
				break;
			if(write(pfd[1], buf, n) != n){
				close(fd);
				goto out;
			}
		}
		close(fd);
	}
	close(pfd[1]);
out:
	wm = wait();
	if(wm == nil){
		syslog(0, "runq", "wait: %r");
		logit("wait failed", w, name, av);
		return -1;
	}
	i = 0;
	if(wm->msg[0]){
		i = -1;
		syslog(0, "runq", "returnmail child: %s", wm->msg);
		logit("returnmail child failed", w, name, av);
	}
	free(wm);
	return i;
}

/*
 * print a warning and continue
 */
void
warning(char *f, void *a)
{
	char err[ERRMAX];
	char buf[256];

	rerrstr(err, sizeof(err));
	snprint(buf, sizeof(buf), f, a);
	fprint(2, "runq: %s: %s\n", buf, err);
}

/*
 * print an error and die
 */
void
error(char *f, void *a)
{
	char err[ERRMAX];
	char buf[256];

	rerrstr(err, sizeof(err));
	snprint(buf, sizeof(buf), f, a);
	fprint(2, "runq: %s: %s\n", buf, err);
	exits(buf);
}

void
logit(char *msg, Wdir *w, char *file, char **av)
{
	int n, m;
	char buf[256];

	n = snprint(buf, sizeof(buf), "%s/%s: %s", w->name, file, msg);
	for(; *av; av++){
		m = strlen(*av);
		if(n + m + 4 > sizeof(buf))
			break;
		sprint(buf + n, " '%s'", *av);
		n += m + 3;
	}
	syslog(0, runqlog, "%s", buf);
}


Sat Jan 23 19:30:45 EST 2021
Good morning people at okturing.com,
Hope you’re great.
I'm ,
Hope you’re excellent, and that clients are profitable.  Please allow me to
introduce to you this service.
The quickest way to promote your web site.  Just enter your URL.  Your competitors
use this service already.
https://bogazicitente.com/websitesubmitter57512
Regards,


Sat Jan 23 19:27:50 EST 2021
6c -FTVw -I../common runq.c warning: runq.c:151 auto declared and not used: n
warning: runq.c:151 auto declared and not used: i warning: runq.c:149 auto
declared and not used: db warning: runq.c:154 set and not used: fd runq.c:158
syntax error, last name: if mk: 6c -FTVw -I../common runq.c : exit status=rc
16719941: 6c 16719943: error mk: for (i in ...  : exit status=rc 16719927: mk
16719940: error mk: for (i in ...  : exit status=rc 16713464: rc 16719925: mk
16719926: error

Sat Jan 23 16:13:04 EST 2021
diff -r de663b03be21 sys/src/cmd/vnc/auth.c
--- a/sys/src/cmd/vnc/auth.c Sat Jan 23 11:03:05 2021 -0800
+++ b/sys/src/cmd/vnc/auth.c Sat Jan 23 13:13:04 2021 -0800
@@ -2,26 +2,12 @@
 #include <libsec.h>
 #include <auth.h>

-char *serveraddr;
-
-enum
-{
- VerLen = 12
-};
-
-static char version33[VerLen+1] = "RFB 003.003\n";
-static char version38[VerLen+1] = "RFB 003.008\n";
-static int srvversion;
-
 int
 vncsrvhandshake(Vnc *v)
 {
	char msg[VerLen+1];

- strecpy(msg, msg+sizeof msg, version33);
- if(verbose)
- fprint(2, "server version: %s\n", msg);
- vncwrbytes(v, msg, VerLen);
+ vncwrbytes(v, "RFB 003.003\n", VerLen);
	vncflush(v);

	vncrdbytes(v, msg, VerLen);
@@ -33,67 +19,57 @@
 int
 vnchandshake(Vnc *v)
 {
- char msg[VerLen+1];
+ char msg[VerLen + 1];

	msg[VerLen] = 0;
	vncrdbytes(v, msg, VerLen);
- if(strncmp(msg, "RFB 003.", 8) != 0 ||
- strncmp(msg, "RFB 003.007\n", VerLen) == 0){
- werrstr("bad rfb version \"%s\"", msg);
- return -1;
- }
- if(strncmp(msg, "RFB 003.008\n", VerLen) == 0)
- srvversion = 38;
- else
- srvversion = 33;

	if(verbose)
		fprint(2, "server version: %s\n", msg);
- strcpy(msg, version38);
+
+ if(strncmp(msg, "RFB 003.003\n", VerLen) == 0)
+ v->vers = 33;
+ else if(strncmp(msg, "RFB 003.007\n", VerLen) == 0)
+ v->vers = 37;
+ else if(strncmp(msg, "RFB 003.008\n", VerLen) == 0)
+ v->vers = 38;
+ else /* RFC6143: Any other should be treated as 3.3.  */
+ v->vers = 33;
+
+ strcpy(msg, "RFB 003.008\n");
	vncwrbytes(v, msg, VerLen);
	vncflush(v);
	return 0;
 }

-ulong
-sectype38(Vnc *v)
-{
- ulong auth, type;
- int i, ntypes;
-
- ntypes = vncrdchar(v);
- if(ntypes == 0){
- werrstr("no security types from server");
- return AFailed;
- }
-
- /* choose the "most secure" security type */
- auth = AFailed;
- for(i = 0; i < ntypes; i++){
- type = vncrdchar(v);
- if(verbose){
- fprint(2, "auth type %s\n",
- type == AFailed ? "Invalid" :
- type == ANoAuth ? "None" :
- type == AVncAuth ? "VNC" : "Unknown");
- }
- if(type > auth && type <= AVncAuth)
- auth = type;
- }
- return auth;
-}
-
 int
 vncauth(Vnc *v, char *keypattern)
 {
- char *reason;
	uchar chal[VncChalLen];
- ulong auth;
+ ulong auth, type;
+ int i, ntypes;
+ char *err;

	if(keypattern == nil)
		keypattern = "";

- auth = srvversion == 38 ? sectype38(v) : vncrdlong(v);
+ auth = AFailed;
+ if(v->vers == 33)
+ auth = vncrdlong(v);
+ else{
+ ntypes = vncrdchar(v);
+ for(i = 0; i < ntypes; i++){
+ type = vncrdchar(v);
+ if(verbose)
+ fprint(2, "auth type %uld\n", type);
+ if(type > auth && type <= AVncAuth)
+ auth = type;
+ }
+ if(auth == AFailed){
+ werrstr("no supported auth types");
+ return -1;
+ }
+ }

	switch(auth){
	default:
@@ -103,15 +79,14 @@
		return -1;

	case AFailed:
- failed:
- reason = vncrdstring(v);
- werrstr("%s", reason);
+ err = vncrdstring(v);
+ werrstr("%s", err);
		if(verbose)
- fprint(2, "auth failed: %s\n", reason);
+ fprint(2, "auth failed: %s\n", err);
		return -1;

	case ANoAuth:
- if(srvversion == 38){
+ if(v->vers == 38){
			vncwrchar(v, auth);
			vncflush(v);
		}
@@ -120,14 +95,14 @@
		break;

	case AVncAuth:
- if(srvversion == 38){
+ if(v->vers == 38){
			vncwrchar(v, auth);
			vncflush(v);
		}

		vncrdbytes(v, chal, VncChalLen);
		if(auth_respond(chal, VncChalLen, nil, 0, chal, VncChalLen,
		auth_getkey,
- "proto=vnc role=client server=%s %s", serveraddr, keypattern) != VncChalLen){
+ "proto=vnc role=client server=%s %s", v->srvaddr, keypattern) != VncChalLen){
			return -1;
		}
		vncwrbytes(v, chal, VncChalLen);
@@ -135,18 +110,18 @@
		break;
	}

- /* in version 3.8 the auth status is always sent, in 3.3 only in AVncAuth */
- if(srvversion == 38 || auth == AVncAuth){
+ /* in version 3.8 the auth status is always sent, in 3.3 and 3.7, only in
AVncAuth */
+ if(v->vers == 38 || auth == AVncAuth){
		auth = vncrdlong(v); /* auth status */
		switch(auth){
		default:
			werrstr("unknown server response 0x%lux", auth);
			return -1;
		case VncAuthFailed:
- if (srvversion == 38)
- goto failed;
-
- werrstr("server says authentication failed");
+ err = (v->vers == 38) ? vncrdstring(v) : "rejected";
+ werrstr("%s", err);
+ if(verbose)
+ fprint(2, "auth failed: %s\n", err);
			return -1;
		case VncAuthTooMany:
			werrstr("server says too many tries");
diff -r de663b03be21 sys/src/cmd/vnc/vnc.h
--- a/sys/src/cmd/vnc/vnc.h Sat Jan 23 11:03:05 2021 -0800
+++ b/sys/src/cmd/vnc/vnc.h Sat Jan 23 13:13:04 2021 -0800
@@ -33,7 +33,11 @@

	Rectangle dim;
	Pixfmt;
- char *name; /* client only */
+
+ /* client only */
+ char *name;
+ char *srvaddr;
+ int vers;

	int canresize;
	struct {
@@ -44,6 +48,7 @@
 };

 enum {
+ VerLen = 12,
	/* authentication negotiation */
	AFailed = 0,
	ANoAuth,
@@ -142,4 +147,3 @@
 extern void vnchungup(Vnc*);

 extern int verbose;
-extern char* serveraddr;
diff -r de663b03be21 sys/src/cmd/vnc/vncv.c
--- a/sys/src/cmd/vnc/vncv.c Sat Jan 23 11:03:05 2021 -0800
+++ b/sys/src/cmd/vnc/vncv.c Sat Jan 23 13:13:04 2021 -0800
@@ -111,10 +111,9 @@
	if(argc != 1)
		usage();

- serveraddr = strdup(argv[0]);
- dfd = dial(netmkvncaddr(serveraddr), nil, nil, &cfd);
+ dfd = dial(netmkvncaddr(argv[0]), nil, nil, &cfd);
	if(dfd < 0)
- sysfatal("cannot dial %s: %r", serveraddr);
+ sysfatal("cannot dial %s: %r", argv[0]);
	if(tls){
		TLSconn conn;

@@ -126,6 +125,7 @@
		free(conn.sessionID);
	}
	vnc = vncinit(dfd, cfd, nil);
+ vnc->srvaddr = strdup(argv[0]);

	if(vnchandshake(vnc) < 0)
		sysfatal("handshake failure: %r");


Sat Jan 23 15:57:36 EST 2021

     QER(8) QER(8)

     NAME
	  qer, runq - queue management for spooled files

     SYNOPSIS
	  qer [ -q subdir ] [ -f file ] root tag reply args
	  runq [ -adER ] [ -f file ] [ -q subdir ] [ -t time ] [ -r
	  nfiles ] [ -n njobs ] root cmd

     DESCRIPTION
	  Qer creates a control and a data file in a queue directory.
	  The control file contents consist of the tag, reply, and
	  args separated by spaces.  The data file contains the stan-
	  dard input to qer.  The files are created in the directory
	  root/subdi The names of the control and data files differ
	  only in the first character which is `C' and `D' respec-
	  tively.  Mktemp(2) is used to create the actual names of the
	  control and data file.

	  Some commands, such as fax (see telco(4)), must queue more
	  files than just the data file.  Each file following a -f
	  flag is copied into the queue directory.  The names of the
	  copies differ from the name of the data file only in the
	  first character.  The first one starts with 'F', the second
	  'G', etc.

	  Qer takes the following arguments:

	  -q subdir
	       Specifies the queue subdirectory to use.  If unspeci-
	       fied, the contents of /dev/user are used.

	  -f file
	       Specifies the files to copy into the queue directory,
	       in the manner described above.

	  Runq processes the files queued by qer.  Runq processes all
	  requests in the directory root/subdir, where subdir is the
	  argument to -q if present, else the contents of /dev/user.
	  Each request is processed by executing the command cmd with
	  the contents of the control file as its arguments, the con-
	  tents of the data file as its standard input, and standard
	  error appended to the error file E.XXXXXX.

	  The action taken by runq depends on the return status of
	  cmd.  If cmd returns a null status, the processing is assumed
	  successful and the control, data, and error files are
	  removed.  If cmd returns an error status containing the word
	  `Retry', the files are left to be reprocessed at a later
	  time.  For any other status, an error message is mailed to
	  the requester and the files are removed.  Runq uses the
	  reply field in the control file as a mail address to which
	  to send an error notification.  The notification contains
	  the contents of the control file to identify the failed
	  request.

	  To avoid reprocessing files too often, the following algo-
	  rithm is used: a data file younger than one hour will not be
	  processed if its error file exists and was last modified
	  within the preceding 10 minutes.  A data file older than one
	  hour will not be processed if its error file exists and was
	  last modified within the preceding hour.

	  The following flags are accepted by runq:

	  -a Causes runq to process all user directories in
	       sequence, instead of only the directory of the current
	       user.

	  -E Causes all files to be reprocessed regardless of the
	       file times.

	  -R Instructs runq never to give up on a failed queue job,
	       instead leaving it in the queue to be retried.

	  -d Causes debugging output on standard error describing
	       the progress through the queues.

	  -t Specifies the number of hours that retries will con-
	       tinue after a send failure.  The default is 48 hours.

	  -r Limits the number of files that are processed in a sin-
	       gle pass of a queue.  Runq accumulates the entire
	       directory containing a queue before processing any
	       files.  When a queue contains many files and the system
	       does not have enough memory, runq exits without making
	       progress.  This flag forces runq to process the direc-
	       tory in chunks, allowing the queue to be drained incre-
	       mentally.  It is most useful in combination with the -q
	       flag.

	  -n Specifies the number of queued jobs that are processed
	       in parallel from the queue; the default is 1.  This is
	       useful for a large queue to be processed with a bounded
	       amount of parallelism.

	  Runq is often called from cron(8) by an entry such as

	       0,10,20,30,40,50 * * * * kremvax
		       /bin/upas/runq -a /mail/queue /mail/lib/remotemail

	  The entry must be a single line; it is folded here only so
	  it fits on the page.

     FILES
	  root/user queue directory for user
	  root/user/D.XXXXXX data file
	  root/user/C.XXXXXX control file
	  root/user/E.XXXXXX error file
	  root/user/[F-Z].XXXXXX secondary data files

     SOURCE
	  /sys/src/cmd/upas/q

     SEE ALSO
	  mail(1)



Sat Jan 23 15:34:33 EST 2021
latest oxford dictionary for mobile resa lawang sewu tresno waranggono lg smart tv
software update get the cool shoe shine gorillaz force two decimal places python
festival trap remix hate being sober old dos orcad full class 156 railworks s
armand van helden livemixtapes flava in ya ear instrumental de la soul baby phat
instrumental music nuance pdf reader 8 how life changed ti page criando paisagens
benedito abbud firefox cd ellie goulding halcyon deluxe
bijelo dugme najveci hitovi <a
href=http://file-share-rabbit.biz/invoice/data-structure-mcq-games.php>data
structure mcq games</a> samurai flamenco opening 1 <a
href=http://file-share-rabbit.biz/music/music-app-for-iphone-5.php>music app
for iphone 5</a> <a
href=http://file-share-rabbit.biz/travel-local/amd64-vs-wow64-sysprep.php>amd64
vs wow64 sysprep</a> moyea flv er software <a
href=http://file-share-rabbit.biz/android/video-of-root-canal-treatment.php>video
of root canal treatment</a> gujarat riots banned documentary sites <a
href=http://file-share-rabbit.xyz/libraries-demo/xgra-ps2-iso-s.php>xgra ps2
iso s</a>
ichat player list bukkit viswaroopam tamil trailer hd breast cancer ribbon vector
fortune deluxe album chris brown able red bloody te dashuroj psn code list 2013 no
be chrool to your scuel games elephant man city lock arde la ciudad la mancha de
rolando progressive house blog game articles english grammar ppt lan speed limit
software s beautifully madeline sheehan epub merlin season 5 episode 1 ardas of
wahe guru boutique samayal manthiram hot lene <a
href=http://file-share-rabbit.info/simulation/uhart-spring-fling-2k15.php>uhart
spring fling 2k15</a>
apps that pay you for s <a
href=http://file-share-rabbit.biz/android/my-family-series-1.php>my family
series 1</a> dreamchasers 2 mixtape dopehood <a
href=http://file-share-rabbit.biz/uncategorized/milad-raza-qadri-habibi-ya-rasool-allah.php>milad
raza qadri habibi ya rasool allah</a> <a
href=http://file-share-rabbit.xyz/arcade-action/aljabar-smp-kelas-8-pdf.php>aljabar
smp kelas 8 pdf</a> laputa castle in the sky eng sub <a
href=http://file-share-rabbit.biz/games/blumhouse-book-of-nightmares-pdf.php>blumhouse
book of nightmares pdf</a> simulation modelling and analysis kelton pdf
<a
href=http://file-share-rabbit.xyz/libraries-demo/dark-force-rising-pdf.php>dark
force rising pdf</a> <a
href=http://file-share-rabbit.biz/games/alicja-janosz-let-it-snow-wrzuta-er.php>alicja
janosz let it snow wrzuta er</a>
pure hookup app android o heeriye remix ringtone histoire empire ottoman pdf
cleveland browns pics to o pagador de promessas 1988 skype new year's countdown
clock schneeweiss presented by oliver koletzki skype anna karenina pevear skype
kottum kuzhal vili video er dello vs target music thamo naidoo asom s folder iso
fedora 8 live cd minecraft xbox world city monkees headquarters sessions music
user acceptance testing report format
http://mass222333ter.com

Sat Jan 23 15:18:33 EST 2021
diff -r de663b03be21 sys/src/cmd/upas/q/runq.c
--- a/sys/src/cmd/upas/q/runq.c Sat Jan 23 11:03:05 2021 -0800
+++ b/sys/src/cmd/upas/q/runq.c Sat Jan 23 12:18:33 2021 -0800
@@ -2,6 +2,13 @@
 #include <ctype.h>

 typedef struct Job Job;
+typedef struct Wdir Wdir;
+
+struct Wdir {
+ Dir *d;
+ int nd;
+ char *name;
+};

 struct Job {
	Job *next;
@@ -10,6 +17,7 @@
	int dfd;
	char **av;
	char *buf; /* backing for av */
+ Wdir *wdir; /* work dir */
	Dir *dp; /* not owned */
	Mlock *l;
	Biobuf *b;
@@ -17,15 +25,15 @@

 void doalldirs(void);
 void dodir(char*);
-Job* dofile(Dir*);
+Job* dofile(Wdir*, Dir*);
 Job* donefile(Job*, Waitmsg*);
 void freejob(Job*);
 void rundir(char*);
 char* file(char*, char);
 void warning(char*, void*);
 void error(char*, void*);
-int returnmail(char**, char*, char*);
-void logit(char*, char*, char**);
+int returnmail(char**, Wdir*, char*, char*);
+void logit(char*, Wdir*, char*, char**);
 void doload(int);

 #define HUNK 32
@@ -35,12 +43,6 @@
 int giveup = 2*24*60*60;
 int limit;

-/* the current directory */
-Dir *dirbuf;
-long ndirbuf = 0;
-int nfiles;
-char *curdir;
-
 char *runqlog = "runq";

 char **badsys; /* array of recalcitrant systems */
@@ -48,6 +50,7 @@
 int njob = 1; /* number of concurrent jobs to invoke */
 int Eflag; /* ignore E.xxxxxx dates */
 int Rflag; /* no giving up, ever */
+int aflag; /* do all dirs */

 void
 usage(void)
@@ -82,27 +85,37 @@
	case 'q':
		qdir = EARGF(usage());
		break;
+ case 'a':
+ aflag++;
+ break;
	case 'n':
		njob = atoi(EARGF(usage()));
		if(njob == 0)
			usage();
		break;
+ default:
+ usage();
+ break;
	}ARGEND;

	if(argc != 2)
		usage();

- if(qdir == nil)
+ if(!aflag && qdir == nil){
		qdir = getuser();
- if(qdir == nil)
- error("unknown user", 0);
+ if(qdir == nil)
+ error("unknown user", 0);
+ }
	root = argv[0];
	cmd = argv[1];

	if(chdir(root) < 0)
		error("can't cd to %s", root);

- dodir(qdir);
+ if(aflag)
+ doalldirs();
+ else
+ dodir(qdir);
	exits(0);
 }

@@ -129,12 +142,44 @@
 }

 /*
+ * run all user directories, must be bootes (or root on unix) to do this
+ */
+void
+doalldirs(void)
+{
+ Dir *db;
+ int fd;
+ long i, n;
+
+
+ fd = open(".", OREAD);
+ if(fd == -1){
+ warning("reading %s", root);
+ return;
+ }
+ n = dirreadall(fd, &db);
+ if(n == 0){
+ close(fd);
+ return;
+ }
+ for(i=0; i<n; i++){
+ if((db[i].qid.type & QTDIR) == 0)
+ continue;
+ if(emptydir(db[i].name))
+ continue;
+ dodir(db[i].name);
+ }
+ free(db);
+ close(fd);
+}
+
+/*
  * cd to a user directory and run it
  */
 void
 dodir(char *name)
 {
- curdir = name;
+// curdir = name;

	if(chdir(name) < 0){
		warning("cd to %s", name);
@@ -152,9 +197,10 @@
 void
 rundir(char *name)
 {
+ int nlive, fidx, fd, found;
	Job *hd, *j, **p;
- int nlive, fidx, fd, found;
	Waitmsg *w;
+ Wdir wd;

	fd = open(".", OREAD);
	if(fd == -1){
@@ -164,14 +210,15 @@
	fidx= 0;
	hd = nil;
	nlive = 0;
- nfiles = dirreadall(fd, &dirbuf);
- while(nlive > 0 || fidx< nfiles){
- while(fidx< nfiles && nlive < njob){
- if(strncmp(dirbuf[fidx].name, "C.", 2) != 0){
+ wd.name = name;
+ wd.nd = dirreadall(fd, &wd.d);
+ while(nlive > 0 || fidx< wd.nd){
+ while(fidx< wd.nd && nlive < njob){
+ if(strncmp(wd.d[fidx].name, "C.", 2) != 0){
				fidx++;
				continue;
			}
- if((j = dofile(&dirbuf[fidx])) != nil){
+ if((j = dofile(&wd, &wd.d[fidx])) != nil){
				nlive++;
				j->next = hd;
				hd = j;
@@ -201,7 +248,7 @@
			goto rescan;
	}
	assert(hd == nil);
- free(dirbuf);
+ free(wd.d);
	close(fd);
 }

@@ -209,15 +256,15 @@
  * free files matching name in the current directory
  */
 void
-remmatch(char *name)
+remmatch(Wdir *w, char *name)
 {
	long i;

- syslog(0, runqlog, "removing %s/%s", curdir, name);
+ syslog(0, runqlog, "removing %s/%s", w->name, name);

- for(i=0; i<nfiles; i++){
- if(strcmp(&dirbuf[i].name[1], &name[1]) == 0)
- remove(dirbuf[i].name);
+ for(i=0; i<w->nd; i++){
+ if(strcmp(&w->d[i].name[1], &name[1]) == 0)
+ remove(w->d[i].name);
	}

	/* error file (may have) appeared after we read the directory */
@@ -263,7 +310,7 @@
  * tracks the running pid.
  */
 Job*
-dofile(Dir *dp)
+dofile(Wdir *w, Dir *dp)
 {
	int dtime, efd, i, etime;
	Job *j;
@@ -280,13 +327,13 @@
	d = dirstat(file(dp->name, 'D'));
	if(d == nil){
		syslog(0, runqlog, "no data file for %s", dp->name);
- remmatch(dp->name);
+ remmatch(w, dp->name);
		return nil;
	}
	if(dp->length == 0){
		if(time(0)-dp->mtime > 15*60){
			syslog(0, runqlog, "empty ctl file for %s", dp->name);
- remmatch(dp->name);
+ remmatch(w, dp->name);
		}
		return nil;
	}
@@ -338,7 +385,7 @@
	 * - read args into (malloc'd) buffer
	 * - malloc a vector and copy pointers to args into it
	 */
-
+ j->wdir = w;
	j->buf = malloc(dp->length+1);
	if(j->buf == nil){
		warning("buffer allocation", 0);
@@ -381,9 +428,9 @@
	j->av[j->ac] = 0;

	if(!Eflag &&time(0) - dtime > giveup){
- if(returnmail(j->av, dp->name, "Giveup") != 0)
- logit("returnmail failed", dp->name, j->av);
- remmatch(dp->name);
+ if(returnmail(j->av, w, dp->name, "Giveup") != 0)
+ logit("returnmail failed", w, dp->name, j->av);
+ remmatch(w, dp->name);
		goto done;
	}

@@ -415,7 +462,7 @@
				fprint(2, " %s", j->av[i]);
			fprint(2, "\n");
		}
- logit("execing", dp->name, j->av);
+ logit("execing", w, dp->name, j->av);
		close(0);
		dup(j->dfd, 0);
		close(j->dfd);
@@ -461,9 +508,9 @@
			fprint(2, "[%d] wm->msg == %s\n", getpid(),
			wm->msg);
		if(!Rflag && strstr(wm->msg, "Retry")==0){
			/* return the message and remove it */
- if(returnmail(j->av, j->dp->name, wm->msg) != 0)
- logit("returnmail failed", j->dp->name, j->av);
- remmatch(j->dp->name);
+ if(returnmail(j->av, j->wdir, j->dp->name, wm->msg) != 0)
+ logit("returnmail failed", j->wdir, j->dp->name, j->av);
+ remmatch(j->wdir, j->dp->name);
		} else {
			/* add sys to bad list and try again later */
			nbad++;
@@ -472,7 +519,7 @@
		}
	} else {
		/* it worked remove the message */
- remmatch(j->dp->name);
+ remmatch(j->wdir, j->dp->name);
	}
	n = j->next;
	freejob(j);
@@ -520,7 +567,7 @@
  * return 0 if successful
  */
 int
-returnmail(char **av, char *name, char *msg)
+returnmail(char **av, Wdir *w, char *name, char *msg)
 {
	char buf[256], attachment[Pathlen], *sender;
	int i, fd, pfd[2];
@@ -529,7 +576,7 @@
	String *s;

	if(av[1] == 0 || av[2] == 0){
- logit("runq - dumping bad file", name, av);
+ logit("runq - dumping bad file", w, name, av);
		return 0;
	}

@@ -537,21 +584,21 @@
	sender = s_to_c(s);

	if(!returnable(sender) || strcmp(sender, "postmaster") == 0) {
- logit("runq - dumping p to p mail", name, av);
+ logit("runq - dumping p to p mail", w, name, av);
		return 0;
	}

	if(pipe(pfd) < 0){
- logit("runq - pipe failed", name, av);
+ logit("runq - pipe failed", w, name, av);
		return -1;
	}

	switch(rfork(RFFDG|RFPROC|RFENVG)){
	case -1:
- logit("runq - fork failed", name, av);
+ logit("runq - fork failed", w, name, av);
		return -1;
	case 0:
- logit("returning", name, av);
+ logit("returning", w, name, av);
		close(pfd[1]);
		close(0);
		dup(pfd[0], 0);
@@ -592,14 +639,14 @@
	wm = wait();
	if(wm == nil){
		syslog(0, "runq", "wait: %r");
- logit("wait failed", name, av);
+ logit("wait failed", w, name, av);
		return -1;
	}
	i = 0;
	if(wm->msg[0]){
		i = -1;
		syslog(0, "runq", "returnmail child: %s", wm->msg);
- logit("returnmail child failed", name, av);
+ logit("returnmail child failed", w, name, av);
	}
	free(wm);
	return i;
@@ -635,12 +682,12 @@
 }

 void
-logit(char *msg, char *file, char **av)
+logit(char *msg, Wdir *w, char *file, char **av)
 {
	int n, m;
	char buf[256];

- n = snprint(buf, sizeof(buf), "%s/%s: %s", curdir, file, msg);
+ n = snprint(buf, sizeof(buf), "%s/%s: %s", w->name, file, msg);
	for(; *av; av++){
		m = strlen(*av);
		if(n + m + 4 > sizeof(buf))


next