Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000389.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: CVS Adm Web App Prototype</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000388.html" title="CVS Adm Web App - per repository" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000390.html" title="CVS Adm Web App Conf" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000388.html">&laquo; CVS Adm Web App - per repository</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000390.html">CVS Adm Web App Conf &raquo;</a>
44                      </p>
45
46                      <a id="a000389"></a>
47                      <div class="entry" id="entry-389">
48                         <h3 class="entry-header">CVS Adm Web App Prototype</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <ul>
52   <li>Finished up on a CVS Adm Web App prototype. Still need to adapt this to real CVS repositories on web server</li>
53 </ul>
54                            </div>
55                            <div id="more" class="entry-more">
56                               <p>Vinnie So wrote:</p>
57
58 <blockquote type=cite>
59 Andrew,
60
61 I just cook up the information on what we need to get the cvs user administration project requirement going. Please review and add/modify what you think is necessary. Also, add the information you need.
62
63 --Vinnie
64
65 <hr>
66 <ul>
67   <li>CVS Passwd file format:
68
69   <div class="code"><pre>
70 CVS User Name:Encrypted Password:System User:User Real Name:User Email:Groups</pre></div>
71 <p>Example of passwd file:</p>
72   <div class="code"><pre>
73 adefaria:88ZHm.yYFgFyI:lynxuser:Andrew DeFaria:adefaria@lnxw.com:int,cvsadmin
74 jdoe:78WHm.yYFgFyI:toolsuser:John Doe:jdoe@lnxw.com:tools
75 hyow:78WHm.yYFgFyI::Harry Yow:hyow@lnxw.com:test</pre></div></li>
76
77   <li>Writers file format: This file contains CVS User Name listing who has write only permission access to the CVS repository. One CVS User Name per line.
78
79 <br>Example of writers file:
80
81   <div class="code"><pre>
82 adefaria
83 vso</pre></div></li>
84
85   <li>Readers file format: This file contains CVS User Name listing who has read only permission access to the CVS repository . One CVS User Name per line.
86
87 <br>Example of readers file:
88
89   <div class="code"><pre>
90 int
91 anoncvs</pre></div>
92 </ul>
93 </blockquote>
94
95 <p>Readers/Writers file formats and their interaction is not that clearly defined in the CVS manual. I've attempted to document that <a href="000384.html#more">here</a>. Worse yet, it's even harder to ascertain after the fact from a web application. For example, if the web application is told that user john has only read access to repository X, which of the 5 cases (#2, #5, #7, #8 or #9) should the backend update the readers and writers files to look like?</p>
96
97 <p>Here's my simplification:</p>
98
99 <div class="code"><pre>
100       # CVS readers and writers files are a little weird. We will attempt
101       # to simplify here. If a user has read only access to a repository
102       # then we will explicitly list them in the readers file and make
103       # sure they are not in the writers file. If they have write access
104       # (thus implying read access) then we will arrange for them to be in
105       # the writers file and absent from the readers file as CVS treats
106       # users who are in both files as read only.
107       my $user    = $user_record {userid};
108       my $access  = $user_record {$repository};
109
110       if ($access eq "r") {
111         Remove $cvs_server, $repository, "writers", $user;
112         Add    $cvs_server, $repository, "readers", $user;
113       } elsif ($access eq "rw") {
114         Remove $cvs_server, $repository, "readers", $user;
115         Add    $cvs_server, $repository, "writers", $user;
116       } else {
117         Remove $cvs_server, $repository, "readers", $user;
118         Remove $cvs_server, $repository, "writers", $user;
119       } # if
120 </pre></div>
121
122 <blockquote type=cite>
123 <p># The GUI Interface requirement:</p>
124
125 <p>CVS User cvsroot can to the following once authentication passed:</p>
126
127 <ul>
128   <li>Administer the GUI interface</li>
129 </ul>
130 </blockquote>
131
132 <p>I don't know what that means.</p>
133
134 <blockquote type=cite>
135 <ul>
136   <li>Add/delete attributes list
137   <p>For example:</p>
138   <div class="code"><pre>
139 group - int, csadmin, ce, engr, tools
140 system users - lynxuser, gduser, toolsuser</pre></div></li>
141 </ul>
142
143 <p>CVS User belonging to group "cvsadmin" shall be able to do the following once authentication passed:</p>
144
145 <ul>
146   <li>Add user</li>
147
148   <li>Delete user</li>
149
150   <li>Modify user's attributes</li>
151
152   <li>Change user's permission to the cvs repository by modifying writer or readers files.</li>
153 </ul>
154
155 <p>CVS User not belonging to group "cvsadmin" shall be able to do the following once authentication passed:</p>
156
157 <ul>
158   <li>Change its own password</li>
159 </ul>
160 </blockquote>
161
162 <p>Well a prototype is up and running at http://saturn/cvsadm. First select a server then a repository. All files (passwd, groups, sysusers, readers, writers) are kept at the repository level and world write access is current required to the files. Locally I have set the cvsroot password to cvsroot123 (that is the CVS user's password not the system cvsroot user's password) so you can login as cvsroot then use Admin to edit other users, etc. Users who are members of the group cvsadm are considered no different than cvsroot themselves as they can add/change/delete users, groups and sysusers (the group cvsadm and the sysuser cvsroot cannot be deleted). Play around with it and let me know what you think.</p>
163
164 <p>Note, if a cvsroot user deletes a group the web app is smart enough to go back through the passwd file and remove the removed group from the users lists. So, for example, if vso is a member of int,badgroup,tools those groups will be listed in his passwd entry. If the cvsroot user deletes badgroup then vso's passwd entry will be adjusted to just int,tools. Also, if the cvsroot user edits tools to change it to toolchain then vso's passwd entry will then read int,toolchain.</p>
165
166 <p>With sysusers it's a little different. Technically sysusers should equate to bona fide Unix usernames. Yet there is no easy way to insure this. For one, how would the web server gain access to /etc/passwd on a remote machine? Also, sysusers are stored in a file in the repository's CVSROOT directory and can easily become out of date WRT that server's /etc/passwd file. So no checks are made to insure that a sysuser is indeed a Unix userid.</p>
167
168 <p>Finally, while if cvsroot edits say the sysuser lynxuser -> lynuxosuser, the passwd file will be modified by also changing all lynxuser's -> lynxosuser's. However if cvsroot deletes sysuser lynxuser the passwd file is not changed to remove the sysuser from the passwd lines. Doing so changes the meaning of the user entirely.</p>
169
170 <p>The backend, however, will need to change to properly handle the security of the various files as well as to properly use CVS to maintain a history (i.e. check out admin files, change them and check them in). The current thought is to set up the apache user as having login rights for cvsroot from the web server only.</p>
171
172 <p>In order for this to work we need to:</p>
173
174 <ul>
175   <li>Create groups and sysusers files for each &lt;host&gt;:&lt;repository&gt;</li>
176
177   <li>Add groups and sysusers files to checkoutlist so that CVS considers them part of the administrative files set.</li>
178
179   <li>Have cvsroot perform a cvs -d :pserver:cvsroot@&lt;host&gt;:&lt;repository&gt; login for each and every host:repository combination as whatever the apache user will be on the web server</li>
180 </ul>
181
182 <p>Then the web app has to change to use a file store created by issuing a cvs co CVSROOT for the host/repository it is working on (and/or possibly a cvs update). Finally the web app needs to change to perform the necessary commit after a file (groups, sysusers, readers or writers - passwd will be handled differently - see <a href="http://www.network-theory.co.uk/docs/cvsmanual/cvs_30.html">http://www.network-theory.co.uk/docs/cvsmanual/cvs_30.html</a> - bottom of the page) has been changed with an appropriate checkin comment. Still at issue is how to handle the passwd file.</p>
183
184 <p>This should be done (setup) on the web server instead of my desktop. We should, perhaps, create a dummy repository for testing.</p>
185
186 <p>Let me know when this is available so I can start testing there.</p>
187
188                            </div>
189                         </div>
190                         <p class="entry-footer">
191                            <span class="post-footers">Posted by  on July 19, 2005  4:54 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000389.html">Permalink</a>
192                         </p>
193                      </div>
194
195                      
196
197                      
198                   </div>
199                </div>
200             </div>
201          </div>
202       </div>
203    </div>
204 </body>
205 </html>