|
libsmbclient
|
Functions | |
| int | smbc_stat (const char *url, struct stat *st) |
| int | smbc_fstat (int fd, struct stat *st) |
| int | smbc_statvfs (char *url, struct statvfs *st) |
| int | smbc_fstatvfs (int fd, struct statvfs *st) |
| int | smbc_ftruncate (int fd, off_t size) |
| int | smbc_chmod (const char *url, mode_t mode) |
| int | smbc_utimes (const char *url, struct timeval *tbuf) |
| int | smbc_setxattr (const char *url, const char *name, const void *value, size_t size, int flags) |
| int | smbc_lsetxattr (const char *url, const char *name, const void *value, size_t size, int flags) |
| int | smbc_fsetxattr (int fd, const char *name, const void *value, size_t size, int flags) |
| int | smbc_getxattr (const char *url, const char *name, const void *value, size_t size) |
| int | smbc_lgetxattr (const char *url, const char *name, const void *value, size_t size) |
| int | smbc_fgetxattr (int fd, const char *name, const void *value, size_t size) |
| int | smbc_removexattr (const char *url, const char *name) |
| int | smbc_lremovexattr (const char *url, const char *name) |
| int | smbc_fremovexattr (int fd, const char *name) |
| int | smbc_listxattr (const char *url, char *list, size_t size) |
| int | smbc_llistxattr (const char *url, char *list, size_t size) |
| int | smbc_flistxattr (int fd, char *list, size_t size) |
Functions used to view or change file and directory attributes
| int smbc_chmod | ( | const char * | url, |
| mode_t | mode | ||
| ) |
Change the permissions of a file.
| url | The smb url of the file or directory to change permissions of |
| mode | The permissions to set:
|
| int smbc_fgetxattr | ( | int | fd, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size | ||
| ) |
Get extended attributes for a file.
| fd | A file descriptor associated with an open file (as previously returned by smbc_open(), to get extended attributes for. |
| name | The name of an attribute to be retrieved. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter will return a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| value | A pointer to a buffer in which the value of the specified attribute will be placed (unless size is zero). |
| size | The size of the buffer pointed to by value. This parameter may also be zero, in which case the size of the buffer required to hold the attribute value will be returned, but nothing will be placed into the value buffer. |
| int smbc_flistxattr | ( | int | fd, |
| char * | list, | ||
| size_t | size | ||
| ) |
List the supported extended attribute names associated with a file
| fd | A file descriptor associated with an open file (as previously returned by smbc_open(), to get extended attributes for. |
| list | A pointer to a buffer in which the list of attributes for the specified file or directory will be placed (unless size is zero). |
| size | The size of the buffer pointed to by list. This parameter may also be zero, in which case the size of the buffer required to hold all of the attribute names will be returned, but nothing will be placed into the list buffer. |
| int smbc_fremovexattr | ( | int | fd, |
| const char * | name | ||
| ) |
Remove extended attributes for a file. This is used for modifying a file's security descriptor (i.e. owner, group, and access control list)
| fd | A file descriptor associated with an open file (as previously returned by smbc_open(), to get extended attributes for. |
| name | The name of an attribute to be removed. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter will return a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| int smbc_fsetxattr | ( | int | fd, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags | ||
| ) |
Set extended attributes for a file. This is used for modifying a file's security descriptor (i.e. owner, group, and access control list)
| fd | A file descriptor associated with an open file (as previously returned by smbc_open(), to get extended attributes for. |
| name | The name of an attribute to be changed. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter should contain a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| value | The value to be assigned to the specified attribute name. This buffer should contain only the attribute value if the name was of the "system.nt_sec_desc.<attribute_name>" form. If the name was of the "system.nt_sec_desc.*" form then a complete security descriptor, with name:value pairs separated by tabs, commas, or newlines (not spaces!), should be provided in this value buffer. A complete security descriptor will contain one or more entries selected from the following: |
REVISION:<revision number>=""> OWNER:<sid or="" name>=""> GROUP:<sid or="" name>=""> ACL:<sid or="" name>="">:<type>/<flags>/<mask>
The revision of the ACL specifies the internal Windows NT ACL revision for the security descriptor. If not specified it defaults to 1. Using values other than 1 may cause strange behaviour.
The owner and group specify the owner and group sids for the object. If the attribute name (either '*+' with a complete security descriptor, or individual 'owner+' or 'group+' attribute names) ended with a plus sign, the specified name is resolved to a SID value, using the server on which the file or directory resides. Otherwise, the value should be provided in SID-printable format as S-1-x-y-z, and is used directly. The <sid or="" name>=""> associated with the ACL: attribute should be provided similarly.
| size | The number of the bytes of data in the value buffer |
| flags | A bit-wise OR of zero or more of the following: SMBC_XATTR_FLAG_CREATE - fail if the named attribute already exists SMBC_XATTR_FLAG_REPLACE - fail if the attribute does not already exist |
If neither flag is specified, the specified attributes will be added or replace existing attributes of the same name, as necessary.
| int smbc_fstat | ( | int | fd, |
| struct stat * | st | ||
| ) |
Get file information via an file descriptor.
| fd | Open file handle from smbc_open() or smbc_creat() |
| st | pointer to a buffer that will be filled with standard Unix struct stat information. |
| int smbc_fstatvfs | ( | int | fd, |
| struct statvfs * | st | ||
| ) |
Get file system information via an file descriptor.
| fd | Open file handle from smbc_open(), smbc_creat(), or smbc_opendir() |
| st | pointer to a buffer that will be filled with standard Unix struct statvfs information. |
| int smbc_ftruncate | ( | int | fd, |
| off_t | size | ||
| ) |
Truncate a file given a file descriptor
| fd | Open file handle from smbc_open() or smbc_creat() |
| size | size to truncate the file to |
| int smbc_getxattr | ( | const char * | url, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size | ||
| ) |
Get extended attributes for a file.
| url | The smb url of the file or directory to get extended attributes for. |
| name | The name of an attribute to be retrieved. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter will return a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| value | A pointer to a buffer in which the value of the specified attribute will be placed (unless size is zero). |
| size | The size of the buffer pointed to by value. This parameter may also be zero, in which case the size of the buffer required to hold the attribute value will be returned, but nothing will be placed into the value buffer. |
| int smbc_lgetxattr | ( | const char * | url, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size | ||
| ) |
Get extended attributes for a file. The POSIX function which this maps to would act on a symbolic link rather than acting on what the symbolic link points to, but with no symbolic links in SMB file systems, this function is functionally identical to smbc_getxattr().
| url | The smb url of the file or directory to get extended attributes for. |
| name | The name of an attribute to be retrieved. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter will return a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| value | A pointer to a buffer in which the value of the specified attribute will be placed (unless size is zero). |
| size | The size of the buffer pointed to by value. This parameter may also be zero, in which case the size of the buffer required to hold the attribute value will be returned, but nothing will be placed into the value buffer. |
| int smbc_listxattr | ( | const char * | url, |
| char * | list, | ||
| size_t | size | ||
| ) |
List the supported extended attribute names associated with a file
| url | The smb url of the file or directory to list the extended attributes for. |
| list | A pointer to a buffer in which the list of attributes for the specified file or directory will be placed (unless size is zero). |
| size | The size of the buffer pointed to by list. This parameter may also be zero, in which case the size of the buffer required to hold all of the attribute names will be returned, but nothing will be placed into the list buffer. |
| int smbc_llistxattr | ( | const char * | url, |
| char * | list, | ||
| size_t | size | ||
| ) |
List the supported extended attribute names associated with a file The POSIX function which this maps to would act on a symbolic link rather than acting on what the symbolic link points to, but with no symbolic links in SMB file systems, this function is functionally identical to smbc_listxattr().
| url | The smb url of the file or directory to list the extended attributes for. |
| list | A pointer to a buffer in which the list of attributes for the specified file or directory will be placed (unless size is zero). |
| size | The size of the buffer pointed to by list. This parameter may also be zero, in which case the size of the buffer required to hold all of the attribute names will be returned, but nothing will be placed into the list buffer. |
| int smbc_lremovexattr | ( | const char * | url, |
| const char * | name | ||
| ) |
Remove extended attributes for a file. This is used for modifying a file's security descriptor (i.e. owner, group, and access control list) The POSIX function which this maps to would act on a symbolic link rather than acting on what the symbolic link points to, but with no symbolic links in SMB file systems, this function is functionally identical to smbc_removexattr().
| url | The smb url of the file or directory to remove the extended attributes for. |
| name | The name of an attribute to be removed. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter will return a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| int smbc_lsetxattr | ( | const char * | url, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags | ||
| ) |
Set extended attributes for a file. This is used for modifying a file's security descriptor (i.e. owner, group, and access control list). The POSIX function which this maps to would act on a symbolic link rather than acting on what the symbolic link points to, but with no symbolic links in SMB file systems, this function is functionally identical to smbc_setxattr().
| url | The smb url of the file or directory to set extended attributes for. |
| name | The name of an attribute to be changed. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter should contain a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| value | The value to be assigned to the specified attribute name. This buffer should contain only the attribute value if the name was of the "system.nt_sec_desc.<attribute_name>" form. If the name was of the "system.nt_sec_desc.*" form then a complete security descriptor, with name:value pairs separated by tabs, commas, or newlines (not spaces!), should be provided in this value buffer. A complete security descriptor will contain one or more entries selected from the following: |
REVISION:<revision number>=""> OWNER:<sid or="" name>=""> GROUP:<sid or="" name>=""> ACL:<sid or="" name>="">:<type>/<flags>/<mask>
The revision of the ACL specifies the internal Windows NT ACL revision for the security descriptor. If not specified it defaults to 1. Using values other than 1 may cause strange behaviour.
The owner and group specify the owner and group sids for the object. If the attribute name (either '*+' with a complete security descriptor, or individual 'owner+' or 'group+' attribute names) ended with a plus sign, the specified name is resolved to a SID value, using the server on which the file or directory resides. Otherwise, the value should be provided in SID-printable format as S-1-x-y-z, and is used directly. The <sid or="" name>=""> associated with the ACL: attribute should be provided similarly.
| size | The number of the bytes of data in the value buffer |
| flags | A bit-wise OR of zero or more of the following: SMBC_XATTR_FLAG_CREATE - fail if the named attribute already exists SMBC_XATTR_FLAG_REPLACE - fail if the attribute does not already exist |
If neither flag is specified, the specified attributes will be added or replace existing attributes of the same name, as necessary.
| int smbc_removexattr | ( | const char * | url, |
| const char * | name | ||
| ) |
Remove extended attributes for a file. This is used for modifying a file's security descriptor (i.e. owner, group, and access control list)
| url | The smb url of the file or directory to remove the extended attributes for. |
| name | The name of an attribute to be removed. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter will return a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| int smbc_setxattr | ( | const char * | url, |
| const char * | name, | ||
| const void * | value, | ||
| size_t | size, | ||
| int | flags | ||
| ) |
Set extended attributes for a file. This is used for modifying a file's security descriptor (i.e. owner, group, and access control list)
| url | The smb url of the file or directory to set extended attributes for. |
| name | The name of an attribute to be changed. Names are of one of the following forms: |
system.nt_sec_desc.<attribute name>=""> system.nt_sec_desc.* system.nt_sec_desc.*+
where <attribute name>=""> is one of:
revision owner owner+ group group+ acl:<name or="" sid>=""> acl+:<name or="" sid>="">
In the forms "system.nt_sec_desc.*" and "system.nt_sec_desc.*+", the asterisk and plus signs are literal, i.e. the string is provided exactly as shown, and the value parameter should contain a complete security descriptor with name:value pairs separated by tabs, commas, or newlines (not spaces!).
The plus sign ('+') indicates that SIDs should be mapped to names. Without the plus sign, SIDs are not mapped; rather they are simply converted to a string format.
| value | The value to be assigned to the specified attribute name. This buffer should contain only the attribute value if the name was of the "system.nt_sec_desc.<attribute_name>" form. If the name was of the "system.nt_sec_desc.*" form then a complete security descriptor, with name:value pairs separated by tabs, commas, or newlines (not spaces!), should be provided in this value buffer. A complete security descriptor will contain one or more entries selected from the following: |
REVISION:<revision number>=""> OWNER:<sid or="" name>=""> GROUP:<sid or="" name>=""> ACL:<sid or="" name>="">:<type>/<flags>/<mask>
The revision of the ACL specifies the internal Windows NT ACL revision for the security descriptor. If not specified it defaults to 1. Using values other than 1 may cause strange behaviour.
The owner and group specify the owner and group sids for the object. If the attribute name (either '*+' with a complete security descriptor, or individual 'owner+' or 'group+' attribute names) ended with a plus sign, the specified name is resolved to a SID value, using the server on which the file or directory resides. Otherwise, the value should be provided in SID-printable format as S-1-x-y-z, and is used directly. The <sid or="" name>=""> associated with the ACL: attribute should be provided similarly.
| size | The number of the bytes of data in the value buffer |
| flags | A bit-wise OR of zero or more of the following: SMBC_XATTR_FLAG_CREATE - fail if the named attribute already exists SMBC_XATTR_FLAG_REPLACE - fail if the attribute does not already exist |
If neither flag is specified, the specified attributes will be added or replace existing attributes of the same name, as necessary.
| int smbc_stat | ( | const char * | url, |
| struct stat * | st | ||
| ) |
Get information about a file or directory.
| url | The smb url to get information for |
| st | pointer to a buffer that will be filled with standard Unix struct stat information. |
| int smbc_statvfs | ( | char * | url, |
| struct statvfs * | st | ||
| ) |
Get file system information for a specified path.
| url | The smb url to get information for |
| st | pointer to a buffer that will be filled with standard Unix struct statvfs information. |
| int smbc_utimes | ( | const char * | url, |
| struct timeval * | tbuf | ||
| ) |
Change the last modification time on a file
| url | The smb url of the file or directory to change the modification time of |
| tbuf | An array of two timeval structures which contains, respectively, the desired access and modification times. NOTE: Only the tv_sec field off each timeval structure is used. The tv_usec (microseconds) portion is ignored. |
1.7.4