bluestar 发表于 2013-1-27 05:27:22

CVS thinks I'm Administrator, not myself

(原文)http://www.gigascale.org/softdevel/faq/19.html
Christopher Brooks, 29 Oct 2001
Last updated: 14 Nov 2004
If, under Windows, when you run cvs updateyou areprompted for the Administrator password on the CVSrepository, or you have permission problems writing to files, then you may need to set up /etc/passwdon machine to include your name and UID.
Location of /etc/passwd

Note that the actual location of /etc/passwdvaries depending on where you installed Cygwin.If Cygwin is installed in c:/cygwin, then/etc/passwd will actually end up inc:/cygwin/etc/passwd
.
mkpasswd

The easiest way to update /etc/passwdis to run the mkpasswd command thatis included with the Cygwin toolkit.Usually, when Cygwin is installed, mkpasswdis run and /etc/passwd is automaticallycreated.If your account was added after Cygwin wasinstalled, then you may need to run mkpasswd by hand.
mkpasswd -help will print outthe help for mkpasswd.
Below are a few scenarios for updating /etc/passwd:
Your machine is in a windows domain

If your Windows machine is a member of a Windowsdomain, use this command to add yourself to /etc/passwd:
mkpasswd -d | grep yourlogin > /etc/passwdNote that if your domain is rather large, thenmkpasswd -d could take a minute to complete.
Your machine is not in a Windows domain

To generate /etc/passwd for all the localWindows accounts, try:
mkpasswd -l > /etc/passwdYour home directory

/etc/passwd also defines where your homedirectory is.Usually, Cygwin will set your initial default home directory to/home/yourname, which mapsto c:/cygwin/home/yourname.
Unfortunately, tools like Java do not know aboutthe Cygwin directory mapping, so you may want toreset your home directory to a location outside ofthe Cygwin tree.
For example, if your home directory was atc:/users/yourname, then Cygwinwould find this as /cygdrive/c/users/yourname becauseCygwin mounts the c: drive as/cygdrive/cTo set up Cygwin so that it finds your home directory,edit c:/cygwin/etc/passwd and changeyour home directory from /home/yournameto /cygdrive/c/users/yourname
Set up /etc/passwd by hand

Stephen Neuendorffer suggests
Edit /etc/passwd and add a new line that containsyour information.
username::userid:groupid:fullName:home directory:/bin/sh
Your username and fullname should be obvious. If you forget these, then CVS probably won't be much useto you!Your home directory is probably/home/username.Your groupid should probably bethe same as the administrator and your userid should besome unique number that is not used elsewhere in the fileand less than 65535.Adding one to thelargest number in the file will probably work.Another suggestion for obtaining a userid is to lookat your entry in /etc/passwd on a Unix machineand use that number.
mkgroup

There is also a mkgroup commandthat is similar to mkpasswd.mkgroup can be used to create/etc/group:
mkgroup -l > /etc/groupOther resources

The CVS Account Name FAQ covers howto use a CVS repository with a login that is differentthan your current login.Note that even if you configureyour system to properly use a different login on the cvs server, then you may still have permission problems ifyou do not have /etc/passwd set upproperly.
页: [1]
查看完整版本: CVS thinks I'm Administrator, not myself