---
name: "globus_gsi_sysconfig_get_proxy_filename_unix"
section: "3"
platform: "linux"
package: "libglobus-gsi-sysconfig-doc"
version: "9.6-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gsi_sysconfig_unix"
---

# globus\_gsi\_sysconfig\_get\_proxy\_filename\_unix(3)

Functions for UNIX platforms - Functions for UNIX platforms.

Part of [globus\_gsi\_sysconfig\_unix(3)](/globus_gsi_sysconfig_unix/3.md).

## NAME

globus\_gsi\_sysconfig\_unix - Functions for UNIX platforms

 \- Functions for UNIX platforms.

## SYNOPSIS

### Functions

globus\_result\_t **globus\_gsi\_sysconfig\_set\_key\_permissions\_unix** (char \*filename)\
 UNIX - Set Key Permissions.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_user\_id\_string\_unix** (char \*\*user\_id\_string)\
 UNIX - Get User ID.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_username\_unix** (char \*\*username)\
 UNIX - Get Username.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_proc\_id\_string\_unix** (char \*\*proc\_id\_string)\
 UNIX - Get Process ID.  globus\_result\_t **globus\_gsi\_sysconfig\_make\_absolute\_path\_for\_filename\_unix** (char \*filename, char \*\*absolute\_path)\
 UNIX - Make Absolute Path.  globus\_result\_t **globus\_gsi\_sysconfig\_split\_dir\_and\_filename\_unix** (char \*full\_filename, char \*\*dir\_string, char \*\*filename\_string)\
 UNIX - Split Directory and Filename.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_current\_working\_dir\_unix** (char \*\*working\_dir)\
 UNIX - Get Current Working Directory.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_home\_dir\_unix** (char \*\*home\_dir)\
 UNIX - Get HOME Directory

Get the HOME Directory of the current user. Should be the $HOME environment variable. " globus\_result\_t **globus\_gsi\_sysconfig\_file\_exists\_unix** (const char \*filename)\
 UNIX - File Exists.  globus\_result\_t **globus\_gsi\_sysconfig\_dir\_exists\_unix** (const char \*filename)\
 UNIX - Directory Exists.  globus\_result\_t **globus\_gsi\_sysconfig\_check\_keyfile\_unix** (const char \*filename)\
 UNIX - Check File Status for Key.  globus\_result\_t **globus\_gsi\_sysconfig\_check\_keyfile\_uid\_unix** (const char \*filename, uid\_t uid)\
 UNIX - Check File Status for Key.  globus\_result\_t **globus\_gsi\_sysconfig\_check\_certfile\_unix** (const char \*filename)\
 UNIX - Check File Status for Cert.  globus\_result\_t **globus\_gsi\_sysconfig\_check\_certfile\_uid\_unix** (const char \*filename, uid\_t uid)\
 UNIX - Check File Status for Cert.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_cert\_dir\_unix** (char \*\*cert\_dir)\
 UNIX - Get Trusted CA Cert Dir.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_user\_cert\_filename\_unix** (char \*\*user\_cert, char \*\*user\_key)\
 UNIX - Get User Certificate and Key Filenames.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_host\_cert\_filename\_unix** (char \*\*host\_cert, char \*\*host\_key)\
 UNIX - Get Host Certificate and Key Filenames.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_service\_cert\_filename\_unix** (char \*service\_name, char \*\*service\_cert, char \*\*service\_key)\
 UNIX - Get Service Certificate and Key Filenames.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_proxy\_filename\_unix** (char \*\*user\_proxy, **globus\_gsi\_proxy\_file\_type\_t** proxy\_file\_type)\
 UNIX - Get Proxy Filename.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_signing\_policy\_filename\_unix** (X509\_NAME \*ca\_name, char \*cert\_dir, char \*\*signing\_policy\_filename)\
 UNIX - Get Signing Policy Filename.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_ca\_cert\_files\_unix** (char \*ca\_cert\_dir, globus\_fifo\_t \*ca\_cert\_list)\
 UNIX - Get CA Cert Filenames.  globus\_result\_t **globus\_gsi\_sysconfig\_remove\_all\_owned\_files\_unix** (char \*default\_filename)\
 UNIX - Remove all proxies owned by current uid.  globus\_result\_t **globus\_gsi\_sysconfig\_is\_superuser\_unix** (int \*is\_superuser)\
 UNIX - Check if the current user is root.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_gridmap\_filename\_unix** (char \*\*filename)\
 UNIX - Get the path and file name of the grid map file.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_authz\_conf\_filename\_unix** (char \*\*filename)\
 UNIX - Get the path of authorization callback configuration.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_authz\_lib\_conf\_filename\_unix** (char \*\*filename)\
 UNIX - Get the path and file name of the authorization callback configuration file.  globus\_result\_t **globus\_gsi\_sysconfig\_get\_gaa\_conf\_filename\_unix** (char \*\*filename)\
 UNIX - Get the path and file name of the gaa configuration file.

## Detailed Description

Functions for UNIX platforms.

These functions implement the UNIX version of the Globus GSI System Configuration API. **They should never be called directly, please use the provided platform independent defines.**

## Function Documentation

### globus\_result\_t globus\_gsi\_sysconfig\_check\_certfile\_uid\_unix (const char \* filename, uid\_t uid)

UNIX - Check File Status for Cert. This is a convenience function used to check the status of a certificate file. The desired status is the current user has ownership and read/write permissions, while group and others only have read permissions.

**Parameters**

*filename* The name of the file to check the status of \
 *uid* The user id that may be the owner of the file

**Returns**

GLOBUS\_SUCCESS if the status of the file was able to be determined. Otherwise, an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_check\_certfile\_unix (const char \* filename)

UNIX - Check File Status for Cert. This is a convenience function used to check the status of a certificate file. The desired status is the current user has ownership and read/write permissions, while group and others only have read permissions.

**Parameters**

*filename* The name of the file to check the status of

**Returns**

GLOBUS\_SUCCESS if the status of the file was able to be determined. Otherwise, an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_check\_keyfile\_uid\_unix (const char \* filename, uid\_t uid)

UNIX - Check File Status for Key. This is a convenience function used to check the status of a private key file. The desired status is only the specified user has ownership and read permissions, everyone else should not be able to access it.

**Parameters**

*filename* The name of the file to check the status of \
 *uid* The owner of the file to check the status of

**Returns**

GLOBUS\_SUCCESS if the status of the file was able to be determined. Otherwise, an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_check\_keyfile\_unix (const char \* filename)

UNIX - Check File Status for Key. This is a convenience function used to check the status of a private key file. The desired status is only the current user has ownership and read permissions, everyone else should not be able to access it.

**Parameters**

*filename* The name of the file to check the status of

**Returns**

GLOBUS\_SUCCESS if the status of the file was able to be determined. Otherwise, an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_dir\_exists\_unix (const char \* filename)

UNIX - Directory Exists. Check if the directory exists

**Parameters**

*filename* The filename of the directory to check for

**Returns**

GLOBUS\_SUCCESS if the directory exists, otherwise an error object identifier.

### globus\_result\_t globus\_gsi\_sysconfig\_file\_exists\_unix (const char \* filename)

UNIX - File Exists. Check if the file exists

**Parameters**

*filename* The filename of the file to check for

**Returns**

GLOBUS\_SUCCESS if the file exists and is readable, otherwise an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_get\_authz\_conf\_filename\_unix (char \*\* filename)

UNIX - Get the path of authorization callback configuration. Get the path and file name of the authorization callback configuration file

**Parameters**

*filename* Contains the location of the authorization callback configuration file upon successful return

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_get\_authz\_lib\_conf\_filename\_unix (char \*\* filename)

UNIX - Get the path and file name of the authorization callback configuration file. Get the path and file name of the authorization callback configuration file

**Parameters**

*filename* Contains the location of the authorization callback configuration file upon successful return

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_get\_ca\_cert\_files\_unix (char \* ca\_cert\_dir, globus\_fifo\_t \* ca\_cert\_list)

UNIX - Get CA Cert Filenames. Gets a list of trusted CA certificate filenames in a trusted CA certificate directory. \

**Parameters**

*ca\_cert\_dir* The trusted CA certificate directory to get the filenames from \
 *ca\_cert\_list* The resulting list of CA certificate filenames. This is a a globus list structure. \

**See also**

globus\_fifo\_t

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_get\_cert\_dir\_unix (char \*\* cert\_dir)

UNIX - Get Trusted CA Cert Dir. Get the Trusted Certificate Directory containing the trusted Certificate Authority certificates. This directory is determined in the order shown below. Failure in one method results in attempting the next.

- 1\.

  **X509\_CERT\_DIR environment variable** - if this is set, the trusted certificates will be searched for in that directory. This variable allows the end user to specify the location of trusted certificates.

- 2\.

  **$HOME/.globus/certificates** - If this directory exists, and the previous methods of determining the trusted certs directory failed, this directory will be used. \

- 3\.

  **/etc/grid-security/certificates** - This location is intended to be independent of the globus installation ($GLOBUS\_LOCATION), and is generally only writeable by the host system administrator. \

- 4\.

  **$GLOBUS\_LOCATION/share/certificates**

**Parameters**

*cert\_dir* The trusted certificates directory

**Returns**

GLOBUS\_SUCCESS if no error occurred, and a sufficient trusted certificates directory was found. Otherwise, an error object identifier returned.

### globus\_result\_t globus\_gsi\_sysconfig\_get\_current\_working\_dir\_unix (char \*\* working\_dir)

UNIX - Get Current Working Directory. Get the current working directory on the system. \

**Parameters**

*working\_dir* The current working directory

**Returns**

GLOBUS\_SUCCESS or an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_get\_gaa\_conf\_filename\_unix (char \*\* filename)

UNIX - Get the path and file name of the gaa configuration file. Get the path and file name of the GAA configuration file

**Parameters**

*filename* Contains the location of the GAA callback configuration file upon successful return

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_get\_gridmap\_filename\_unix (char \*\* filename)

UNIX - Get the path and file name of the grid map file. Get the path and file name of the grid map file.

**Parameters**

*filename* Contains the location of the grid map file upon successful return

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_get\_home\_dir\_unix (char \*\* home\_dir)

UNIX - Get HOME Directory

Get the HOME Directory of the current user. Should be the $HOME environment variable.

**Parameters**

*home\_dir* The home directory of the current user

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object is returned.

### globus\_result\_t globus\_gsi\_sysconfig\_get\_host\_cert\_filename\_unix (char \*\* host\_cert, char \*\* host\_key)

UNIX - Get Host Certificate and Key Filenames. Get the Host Certificate and Key Filenames based on the current user's environment. The host cert and key are searched for in the following locations (in order):

- 1\.

  X509\_USER\_CERT and X509\_USER\_KEY environment variables

- 2\.

  *$GLOBUS\_LOCATION*/etc/host\[cert\|key\].pem

- 3\.

  *$HOME*/.globus/host\[cert\|key\].pem

**Parameters**

*host\_cert* pointer to the host certificate filename \
 *host\_key* pointer to the host key filename

**Returns**

GLOBUS\_SUCCESS if the host cert and key were found, otherwise an error object identifier is returned

### globus\_result\_t globus\_gsi\_sysconfig\_get\_proc\_id\_string\_unix (char \*\* proc\_id\_string)

UNIX - Get Process ID. Get a unique string representing the current process. This is just the pid converted to a string. \

**Parameters**

*proc\_id\_string* A unique string representing the process

**Returns**

GLOBUS\_SUCCESS unless an error occurred

### globus\_result\_t globus\_gsi\_sysconfig\_get\_proxy\_filename\_unix (char \*\* user\_proxy, globus\_gsi\_proxy\_file\_type\_t proxy\_file\_type)

UNIX - Get Proxy Filename. Get the proxy cert filename based on the following search order:

- 1\.

  X509\_USER\_PROXY environment variable - This environment variable is set by the at run time for the specific application. If the proxy\_file\_type variable is set to GLOBUS\_PROXY\_OUTPUT (a proxy filename for writing is requested), and the X509\_USER\_PROXY is set, this will be the resulting value of the user\_proxy filename string passed in. If the proxy\_file\_type is set to GLOBUS\_PROXY\_INPUT and X509\_USER\_PROXY is set, but the file it points to does not exist, or has some other readability issues, the function will continue checking using the other methods available.

- 2\.

  Check the default location for the proxy file of \\/tmp\\/x509\_u\\\<user\_id\\\> where \\\<user id\\\> is some unique string for that user on the host

**Parameters**

*user\_proxy* the proxy filename of the user \
 *proxy\_file\_type* Switch for determining whether to return a existing proxy filename or if a filename suitable for creating a proxy should be returned

**Returns**

GLOBUS\_SUCCESS or an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_get\_service\_cert\_filename\_unix (char \* service\_name, char \*\* service\_cert, char \*\* service\_key)

UNIX - Get Service Certificate and Key Filenames. Get the Service Certificate Filename based on the current user's environment. The host cert and key are searched for in the following locations (in order):

- 1\.

  X509\_USER\_CERT and X509\_USER\_KEY environment variables

- 2\.

  \\/etc\\/grid-security\\/{service\_name}\\/{service\_name}\[cert\|key\].pem

- 3\.

  GLOBUS\_LOCATION\\/etc\\/{service\_name}\\/{service\_name}\[cert\|key\].pem So for example, if my service was named: myservice, the location of the certificate would be: GLOBUS\_LOCATION\\/etc\\/myservice\\/myservicecert.pem

- 4\.

  \\\<users home\\\>\\/.globus\\/{service\_name}\\/{service\_name}\[cert\|key\].pem

**Parameters**

*service\_name* The name of the service which allows us to determine the locations of cert and key files to look for \
 *service\_cert* pointer to the host certificate filename \
 *service\_key* pointer to the host key filename

**Returns**

GLOBUS\_SUCCESS if the service cert and key were found, otherwise an error object identifier

### globus\_result\_t globus\_gsi\_sysconfig\_get\_signing\_policy\_filename\_unix (X509\_NAME \* ca\_name, char \* cert\_dir, char \*\* signing\_policy\_filename)

UNIX - Get Signing Policy Filename. Get the Signing Policy Filename on the current system, based on the CA's subject name, and the trusted certificates directory

**Parameters**

*ca\_name* The X509 subject name of the CA to get the signing policy of. The hash of the CA is generated from this\
 *cert\_dir* The trusted CA certificates directory, containing the singing\_policy files of the trusted CA's.\
 *signing\_policy\_filename* The resulting singing\_policy filename

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID

### globus\_result\_t globus\_gsi\_sysconfig\_get\_user\_cert\_filename\_unix (char \*\* user\_cert, char \*\* user\_key)

UNIX - Get User Certificate and Key Filenames. Get the User Certificate Filename based on the current user's environment. The following locations are searched for cert and key files in order:

- 1\.

  environment variables X509\_USER\_CERT and X509\_USER\_KEY

- 2\.

  $HOME/.globus/usercert.pem and $HOME/.globus/userkey.pem

- 3\.

  $HOME/.globus/usercred.p12 - this is a PKCS12 credential

**Parameters**

*user\_cert* pointer the filename of the user certificate \
 *user\_key* pointer to the filename of the user key

**Returns**

GLOBUS\_SUCCESS if the cert and key files were found in one of the possible locations, otherwise an error object identifier is returned

### globus\_result\_t globus\_gsi\_sysconfig\_get\_user\_id\_string\_unix (char \*\* user\_id\_string)

UNIX - Get User ID. Get a unique string representing the current user. This is just the uid converted to a string. \

**Parameters**

*user\_id\_string* A unique string representing the user

**Returns**

GLOBUS\_SUCCESS unless an error occurred

### globus\_result\_t globus\_gsi\_sysconfig\_get\_username\_unix (char \*\* username)

UNIX - Get Username. Get the username of the current user.

**Parameters**

*username* This parameter will contain the current user name upon a successful return. It is the users responsibility to free memory allocated for this return value.

**Returns**

GLOBUS\_SUCCESS unless an error occurred

### globus\_result\_t globus\_gsi\_sysconfig\_is\_superuser\_unix (int \* is\_superuser)

UNIX - Check if the current user is root. Checks whether the current user is root.

**Parameters**

*is\_superuser* 1 if the user is the superuser 0 if not

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_make\_absolute\_path\_for\_filename\_unix (char \* filename, char \*\* absolute\_path)

UNIX - Make Absolute Path. Make the filename into an absolute path string based on the current working directory.

**Parameters**

*filename* the filename to get the absolute path of. \

*absolute\_path* The resulting absolute path. This needs to be freed when no longer needed.

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_remove\_all\_owned\_files\_unix (char \* default\_filename)

UNIX - Remove all proxies owned by current uid. Removes all proxies (ie. all delegated and grid-proxy-init generated proxies) found in the secure tmp directory that are owned by the current user.

**Parameters**

*default\_filename* The filename of the default proxy

**Returns**

GLOBUS\_SUCCESS if no error occurred, otherwise an error object ID is returned

### globus\_result\_t globus\_gsi\_sysconfig\_set\_key\_permissions\_unix (char \* filename)

UNIX - Set Key Permissions. Set the file permissions of a file to read-write only by the user which are the permissions that should be set for all private keys.

**Parameters**

*filename*

**Returns**

GLOBUS\_SUCCESS or an error object id

### globus\_result\_t globus\_gsi\_sysconfig\_split\_dir\_and\_filename\_unix (char \* full\_filename, char \*\* dir\_string, char \*\* filename\_string)

UNIX - Split Directory and Filename. Split the directory and filename portions of a filename string into two separate strings

**Parameters**

*full\_filename* The filename to split. Splits on the last occurrence of '/' where the directory is everything before the last '/', and the filename is everything after. \
 *dir\_string* \
\
  The directory portion of the filename string. If no '/' is found throughout the string, this variable points to NULL. This needs to be freed when no longer needed. \
 *filename\_string* The filename portion of the filename string. If no '/' is found throughout, this variable is a duplicate of the full\_filename parameter. This needs to be freed when no longer needed.

**Returns**

GLOBUS\_SUCCESS if no error occurred. Otherwise an error object ID is returned.

## Author

Generated automatically by Doxygen for globus\_gsi\_sysconfig from the source code.
