Qt 4.8
Public Functions | Public Variables | List of all members
QTransportAuth::Data Struct Reference

#include <qtransportauth_qws.h>

Public Functions

bool connection () const
 Is the transport connection oriented. More...
 
 Data ()
 
 Data (unsigned char p, int d)
 
void setConnection (bool)
 Assert that the transport is connection oriented. More...
 
void setTrusted (bool)
 Assert that the transport is trusted. More...
 
bool trusted () const
 Is the transport trusted. More...
 

Public Variables

unsigned int descriptor
 
pid_t processId
 
unsigned char progId
 
unsigned char properties
 
unsigned char status
 

Detailed Description

Definition at line 108 of file qtransportauth_qws.h.

Constructors and Destructors

◆ Data() [1/2]

QTransportAuth::Data::Data ( )
inline

Definition at line 110 of file qtransportauth_qws.h.

110 { processId = -1; }

◆ Data() [2/2]

QTransportAuth::Data::Data ( unsigned char  p,
int  d 
)
inline

Functions

◆ connection()

bool QTransportAuth::Data::connection ( ) const
inline

Is the transport connection oriented.

This is true iff once a connection has been accepted, and state established, then further messages over the transport are guaranteed to have come from the original connecting entity. This is for example true for Unix Domain Sockets, but not for shared memory or UDP sockets.

By extension if the transport is not trusted() then it should not be assumed to be connection oriented, since spoofed connection information could be created. For example if we assume the TCP/IP transport is trusted, it can be treated as connection oriented; but this is only the case if intervening routers are trusted.

Connection oriented transports have authorization cached against the connection, and thus authorization is only done at connect time.

Definition at line 341 of file qtransportauth_qws.cpp.

Referenced by QTransportAuth::authToMessage(), and QAuthDevice::recvReadyRead().

342 {
343  return (bool)(properties & Connection);
344 }

◆ setConnection()

void QTransportAuth::Data::setConnection ( bool  t)
inline

Assert that the transport is connection oriented.

See also
connection()

Definition at line 351 of file qtransportauth_qws.cpp.

◆ setTrusted()

void QTransportAuth::Data::setTrusted ( bool  t)
inline

Assert that the transport is trusted.

For example with respect to shared memory, if it is ensured that no untrusted root processes are running, and that unix permissions have been set such that any untrusted non-root processes do not have access rights, then a shared memory transport could be asserted to be trusted.

See also
trusted()

Definition at line 320 of file qtransportauth_qws.cpp.

◆ trusted()

bool QTransportAuth::Data::trusted ( ) const
inline

Is the transport trusted.

This is true iff data written into the transport medium cannot be intercepted or modified by another process. This is for example true for Unix Domain Sockets, but not for shared memory or UDP sockets.

There is of course an underlying assumption that the kernel implementing the transport is sound, ie it cannot be compromised by writing to /dev/kmem or loading untrusted modules

Definition at line 305 of file qtransportauth_qws.cpp.

Referenced by QTransportAuth::authFromMessage(), and QTransportAuth::authToMessage().

306 {
307  return (bool)(properties & Trusted);
308 }

Properties

◆ descriptor

unsigned int QTransportAuth::Data::descriptor

Definition at line 124 of file qtransportauth_qws.h.

◆ processId

pid_t QTransportAuth::Data::processId

◆ progId

unsigned char QTransportAuth::Data::progId

◆ properties

unsigned char QTransportAuth::Data::properties

Definition at line 121 of file qtransportauth_qws.h.

◆ status

unsigned char QTransportAuth::Data::status

The documentation for this struct was generated from the following files: