Back to index

glibc  2.9
Functions
nis_verifygroup.c File Reference
#include <string.h>
#include <rpcsvc/nis.h>

Go to the source code of this file.

Functions

nis_error nis_verifygroup (const_nis_name group)

Function Documentation

nis_error nis_verifygroup ( const_nis_name  group)

Definition at line 24 of file nis_verifygroup.c.

{
  if (group != NULL && group[0] != '\0')
    {
      size_t grouplen = strlen (group);
      char buf[grouplen + 50];
      char leafbuf[grouplen + 2];
      char domainbuf[grouplen + 2];
      nis_result *res;
      nis_error status;
      char *cp, *cp2;

      cp = stpcpy (buf, nis_leaf_of_r (group, leafbuf, sizeof (leafbuf) - 1));
      cp = stpcpy (cp, ".groups_dir");
      cp2 = nis_domain_of_r (group, domainbuf, sizeof (domainbuf) - 1);
      if (cp2 != NULL && cp2[0] != '\0')
       {
         *cp++ = '.';
         stpcpy (cp, cp2);
       }
      res = nis_lookup (buf, 0);
      status = NIS_RES_STATUS (res);
      nis_freeresult (res);
      return status;
    }
  else
    return NIS_FAIL;
}

Here is the call graph for this function: