mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-22 19:58:29 +01:00
* g10.c (check permissions): Back out previous change - some translations
already done for 1.2.
This commit is contained in:
parent
3643188d72
commit
9da9e88433
@ -1,3 +1,8 @@
|
|||||||
|
2002-09-15 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* g10.c (check permissions): Back out previous change - some
|
||||||
|
translations already done for 1.2.
|
||||||
|
|
||||||
2002-09-14 David Shaw <dshaw@jabberwocky.com>
|
2002-09-14 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* g10.c (check_permissions): Rearrange strings to make translating
|
* g10.c (check_permissions): Rearrange strings to make translating
|
||||||
|
66
g10/g10.c
66
g10/g10.c
@ -25,7 +25,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <assert.h>
|
|
||||||
#ifdef HAVE_DOSISH_SYSTEM
|
#ifdef HAVE_DOSISH_SYSTEM
|
||||||
#include <fcntl.h> /* for setmode() */
|
#include <fcntl.h> /* for setmode() */
|
||||||
#endif
|
#endif
|
||||||
@ -851,7 +850,7 @@ check_permissions(const char *path,int item)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_STAT) && !defined(HAVE_DOSISH_SYSTEM)
|
#if defined(HAVE_STAT) && !defined(HAVE_DOSISH_SYSTEM)
|
||||||
static int homedir_cache=-1;
|
static int homedir_cache=-1;
|
||||||
char *tmppath,*dir;
|
char *tmppath,*isa,*dir;
|
||||||
struct stat statbuf,dirbuf;
|
struct stat statbuf,dirbuf;
|
||||||
int homedir=0,ret=0,checkonly=0;
|
int homedir=0,ret=0,checkonly=0;
|
||||||
int perm=0,own=0,enc_dir_perm=0,enc_dir_own=0;
|
int perm=0,own=0,enc_dir_perm=0,enc_dir_own=0;
|
||||||
@ -859,8 +858,6 @@ check_permissions(const char *path,int item)
|
|||||||
if(opt.no_perm_warn)
|
if(opt.no_perm_warn)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
assert(item==0 || item==1 || item==2);
|
|
||||||
|
|
||||||
/* extensions may attach a path */
|
/* extensions may attach a path */
|
||||||
if(item==2 && path[0]!=DIRSEP_C)
|
if(item==2 && path[0]!=DIRSEP_C)
|
||||||
{
|
{
|
||||||
@ -910,6 +907,8 @@ check_permissions(const char *path,int item)
|
|||||||
|
|
||||||
if(item==0)
|
if(item==0)
|
||||||
{
|
{
|
||||||
|
isa="homedir";
|
||||||
|
|
||||||
/* The homedir must be x00, a directory, and owned by the user. */
|
/* The homedir must be x00, a directory, and owned by the user. */
|
||||||
|
|
||||||
if(S_ISDIR(statbuf.st_mode))
|
if(S_ISDIR(statbuf.st_mode))
|
||||||
@ -929,6 +928,11 @@ check_permissions(const char *path,int item)
|
|||||||
}
|
}
|
||||||
else if(item==1 || item==2)
|
else if(item==1 || item==2)
|
||||||
{
|
{
|
||||||
|
if(item==1)
|
||||||
|
isa="configuration file";
|
||||||
|
else
|
||||||
|
isa="extension";
|
||||||
|
|
||||||
/* The options or extension file. Okay unless it or its
|
/* The options or extension file. Okay unless it or its
|
||||||
containing directory is group or other writable or not owned
|
containing directory is group or other writable or not owned
|
||||||
by us or root. */
|
by us or root. */
|
||||||
@ -976,53 +980,19 @@ check_permissions(const char *path,int item)
|
|||||||
if(!checkonly)
|
if(!checkonly)
|
||||||
{
|
{
|
||||||
if(own)
|
if(own)
|
||||||
{
|
log_info(_("WARNING: unsafe ownership on %s \"%s\"\n"),
|
||||||
if(item==0)
|
isa,tmppath);
|
||||||
log_info(_("WARNING: unsafe ownership on "
|
|
||||||
"homedir \"%s\"\n"),tmppath);
|
|
||||||
else if(item==1)
|
|
||||||
log_info(_("WARNING: unsafe ownership on "
|
|
||||||
"configuration file \"%s\"\n"),tmppath);
|
|
||||||
else
|
|
||||||
log_info(_("WARNING: unsafe ownership on "
|
|
||||||
"extension \"%s\"\n"),tmppath);
|
|
||||||
}
|
|
||||||
if(perm)
|
if(perm)
|
||||||
{
|
log_info(_("WARNING: unsafe permissions on %s \"%s\"\n"),
|
||||||
if(item==0)
|
isa,tmppath);
|
||||||
log_info(_("WARNING: unsafe permissions on "
|
|
||||||
"homedir \"%s\"\n"),tmppath);
|
|
||||||
else if(item==1)
|
|
||||||
log_info(_("WARNING: unsafe permissions on "
|
|
||||||
"configuration file \"%s\"\n"),tmppath);
|
|
||||||
else
|
|
||||||
log_info(_("WARNING: unsafe permissions on "
|
|
||||||
"extension \"%s\"\n"),tmppath);
|
|
||||||
}
|
|
||||||
if(enc_dir_own)
|
if(enc_dir_own)
|
||||||
{
|
log_info(_("WARNING: unsafe enclosing directory "
|
||||||
if(item==0)
|
"ownership on %s \"%s\"\n"),
|
||||||
log_info(_("WARNING: unsafe enclosing directory ownership on "
|
isa,tmppath);
|
||||||
"homedir \"%s\"\n"),tmppath);
|
|
||||||
else if(item==1)
|
|
||||||
log_info(_("WARNING: unsafe enclosing directory ownership on "
|
|
||||||
"configuration file \"%s\"\n"),tmppath);
|
|
||||||
else
|
|
||||||
log_info(_("WARNING: unsafe enclosing directory ownership on "
|
|
||||||
"extension \"%s\"\n"),tmppath);
|
|
||||||
}
|
|
||||||
if(enc_dir_perm)
|
if(enc_dir_perm)
|
||||||
{
|
log_info(_("WARNING: unsafe enclosing directory "
|
||||||
if(item==0)
|
"permissions on %s \"%s\"\n"),
|
||||||
log_info(_("WARNING: unsafe enclosing directory permissions on "
|
isa,tmppath);
|
||||||
"homedir \"%s\"\n"),tmppath);
|
|
||||||
else if(item==1)
|
|
||||||
log_info(_("WARNING: unsafe enclosing directory permissions on "
|
|
||||||
"configuration file \"%s\"\n"),tmppath);
|
|
||||||
else
|
|
||||||
log_info(_("WARNING: unsafe enclosing directory permissions on "
|
|
||||||
"extension \"%s\"\n"),tmppath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user