#include "common.h"
#include "daemon.h"
#include "lib.h"
+#include "both.h"
#include "version.h"
static void NONRETURNING serv_syscallfail(const char *msg) {
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;
- printf("uservd version " VERSION VEREXT "; copyright (C)1996-1997 Ian Jackson.\n"
+ printf("uservd version " VERSION VEREXT "; copyright (C)1996-2000 Ian Jackson.\n"
#ifdef DEBUG
"DEBUGGING VERSION"
#else
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;
static const char *seei_gid(int i) {
static char buf[CHAR_BIT*sizeof(gid_t)/3+4];
- snyprintf(buf,sizeof(buf),"%d",calling_gids[i]);
+ snyprintf(buf,sizeof(buf),"%ld",(long)calling_gids[i]);
return buf;
}
static const char *see_c_gid(void) {
fdarray[fd].holdfd= -1;
}
for (fd=0; fd<fdarrayused; fd++) {
- if (fdarray[fd].realfd < fdarrayused) fdarray[fdarray[fd].realfd].holdfd= fd;
+ if (fdarray[fd].realfd < fdarrayused && fdarray[fd].realfd >= 0)
+ fdarray[fdarray[fd].realfd].holdfd= fd;
}
for (fd=0; fd<fdarrayused; fd++) {
realfd= fdarray[fd].realfd;