mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtfile/Find: CID 88258,87250
This commit is contained in:
parent
32e8827cbc
commit
e2162e0800
1 changed files with 25 additions and 16 deletions
|
@ -948,6 +948,8 @@ GetDefaultValues( void )
|
||||||
/* Allocate and initialize the default find file dialog data. */
|
/* Allocate and initialize the default find file dialog data. */
|
||||||
|
|
||||||
find_data = (FindData *) XtMalloc (sizeof (FindData));
|
find_data = (FindData *) XtMalloc (sizeof (FindData));
|
||||||
|
if (!find_data)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
find_data->displayed = False;
|
find_data->displayed = False;
|
||||||
find_data->x = 0;
|
find_data->x = 0;
|
||||||
|
@ -955,7 +957,11 @@ GetDefaultValues( void )
|
||||||
find_data->height = 0;
|
find_data->height = 0;
|
||||||
find_data->width = 0;
|
find_data->width = 0;
|
||||||
|
|
||||||
(void)getcwd((char *)dirbuf, (unsigned int)MAX_DIR_PATH_LEN);
|
if (!getcwd((char *)dirbuf, (unsigned int)MAX_DIR_PATH_LEN))
|
||||||
|
{
|
||||||
|
XtFree((char *)find_data);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if(restrictMode &&
|
if(restrictMode &&
|
||||||
strncmp(users_home_dir, dirbuf, strlen(users_home_dir)) != 0)
|
strncmp(users_home_dir, dirbuf, strlen(users_home_dir)) != 0)
|
||||||
{
|
{
|
||||||
|
@ -1322,14 +1328,14 @@ InvalidFindMessage(
|
||||||
int messageIndex,
|
int messageIndex,
|
||||||
String extra_string )
|
String extra_string )
|
||||||
{
|
{
|
||||||
String string;
|
String string = NULL;
|
||||||
String new_string;
|
String new_string = NULL;
|
||||||
char * title;
|
char * title = NULL;
|
||||||
static String badDirectoryNameMessage = NULL;
|
static String badDirectoryNameMessage = NULL;
|
||||||
static String noDirectoryAccessMessage = NULL;
|
static String noDirectoryAccessMessage = NULL;
|
||||||
static String noSearchArgumentMessage = NULL;
|
static String noSearchArgumentMessage = NULL;
|
||||||
static String noExistanceMessage = NULL;
|
static String noExistanceMessage = NULL;
|
||||||
char * tmpStr;
|
char * tmpStr = NULL;
|
||||||
|
|
||||||
if (noExistanceMessage == NULL)
|
if (noExistanceMessage == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1363,7 +1369,7 @@ InvalidFindMessage(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extra_string)
|
if (extra_string && string)
|
||||||
{
|
{
|
||||||
new_string = XtMalloc (strlen(string) + strlen(extra_string) + 1);
|
new_string = XtMalloc (strlen(string) + strlen(extra_string) + 1);
|
||||||
(void) sprintf(new_string, string, extra_string);
|
(void) sprintf(new_string, string, extra_string);
|
||||||
|
@ -1732,6 +1738,7 @@ ExecuteFind(
|
||||||
#ifdef __osf__
|
#ifdef __osf__
|
||||||
extern void sigchld_handler(int);
|
extern void sigchld_handler(int);
|
||||||
#endif /* __osf__ */
|
#endif /* __osf__ */
|
||||||
|
int rv;
|
||||||
|
|
||||||
if(strcmp(find_data->content, "") == 0)
|
if(strcmp(find_data->content, "") == 0)
|
||||||
{
|
{
|
||||||
|
@ -1794,34 +1801,36 @@ ExecuteFind(
|
||||||
/* needed for getaccess () call */
|
/* needed for getaccess () call */
|
||||||
save_ruid = getuid();
|
save_ruid = getuid();
|
||||||
#if !defined(SVR4) && ! defined(sco)
|
#if !defined(SVR4) && ! defined(sco)
|
||||||
setreuid(geteuid(),-1);
|
rv = setreuid(geteuid(),-1);
|
||||||
#else
|
#else
|
||||||
setuid(geteuid());
|
rv = setuid(geteuid());
|
||||||
#endif
|
#endif
|
||||||
save_rgid = getgid();
|
save_rgid = getgid();
|
||||||
#if !defined(SVR4) && !defined(sco)
|
#if !defined(SVR4) && !defined(sco)
|
||||||
setregid(getegid(),-1);
|
rv = setregid(getegid(),-1);
|
||||||
#else
|
#else
|
||||||
setgid(getegid());
|
rv = setgid(getegid());
|
||||||
#endif
|
#endif
|
||||||
access_priv = access (path, R_OK);
|
access_priv = access (path, R_OK);
|
||||||
#if !defined(SVR4) && !defined(sco)
|
#if !defined(SVR4) && !defined(sco)
|
||||||
setreuid(save_ruid,-1);
|
rv = setreuid(save_ruid,-1);
|
||||||
setregid(save_rgid,-1);
|
rv = setregid(save_rgid,-1);
|
||||||
#else
|
#else
|
||||||
setuid(save_ruid);
|
rv = setuid(save_ruid);
|
||||||
setgid(save_rgid);
|
rv = setgid(save_rgid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (access_priv == -1 && geteuid() != root_user)
|
if (access_priv == -1 && geteuid() != root_user)
|
||||||
{
|
{
|
||||||
#else
|
#else
|
||||||
# if defined(__hp_osf) || defined(__ultrix) || defined(__osf__) || defined(linux) || defined(CSRG_BASED)
|
# if defined(__hp_osf) || defined(__ultrix) || defined(__osf__) || defined(linux) || defined(CSRG_BASED)
|
||||||
setreuid(geteuid(),-1);
|
rv = setreuid(geteuid(),-1);
|
||||||
if (access ((char *) path, R_OK) == -1)
|
if (access ((char *) path, R_OK) == -1)
|
||||||
{
|
{
|
||||||
# else
|
# else
|
||||||
# ifdef BLS
|
# ifdef BLS
|
||||||
setresuid(geteuid(),-1,-1);
|
rv =setresuid(geteuid(),-1,-1);
|
||||||
if (access ((char *) path, R_OK) == -1)
|
if (access ((char *) path, R_OK) == -1)
|
||||||
{
|
{
|
||||||
# else
|
# else
|
||||||
|
|
Loading…
Reference in a new issue