Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fix Fossil's handling of file permission bits on systems which have ACL's. In that case, group permissions can give unexpected values, which results in unnecessary slowdown repeatedly trying to unset the flags which doesn't work. More explanation: [https://cygwin.com/faq/faq.html#faq.using.ssh-pubkey-stops-working]. Noted on latest Cygwin (1.7.34) which added support for ACL handling. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
3d0e8c01fe45d0167b55e72de228f147 |
| User & Date: | jan.nijtmans 2015-02-08 10:20:49.192 |
Context
|
2015-02-08
| ||
| 18:02 | Fix a typo in artifact descriptions. check-in: 88ed51221d user: drh tags: trunk | |
| 10:20 | Fix Fossil's handling of file permission bits on systems which have ACL's. In that case, group permissions can give unexpected values, which results in unnecessary slowdown repeatedly trying to unset the flags which doesn't work. More explanation: [https://cygwin.com/faq/faq.html#faq.using.ssh-pubkey-stops-working]. Noted on latest Cygwin (1.7.34) which added support for ACL handling. check-in: 3d0e8c01fe user: jan.nijtmans tags: trunk | |
| 00:22 | Fix formatting issues on the object description in /artifact check-in: ca30907b0e user: drh tags: trunk | |
Changes
Changes to src/file.c.
| ︙ | ︙ | |||
228 229 230 231 232 233 234 |
void symlink_copy(const char *zFrom, const char *zTo){
Blob content;
blob_read_link(&content, zFrom);
symlink_create(blob_str(&content), zTo);
blob_reset(&content);
}
| < < < < < < < < < | < | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
void symlink_copy(const char *zFrom, const char *zTo){
Blob content;
blob_read_link(&content, zFrom);
symlink_create(blob_str(&content), zTo);
blob_reset(&content);
}
/*
** Return file permissions (normal, executable, or symlink):
** - PERM_EXE if file is executable;
** - PERM_LNK on Unix if file is symlink and allow-symlinks option is on;
** - PERM_REG for all other cases (regular file, directory, fifo, etc).
*/
int file_wd_perm(const char *zFilename){
if( getStat(zFilename, 1) ) return PERM_REG;
#if defined(_WIN32)
# ifndef S_IXUSR
# define S_IXUSR _S_IEXEC
# endif
if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 )
return PERM_EXE;
else
return PERM_REG;
#else
if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 )
return PERM_EXE;
else if( g.allowSymlinks && S_ISLNK(fileStat.st_mode) )
return PERM_LNK;
else
return PERM_REG;
#endif
}
|
| ︙ | ︙ | |||
439 440 441 442 443 444 445 |
int file_wd_setexe(const char *zFilename, int onoff){
int rc = 0;
#if !defined(_WIN32)
struct stat buf;
if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
if( onoff ){
int targetMode = (buf.st_mode & 0444)>>2;
| | | | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
int file_wd_setexe(const char *zFilename, int onoff){
int rc = 0;
#if !defined(_WIN32)
struct stat buf;
if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
if( onoff ){
int targetMode = (buf.st_mode & 0444)>>2;
if( (buf.st_mode & 0100) == 0 ){
chmod(zFilename, buf.st_mode | targetMode);
rc = 1;
}
}else{
if( (buf.st_mode & 0100) != 0 ){
chmod(zFilename, buf.st_mode & ~0111);
rc = 1;
}
}
#endif /* _WIN32 */
return rc;
}
|
| ︙ | ︙ |