static bool check_file_permissions()

in common/util.hpp [23:39]


    static bool check_file_permissions( std::string filename )
    {
        struct stat st;

        if ( lstat( filename.c_str(), &st ) == -1 )
        {
            return false;
        }

        // S_IWOTH - Write permission bit for other users. Usually 02.
        if ( ( st.st_uid != 0 ) || ( st.st_gid != 0 ) || ( st.st_mode & S_IWOTH ) )
        {
            return false;
        }

        return true;
    }