Lines 42-47
Link Here
|
42 |
static int rc_symlink(hctransaction_t trans, struct HCHead *); |
42 |
static int rc_symlink(hctransaction_t trans, struct HCHead *); |
43 |
static int rc_rename(hctransaction_t trans, struct HCHead *); |
43 |
static int rc_rename(hctransaction_t trans, struct HCHead *); |
44 |
static int rc_utimes(hctransaction_t trans, struct HCHead *); |
44 |
static int rc_utimes(hctransaction_t trans, struct HCHead *); |
|
|
45 |
static int rc_lutimes(hctransaction_t trans, struct HCHead *); |
45 |
static int rc_geteuid(hctransaction_t trans, struct HCHead *); |
46 |
static int rc_geteuid(hctransaction_t trans, struct HCHead *); |
46 |
static int rc_getgroups(hctransaction_t trans, struct HCHead *); |
47 |
static int rc_getgroups(hctransaction_t trans, struct HCHead *); |
47 |
|
48 |
|
Lines 80-85
Link Here
|
80 |
{ HC_GETGROUPS, rc_getgroups }, |
81 |
{ HC_GETGROUPS, rc_getgroups }, |
81 |
{ HC_SCANDIR, rc_scandir }, |
82 |
{ HC_SCANDIR, rc_scandir }, |
82 |
{ HC_READFILE, rc_readfile }, |
83 |
{ HC_READFILE, rc_readfile }, |
|
|
84 |
{ HC_LUTIMES, rc_lutimes }, |
83 |
}; |
85 |
}; |
84 |
|
86 |
|
85 |
static int chown_warning; |
87 |
static int chown_warning; |
Lines 1817-1822
Link Here
|
1817 |
if (path == NULL) |
1819 |
if (path == NULL) |
1818 |
return(-2); |
1820 |
return(-2); |
1819 |
return(utimes(path, times)); |
1821 |
return(utimes(path, times)); |
|
|
1822 |
} |
1823 |
|
1824 |
/* |
1825 |
* LUTIMES |
1826 |
*/ |
1827 |
int |
1828 |
hc_lutimes(struct HostConf *hc, const char *path, const struct timeval *times) |
1829 |
{ |
1830 |
hctransaction_t trans; |
1831 |
struct HCHead *head; |
1832 |
|
1833 |
if (hc == NULL || hc->host == NULL) |
1834 |
return(lutimes(path, times)); |
1835 |
|
1836 |
trans = hcc_start_command(hc, HC_LUTIMES); |
1837 |
hcc_leaf_string(trans, LC_PATH1, path); |
1838 |
hcc_leaf_int64(trans, LC_ATIME, times[0].tv_sec); |
1839 |
hcc_leaf_int64(trans, LC_MTIME, times[1].tv_sec); |
1840 |
if ((head = hcc_finish_command(trans)) == NULL) |
1841 |
return(-1); |
1842 |
if (head->error) |
1843 |
return(-1); |
1844 |
return(0); |
1845 |
} |
1846 |
|
1847 |
static int |
1848 |
rc_lutimes(hctransaction_t trans, struct HCHead *head) |
1849 |
{ |
1850 |
struct HCLeaf *item; |
1851 |
struct timeval times[2]; |
1852 |
const char *path; |
1853 |
|
1854 |
bzero(times, sizeof(times)); |
1855 |
path = NULL; |
1856 |
|
1857 |
FOR_EACH_ITEM(item, trans, head) { |
1858 |
switch(item->leafid) { |
1859 |
case LC_PATH1: |
1860 |
path = HCC_STRING(item); |
1861 |
break; |
1862 |
case LC_ATIME: |
1863 |
times[0].tv_sec = HCC_INT64(item); |
1864 |
break; |
1865 |
case LC_MTIME: |
1866 |
times[1].tv_sec = HCC_INT64(item); |
1867 |
break; |
1868 |
} |
1869 |
} |
1870 |
if (ReadOnlyOpt) { |
1871 |
head->error = EACCES; |
1872 |
return (0); |
1873 |
} |
1874 |
if (path == NULL) |
1875 |
return(-2); |
1876 |
return(lutimes(path, times)); |
1820 |
} |
1877 |
} |
1821 |
|
1878 |
|
1822 |
uid_t |
1879 |
uid_t |