*** apache_base:[src.main]util.c;1 Mon Aug 23 11:38:21 1999 --- apache_cur:[src.main]util.c;5 Mon Aug 23 11:38:05 1999 *************** *** 61,66 **** --- 61,71 ---- * 3/21/93 Rob McCool * 1995-96 Many changes by the Apache Group * + * Jan-Feb 99 PV. Porting to OpenVMS. Modified ap_make_dirstr_prefix to + * return "/usr/* if directory is "/" or "". Otherwise the stat function fails + * because /usr must point to a valid device name. + * Added "|| defined (VMS)" to other operating system due to lack of support + * of some functions. */ /* Debugging aid: *************** *** 505,510 **** --- 510,521 ---- */ API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n) { + #ifdef VMS + if ((*s == '\0') || (*s == '/' && n == 1)) { + strcpy(d,"/usr"); + d += 4; + } + #endif /* VMS */ for (;;) { *d = *s; if (*d == '\0') { *************** *** 1596,1601 **** --- 1607,1625 ---- if (stat(path, &finfo) == -1) return 0; /* in error condition, just return no */ + #ifdef VMS + if ( !S_ISDIR(finfo.st_mode) ) { + /* + * Work around ambiguity in case where a file named ".;" + * exits in the directory, stat returns the info on that file + * instead of the directory. If path argument ends in '/' assume + * it is a directory. + */ + if ( !path[0] ) return 0; /* null path shouldn't happen */ + if ( path[strlen(path)-1] == '/' ) return 1; + } + #endif + return (S_ISDIR(finfo.st_mode)); } *************** *** 1746,1752 **** #ifdef NEED_INITGROUPS int initgroups(const char *name, gid_t basegid) { ! #if defined(QNX) || defined(MPE) || defined(BEOS) || defined(_OSD_POSIX) || defined(TPF) || defined(__TANDEM) /* QNX, MPE and BeOS do not appear to support supplementary groups. */ return 0; #else /* ndef QNX */ --- 1770,1777 ---- #ifdef NEED_INITGROUPS int initgroups(const char *name, gid_t basegid) { ! #if defined(QNX) || defined(MPE) || defined(BEOS) || defined(_OSD_POSIX) || \ ! defined(TPF) || defined(__TANDEM) || defined(VMS) /* QNX, MPE and BeOS do not appear to support supplementary groups. */ return 0; #else /* ndef QNX */ *************** *** 1834,1840 **** --- 1859,1869 ---- if (name[0] == '#') return (atoi(&name[1])); + #ifdef VMS + if (!(ent = vms_getpwnam(name))) { + #else if (!(ent = getpwnam(name))) { + #endif fprintf(stderr, "%s: bad user name %s\n", ap_server_argv0, name); exit(1); } *************** *** 1844,1850 **** API_EXPORT(gid_t) ap_gname2id(const char *name) { ! #ifdef WIN32 return (1); #else struct group *ent; --- 1873,1879 ---- API_EXPORT(gid_t) ap_gname2id(const char *name) { ! #if defined(WIN32) || defined(VMS) return (1); #else struct group *ent;