Subversion Repositories wimsdev

Rev

Rev 8849 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8849 Rev 12474
Line 20... Line 20...
20
 
20
 
21
/* The following directories will be relocatable.
21
/* The following directories will be relocatable.
22
 * Clusterable directories (log, backup) should be avoided.
22
 * Clusterable directories (log, backup) should be avoided.
23
 */
23
 */
24
char *putlist[]={
24
char *putlist[]={
25
    "public_html/modules","public_html/modules/devel",
25
  "public_html/modules","public_html/modules/devel",
26
      "public_html/modules/local",
26
    "public_html/modules/local",
27
      "public_html/bases","public_html/bases/doc",
27
    "public_html/bases","public_html/bases/doc",
28
      "other"
28
    "other"
29
};
29
};
30
#define putcnt (sizeof(putlist)/sizeof(putlist[0]))
30
#define putcnt (sizeof(putlist)/sizeof(putlist[0]))
31
 
31
 
32
void homedir(void)
32
void homedir(void)
33
{
33
{
34
    char buf[MAX_LINELEN+1], fname[4096];
34
  char buf[MAX_LINELEN+1], fname[4096];
35
    char *p1;
35
  char *p1;
36
    struct stat st;
36
  struct stat st;
37
    int i,t;
37
  int i,t;
38
    for(i=0;i<putcnt;i++) {
38
  for(i=0;i<putcnt;i++) {
39
      t=stat(putlist[i],&st); if(t || !S_ISDIR(st.st_mode)) continue;
39
    t=stat(putlist[i],&st); if(t || !S_ISDIR(st.st_mode)) continue;
40
      snprintf(fname,sizeof(fname),"%s/.wimshome",putlist[i]);
40
    snprintf(fname,sizeof(fname),"%s/.wimshome",putlist[i]);
41
      wlogdaccessfile(buf,"r","%s",fname);
41
    wlogdaccessfile(buf,"r","%s",fname);
42
      p1=find_word_start(buf); *find_word_end(p1)=0;
42
    p1=find_word_start(buf); *find_word_end(p1)=0;
43
      if(strcmp(p1,cwd)==0) continue;
43
    if(strcmp(p1,cwd)==0) continue;
44
      wlogdaccessfile(cwd,"w","%s",fname);
44
    wlogdaccessfile(cwd,"w","%s",fname);
45
      chmod(fname,S_IRUSR|S_IWUSR);
45
    chmod(fname,S_IRUSR|S_IWUSR);
46
    }
46
  }
47
}
47
}
48
 
48