[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] svnadmin create --owner --group patch (new feature)

From: John Peacock <jpeacock_at_rowman.com>
Date: 2003-09-16 16:12:51 CEST

brane@xbc.nu wrote:
> I suspected as much. It should be fairly easy to implement them, though.

Except that Win32 is so conceptually different. Even if the repository is
created by a specific user account, unless there is an externally applied ACL,
there is nothing to prevent other users from accessing the files. There is also
no concept of "root" so we would have to require that the user be a member of
the Administrators group. It would be much more complicated and probably would
involve applying an ACL after the repository was created, as opposed to using
impersonation to create the repos as a specific user. I'm not qualified to do
this (for lack of experience programming at this level under Win32).

> I suppose an #ifdef would be appropriate in this case, at least temporarily, as
> long as it's carefully localized. I'd suggest just ignoring the option on
> Windows, not removing the option itself. The option's docstring should indicate
> that it's a no-op on non-Unix systems.

Like this?

$ ./svnadmin create --owner nobody /tmp/test
svn: Client error in parsing arguments
svn: --owner and --group unavailable under Win32
create: usage: svnadmin create REPOS_PATH

Create a new, empty repository at REPOS_PATH. The --owner and --group
options will create the repository with appropriate ownership and
permissions under most Unix-like O/S's (and do nothing on Win32), but
require that svnadmin be run as root.

Valid options:
   --on-disk-template arg : specify template for the on disk structure
   --in-repos-template arg : specify template for the repository structure
   --bdb-txn-nosync : disable fsync at transaction commit [Berkeley DB]
   --config-dir arg : read user configuration files from directory ARG
   --owner arg : create repository owned and usable by user ARG
   --group arg : create repository owned and usable by group ARG

The patch changes to look like this:

> + if (opt_state->owner_id)
> + {
> +#ifdef SVN_WIN32
> + return svn_error_createf (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
> + "--owner and --group unavailable under Win32");
> +#else
> + apr_uid_t retrieved_uid;
> + apr_gid_t retrieved_gid;
> + apr_status_t apr_err;
...snip...

so that all of the Unix specific stuff doesn't exist for Win32...

I'll continue testing and resend the patch tonight if I don't hear otherwise...

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 16 16:13:20 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.