X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=common.h;h=87a8c102fd5646f64ad47168d418c4dc9fa7e884;hb=7adf2c71251abac86b93cbd21914acccac295575;hp=2a2db41eb2c315b63ff26c0549b44ffca324f74a;hpb=db59ee1476515a65cfcca10a3059d8ccb2d24d32;p=userv.git diff --git a/common.h b/common.h index 2a2db41..87a8c10 100644 --- a/common.h +++ b/common.h @@ -2,11 +2,12 @@ * userv - common.h * definitions shared between client and daemon * - * Copyright (C)1996-1997 Ian Jackson + * userv is copyright Ian Jackson and other contributors. + * See README for full authorship information. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but @@ -15,13 +16,18 @@ * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with userv; if not, write to the Free Software - * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with userv; if not, see . */ #ifndef COMMON_H #define COMMON_H +#define COPYRIGHT(indent,nl) \ + indent "Copyright 1996-2021 Ian Jackson; copyright 2000 Ben Harris;" nl \ + indent "Copyright 2021 Genome Research Limited apropos work by" nl \ + indent "Matthew Vernon." nl \ + indent "there is NO WARRANTY; type `userv --copyright' for details." nl + #define PCSUMSIZE 16 static const unsigned char protocolchecksumversion[PCSUMSIZE]= { @@ -43,13 +49,13 @@ static const unsigned char protocolchecksumversion[PCSUMSIZE]= { #ifndef PIPEFORMAT # define PIPEFORMAT "%lx.%lx.%x" # define PIPEPATTERN "[0-9a-f]*.[0-9a-f]*.*[0-9a-f]" -# define PIPEFORMATEXTEND (sizeof(unsigned long)*2*2+sizeof(int)*2+3) -# define PIPEMAXLEN (sizeof(PIPEFORMAT)+PIPEFORMATEXTEND) +# define PIPEFORMATEXTEND ((int)(sizeof(unsigned long)*2*2+(int)sizeof(int)*2+3)) +# define PIPEMAXLEN ((int)(sizeof(PIPEFORMAT)+PIPEFORMATEXTEND)) #endif #ifndef PIPEPATHFORMAT # define PIPEPATHFORMAT VARDIR "/" PIPEFORMAT -# define PIPEPATHMAXLEN (sizeof(PIPEPATHFORMAT)+PIPEFORMATEXTEND) +# define PIPEPATHMAXLEN ((int)(sizeof(PIPEPATHFORMAT)+PIPEFORMATEXTEND)) #endif #define MAX_ALLOW_FD 1024 @@ -77,22 +83,22 @@ enum { struct opening_msg { unsigned long magic; unsigned char protocolchecksumversion[PCSUMSIZE]; - pid_t serverpid; + pid_t overlordpid, serverpid; }; struct request_msg { unsigned long magic; - pid_t clientpid; + pid_t clientpid; /* or -1 if no service is required and this was a version check */ int serviceuserlen; int servicelen; - int lognamelen; + int loginnamelen, spoofed; /* spoofed is 0 or 1 */ int cwdlen, overridelen; uid_t callinguid; int ngids, nreadfds, nwritefds, nargs, nvars; /* Followed by: * serviceuserlen bytes for the service user (unterminated) * servicelen bytes for the service (unterminated) - * lognamelen bytes for the login name (unterminated) + * loginnamelen bytes for the login name (unterminated) * cwdlen bytes for the cwd (unterminated) * overridelen bytes for the override data (with extra \n but unterminated), * or nothing if overridelen==-1