summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9a32edf)
+ * #include <fcntl.h>, not <sys/fcntl.h> (fixes some implicit decls).
+ * gid_t may be >int, so cast to long when putting in USERV_GIDS
+ (Might conceivably make USERV_GIDS be wrong on some platforms.)
+ * Do not pass char to ctype macros; they can't cope with -ve !
void syscallerror(const char *what) NONRETURNING;
void syscallerror(const char *what) NONRETURNING;
+#define ISCHAR(iswotsit,ch) (iswotsit((unsigned char)(ch))) /*Feh!*/
+
for (i=0; i<progress_r->data.errmsg.messagelen; i++) {
c= working_getc(file);
if (c==EOF) protoreaderror(file,"in error message");
for (i=0; i<progress_r->data.errmsg.messagelen; i++) {
c= working_getc(file);
if (c==EOF) protoreaderror(file,"in error message");
- if (isprint(c)) putc(c,stderr);
+ if (ISCHAR(isprint,c)) putc(c,stderr);
else fprintf(stderr,"\\x%02x",(unsigned char)c);
}
putc('\n',stderr);
else fprintf(stderr,"\\x%02x",(unsigned char)c);
}
putc('\n',stderr);
* Specification's usage notes section improved.
* --help and --version behaviour made to conform to GNU standards.
* userv(1) manpage: fixed broken definitions of fd excl and trunc.
* Specification's usage notes section improved.
* --help and --version behaviour made to conform to GNU standards.
* userv(1) manpage: fixed broken definitions of fd excl and trunc.
+ * #include <fcntl.h>, not <sys/fcntl.h> (fixes some implicit decls).
+ * gid_t may be >int, so cast to long when putting in USERV_GIDS
+ (Might conceivably make USERV_GIDS be wrong on some platforms.)
+ * Do not pass char to ctype macros; they can't cope with -ve !
*q++= v;
continue;
default:
*q++= v;
continue;
default:
+ if (ISCHAR(isalpha,*p))
return parseerrprint("unknown \\<letter> sequence \\%c in quoted string",*p);
return parseerrprint("unknown \\<letter> sequence \\%c in quoted string",*p);
+ if (ISCHAR(isdigit,*p)) {
if (!((buf[0]= *p++) && (buf[1]= *p++) && (buf[2]= *p++))) abort();
buf[3]= 0; v= strtoul(buf,&bep,8);
if (bep != buf+3 || (v & ~0xff))
return parseerrprint("invalid \\<octal> sequence \\%s in quoted string",buf);
*q++= v; continue;
if (!((buf[0]= *p++) && (buf[1]= *p++) && (buf[2]= *p++))) abort();
buf[3]= 0; v= strtoul(buf,&bep,8);
if (bep != buf+3 || (v & ~0xff))
return parseerrprint("invalid \\<octal> sequence \\%s in quoted string",buf);
*q++= v; continue;
- } else if (ispunct(*p)) {
+ } else if (ISCHAR(ispunct,*p)) {
*q++= *p++; continue;
} else {
while (*p==' ' || *p=='\t') p++;
*q++= *p++; continue;
} else {
while (*p==' ' || *p=='\t') p++;
l= strlen(buf); i= sizeof(buf)-l-2; p= yytext; q= buf+l;
while ((c= *p++)) {
if (i-- <= 0) { q--; strcpy(q-3,"..."); break; }
l= strlen(buf); i= sizeof(buf)-l-2; p= yytext; q= buf+l;
while ((c= *p++)) {
if (i-- <= 0) { q--; strcpy(q-3,"..."); break; }
- if (isspace(c)) c= ' ';
- else if (!isprint(c) || iscntrl(c)) c= '?';
+ if (ISCHAR(isspace,c)) c= ' ';
+ else if (!ISCHAR(isprint,c) || ISCHAR(iscntrl,c)) c= '?';
else *q++= c;
}
strcpy(q,"'");
else *q++= c;
}
strcpy(q,"'");
buf= xmalloc(maxlen+2); actrue= 0; c= 0;
while (!actrue && c!=EOF) {
c= getc(file); if (c==EOF) break;
buf= xmalloc(maxlen+2); actrue= 0; c= 0;
while (!actrue && c!=EOF) {
c= getc(file); if (c==EOF) break;
- if (isspace(c)) continue;
+ if (ISCHAR(isspace,c)) continue;
l= maxlen+1; p= buf;
while (l>0 && c!='\n' && c!=EOF) { *p++= c; l--; c= getc(file); }
l= maxlen+1; p= buf;
while (l>0 && c!='\n' && c!=EOF) { *p++= c; l--; c= getc(file); }
- if (c=='\n' || c==EOF || isspace(c)) {
- while (p>buf && isspace(p[-1])) --p;
+ if (c=='\n' || c==EOF || ISCHAR(isspace,c)) {
+ while (p>buf && ISCHAR(isspace,p[-1])) --p;
*p= 0; posstrue= 0;
for (pp= pv; !posstrue && *pp; pp++)
if (!strcmp(*pp,buf)) posstrue= 1;
*p= 0; posstrue= 0;
for (pp= pv; !posstrue && *pp; pp++)
if (!strcmp(*pp,buf)) posstrue= 1;
for (;;) {
c= getc(file);
if (c==EOF || c=='\n') break;
for (;;) {
c= getc(file);
if (c==EOF || c=='\n') break;
- if (!isspace(c)) posstrue= 0;
+ if (!ISCHAR(isspace,c)) posstrue= 0;
}
}
if (posstrue) actrue= 1;
}
}
if (posstrue) actrue= 1;
r= paa_pathargs(&rv,&newargs); if (r) return r;
p= strrchr(service,'/'); if (p) p++; else p= service;
r= paa_pathargs(&rv,&newargs); if (r) return r;
p= strrchr(service,'/'); if (p) p++; else p= service;
- if (!*p || !isalnum(*p)) {
+ if (!*p || !ISCHAR(isalnum,*p)) {
parseerrprint("execute-from-directory requires initial char of service "
"portion to be alphanumeric (service portion was `%s')",
p);
parseerrprint("execute-from-directory requires initial char of service "
"portion to be alphanumeric (service portion was `%s')",
p);
return tokv_error;
}
for (q=p+1; *q; q++) {
return tokv_error;
}
for (q=p+1; *q; q++) {
- if (!isalnum(*q) && *q != '-') {
+ if (!ISCHAR(isalnum,*q) && *q != '-') {
parseerrprint("execute-from-directory requires service portion to "
"contain only alphanumerics and hyphens (was `%s')",
p);
parseerrprint("execute-from-directory requires service portion to "
"contain only alphanumerics and hyphens (was `%s')",
p);
tel= strlen(de->d_name);
if (!tel) continue;
p= de->d_name;
tel= strlen(de->d_name);
if (!tel) continue;
p= de->d_name;
- if (!*p || !isalnum(*p)) continue;
- while ((c= *++p)) if (!(isalnum(c) || c=='-')) break;
+ if (!*p || !ISCHAR(isalnum,*p)) continue;
+ while ((c= *++p)) if (!(ISCHAR(isalnum,c) || c=='-')) break;
if (c) continue;
if (makeroom(&buildbuf,&buildbuflen,cpl+1+tel+1)) {
stringoverflow("pathname in directory");
if (c) continue;
if (makeroom(&buildbuf,&buildbuflen,cpl+1+tel+1)) {
stringoverflow("pathname in directory");
#include <syslog.h>
#include <pwd.h>
#include <grp.h>
#include <syslog.h>
#include <pwd.h>
#include <grp.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
static const char *seei_gid(int i) {
static char buf[CHAR_BIT*sizeof(gid_t)/3+4];
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) {
return buf;
}
static const char *see_c_gid(void) {