Fossil

Check-in [5e47d555]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merged in fix from Andy B. which resolves mis-resolution of db file name when fossil is run as root (chroot-related). Haiku OS runs everything as root.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5e47d555e4770445328a34f8a46f6487b75192f6
User & Date: stephan 2014-04-30 16:35:21
Context
2014-04-30
17:36
changelog update for root-user enhancement. check-in: 3fd95992 user: stephan tags: trunk
16:35
Merged in fix from Andy B. which resolves mis-resolution of db file name when fossil is run as root (chroot-related). Haiku OS runs everything as root. check-in: 5e47d555 user: stephan tags: trunk
07:54
On second thought, make this also work for fossil server as well which has the same problem. Closed-Leaf check-in: 644e78cc user: andybradford tags: pending-review
07:43
If Openssl is available, use its sha1 implementation. Suggested by Baruch Burstein. check-in: 379309b6 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

1264
1265
1266
1267
1268
1269
1270



1271
1272
1273
1274
1275
1276
1277
    if( stat(zRepo, &sStat)!=0 ){
      fossil_fatal("cannot stat() repository: %s", zRepo);
    }
    i = setgid(sStat.st_gid);
    i = i || setuid(sStat.st_uid);
    if(i){
      fossil_fatal("setgid/uid() failed with errno %d", errno);



    }
  }
#endif
  return zRepo;
}

/*







>
>
>







1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
    if( stat(zRepo, &sStat)!=0 ){
      fossil_fatal("cannot stat() repository: %s", zRepo);
    }
    i = setgid(sStat.st_gid);
    i = i || setuid(sStat.st_uid);
    if(i){
      fossil_fatal("setgid/uid() failed with errno %d", errno);
    }
    if( g.db==0 && file_isfile(zRepo) ){
      db_open_repository(zRepo);
    }
  }
#endif
  return zRepo;
}

/*