From 1aaa53c45a2e56fb05cc170b3476e591980e1b1f Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 17 May 2005 15:12:51 +0000 Subject: Fixed file rights (All read on files and directories, and all execute on directories). --- src/server.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/server.cc') diff --git a/src/server.cc b/src/server.cc index ee14132..03f9552 100644 --- a/src/server.cc +++ b/src/server.cc @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.16 2005/05/17 15:12:51 deva + * Fixed file rights (All read on files and directories, and all execute on directories). + * * Revision 1.15 2005/05/17 14:30:56 deva * Added code, preparing threaded encoding. * @@ -114,7 +117,7 @@ void saveFrameAsImage(char* cpr, Frame *f) // Check for cpr length correctness if(strlen(cpr) != 11) { int r = rand(); - fprintf(stderr, "Illigal CPR, it must have length 11, it had lentgh %d\n", strlen(cpr)); + fprintf(stderr, "Illigal CPR, it must have length 11, it had length %d\n", strlen(cpr)); fprintf(stderr, "Redirecting output to [/tmp/miav-%d.jpg]\n", r); sprintf(fname, "/tmp/miav-%d.mpg", r); imgenc.encode(f, fname, 100); // Quality is between 0...100, where 100 is best. @@ -128,7 +131,7 @@ void saveFrameAsImage(char* cpr, Frame *f) // Create folder named birthmonth in server root sprintf(fname, "%s/%s", root->c_str(), birthmonth); - if(!mkdir(fname, S_IRWXU) == -1 && errno != EEXIST) { + if(!mkdir(fname, S_IRWXU | S_IRGRP | S_IXGRP | S_IXOTH | S_IROTH) == -1 && errno != EEXIST) { int r = rand(); fprintf(stderr, "Not possible to create subfolder %s\n", fname); fprintf(stderr, "Redirecting output to [/tmp/miav-%d.jpg]\n", r); @@ -139,7 +142,7 @@ void saveFrameAsImage(char* cpr, Frame *f) // Create folder named cpr in serverroot/birthmonth sprintf(fname, "%s/%s/%s", root->c_str(), birthmonth, cpr); - if(!mkdir(fname, S_IRWXU) == -1 && errno != EEXIST) { + if(!mkdir(fname, S_IRWXU | S_IRGRP | S_IXGRP | S_IXOTH | S_IROTH) == -1 && errno != EEXIST) { int r = rand(); fprintf(stderr, "Not possible to create subfolder %s\n", fname); fprintf(stderr, "Redirecting output to [/tmp/miav-%d.jpg]\n", r); -- cgit v1.2.3