Rev 8849 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 10 | reyssat | 1 | /* Copyright (C) 1998-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis |
| 2 | * |
||
| 3 | * This program is free software; you can redistribute it and/or modify |
||
| 4 | * it under the terms of the GNU General Public License as published by |
||
| 5 | * the Free Software Foundation; either version 2 of the License, or |
||
| 6 | * (at your option) any later version. |
||
| 7 | * |
||
| 8 | * This program is distributed in the hope that it will be useful, |
||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
| 11 | * GNU General Public License for more details. |
||
| 12 | * |
||
| 13 | * You should have received a copy of the GNU General Public License |
||
| 14 | * along with this program; if not, write to the Free Software |
||
| 15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
||
| 16 | */ |
||
| 8155 | bpr | 17 | /* Routines to update home directory. */ |
| 10 | reyssat | 18 | |
| 8185 | bpr | 19 | #include "wimslogd.h" |
| 20 | |||
| 8155 | bpr | 21 | /* The following directories will be relocatable. |
| 22 | * Clusterable directories (log, backup) should be avoided. |
||
| 23 | */ |
||
| 10 | reyssat | 24 | char *putlist[]={ |
| 12474 | bpr | 25 | "public_html/modules","public_html/modules/devel", |
| 26 | "public_html/modules/local", |
||
| 27 | "public_html/bases","public_html/bases/doc", |
||
| 28 | "other" |
||
| 10 | reyssat | 29 | }; |
| 30 | #define putcnt (sizeof(putlist)/sizeof(putlist[0])) |
||
| 31 | |||
| 32 | void homedir(void) |
||
| 33 | { |
||
| 12474 | bpr | 34 | char buf[MAX_LINELEN+1], fname[4096]; |
| 35 | char *p1; |
||
| 36 | struct stat st; |
||
| 37 | int i,t; |
||
| 38 | for(i=0;i<putcnt;i++) { |
||
| 39 | t=stat(putlist[i],&st); if(t || !S_ISDIR(st.st_mode)) continue; |
||
| 40 | snprintf(fname,sizeof(fname),"%s/.wimshome",putlist[i]); |
||
| 41 | wlogdaccessfile(buf,"r","%s",fname); |
||
| 42 | p1=find_word_start(buf); *find_word_end(p1)=0; |
||
| 43 | if(strcmp(p1,cwd)==0) continue; |
||
| 44 | wlogdaccessfile(cwd,"w","%s",fname); |
||
| 45 | chmod(fname,S_IRUSR|S_IWUSR); |
||
| 46 | } |
||
| 10 | reyssat | 47 | } |
| 48 |