+ struct passwd *pw;
+ char *file;
+ int len = strlen(cfg.owner) + strlen(GIT_ACL_FILE) + 8;
+
+ pw = getpwnam(cfg.owner);
+ if (!pw)
+ die("owner %s has no passwd entry?", cfg.owner);
+ len = strlen(pw->pw_dir) + strlen(GIT_ACL_FILE) + 2;
+ file = xmalloc(sizeof(char) * len);
+ sprintf(file, "%s/%s", pw->pw_dir, GIT_ACL_FILE);
+ fprintf(stderr, "[someday check %s]\n", file);
+ free(file);
+ return 2; /* assume read/write for now */
+}
+
+static int git_check_access(const char *cmd, const char *repo, const char *user)
+{
+ int rw = 1; /* 0=no access, 1=read only, 2=read/write */
+
+ /* What access is required per the incoming command? */
+ if (!strcmp(cmd, "git-upload-pack") ||
+ !strcmp(cmd, "git-upload-archive"))
+ rw = 2;
+
+ /* Return true (1) if the user permissions >= those required */
+ return (git_acl(user, repo) >= rw) ? 1 : 0;