vattrib(1)

Name

vattrib - Read or modify attributes of a source in the Vesta repository

Synopsis

vattrib [options] [source...] [options [source...] ...]

Contents

Description

See the vesta-intro man page's Terminology section for definitions of terms, and its Name Interpretation section for an explanation of how names are looked up.

The vattrib command reads or modifies the mutable attributes of a source in the Vesta repository.

If source is omitted, it defaults to ".". If source is unqualified (does not have "/", ".", or ".." as its first arc), it is interpreted relative to ".". If source is a symbolic link, vattrib does not follow the link. If no flags are given, the default is "-m -T -l": print the master status, type tag, and all attribute names and values. If the -t flag is not given and a timestamp is required, the timestamp defaults to the current time.

A source has attributes if its parent directory is appendable or mutable. In addition, /vesta and /vesta-work have attributes. Other sources do not. In all cases below except -x, -m, and -T, if the specified source does not have attributes, vattrib prints an error message on standard error and exits with status 2. In all cases, if the specified source does not exist in the Vesta repository, vattrib prints a message on standard error and exits with status 2. For parameter syntax errors, vattrib prints a usage summary on standard error and exits with status 3.

To modify most attributes requires only write access. To modify an attribute whose name begins with "#", you must have owner access. In addition, to add a user name to the #setuid attribute, you must be either root or the named user; to add a group name to the #setgid attribute, you must be either root or a member of the named group. Reading attributes is unrestricted. For access control errors, vattrib prints a message on standard error and exits with status 2.

A single vattrib invocation can examine/modify multiple objects. Both multiple sources for one operation and multiple different operations can be combined in one vattrib call. The -R, -M, and -H flags affect all sources appearing after them until the end of the command line or until the next -R or -H flag accordingly.

Flags

-R repos
This flag may be used in any of the command forms shown below. It causes vattrib to operate on repos instead of the default local repository. The repository is specified by host name and TCP port number in the format host:port. The :port portion may be omitted; it defaults to [Repository]VestaSourceSRPC_port.
-M
This flag may be used in any of the command forms shown below. It causes vattrib to locate the repository with the master copy of source and operate on it instead of the local repository. (Note that this option doesn't work if source starts with "/vesta-work".)
-H hints
This flag may be used in any of the command forms shown below, but is only used with the -M flag. If vattrib fails to find the master copy of an object in either the local repository or any of those repositories listed in [UserInterface]DefaultHints, you can suggest additional repositories for it to look in using this option. The hints argument is a comma- or space-separated list of repositories, specified by host name and TCP port number in the format host:port. The :port portion may be omitted; it defaults to [Repository]VestaSourceSRPC_port.
vattrib [-q] -x [source]
Print true and exit with status 0 if source has attributes. Print false and exit with status 1 if it does not. If -q is given, the true or false output is suppressed.
vattrib -m [source]
Print the master status of source, either master or nonmaster. This flag can be used alone or in combination with the other flags listed below. If -m and -T are used together, both values are printed on the same line.
vattrib -q -m [source]
Exit with status 0 if source is master and 1, otherwise. Can not be used with other flags except for -R, -M and -H flags.
vattrib -T [source]
Print the type tag of source, normally one of the following: immutableFile, mutableFile, immutableDirectory, appendableDirectory, mutableDirectory, ghost, stub. This flag can be used alone or in combination with the other flags listed below. If -m and -T are used together, both values are printed on the same line.
vattrib [-q] -C value [source]
Compare the type tag of source to value. Print true if they are equal and exit with status 0. Otherwise print false and exit with status 1. If -q is given, the output is suppressed. If value is not one of the valid type strings (immutableFile, mutableFile, immutableDirectory, appendableDirectory, mutableDirectory, ghost or stub), print invalid type and exit with status 2.
vattrib -L [source]
Print last-modified time of source if it is not stub or ghost.
vattrib [-q] -i attrib value [source]
Print true and exit with status 0 if value is a member of the set bound to attrib of source. Print false and exit with status 1 if not. If -q is given, the true or false output is suppressed.
vattrib -g attrib [source]
Print the set of values for attrib of source, one per line.
vattrib [-q] -G attrib [source]
Print one value for attrib of source. If attrib has an empty value set, exit with status 1, and print an error message on stderr unless -q is given.
vattrib -n [source]
Print each attribute name of source that has a nonempty value set, one per line.
vattrib -l [source]
For each attribute of source that has a nonempty value set, print the attribute name, followed by the set of values. Each attribute name and each value appears on a new line, and values are indented by one tab character.
vattrib -h [source]
Print the recorded attribute history of source (see VestaSource.H).
vattrib [-t timestamp] -s attrib value [source]
Bind attrib of source to the singleton set {value}. If present, timestamp is a time_t in decimal (or hexadecimal if it begins with 0x, or octal if it begins with 0).
vattrib [-t timestamp] -c attrib [source]
Bind attrib of source to the empty set; i.e., unbind it. If present, timestamp is a time_t in decimal (or hexadecimal if it begins with 0x, or octal if it begins with 0).
vattrib [-t timestamp] -a attrib value [source]
Add value to the set that is bound to attrib of source. If present, timestamp is a time_t in decimal (or hexadecimal if it begins with 0x, or octal if it begins with 0).
vattrib [-t timestamp] -r attrib value [source]
Remove value from the set that is bound to attrib of source. It is not an error for value not to have been in the set. If present, timestamp is a time_t in decimal (or hexadecimal if it begins with 0x, or octal if it begins with 0).

Configuration

The following values are obtained from the [UserInterface] section of the Vesta configuration file (vesta.cfg).

AppendableRootName
The filename under which the global root directory of Vesta repositories is mounted. Ordinarily set to /vesta.
MutableRootName
The filename under which the local tree of mutable directories provided by Vesta is mounted. Ordinarily set to /vesta-work.
DefaultPackageParent
The default directory to put new packages in. Ordinarily a subdirectory of the appendable root, named with an Internet domain name belonging to the local site.
DefaultWorkParent
The default parent directory for mutable working directory trees belonging to individual users. Ordinarily the same as the mutable root.
realm
Global user names are formed by appending @realm to the local name.
TimeFormat
A format string for strftime(3) to produce time strings for Vesta attributes. A common setting is "%a %b %e %T %Z %Y".
DefaultHints
A comma- or space-separated list of additional repositories to search for the master copy of an object. Each repository is specified by host name and TCP port number in the format host:port. The :port portion may be omitted; it defaults to [Repository]VestaSourceSRPC_port. This setting is optional.

The following values are obtained from the [Repository] section of the Vesta configuration file.

VestaSourceSRPC_host
The host name of the default (local) repository.
VestaSourceSRPC_port
The default TCP port number for repositories.

Limitations

Flags which affect the exit status of vattrib cannot be used with multiple sources: -x, -i, -C and -q -m.

If you wish to perform multiple attribute changes to the same source, you will have to explicitly list the path to the source, once for each change. For example:

vattrib -r \it{attrib} \it{old-value} /vesta/example.com -a \it{attrib} \it{new-value} /vesta/example.com

See Also

vesta-intro(1), repos-ui(1)

See the VestaSource class for a full explanation of mutable attributes.

Author

Tim Mann

Last modified on Mon Nov 22 17:26:46 EST 2004 by ken@xorian.net         
     modified on Tue Nov 16 16:33:57 EST 2004 by irina.furman@intel.com 
     modified on Tue Apr 29 23:59:52 PDT 2003 by mann
This page was generated automatically by mtex software.