Changeset 311 for trunk/util

Show
Ignore:
Timestamp:
06/14/08 20:42:54 (7 months ago)
Author:
saurik
Message:

Maintain permissions during codehashing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/util/ldid.cpp

    r310 r311  
    4646 
    4747#include <sys/wait.h> 
     48#include <sys/types.h> 
     49#include <sys/stat.h> 
    4850 
    4951struct fat_header { 
     
    338340        const char *base = strrchr(path, '/'); 
    339341        char *temp(NULL), *dir; 
     342        mode_t mode = 0; 
    340343 
    341344        if (base != NULL) 
     
    507510 
    508511        if (temp) { 
     512            struct stat info; 
     513            _syscall(stat(path, &info)); 
     514            _syscall(chown(temp, info.st_uid, info.st_gid)); 
     515            _syscall(chmod(temp, info.st_mode)); 
    509516            _syscall(unlink(path)); 
    510517            _syscall(rename(temp, path));