---
name: "rpc_gss_set_svc_name"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/rpc_gss_set_svc_name"
---

# rpc\_gss\_set\_svc\_name(3)

Associate a GSS-API service principal with an RPC service

## NAME

**rpc\_gss\_set\_svc\_name** – Associate a GSS-API service principal with an RPC service

## LIBRARY

library “librpcsec\_gss”

## SYNOPSIS

**#include \<rpc/rpcsec\_gss.h\>**

*bool\_t*\

**rpc\_gss\_set\_svc\_name**(*const char \*principal*, *const char \*mechanism*, *u\_int req\_time*, *u\_int program*, *u\_int version*);

## DESCRIPTION

This function registers a service principal which will be used to authenticate RPCSEC\_GSS security contexts for a given RPC program and version.

## PARAMETERS

- principal

  A string representing the service principal in the form "service@hostname"

- mechanism

  The name of the security mechanism

- req\_time

  The time in seconds that the service credentials should remain valid. See [gss\_acquire\_cred(3)](/gss_acquire_cred/3.md) for more details. principal.

- program

  RPC program number for this service

- version

  RPC program version for this service

## RETURN VALUES

Returns TRUE if the service principal was registered or FALSE otherwise.

## SEE ALSO

[gss\_acquire\_cred(3)](/gss_acquire_cred/3.md), [gssapi(3)](/gssapi/3.md), [rpc(3)](/rpc/3.md), [rpcsec\_gss(3)](/rpcsec_gss/3.md)

## HISTORY

The **rpc\_gss\_set\_svc\_name** function first appeared in FreeBSD 8.0.

## AUTHORS

This manual page was written by Doug Rabson ⟨*dfr@FreeBSD.org*⟩.
