+ /* --- Set a passphrase --- */
+
+ else if (strcmp(q, "set") == 0) {
+ char *tag;
+ unsigned long t;
+ if ((tag = str_getword(&s)) == 0)
+ pixserv_write(px, "FAIL missing tag\n");
+ else if ((q = str_getword(&s)) == 0)
+ pixserv_write(px, "FAIL no passphrase\n");
+ else {
+ if (strcmp(q, "--") != 0) {
+ t = pixserv_timeout(q);
+ q = str_getword(&s);
+ } else
+ t = pixserv_timeout(0);
+ if (!q)
+ pixserv_write(px, "FAIL no passphrase\n");
+ else if (strcmp(q, "--") != 0)
+ pixserv_write(px, "FAIL rubbish found before passphrase\n");
+ else {
+ p_flush(tag);
+ p_add(tag, s, t);
+ pixserv_write(px, "OK\n");
+ }
+ }
+ }
+