Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2005_07_17.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: July 17, 2005 - July 23, 2005 Archives</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/week_2005_07_10.html" title="July 10, 2005 - July 16, 2005" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2005_07_24.html" title="July 24, 2005 - July 30, 2005" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/week_2005_07_10.html">&laquo; July 10, 2005 - July 16, 2005</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2005_07_24.html">July 24, 2005 - July 30, 2005 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">July 22, 2005</h2>
44                      <a id="a000392"></a>
45                      <div class="entry" id="entry-392">
46                         <h3 class="entry-header">Porting Perl -> LOS178</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <ul>
50   <li>Started implementing a CVS Checkout/Update in CVSAdm</li>
51
52   <li>Jas asked me to look into porting Perl -> LOS178 3.0.0</li>
53 </ul>
54                               
55                               <h3>Porting Perl -> LOS178 3.0.0</h3>
56
57 <p>I was asked to attempt to port Perl (latest version - 5.8.7) to LOS178 (latest version - 3.0.0 20050719). Here's what I attempted:</p>
58
59 <ul>
60   <li>Downloaded perl-5.8.7 from perl.com (http://www.perl.com/download.csp#stable)</li>
61
62   <li>Extracted to europa:/build/perl-5.8.7</li>
63
64   <li>Extracted from 20050719:
65
66   <ul>
67     <li>3000-04.los178_rsc_src.tar.gz</li>
68
69     <li>3001-05.los178_src.tar.gz</li>
70
71     <li>3013-05.los178_dev.tar.gz</li>
72
73     <li>3015-04.los178_rsc_dev.tar.gz</li>
74   </ul>
75
76   to /build/3.0.0/los178</li>
77
78   <li>Extracted ppc.cdklinux.tar.gz from bin-image (DEV_LOS178_3p0p0_ppc_20050719)</li>
79
80   <li>Sourced SETUP.bash</li>
81 </ul>
82
83 <p>Next I went to /build/perl-5.8.7 and ran Configure. I was supprised to see that it had a selection for lynxos! Unfortunately this is not the way to go.</p>
84
85 <p>Spoke with Ed Mooring, who happens to be a Perl porter and who had previously ported Perl 5.6 to LynxOS 4.0. He suggested I attempt to run Configure natively on a LynxOS 4.0 machine to get config.sh to be generated. I could then use that in conjunction with reading about the <i>Perl Patch Pumpkin</i> (Apparently a guide about patching and porting) in an attempt to figure out what needs to be done to that config.sh to get a cross build to LOS178 3.0.0. (Note that I used a LynxOS 5.0 machine not a LynxOS 4.0 machine)</p>
86
87 <p>After going through the long Configure process and hopefully answering questions properly Ed said I should attempt a native build anyway. Build failed with:</p>
88 <div class="code"><pre>
89     `sh  cflags "optimize='-O'" mg.o`  mg.c
90               CCCMD =  gcc -DPERL_CORE -c -DEXTRA_F_IN_SEMUN_BUF -D__NO_INCLUDE_WARN__ -fno-strict-aliasing -pipe -I/usr/local/include -O  -Wall
91     mg.c:74: conflicting types for `setegid'
92     /usr/include/unistd.h:410: previous declaration of `setegid'
93     /usr/include/netinet/in.h:512: warning: `ntohs' declared `static' but never defined
94     /usr/include/netinet/in.h:514: warning: `ntohl' declared `static' but never defined
95     make: *** [mg.o] Error 1
96 </pre></div>
97                               
98                               <p class="entry-footer">
99                                  <span class="post-footers">Posted by  at  5:03 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000392.html">Permalink</a>
100                                  
101                                  
102                               </p>
103                            </div>
104                         </div>
105                      </div>
106                      
107                      
108
109                      <h2 class="date-header">July 21, 2005</h2>
110                      <a id="a000391"></a>
111                      <div class="entry" id="entry-391">
112                         <h3 class="entry-header">Ants and Docs</h3>
113                         <div class="entry-content">
114                            <div class="entry-body">
115                               <ul>
116   <li>Spent most of the day dealing with ants and documenting the LOS178 2.1.0 Build Procedure</li>
117 </ul>
118                               
119                               <p class="entry-footer">
120                                  <span class="post-footers">Posted by  at  3:52 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000391.html">Permalink</a>
121                                  
122                                  
123                               </p>
124                            </div>
125                         </div>
126                      </div>
127                      
128                      
129
130                      <h2 class="date-header">July 20, 2005</h2>
131                      <a id="a000390"></a>
132                      <div class="entry" id="entry-390">
133                         <h3 class="entry-header">CVS Adm Web App Conf</h3>
134                         <div class="entry-content">
135                            <div class="entry-body">
136                               <ul>
137   <li>CVS Adm Web App now uses files under &lt;DocumentRoot&gt;/cvsadm/&lt;cvs_server&gt;/&lt;repository&gt;/CVSROOT</li>
138
139   <li>CVS Adm Web App now uses a cvsadm.conf file to configure the servers and repositories it will consider working on.</li>
140
141   <li>Need to implement the cvs checkout of CVSROOT</li>
142 </ul>
143                               
144                               <h3>New File Store</h3>
145
146 <p>Instead of relying on network access to a file store under /&lt;cvs_server&gt;-cvs/&lt;repository&gt;/CVSROOT/etc... we now instead rely on it directly under &lt;DocumentRoot&gt;/cvsadm. This also will allow us to create/refresh that area using cvs checkout CVSROOT instead. The checkout portion has not yet been implemented because currently I cannot checkout CVSROOT due to lack of permissions. I have asked Vinnie to create a test repository so I can play with this and not damage anybody.</p>
147
148 <h3>cvsadm.conf</h3>
149
150 <p>Also, instead of having a simple list of CVS servers and hoping that /&lt;cvs_server&gt;-cvs is a network path to that server's CVS repositories a scheme was designed to use a configuration file. Soon cvs checkout CVSROOT will be used to populate a different file store to work on and when files are modified cvs commit's will commit them to the actual CVS repositories. This also has the effect of defining and perhaps limiting exactly which servers and repositories CVS Adm Web App is even allowed to work on.</p>
151
152 <p>The format of the config file is simple. Here's an example:</p>
153
154 <div class="code"><pre>
155 ################################################################################
156 #
157 # File:         cvsadm/cvsadm.conf
158 # Description:  Identifies the CVS servers and repositories per server
159 # Author:       Andrew@DeFaria.com
160 # Created:      Thu Jul  7 16:54:07 PDT 2005
161 # Modified:
162 # Language:     Perl
163 #
164 # (c) Copyright 2005, LynuxWorks Inc., all rights reserved.
165 #
166 ################################################################################
167 # Format: &lt;host&gt; &lt;respository&gt;
168 rock    los178-cvs
169 t3      X-cvs
170 t3      bootloader-cvs
171 t3      gcc-cvs
172 t3      lynxos-cvs
173 t3      results-cvs
174 t3      spyker-cvs
175 t3      tst-cvs
176 t3      yaboot-cvs
177 tomcat  hybrid-os-cvs
178 </pre></div>
179                               
180                               <p class="entry-footer">
181                                  <span class="post-footers">Posted by  at  3:35 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000390.html">Permalink</a>
182                                  
183                                  
184                               </p>
185                            </div>
186                         </div>
187                      </div>
188                      
189                      
190
191                      <h2 class="date-header">July 19, 2005</h2>
192                      <a id="a000389"></a>
193                      <div class="entry" id="entry-389">
194                         <h3 class="entry-header">CVS Adm Web App Prototype</h3>
195                         <div class="entry-content">
196                            <div class="entry-body">
197                               <ul>
198   <li>Finished up on a CVS Adm Web App prototype. Still need to adapt this to real CVS repositories on web server</li>
199 </ul>
200                               
201                               <p>Vinnie So wrote:</p>
202
203 <blockquote type=cite>
204 Andrew,
205
206 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.
207
208 --Vinnie
209
210 <hr>
211 <ul>
212   <li>CVS Passwd file format:
213
214   <div class="code"><pre>
215 CVS User Name:Encrypted Password:System User:User Real Name:User Email:Groups</pre></div>
216 <p>Example of passwd file:</p>
217   <div class="code"><pre>
218 adefaria:88ZHm.yYFgFyI:lynxuser:Andrew DeFaria:adefaria@lnxw.com:int,cvsadmin
219 jdoe:78WHm.yYFgFyI:toolsuser:John Doe:jdoe@lnxw.com:tools
220 hyow:78WHm.yYFgFyI::Harry Yow:hyow@lnxw.com:test</pre></div></li>
221
222   <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.
223
224 <br>Example of writers file:
225
226   <div class="code"><pre>
227 adefaria
228 vso</pre></div></li>
229
230   <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.
231
232 <br>Example of readers file:
233
234   <div class="code"><pre>
235 int
236 anoncvs</pre></div>
237 </ul>
238 </blockquote>
239
240 <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>
241
242 <p>Here's my simplification:</p>
243
244 <div class="code"><pre>
245       # CVS readers and writers files are a little weird. We will attempt
246       # to simplify here. If a user has read only access to a repository
247       # then we will explicitly list them in the readers file and make
248       # sure they are not in the writers file. If they have write access
249       # (thus implying read access) then we will arrange for them to be in
250       # the writers file and absent from the readers file as CVS treats
251       # users who are in both files as read only.
252       my $user    = $user_record {userid};
253       my $access  = $user_record {$repository};
254
255       if ($access eq "r") {
256         Remove $cvs_server, $repository, "writers", $user;
257         Add    $cvs_server, $repository, "readers", $user;
258       } elsif ($access eq "rw") {
259         Remove $cvs_server, $repository, "readers", $user;
260         Add    $cvs_server, $repository, "writers", $user;
261       } else {
262         Remove $cvs_server, $repository, "readers", $user;
263         Remove $cvs_server, $repository, "writers", $user;
264       } # if
265 </pre></div>
266
267 <blockquote type=cite>
268 <p># The GUI Interface requirement:</p>
269
270 <p>CVS User cvsroot can to the following once authentication passed:</p>
271
272 <ul>
273   <li>Administer the GUI interface</li>
274 </ul>
275 </blockquote>
276
277 <p>I don't know what that means.</p>
278
279 <blockquote type=cite>
280 <ul>
281   <li>Add/delete attributes list
282   <p>For example:</p>
283   <div class="code"><pre>
284 group - int, csadmin, ce, engr, tools
285 system users - lynxuser, gduser, toolsuser</pre></div></li>
286 </ul>
287
288 <p>CVS User belonging to group "cvsadmin" shall be able to do the following once authentication passed:</p>
289
290 <ul>
291   <li>Add user</li>
292
293   <li>Delete user</li>
294
295   <li>Modify user's attributes</li>
296
297   <li>Change user's permission to the cvs repository by modifying writer or readers files.</li>
298 </ul>
299
300 <p>CVS User not belonging to group "cvsadmin" shall be able to do the following once authentication passed:</p>
301
302 <ul>
303   <li>Change its own password</li>
304 </ul>
305 </blockquote>
306
307 <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>
308
309 <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>
310
311 <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>
312
313 <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>
314
315 <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>
316
317 <p>In order for this to work we need to:</p>
318
319 <ul>
320   <li>Create groups and sysusers files for each &lt;host&gt;:&lt;repository&gt;</li>
321
322   <li>Add groups and sysusers files to checkoutlist so that CVS considers them part of the administrative files set.</li>
323
324   <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>
325 </ul>
326
327 <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>
328
329 <p>This should be done (setup) on the web server instead of my desktop. We should, perhaps, create a dummy repository for testing.</p>
330
331 <p>Let me know when this is available so I can start testing there.</p>
332
333                               
334                               <p class="entry-footer">
335                                  <span class="post-footers">Posted by  at  4:54 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000389.html">Permalink</a>
336                                  
337                                  
338                               </p>
339                            </div>
340                         </div>
341                      </div>
342                      
343                   </div>
344                </div>
345             </div>
346          </div>
347       </div>
348    </div>
349 </body>
350 </html>