	SUBROUTINE CHKPRIVS(cmd_type, privl)
	IMPLICIT INTEGER(A-Z)

	INTEGER*4 icode
	CHARACTER privs*256, cmd_type*6
	LOGICAL privl
C
	INCLUDE '($LIBDEF)'
	INCLUDE '($JPIDEF)'
        PARAMETER (STR$_MATCH   = 2393113)
        PARAMETER (STR$_NOMATCH = 2392584)
C
	EXTERNAL netmail_nopriv
C
C	Set default strings and logicals.
C
	privl = .false.
C
C	Get running privelges.
C
	icode = LIB$GETJPI(JPI$_PROCPRIV,,,, privs,)
C
C	Does the process have the right privelges.
C
	icode = STR$MATCH_WILD(' ' // privs, '*OPER*')
	if (icode.eq.STR$_MATCH) then
	icode = STR$MATCH_WILD(' ' // privs, '*SYSPRV*')
	 if (icode.eq.STR$_MATCH) privl = .true.
	Endif !Priv check.
C
	return
	end

