Changeset 8385
- Timestamp:
- Aug 16, 2006, 9:14:42 AM (20 years ago)
- Location:
- trunk/Ohana/src/libohana
- Files:
-
- 5 edited
-
include/ohana.h (modified) (1 diff)
-
src/CommOps.c (modified) (1 diff)
-
src/IOBufferOps.c (modified) (1 diff)
-
src/findexec.c (modified) (3 diffs)
-
src/time.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libohana/include/ohana.h
r8303 r8385 125 125 void make_backup PROTO((char *filename)); 126 126 int check_file_access PROTO((char *basefile, int backup, int verbose)); 127 int check_dir_access PROTO((char *path, int verbose)); 127 128 int check_file_exec PROTO((char *filename)); 128 129 -
trunk/Ohana/src/libohana/src/CommOps.c
r7939 r8385 74 74 int SendMessage (int device, char *format, ...) { 75 75 76 int Nbyte , status;76 int Nbyte; 77 77 char tmp; 78 78 va_list argp; -
trunk/Ohana/src/libohana/src/IOBufferOps.c
r7929 r8385 102 102 /* add the output line to the given IOBuffer */ 103 103 104 int Nbyte , status;105 char tmp , *line;104 int Nbyte; 105 char tmp; 106 106 107 107 Nbyte = vsnprintf (&tmp, 0, format, argp); -
trunk/Ohana/src/libohana/src/findexec.c
r6674 r8385 25 25 } 26 26 27 /* check that file can be written to:27 /* check that: 28 28 - dir exists 29 29 - dir permissions OK 30 - file permissions OK, 31 - file backup permission OK (optional) 32 */ 33 int check_file_access (char *basefile, int BACKUP, int VERBOSE) { 34 35 char *path, *filename; 30 */ 31 int check_dir_access (char *path, int VERBOSE) { 32 36 33 struct stat filestat; 37 34 uid_t uid; … … 43 40 44 41 /* check permission to write to directory */ 45 path = pathname (basefile);46 42 status = stat (path, &filestat); 47 43 if (status == -1) { … … 62 58 return (FALSE); 63 59 } 60 return (TRUE); 61 } 62 63 /* check that file can be written to: 64 - dir exists 65 - dir permissions OK 66 - file permissions OK, 67 - file backup permission OK (optional) 68 */ 69 int check_file_access (char *basefile, int BACKUP, int VERBOSE) { 70 71 char *path, *filename; 72 struct stat filestat; 73 uid_t uid; 74 gid_t gid; 75 int status; 76 77 uid = getuid(); 78 gid = getgid(); 79 80 /* check permission to write to directory */ 81 path = pathname (basefile); 82 status = check_dir_access (path, VERBOSE); 64 83 free (path); 84 if (!status) return (FALSE); 65 85 66 86 /* check permission to write to file */ -
trunk/Ohana/src/libohana/src/time.c
r7964 r8385 410 410 double ohana_lst (double jd, double longitude) { 411 411 412 double t, ut, jdmid, jdint, jdfrac, sid_g , sid;412 double t, ut, jdmid, jdint, jdfrac, sid_g; 413 413 long sid_int; 414 414
Note:
See TracChangeset
for help on using the changeset viewer.
