* details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
#endif /* SIA */
-
-#ifdef __apollo
- extern char *getenv();
-#endif
-
#define GREET_STATE_LOGIN 0
#define GREET_STATE_AUTHENTICATE 1
#define GREET_STATE_EXIT 2
longjmp (pingTime, 1);
}
-static int
-FileNameCompare (a, b)
#if defined(__STDC__)
- const void *a, *b;
+static int
+FileNameCompare (const char *a, const char *b)
#else
- char *a, *b;
+static int
+FileNameCompare (char *a, char *b)
#endif
{
return strcoll (*(char **)a, *(char **)b);
LoadXloginResources( struct display *d )
{
char cmd[1024];
- char *language = NULL;
- char *lang_key="";
char *authority="";
char *auth_key="";
char *resources = NULL;
auth_key = "XAUTHORITY=";
}
- if (d->language && strlen(d->language) > 0 ) {
- language = strdup(d->language);
- lang_key = "-D";
- }
-
- /*
- * replace any "-" or "." in the language name with "_". The C
- * preprocessor used by xrdb does not accept "-" or "." in a name.
- */
-
- while ( (p = strchr(language, '-')) != NULL ) {
- *p = '_';
- }
-
- while ( (p = strchr(language, '.')) != NULL ) {
- *p = '_';
- }
-
- free(language);
-
-
Debug("LoadXloginResources - loading resource db from %s\n", resources);
if((XresourceDB = XrmGetFileDatabase(resources)) == NULL)
Debug("LoadXloginResources - Loading resource db from %s failed\n",
if ( XrmGetResource(XresourceDB,
"Dtlogin*altDts", "Dtlogin*AltDts",
&rmtype, &rmvalue ) ) {
- strcpy(tempbuf,rmvalue.addr);
+ snprintf(tempbuf, sizeof(tempbuf), "%s", rmvalue.addr);
i = atoi(tempbuf);
}
Debug("LoadAltDtsResources- cant access %s.\n", resources);
Debug("\t %s. Falling back to C.\n", strerror(errno));
- if (resources)
- {
- free (resources);
- resources = NULL;
- }
+ free (resources);
+ resources = NULL;
resources = _ExpandLang(dirname[j], "C");
if (access (resources, R_OK) != 0)
Debug("\t %s.\n", strerror(errno));
}
else
- strcpy(dirname[j], resources);
+ snprintf(dirname[j], sizeof(dirname[j]), "%s", resources);
}
else {
- strcpy(dirname[j],resources);
+ snprintf(dirname[j], sizeof(dirname[j]), "%s", resources);
Debug("LoadAltDtsResources- found resource dir %s\n", dirname[j]);
}
- if (resources)
- {
- free (resources);
- resources = NULL;
- }
+ free (resources);
+ resources = NULL;
}
}
if (file_count == 0) {
- file_list = malloc (list_incr * sizeof(char **));
+ file_list = malloc (list_incr * sizeof(char *));
num_allocated += list_incr;
}
if (file_count + 1 > num_allocated) {
num_allocated += list_incr;
file_list = realloc (file_list,
- num_allocated * sizeof(char **));
+ num_allocated * sizeof(char *));
}
file_list[file_count] = strdup (res_file);
file_count++;
* remove the trailing spaces
*/
if(strchr(rmvalue.addr,' '))
- strcpy(tempbuf, strtok(rmvalue.addr," "));
+ snprintf(tempbuf, sizeof(tempbuf), "%s", strtok(rmvalue.addr," "));
else
- strcpy(tempbuf, rmvalue.addr);
+ snprintf(tempbuf, sizeof(tempbuf), "%s", rmvalue.addr);
if ((strcmp(tempbuf, "True") == 0) ||
(strcmp(tempbuf, "TRUE") == 0)) {
/* make sure the server gets reset after the session is over */
if (d->serverPid >= 2) {
- Debug("Reseting server: pid %d signal %d\n",
+ Debug("Resetting server: pid %d signal %d\n",
d->serverPid, d->resetSignal);
if (d->terminateServer == 0 && d->resetSignal)
Debug("BLS - Session setup complete.\n");
} else {
#endif /* BLS */
-
-#ifdef __apollo
-
- /*
- * This should never fail since everything has been verified already.
- * If it does it must mean registry strangeness, so exit, and try
- * again...
- */
-
- if (!DoLogin (user, greet.password, d->name)) exit (1);
-
- /*
- * extract the SYSTYPE and ISP environment values and set into user's
- * environment. This is necessary since we do an execve below...
- */
-
- verify->userEnviron = setEnv(verify->userEnviron, "SYSTYPE",
- getenv("SYSTYPE"));
-
- verify->userEnviron = setEnv(verify->userEnviron, "ISP",
- getenv("ISP"));
-
-#else /* ! __apollo */
-
# ifdef __AFS
if ( IsVerifyName(VN_AFS) ) {
* the "setgroups()" call instead...
*/
-# if (defined(__hpux) || defined(__osf__))
+# if defined(__hpux)
initgroups(user, -1);
# else
setgroups (verify->ngroups, verify->groups);
}
#endif
-#endif /* __apollo */
-
#ifdef BLS
} /* ends the else clause of if ( ISSECURE ) */
#endif /* BLS */
failsafeArgv[i++] = "/usr/bin/X11/aixterm";
#elif defined(sun)
failsafeArgv[i++] = "/usr/openwin/bin/xterm";
-#elif defined (USL) || defined(__uxp__)
- failsafeArgv[i++] = "/usr/X/bin/xterm";
#elif defined(__hpux)
failsafeArgv[i++] = "/usr/bin/X11/hpterm";
#elif defined(__OpenBSD__)
failsafeArgv[i++] = "-e";
failsafeArgv[i++] = "/bin/passwd";
-#if defined (__apollo) || defined(__PASSWD_ETC)
+#if defined(__PASSWD_ETC)
failsafeArgv[i++] = "-n";
#endif
failsafeArgv[i++] = getEnv (verify->userEnviron, "USER");
char *p;
char **env;
char *path;
- struct greet_state state = {};
+ struct greet_state state;
int notify_dt;
int dupfp = -1;
int dupfp2 = -1;
if((path = getenv("NLSPATH")) != NULL)
env = setEnv(env, "NLSPATH", path);
-#ifdef __hp_osf
- env = setEnv(env, "NLSPATH", "/usr/lib/nls/msg/%L/%N.cat");
-#endif
/*
if ( d->langList && strlen(d->langList) > 0 )
env = setEnv(env, LANGLIST, d->langList);
#if !defined (ENABLE_DYNAMIC_LANGLIST)
- else if (languageList && strlen(languageList) > 0 )
+ else if (strlen(languageList) > 0 )
env = setEnv(env, LANGLIST, languageList);
#endif /* ENABLE_DYNAMIC_LANGLIST */
language = d->language;
#endif /* ENABLE_DYNAMIC_LANGLIST */
- if ( d->language && strlen(d->language) > 0 )
+ if (env && d->language && strlen(d->language) > 0 )
env = setLang(d, env, language);
}
env = setEnv(env, "OPENWINHOME", path);
#endif
-#ifdef __apollo
- /*
- * set environment for Domain machines...
- */
- env = setEnv(env, "ENVIRONMENT", "bsd");
- env = setEnv(env, "SYSTYPE", "bsd4.3");
-#endif
-
-
Debug ("Greeter environment:\n");
printEnv(env);
Debug ("End of Greeter environment:\n");
* figure out path to dtgreet...
*/
- strcpy(msg, progName);
+ snprintf(msg, sizeof(msg), "%s", progName);
if ((p = (char *) strrchr(msg, '/')) == NULL)
strcpy(msg,"./");