36 #include <sys/types.h>
38 #include "XrdVersion.hh"
101 strcpy(Buff,
"unix"); Bp = Buff + 5;
106 Bp += strlen(Bp); Blen = (Bp - Buff) + 1;
111 {*Bp =
' '; Blen += (n+1);}
115 Bp = (
char *)malloc(Blen);
116 memcpy(Bp, Buff, Blen);
144 if (strcmp(cred->
buffer,
"unix"))
146 snprintf(msg,
sizeof(msg),
147 "Secunix: Authentication protocol id mismatch (unix != %.4s).",
150 else std::cerr <<msg <<std::endl;
156 bp = credBuff = strdup((cred->
buffer)+5);
157 ep = bp + strlen(bp);
161 while(*bp && *bp ==
' ') bp++;
163 while(*bp && *bp !=
' ') bp++;
168 if (bp >= ep)
return 0;
169 while(*bp && *bp ==
' ') bp++;
200 const char *hostname,
210 {
const char *msg =
"Seckunix: Insufficient memory for protocol.";
212 else std::cerr <<msg <<std::endl;
XrdSecBuffer XrdSecCredentials
XrdSecProtocol * XrdSecProtocolunixObject(const char mode, const char *hostname, XrdNetAddrInfo &endPoint, const char *parms, XrdOucErrInfo *erp)
XrdVERSIONINFO(XrdSecProtocolunixObject, secunix)
char * XrdSecProtocolunixInit(const char mode, const char *parms, XrdOucErrInfo *erp)
int setErrInfo(int code, const char *emsg)
static int UserName(uid_t uID, char *uName, int uNsz)
static int GroupName(gid_t gID, char *gName, int gNsz)
XrdNetAddrInfo * addrInfo
Entity's connection details.
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
char * grps
Entity's group name(s)
char * name
Entity's name.
char * host
Entity's host name dnr dependent.
int Authenticate(XrdSecCredentials *cred, XrdSecParameters **parms, XrdOucErrInfo *einfo=0)
XrdSecCredentials * getCredentials(XrdSecParameters *parm=0, XrdOucErrInfo *einfo=0)
void Delete()
Delete the protocol object. DO NOT use C++ delete() on this object.
friend class XrdSecProtocolDummy
XrdSecProtocolunix(const char *hname, XrdNetAddrInfo &endPoint)
Generic structure to pass security information back and forth.
char * buffer
Pointer to the buffer.
int size
Size of the buffer or length of data in the buffer.