hfaxd/FileSystem.c++
/*
 * Like fileAccess, but when the target is a directory.
 * The implicit operation is X_OK and the directory handle
 * returned is for the target, not the containing directory.
 */
Like fileAccess, but when the target is a directory.
The implicit operation is X_OK and the directory handle
returned is for the target, not the containing directory.
Like fileAccess but when the target is a directory . The implicit operation is X_OK and the directory handle returned is for the target not the containing directory .
SpoolDir*
HylaFAXServer::dirAccess(const char* path)
{
    struct stat sb;
    if (!FileCache::lookup(path, sb)) {			
	perror_reply(550, path, errno);
	return (NULL);
    }
    if (!S_ISDIR(sb.st_mode)) {
	perror_reply(550, path, ENOTDIR);
	return (NULL);
    }
    SpoolDir* dir = dirLookup(sb.st_ino);
    if (!dir) {						
	perror_reply(550, path, ENOENT);
	return (NULL);
    } else if (dir->adminOnly && !IS(PRIVILEGED)) {	
	perror_reply(550, path, EPERM);
	return (NULL);
    }
    return (dir);
}
SpoolDir * HylaFAXServer :: dirAccess ( const char * path ) { struct stat sb ; if ( ! FileCache :: lookup ( path , sb ) ) { perror_reply ( 550 , path , errno ) ; return ( NULL ) ; } if ( ! S_ISDIR ( sb . st_mode ) ) { perror_reply ( 550 , path , ENOTDIR ) ; return ( NULL ) ; } SpoolDir * dir = dirLookup ( sb . st_ino ) ; if ( ! dir ) { perror_reply ( 550 , path , ENOENT ) ; return ( NULL ) ; } else if ( dir -> adminOnly && ! IS ( PRIVILEGED ) ) { perror_reply ( 550 , path , EPERM ) ; return ( NULL ) ; } return ( dir ) ; }
Like fileAccess, but when the target is a directory.
Like fileAccess but when the target is a directory .
// file not found // NB: this assumes all directories are top-level // XXX should not happen // requires admin priv's