chiark / gitweb /
New "shutdown" builtin service for terminating uservd. setenv emulation using putenv...
[userv.git] / servexec.c
index c1614f0d9952aeacf71f763b6094658cbfb5b579..fa8b8ac033d4d6e65a179e1e893184469e2af571 100644 (file)
@@ -58,6 +58,14 @@ void bisexec_parameter(const char *const *argv) {
   serv_checkstdoutexit();
 }
   
+void bisexec_help(const char *const *argv) {
+  const char *const *pp;
+  
+  fputs("recognised builtin services:\n",stdout);
+  for (pp= builtinservicehelpstrings; *pp; pp++) printf("  %s\n",*pp);
+  serv_checkstdoutexit();
+}
+  
 void bisexec_version(const char *const *argv) {
   const unsigned char *p;
   int i;
@@ -129,6 +137,15 @@ void bisexec_execute(const char *const *argv) {
   serv_checkstdoutexit();
 }
 
+void bisexec_shutdown(const char *const *argv) {
+  /* This is only reached if the serviceuser_uid test in
+   * process.c:servicerequest() fails (we have to handle the
+   * shutdown request there, unfortunately).
+   */
+  fputs("uservd: builtin service shutdown: permission denied\n",stderr);
+  _exit(-1);
+}
+
 static void serv_resetsignal(int signo) {
   struct sigaction sig;