/[pdpsoft]/trunk/grid-mw-security/cgul/fileutil/fileutil.h
ViewVC logotype

Diff of /trunk/grid-mw-security/cgul/fileutil/fileutil.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1509 by msalle, Wed Feb 10 23:32:47 2010 UTC revision 1510 by msalle, Sun Feb 14 12:31:32 2010 UTC
# Line 43  Line 43 
43   *  LCK_READ    - set shared read lock   *  LCK_READ    - set shared read lock
44   *  LCK_WRITE   - set exclusive write lock   *  LCK_WRITE   - set exclusive write lock
45   *  LCK_UNLOCK  - unset lock   *  LCK_UNLOCK  - unset lock
46   * Locks are exclusive for writing and shared for reading: multiple processes can   * Locks are exclusive for writing and shared for reading: multiple processes
47   * read simultaneously, but writing is exclusive, both for reading and writing.   * can read simultaneously, but writing is exclusive, both for reading and
48     * writing.
49   * Returns -1 on error, 0 on success.   * Returns -1 on error, 0 on success.
50   */   */
51  int cgul_filelock(int fd, int lock_type, int action);  int cgul_filelock(int fd, int lock_type, int action);
# Line 61  int cgul_filelock(int fd, int lock_type, Line 62  int cgul_filelock(int fd, int lock_type,
62   * -3: permissions error   * -3: permissions error
63   * -4: memory error   * -4: memory error
64   * -5: too many retries needed during reading   * -5: too many retries needed during reading
65     * -6: locking failed
66   */   */
67  int cgul_read_proxy(const char *path, int lock_type, char **proxy);  int cgul_read_proxy(const char *path, int lock_type, char **proxy);
68    
# Line 78  int cgul_read_proxy(const char *path, in Line 80  int cgul_read_proxy(const char *path, in
80   *                group={root,trust_gid}   *                group={root,trust_gid}
81   * Return values:   * Return values:
82   *  0: succes   *  0: succes
83   *  -1: I/O error   *  -1: I/O error, including when file changed during reading in any way other
84     *      than access time.
85   *  -2: privilege-drop error   *  -2: privilege-drop error
86   *  -3: permission error (untrusted path)   *  -3: permission error (untrusted path)
87   *  -4: memory error   *  -4: memory error
# Line 89  int cgul_read_config(const char *path, c Line 92  int cgul_read_config(const char *path, c
92    
93  /**  /**
94   * Writes proxy from *proxy to *path using given lock_type (see cgul_filelock).   * Writes proxy from *proxy to *path using given lock_type (see cgul_filelock).
95   * It tries to drop privilege to given write_uid, gid_t write_gid. When either   * When (e)uid==0 it tries to drop privilege to given write_uid, write_gid. When
96   * of them is -1, that one is ignored.   * either of these is -1, the real uid/gid is used instead, if one of those is
97     * root, the corresponding effective uid/gid is used instead.
98   * Return values:   * Return values:
99   * 0: success   * 0: success
100   * -1: I/O error   * -1: I/O error
101   * -2: privilege-drop error   * -2: privilege-drop error
102   * -3: permissions error   * -3: permissions error, including file directly in / or not absolute
103     * -4: memory error
104     * -6: locking failed
105   */   */
106  int cgul_write_proxy(const char *path, int lock_type, const char *proxy,  int cgul_write_proxy(const char *path, int lock_type, const char *proxy,
107                       int write_uid, int write_gid);                       int write_uid, int write_gid);
# Line 118  int cgul_write_proxy(const char *path, i Line 124  int cgul_write_proxy(const char *path, i
124   *  -5: invalid template: it MUST end with 6 X's   *  -5: invalid template: it MUST end with 6 X's
125   */   */
126  int cgul_write_uniq_proxy(char *path_template, const char *proxy,  int cgul_write_uniq_proxy(char *path_template, const char *proxy,
127                       int write_uid, int write_gid);                            int write_uid, int write_gid);
128    
129  /**  /**
130   * Behaviour as mkdir -p: create parents where needed.   * Behaviour as mkdir -p: create parents where needed.

Legend:
Removed from v.1509  
changed lines
  Added in v.1510

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28