mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
generic: drop support for operating systems Katie does not support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
0e86909d0b
commit
524ca13310
45 changed files with 144 additions and 2093 deletions
|
@ -49,22 +49,12 @@ macro(add_x_cursor theme cursor dpi)
|
|||
-P ${MAKE_CONFIG}
|
||||
)
|
||||
# Use the adopted x cursor config file and the png files to produce the cursor file
|
||||
if(NOT WIN32)
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
|
||||
DEPENDS ${inputs} ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
|
||||
COMMAND ${XCURSORGEN} -p ${CMAKE_BINARY_DIR}/oxy-${theme}/png
|
||||
${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
|
||||
${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
|
||||
)
|
||||
else(NOT WIN32)
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
|
||||
DEPENDS ${inputs} ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
|
||||
COMMAND "${CMAKE_SOURCE_DIR}/wincursor.py" ${CMAKE_BINARY_DIR}/oxy-${theme}/png
|
||||
${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
|
||||
${CMAKE_BINARY_DIR}/wincursors/oxy-${theme}
|
||||
${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
|
||||
)
|
||||
endif(NOT WIN32)
|
||||
endmacro(add_x_cursor)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/packages)
|
||||
|
@ -82,9 +72,6 @@ macro(add_theme color theme dpi)
|
|||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/svg)
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/config)
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors)
|
||||
if(WIN32)
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/wincursors/oxy-${theme})
|
||||
endif(WIN32)
|
||||
set(${theme}_cursors)
|
||||
# render SVG to PNG files
|
||||
foreach(svg ${SVGS})
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
import sys
|
||||
import os
|
||||
|
||||
configs = ["left_ptr.in", "help.in", "progress.in", "wait.in", "cross.in", "text.in", "pencil.in", "circle.in", "size_ver.in", "size_hor.in", "size_fdiag.in", "size_bdiag.in", "fleur.in", "up_arrow.in", "pointer.in"]
|
||||
|
||||
if len(sys.argv) < 4:
|
||||
print "too few arguments for wincursor"
|
||||
sys.exit(1)
|
||||
|
||||
pngdir = sys.argv[1]
|
||||
conf = sys.argv[2]
|
||||
outdir = sys.argv[3]
|
||||
dummy = sys.argv[4]
|
||||
|
||||
f = open(dummy, "w")
|
||||
f.close()
|
||||
|
||||
if not configs.count(conf[conf.rfind("/")+1:]):
|
||||
sys.exit(0)
|
||||
else:
|
||||
conffile = conf[conf.rfind("/")+1:]
|
||||
|
||||
f = open(conf)
|
||||
r = f.read()
|
||||
f.close()
|
||||
|
||||
ls = r.split("\n")
|
||||
imglist = []
|
||||
|
||||
for l in ls:
|
||||
if l and not l.startswith("#"):
|
||||
v = l.split(" ")
|
||||
if len(v) == 4:
|
||||
imglist += [(v[3], v[1], v[2])]
|
||||
elif len(v) == 5:
|
||||
imglist += [(v[3], v[1], v[2], v[4])]
|
||||
|
||||
if len(imglist) > 1:
|
||||
pngls = [os.path.join(pngdir, i[0]) for i in imglist]
|
||||
pngstr = ""
|
||||
for p in pngls:
|
||||
pngstr += " %s" % p
|
||||
|
||||
img = imglist[0]
|
||||
jiffie = int((float(img[3]) / 1000) * 60)
|
||||
|
||||
print os.popen4("png2ico %s --hotspotx %s --hotspoty %s --framerate %s %s" % (os.path.join(outdir, conffile.replace(".in", ".ani")), img[1], img[2], jiffie, pngstr))[1].read()
|
||||
elif len(imglist) == 1:
|
||||
img = imglist[0]
|
||||
print os.popen4("png2ico %s --hotspotx %s --hotspoty %s %s" % (os.path.join(outdir, conffile.replace(".in", ".cur")), img[1], img[2], os.path.join(pngdir, img[0])))[1].read()
|
|
@ -77,7 +77,6 @@ bool KCrashBackend::init()
|
|||
return false;
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_WIN32)
|
||||
if (::kill(crashedApplication()->pid(), 0) < 0) {
|
||||
switch (errno) {
|
||||
case EPERM:
|
||||
|
@ -108,7 +107,6 @@ bool KCrashBackend::init()
|
|||
//process when we try to continue it.
|
||||
QTimer::singleShot(2000, this, SLOT(stopAttachedProcess()));
|
||||
}
|
||||
#endif
|
||||
|
||||
//Handle drkonqi crashes
|
||||
s_pid = crashedApplication()->pid(); //copy pid for use by the crash handler, so that it is safer
|
||||
|
|
|
@ -66,20 +66,8 @@ QString SystemInformation::fetchOSBasicInformation() const
|
|||
return QLatin1String("NetBSD");
|
||||
#elif defined(Q_OS_OPENBSD)
|
||||
return QLatin1String("OpenBSD");
|
||||
#elif defined(Q_OS_AIX)
|
||||
return QLatin1String("AIX");
|
||||
#elif defined(Q_OS_HPUX)
|
||||
return QLatin1String("HP-UX");
|
||||
#elif defined(Q_OS_IRIX)
|
||||
return QLatin1String("IRIX");
|
||||
#elif defined(Q_OS_OSF)
|
||||
return QLatin1String("Tru64");
|
||||
#elif defined(Q_OS_SOLARIS)
|
||||
return QLatin1String("Solaris");
|
||||
#elif defined(Q_OS_CYGWIN)
|
||||
return QLatin1String("Cygwin");
|
||||
#elif defined(Q_OS_WIN32)
|
||||
return QLatin1String("MS Windows");
|
||||
#else
|
||||
return OS_UNSPECIFIED;
|
||||
#endif
|
||||
|
|
|
@ -13,8 +13,6 @@ set(kcheckpass_SRCS
|
|||
checkpass_etcpasswd.c
|
||||
checkpass_pam.c
|
||||
checkpass_shadow.c
|
||||
checkpass_osfc2passwd.c
|
||||
checkpass_aix.c
|
||||
)
|
||||
|
||||
add_executable(kcheckpass ${kcheckpass_SRCS})
|
||||
|
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2001 Reza Arbab <arbab@austin.ibm.com>
|
||||
* Copyright (c) 2003 Oswald Buddenhagen <ossi@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "kcheckpass.h"
|
||||
|
||||
#ifdef HAVE_AIX_AUTH
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
/*
|
||||
* The AIX builtin authenticate() uses whichever method the system
|
||||
* has been configured for. (/etc/passwd, DCE, etc.)
|
||||
*/
|
||||
int authenticate(const char *, const char *, int *, char **);
|
||||
|
||||
AuthReturn Authenticate(const char *method,
|
||||
const char *login, char *(*conv) (ConvRequest, const char *))
|
||||
{
|
||||
int result;
|
||||
int reenter; /* Tells if authenticate is done processing or not. */
|
||||
char *passwd;
|
||||
char *msg; /* Contains a prompt message or failure reason. */
|
||||
|
||||
if (!strcmp(method, "classic")) {
|
||||
|
||||
if (!(passwd = conv(ConvGetHidden, 0)))
|
||||
return AuthAbort;
|
||||
|
||||
if ((result = authenticate(login, passwd, &reenter, &msg))) {
|
||||
if (msg) {
|
||||
conv(ConvPutError, msg);
|
||||
free(msg);
|
||||
}
|
||||
dispose(passwd);
|
||||
return AuthBad;
|
||||
}
|
||||
if (reenter) {
|
||||
char buf[256];
|
||||
snprintf(buf, sizeof(buf), "More authentication data requested: %s\n", msg);
|
||||
conv(ConvPutError, buf);
|
||||
free(msg);
|
||||
dispose(passwd);
|
||||
return result == ENOENT || result == ESAD ? AuthBad : AuthError;
|
||||
}
|
||||
dispose(passwd);
|
||||
return AuthOk;
|
||||
|
||||
} else if (!strcmp(method, "generic")) {
|
||||
|
||||
for (passwd = 0;;) {
|
||||
if ((result = authenticate(login, passwd, &reenter, &msg))) {
|
||||
if (msg) {
|
||||
conv(ConvPutError, msg);
|
||||
free(msg);
|
||||
}
|
||||
if (passwd)
|
||||
dispose(passwd);
|
||||
return result == ENOENT || result == ESAD ? AuthBad : AuthError;
|
||||
}
|
||||
if (passwd)
|
||||
dispose(passwd);
|
||||
if (!reenter)
|
||||
break;
|
||||
passwd = conv(ConvGetHidden, msg);
|
||||
free(msg);
|
||||
if (!passwd)
|
||||
return AuthAbort;
|
||||
}
|
||||
return AuthOk;
|
||||
|
||||
} else
|
||||
return AuthError;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,204 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (C) 1999 Mark Davies <mark@MCS.VUW.AC.NZ>
|
||||
* Copyright (C) 2003 Oswald Buddenhagen <ossi@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "kcheckpass.h"
|
||||
|
||||
#ifdef HAVE_OSF_C2_PASSWD
|
||||
|
||||
static char *osf1c2crypt(const char *pw, char *salt);
|
||||
static int osf1c2_getprpwent(char *p, char *n, int len);
|
||||
|
||||
/*******************************************************************
|
||||
* This is the authentication code for OSF C2 security passwords
|
||||
*******************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
AuthReturn Authenticate(const char *method,
|
||||
const char *login, char *(*conv) (ConvRequest, const char *))
|
||||
{
|
||||
char *passwd;
|
||||
char *crpt_passwd;
|
||||
char c2passwd[256];
|
||||
|
||||
if (strcmp(method, "classic"))
|
||||
return AuthError;
|
||||
|
||||
if (!osf1c2_getprpwent(c2passwd, login, sizeof(c2passwd)))
|
||||
return AuthBad;
|
||||
|
||||
if (!*c2passwd)
|
||||
return AuthOk;
|
||||
|
||||
if (!(passwd = conv(ConvGetHidden, 0)))
|
||||
return AuthAbort;
|
||||
|
||||
if ((crpt_passwd = osf1c2crypt(passwd, c2passwd)) && !strcmp(c2passwd, crpt_passwd)) {
|
||||
dispose(passwd);
|
||||
return AuthOk; /* Success */
|
||||
}
|
||||
dispose(passwd);
|
||||
return AuthBad; /* Password wrong or account locked */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
The following code was lifted from the file osfc2.c from the ssh 1.2.26
|
||||
distribution. Parts of the code that were not needed by kcheckpass
|
||||
(notably the osf1c2_check_account_and_terminal() function and the code
|
||||
to set the external variable days_before_password_expires have been
|
||||
removed). The original copyright from the osfc2.c file is included
|
||||
below.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
osfc2.c
|
||||
|
||||
Author: Christophe Wolfhugel
|
||||
|
||||
Copyright (c) 1995 Christophe Wolfhugel
|
||||
|
||||
Free use of this file is permitted for any purpose as long as
|
||||
this copyright is preserved in the header.
|
||||
|
||||
This program implements the use of the OSF/1 C2 security extensions
|
||||
within ssh. See the file COPYING for full licensing information.
|
||||
|
||||
*/
|
||||
|
||||
#include <sys/security.h>
|
||||
#include <prot.h>
|
||||
#include <sia.h>
|
||||
|
||||
static int c2security = -1;
|
||||
static int crypt_algo;
|
||||
|
||||
static void
|
||||
initialize_osf_security(int ac, char **av)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[256];
|
||||
char siad[] = "siad_ses_init=";
|
||||
|
||||
if (access(SIAIGOODFILE, F_OK) == -1)
|
||||
{
|
||||
/* Broken OSF/1 system, better don't run on it. */
|
||||
fprintf(stderr, SIAIGOODFILE);
|
||||
fprintf(stderr, " does not exist. Your OSF/1 system is probably broken\n");
|
||||
exit(1);
|
||||
}
|
||||
if ((f = fopen(MATRIX_CONF, "r")) == NULL)
|
||||
{
|
||||
/* Another way OSF/1 is probably broken. */
|
||||
fprintf(stderr, "%s unreadable. Your OSF/1 system is probably broken.\n"
|
||||
|
||||
MATRIX_CONF);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Read matrix.conf to check if we run C2 or not */
|
||||
while (fgets(buf, sizeof(buf), f) != NULL)
|
||||
{
|
||||
if (strncmp(buf, siad, sizeof(siad) - 1) == 0)
|
||||
{
|
||||
if (strstr(buf, "OSFC2") != NULL)
|
||||
c2security = 1;
|
||||
else if (strstr(buf, "BSD") != NULL)
|
||||
c2security = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
if (c2security == -1)
|
||||
{
|
||||
fprintf(stderr, "C2 security initialization failed : could not determine security level.\n");
|
||||
exit(1);
|
||||
}
|
||||
if (c2security == 1)
|
||||
set_auth_parameters(ac, av);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
osf1c2_getprpwent(char *p, char *n, int len)
|
||||
{
|
||||
time_t pschg, tnow;
|
||||
|
||||
if (c2security == 1)
|
||||
{
|
||||
struct es_passwd *es;
|
||||
struct pr_passwd *pr = getprpwnam(n);
|
||||
if (pr)
|
||||
{
|
||||
strlcpy(p, pr->ufld.fd_encrypt, len);
|
||||
crypt_algo = pr->ufld.fd_oldcrypt;
|
||||
|
||||
tnow = time(NULL);
|
||||
if (pr->uflg.fg_schange == 1)
|
||||
pschg = pr->ufld.fd_schange;
|
||||
else
|
||||
pschg = 0;
|
||||
if (pr->uflg.fg_template == 0)
|
||||
{
|
||||
/** default template, system values **/
|
||||
if (pr->sflg.fg_lifetime == 1)
|
||||
if (pr->sfld.fd_lifetime > 0 &&
|
||||
pschg + pr->sfld.fd_lifetime < tnow)
|
||||
return 1;
|
||||
}
|
||||
else /** user template, specific values **/
|
||||
{
|
||||
es = getespwnam(pr->ufld.fd_template);
|
||||
if (es)
|
||||
{
|
||||
if (es->uflg->fg_expire == 1)
|
||||
if (es->ufld->fd_expire > 0 &&
|
||||
pschg + es->ufld->fd_expire < tnow)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
struct passwd *pw = getpwnam(n);
|
||||
if (pw)
|
||||
{
|
||||
strlcpy(p, pw->pw_passwd, len);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *
|
||||
osf1c2crypt(const char *pw, char *salt)
|
||||
{
|
||||
if (c2security == 1) {
|
||||
return(dispcrypt(pw, salt, crypt_algo));
|
||||
} else
|
||||
return(crypt(pw, salt));
|
||||
}
|
||||
|
||||
#endif
|
|
@ -34,10 +34,7 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#ifndef __hpux
|
||||
#include <shadow.h>
|
||||
#endif
|
||||
|
||||
AuthReturn Authenticate(const char *method,
|
||||
const char *login, char *(*conv) (ConvRequest, const char *))
|
||||
|
|
|
@ -73,51 +73,51 @@ conv_legacy (ConvRequest what, const char *prompt)
|
|||
|
||||
switch (what) {
|
||||
case ConvGetBinary:
|
||||
break;
|
||||
break;
|
||||
case ConvGetNormal:
|
||||
/* there is no prompt == 0 case */
|
||||
if (!havetty)
|
||||
break;
|
||||
/* i guess we should use /dev/tty ... */
|
||||
fputs(prompt, stdout);
|
||||
fflush(stdout);
|
||||
if (!fgets(buf, sizeof(buf), stdin))
|
||||
return 0;
|
||||
len = strlen(buf);
|
||||
if (len && buf[len - 1] == '\n')
|
||||
buf[--len] = 0;
|
||||
return strdup(buf);
|
||||
/* there is no prompt == 0 case */
|
||||
if (!havetty)
|
||||
break;
|
||||
/* i guess we should use /dev/tty ... */
|
||||
fputs(prompt, stdout);
|
||||
fflush(stdout);
|
||||
if (!fgets(buf, sizeof(buf), stdin))
|
||||
return 0;
|
||||
len = strlen(buf);
|
||||
if (len && buf[len - 1] == '\n')
|
||||
buf[--len] = 0;
|
||||
return strdup(buf);
|
||||
case ConvGetHidden:
|
||||
if (havetty) {
|
||||
if (havetty) {
|
||||
#ifdef HAVE_GETPASSPHRASE
|
||||
p = getpassphrase(prompt ? prompt : "Password: ");
|
||||
p = getpassphrase(prompt ? prompt : "Password: ");
|
||||
#else
|
||||
p = getpass(prompt ? prompt : "Password: ");
|
||||
p = getpass(prompt ? prompt : "Password: ");
|
||||
#endif
|
||||
p2 = strdup(p);
|
||||
memset(p, 0, strlen(p));
|
||||
return p2;
|
||||
} else {
|
||||
if (prompt)
|
||||
break;
|
||||
if ((len = read(0, buf, sizeof(buf) - 1)) < 0) {
|
||||
message("Cannot read password\n");
|
||||
return 0;
|
||||
} else {
|
||||
if (len && buf[len - 1] == '\n')
|
||||
--len;
|
||||
buf[len] = 0;
|
||||
p2 = strdup(buf);
|
||||
memset(buf, 0, len);
|
||||
return p2;
|
||||
}
|
||||
}
|
||||
p2 = strdup(p);
|
||||
memset(p, 0, strlen(p));
|
||||
return p2;
|
||||
} else {
|
||||
if (prompt)
|
||||
break;
|
||||
if ((len = read(0, buf, sizeof(buf) - 1)) < 0) {
|
||||
message("Cannot read password\n");
|
||||
return 0;
|
||||
} else {
|
||||
if (len && buf[len - 1] == '\n')
|
||||
--len;
|
||||
buf[len] = 0;
|
||||
p2 = strdup(buf);
|
||||
memset(buf, 0, len);
|
||||
return p2;
|
||||
}
|
||||
}
|
||||
case ConvPutInfo:
|
||||
message("Information: %s\n", prompt);
|
||||
return 0;
|
||||
message("Information: %s\n", prompt);
|
||||
return 0;
|
||||
case ConvPutError:
|
||||
message("Error: %s\n", prompt);
|
||||
return 0;
|
||||
message("Error: %s\n", prompt);
|
||||
return 0;
|
||||
}
|
||||
message("Authentication backend requested data type which cannot be handled.\n");
|
||||
return 0;
|
||||
|
@ -130,18 +130,18 @@ Reader (void *buf, int count)
|
|||
int ret, rlen;
|
||||
|
||||
for (rlen = 0; rlen < count; ) {
|
||||
dord:
|
||||
ret = read (sfd, (void *)((char *)buf + rlen), count - rlen);
|
||||
if (ret < 0) {
|
||||
if (errno == EINTR)
|
||||
goto dord;
|
||||
if (errno == EAGAIN)
|
||||
break;
|
||||
return -1;
|
||||
}
|
||||
if (!ret)
|
||||
break;
|
||||
rlen += ret;
|
||||
dord:
|
||||
ret = read (sfd, (void *)((char *)buf + rlen), count - rlen);
|
||||
if (ret < 0) {
|
||||
if (errno == EINTR)
|
||||
goto dord;
|
||||
if (errno == EAGAIN)
|
||||
break;
|
||||
return -1;
|
||||
}
|
||||
if (!ret)
|
||||
break;
|
||||
rlen += ret;
|
||||
}
|
||||
return rlen;
|
||||
}
|
||||
|
@ -150,8 +150,8 @@ static void
|
|||
GRead (void *buf, int count)
|
||||
{
|
||||
if (Reader (buf, count) != count) {
|
||||
message ("Communication breakdown on read\n");
|
||||
exit(15);
|
||||
message ("Communication breakdown on read\n");
|
||||
exit(15);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,8 +159,8 @@ static void
|
|||
GWrite (const void *buf, int count)
|
||||
{
|
||||
if (write (sfd, buf, count) != count) {
|
||||
message ("Communication breakdown on write\n");
|
||||
exit(15);
|
||||
message ("Communication breakdown on write\n");
|
||||
exit(15);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,10 +201,10 @@ GRecvStr (void)
|
|||
char *buf;
|
||||
|
||||
if (!(len = GRecvInt()))
|
||||
return (char *)0;
|
||||
return (char *)0;
|
||||
if (len > 0x1000 || !(buf = malloc (len))) {
|
||||
message ("No memory for read buffer\n");
|
||||
exit(15);
|
||||
message ("No memory for read buffer\n");
|
||||
exit(15);
|
||||
}
|
||||
GRead (buf, len);
|
||||
buf[len - 1] = 0; /* we're setuid ... don't trust "them" */
|
||||
|
@ -219,20 +219,20 @@ GRecvArr (void)
|
|||
unsigned const char *up;
|
||||
|
||||
if (!(len = (unsigned) GRecvInt()))
|
||||
return (char *)0;
|
||||
return (char *)0;
|
||||
if (len < 4) {
|
||||
message ("Too short binary authentication data block\n");
|
||||
exit(15);
|
||||
message ("Too short binary authentication data block\n");
|
||||
exit(15);
|
||||
}
|
||||
if (len > 0x10000 || !(arr = malloc (len))) {
|
||||
message ("No memory for read buffer\n");
|
||||
exit(15);
|
||||
message ("No memory for read buffer\n");
|
||||
exit(15);
|
||||
}
|
||||
GRead (arr, len);
|
||||
up = (unsigned const char *)arr;
|
||||
if (len != (unsigned)(up[3] | (up[2] << 8) | (up[1] << 16) | (up[0] << 24))) {
|
||||
message ("Mismatched binary authentication data block size\n");
|
||||
exit(15);
|
||||
message ("Mismatched binary authentication data block size\n");
|
||||
exit(15);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
@ -245,33 +245,35 @@ conv_server (ConvRequest what, const char *prompt)
|
|||
switch (what) {
|
||||
case ConvGetBinary:
|
||||
{
|
||||
unsigned const char *up = (unsigned const char *)prompt;
|
||||
int len = up[3] | (up[2] << 8) | (up[1] << 16) | (up[0] << 24);
|
||||
GSendArr (len, prompt);
|
||||
return GRecvArr ();
|
||||
unsigned const char *up = (unsigned const char *)prompt;
|
||||
int len = up[3] | (up[2] << 8) | (up[1] << 16) | (up[0] << 24);
|
||||
GSendArr (len, prompt);
|
||||
return GRecvArr ();
|
||||
}
|
||||
case ConvGetNormal:
|
||||
case ConvGetHidden:
|
||||
{
|
||||
char *msg;
|
||||
GSendStr (prompt);
|
||||
msg = GRecvStr ();
|
||||
if (msg && (GRecvInt() & IsPassword) && !*msg)
|
||||
nullpass = 1;
|
||||
return msg;
|
||||
char *msg;
|
||||
GSendStr (prompt);
|
||||
msg = GRecvStr ();
|
||||
if (msg && (GRecvInt() & IsPassword) && !*msg)
|
||||
nullpass = 1;
|
||||
return msg;
|
||||
}
|
||||
case ConvPutInfo:
|
||||
case ConvPutError:
|
||||
default:
|
||||
GSendStr (prompt);
|
||||
return 0;
|
||||
{
|
||||
GSendStr (prompt);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
message(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
|
@ -321,10 +323,6 @@ main(int argc, char **argv)
|
|||
struct flock lk;
|
||||
char fname[64], fcont[64];
|
||||
|
||||
#ifdef HAVE_OSF_C2_PASSWD
|
||||
initialize_osf_security(argc, argv);
|
||||
#endif
|
||||
|
||||
/* Make sure stdout/stderr are open */
|
||||
for (c = 1; c <= 2; c++) {
|
||||
if (fcntl(c, F_GETFL) == -1) {
|
||||
|
|
|
@ -56,24 +56,10 @@
|
|||
#define _PATH_TMP "/tmp/"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ultrix
|
||||
#include <auth.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef OSF1_ENH_SEC
|
||||
#include <sys/security.h>
|
||||
#include <prot.h>
|
||||
#endif
|
||||
|
||||
/* Make sure there is only one! */
|
||||
#if defined(HAVE_PAM)
|
||||
# undef HAVE_OSF_C2_PASSWD
|
||||
#elif defined(HAVE_OSF_C2_PASSWD)
|
||||
#elif defined(_AIX)
|
||||
# define HAVE_AIX_AUTH
|
||||
#elif defined(HAVE_GETSPNAM)
|
||||
# define HAVE_SHADOW
|
||||
#else
|
||||
|
|
|
@ -102,7 +102,6 @@ extern "C"
|
|||
|
||||
// Write some Qt root property.
|
||||
#ifdef Q_WS_X11
|
||||
#ifndef __osf__ // this crashes under Tru64 randomly -- will fix later
|
||||
QByteArray properties;
|
||||
QDataStream d(&properties, QIODevice::WriteOnly);
|
||||
d.setVersion(QDataStream::Qt_4_8);
|
||||
|
@ -115,7 +114,6 @@ extern "C"
|
|||
XChangeProperty(QX11Info::display(), RootWindow(QX11Info::display(), i),
|
||||
a, a, 8, PropModeReplace,
|
||||
(unsigned char*) properties.data(), properties.size());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ from the copyright holder.
|
|||
As since the demise of imake nobody is setting many of these variables
|
||||
any more, NEED_UTSNAME is essentially always defined. Who cares?
|
||||
*/
|
||||
#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4)
|
||||
#ifdef _POSIX_SOURCE
|
||||
# define NEED_UTSNAME
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
|
@ -64,15 +64,6 @@ from the copyright holder.
|
|||
# undef SIOCGIFCONF
|
||||
#else /* __GNU__ */
|
||||
# include <net/if.h>
|
||||
# ifdef __svr4__
|
||||
# include <netdb.h>
|
||||
# include <sys/sockio.h>
|
||||
# include <sys/stropts.h>
|
||||
# endif
|
||||
# ifdef __EMX__
|
||||
# define chown(a,b,c)
|
||||
# include <io.h>
|
||||
# endif
|
||||
#endif /* __GNU__ */
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
@ -631,34 +622,6 @@ defineLocal(FILE *file, Xauth *auth, int *ok)
|
|||
file, auth, ok);
|
||||
}
|
||||
|
||||
#ifdef SYSV_SIOCGIFCONF
|
||||
|
||||
/* Deal with different SIOCGIFCONF ioctl semantics on SYSV, SVR4 */
|
||||
|
||||
int
|
||||
ifioctl(int fd, int cmd, char *arg)
|
||||
{
|
||||
struct strioctl ioc;
|
||||
int ret;
|
||||
|
||||
bzero(&ioc, sizeof(ioc));
|
||||
ioc.ic_cmd = cmd;
|
||||
ioc.ic_timout = 0;
|
||||
if (cmd == SIOCGIFCONF) {
|
||||
ioc.ic_len = ((struct ifconf *)arg)->ifc_len;
|
||||
ioc.ic_dp = ((struct ifconf *)arg)->ifc_buf;
|
||||
} else {
|
||||
ioc.ic_len = sizeof(struct ifreq);
|
||||
ioc.ic_dp = arg;
|
||||
}
|
||||
ret = ioctl(fd, I_STR, (char *)&ioc);
|
||||
if (ret >= 0 && cmd == SIOCGIFCONF)
|
||||
((struct ifconf *)arg)->ifc_len = ioc.ic_len;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#endif /* SYSV_SIOCGIFCONF */
|
||||
|
||||
#ifdef HAVE_GETIFADDRS
|
||||
# include <ifaddrs.h>
|
||||
|
||||
|
@ -711,7 +674,7 @@ defineSelf(FILE *file, Xauth *auth, int *ok)
|
|||
}
|
||||
#else /* GETIFADDRS */
|
||||
|
||||
#if defined(STREAMSCONN) && !defined(SYSV_SIOCGIFCONF) && !defined(WINTCP)
|
||||
#if defined(STREAMSCONN) && !defined(SYSV_SIOCGIFCONF)
|
||||
|
||||
#include <tiuser.h>
|
||||
|
||||
|
@ -735,86 +698,8 @@ defineSelf(int fd, FILE *file, Xauth *auth, int *ok)
|
|||
|
||||
#else
|
||||
|
||||
#ifdef WINTCP /* NCR with Wollongong TCP */
|
||||
|
||||
#include <stropts.h>
|
||||
#include <tiuser.h>
|
||||
|
||||
#include <sys/stream.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/ip_var.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_var.h>
|
||||
|
||||
static void
|
||||
defineSelf(int fd, FILE *file, Xauth *auth, int *ok)
|
||||
{
|
||||
/*
|
||||
* The Wollongong drivers used by NCR SVR4/MP-RAS don't understand the
|
||||
* socket IO calls that most other drivers seem to like. Because of
|
||||
* this, this routine must be special cased for NCR. Eventually,
|
||||
* this will be cleared up.
|
||||
*/
|
||||
|
||||
struct ipb ifnet;
|
||||
struct in_ifaddr ifaddr;
|
||||
struct strioctl str;
|
||||
int len, ipfd;
|
||||
|
||||
if ((ipfd = open("/dev/ip", O_RDWR, 0)) < 0) {
|
||||
logError("Trouble getting interface configuration\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Indicate that we want to start at the beginning */
|
||||
ifnet.ib_next = (struct ipb *)1;
|
||||
|
||||
while (ifnet.ib_next) {
|
||||
str.ic_cmd = IPIOC_GETIPB;
|
||||
str.ic_timout = 0;
|
||||
str.ic_len = sizeof(struct ipb);
|
||||
str.ic_dp = (char *)&ifnet;
|
||||
|
||||
if (ioctl(ipfd, (int)I_STR, (char *)&str) < 0) {
|
||||
close(ipfd);
|
||||
logError("Trouble getting interface configuration\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ifaddr.ia_next = (struct in_ifaddr *)ifnet.if_addrlist;
|
||||
str.ic_cmd = IPIOC_GETINADDR;
|
||||
str.ic_timout = 0;
|
||||
str.ic_len = sizeof(struct in_ifaddr);
|
||||
str.ic_dp = (char *)&ifaddr;
|
||||
|
||||
if (ioctl(ipfd, (int)I_STR, (char *)&str) < 0) {
|
||||
close(ipfd);
|
||||
logError("Trouble getting interface configuration\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ignore the 127.0.0.1 entry.
|
||||
*/
|
||||
if (IA_SIN(&ifaddr)->sin_addr.s_addr == htonl(0x7f000001))
|
||||
continue;
|
||||
|
||||
writeAddr(FamilyInternet, 4, (CARD8 *)&(IA_SIN(&ifaddr)->sin_addr),
|
||||
file, auth, ok);
|
||||
|
||||
}
|
||||
close(ipfd);
|
||||
}
|
||||
|
||||
#else /* WINTCP */
|
||||
|
||||
#if defined(SIOCGIFCONF) || defined (SIOCGLIFCONF)
|
||||
|
||||
#if !defined(SYSV_SIOCGIFCONF) || defined(SIOCGLIFCONF)
|
||||
# define ifioctl ioctl
|
||||
#endif
|
||||
|
||||
#ifdef SIOCGLIFCONF
|
||||
# define ifr_type struct lifreq
|
||||
#else
|
||||
|
@ -887,7 +772,7 @@ defineSelf(int fd, FILE *file, Xauth *auth, int *ok)
|
|||
ifc.ifc_len = sizeof(buf);
|
||||
ifc.ifc_buf = buf;
|
||||
#endif
|
||||
if (ifioctl(fd, IFC_IOCTL_REQ, (char *)&ifc) < 0) {
|
||||
if (ioctl(fd, IFC_IOCTL_REQ, (char *)&ifc) < 0) {
|
||||
logError("Trouble getting network interface configuration\n");
|
||||
#if defined(SIOCGLIFNUM) && defined(SIOCGLIFCONF)
|
||||
if (bufptr != buf)
|
||||
|
@ -1003,7 +888,6 @@ defineSelf(int fd, int file, int auth, int *ok)
|
|||
}
|
||||
|
||||
#endif /* SIOCGIFCONF else */
|
||||
#endif /* WINTCP else */
|
||||
#endif /* STREAMSCONN && !SYSV_SIOCGIFCONF else */
|
||||
#endif /* HAVE_GETIFADDRS */
|
||||
|
||||
|
|
|
@ -50,9 +50,6 @@ from the copyright holder.
|
|||
#include <netdb.h>
|
||||
|
||||
#ifdef STREAMSCONN
|
||||
# ifdef WINTCP /* NCR with Wollongong TCP */
|
||||
# include <netinet/ip.h>
|
||||
# endif
|
||||
# include <stropts.h>
|
||||
# include <tiuser.h>
|
||||
# include <netconfig.h>
|
||||
|
@ -474,10 +471,6 @@ emptyPingHosts(void)
|
|||
|
||||
#define IFC_REQ(ifc) ifc.ifc_req
|
||||
|
||||
#ifndef SYSV_SIOCGIFCONF
|
||||
# define ifioctl ioctl
|
||||
#endif
|
||||
|
||||
static void
|
||||
registerBroadcastForPing(void)
|
||||
{
|
||||
|
@ -493,47 +486,16 @@ registerBroadcastForPing(void)
|
|||
register struct ifreq *ifr;
|
||||
struct sockaddr broad_addr;
|
||||
char buf[2048], *cp, *cplim;
|
||||
# ifdef WINTCP /* NCR with Wollongong TCP */
|
||||
int ipfd;
|
||||
struct ifconf *ifcp;
|
||||
struct strioctl ioc;
|
||||
int n;
|
||||
|
||||
ifcp = (struct ifconf *)buf;
|
||||
ifcp->ifc_buf = buf + 4;
|
||||
ifcp->ifc_len = sizeof(buf) - 4;
|
||||
|
||||
if ((ipfd = open("/dev/ip", O_RDONLY)) < 0) {
|
||||
t_error("RegisterBroadcastForPing() t_open(/dev/ip) failed");
|
||||
return;
|
||||
}
|
||||
|
||||
ioc.ic_cmd = IPIOC_GETIFCONF;
|
||||
ioc.ic_timout = 60;
|
||||
ioc.ic_len = sizeof(buf);
|
||||
ioc.ic_dp = (char *)ifcp;
|
||||
|
||||
if (ioctl(ipfd, (int)I_STR, (char *)&ioc) < 0) {
|
||||
perror("RegisterBroadcastForPing() ioctl(I_STR(IPIOC_GETIFCONF)) failed");
|
||||
close(ipfd);
|
||||
return;
|
||||
}
|
||||
|
||||
for (ifr = ifcp->ifc_req, n = ifcp->ifc_len / sizeof(struct ifreq); --n >= 0; ifr++)
|
||||
# else /* WINTCP */
|
||||
ifc.ifc_len = sizeof(buf);
|
||||
ifc.ifc_buf = buf;
|
||||
if (ifioctl(socketFD, (int)SIOCGIFCONF, (char *)&ifc) < 0)
|
||||
if (ioctl(socketFD, (int)SIOCGIFCONF, (char *)&ifc) < 0)
|
||||
return;
|
||||
|
||||
cplim = (char *)IFC_REQ(ifc) + ifc.ifc_len;
|
||||
|
||||
for (cp = (char *)IFC_REQ(ifc); cp < cplim; cp += ifr_size(ifr))
|
||||
# endif /* WINTCP */
|
||||
{
|
||||
# ifndef WINTCP
|
||||
ifr = (struct ifreq *)cp;
|
||||
# endif
|
||||
if (ifr->ifr_addr.sa_family != AF_INET)
|
||||
continue;
|
||||
|
||||
|
@ -545,30 +507,12 @@ registerBroadcastForPing(void)
|
|||
struct ifreq broad_req;
|
||||
|
||||
broad_req = *ifr;
|
||||
# ifdef WINTCP /* NCR with Wollongong TCP */
|
||||
ioc.ic_cmd = IPIOC_GETIFFLAGS;
|
||||
ioc.ic_timout = 0;
|
||||
ioc.ic_len = sizeof(broad_req);
|
||||
ioc.ic_dp = (char *)&broad_req;
|
||||
|
||||
if (ioctl(ipfd, I_STR, (char *)&ioc) != -1 &&
|
||||
# else /* WINTCP */
|
||||
if (ifioctl(socketFD, SIOCGIFFLAGS, (char *)&broad_req) != -1 &&
|
||||
# endif /* WINTCP */
|
||||
if (ioctl(socketFD, SIOCGIFFLAGS, (char *)&broad_req) != -1 &&
|
||||
(broad_req.ifr_flags & IFF_BROADCAST) &&
|
||||
(broad_req.ifr_flags & IFF_UP))
|
||||
{
|
||||
broad_req = *ifr;
|
||||
# ifdef WINTCP /* NCR with Wollongong TCP */
|
||||
ioc.ic_cmd = IPIOC_GETIFBRDADDR;
|
||||
ioc.ic_timout = 0;
|
||||
ioc.ic_len = sizeof(broad_req);
|
||||
ioc.ic_dp = (char *)&broad_req;
|
||||
|
||||
if (ioctl(ipfd, I_STR, (char *)&ioc) != -1)
|
||||
# else /* WINTCP */
|
||||
if (ifioctl(socketFD, SIOCGIFBRDADDR, (char *)&broad_req) != -1)
|
||||
# endif /* WINTCP */
|
||||
if (ioctl(socketFD, SIOCGIFBRDADDR, (char *)&broad_req) != -1)
|
||||
broad_addr = broad_req.ifr_addr;
|
||||
else
|
||||
continue;
|
||||
|
|
|
@ -59,13 +59,7 @@ extern int key_setnet(struct key_netstarg *arg);
|
|||
# else
|
||||
# include <security/pam_appl.h>
|
||||
# endif
|
||||
#elif defined(_AIX) /* USE_PAM */
|
||||
# include <login.h>
|
||||
# include <usersec.h>
|
||||
extern int loginrestrictions(const char *Name, const int Mode, const char *Tty, char **Msg);
|
||||
extern int loginfailed(const char *User, const char *Host, const char *Tty);
|
||||
extern int loginsuccess(const char *User, const char *Host, const char *Tty, char **Msg);
|
||||
#else /* USE_PAM || _AIX */
|
||||
#else /* USE_PAM */
|
||||
# ifdef KERBEROS
|
||||
# include <sys/param.h>
|
||||
# include <krb.h>
|
||||
|
@ -78,7 +72,7 @@ extern int loginsuccess(const char *User, const char *Host, const char *Tty, cha
|
|||
# include <unistd.h>
|
||||
/* for expiration */
|
||||
# include <time.h>
|
||||
#endif /* USE_PAM || _AIX */
|
||||
#endif /* USE_PAM */
|
||||
#ifdef HAVE_GETSPNAM
|
||||
# include <shadow.h>
|
||||
#endif
|
||||
|
@ -112,8 +106,6 @@ struct login_cap *lc;
|
|||
#ifdef USE_PAM
|
||||
static pam_handle_t *pamh;
|
||||
static int inAuth;
|
||||
#elif defined(_AIX)
|
||||
static char tty[16], hostname[100];
|
||||
#else
|
||||
# ifdef USESHADOW
|
||||
static struct spwd *sp;
|
||||
|
@ -132,9 +124,9 @@ displayStr(int lv, const char *msg)
|
|||
gRecvInt();
|
||||
}
|
||||
|
||||
#if (!defined(USE_PAM) && !defined(_AIX) \
|
||||
#if !defined(USE_PAM) \
|
||||
&& (defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(USESHADOW) \
|
||||
|| (defined(KERBEROS) && defined(AFS))))
|
||||
|| (defined(KERBEROS) && defined(AFS)))
|
||||
static void
|
||||
displayMsg(int lv, const char *msg, ...)
|
||||
{
|
||||
|
@ -151,17 +143,12 @@ displayMsg(int lv, const char *msg, ...)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
# define _ENDUSERDB , enduserdb()
|
||||
#else
|
||||
# define _ENDUSERDB
|
||||
#endif
|
||||
#ifdef HAVE_GETSPNAM /* (sic!) - not USESHADOW */
|
||||
# define _ENDSPENT , endspent()
|
||||
#else
|
||||
# define _ENDSPENT
|
||||
#endif
|
||||
#define END_ENT endpwent() _ENDSPENT _ENDUSERDB
|
||||
#define END_ENT endpwent() _ENDSPENT
|
||||
|
||||
#define V_RET_NP \
|
||||
do { \
|
||||
|
@ -444,7 +431,7 @@ doPAMAuth(const char *psrv, struct pam_data *pdata)
|
|||
#endif /* USE_PAM */
|
||||
|
||||
static int
|
||||
#if defined(USE_PAM) || defined(_AIX)
|
||||
#if defined(USE_PAM)
|
||||
isNoPassAllowed(const char *un)
|
||||
{
|
||||
struct passwd *pw;
|
||||
|
@ -459,7 +446,7 @@ isNoPassAllowed(struct passwd *pw)
|
|||
char **fp;
|
||||
int hg;
|
||||
|
||||
#if defined(USE_PAM) || defined(_AIX)
|
||||
#if defined(USE_PAM)
|
||||
if (!*un)
|
||||
return False;
|
||||
#endif
|
||||
|
@ -467,7 +454,7 @@ isNoPassAllowed(struct passwd *pw)
|
|||
if (cursource != PWSRC_MANUAL)
|
||||
return True;
|
||||
|
||||
#if defined(USE_PAM) || defined(_AIX)
|
||||
#if defined(USE_PAM)
|
||||
/* Give nss_ldap, etc. a chance to normalize (uppercase) the name. */
|
||||
if (!(pw = getpwnam(un)) ||
|
||||
pw->pw_passwd[0] == '!' || pw->pw_passwd[0] == '*')
|
||||
|
@ -507,7 +494,7 @@ isNoPassAllowed(struct passwd *pw)
|
|||
return False;
|
||||
}
|
||||
|
||||
#if !defined(USE_PAM) && !defined(_AIX) && defined(HAVE_SETUSERCONTEXT)
|
||||
#if !defined(USE_PAM) && defined(HAVE_SETUSERCONTEXT)
|
||||
# define LC_RET0 do { login_close(lc); V_RET; } while(0)
|
||||
#else
|
||||
# define LC_RET0 V_RET
|
||||
|
@ -521,9 +508,6 @@ verify(GConvFunc gconv, int rootok)
|
|||
struct pam_data pdata;
|
||||
int pretc, pnopass;
|
||||
char psrvb[64];
|
||||
#elif defined(_AIX)
|
||||
char *msg, *curret;
|
||||
int i, reenter;
|
||||
#else
|
||||
struct stat st;
|
||||
const char *nolg;
|
||||
|
@ -535,7 +519,7 @@ verify(GConvFunc gconv, int rootok)
|
|||
# if defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(USESHADOW)
|
||||
int tim, expir, warntime, quietlog;
|
||||
# endif
|
||||
# if !defined(ultrix) && !defined(__ultrix__) && (defined(HAVE_PW_ENCRYPT) || defined(HAVE_CRYPT))
|
||||
# if defined(HAVE_PW_ENCRYPT) || defined(HAVE_CRYPT)
|
||||
char *crpt_passwd;
|
||||
# endif
|
||||
#endif
|
||||
|
@ -570,98 +554,6 @@ verify(GConvFunc gconv, int rootok)
|
|||
if (!doPAMAuth(psrv, &pdata))
|
||||
return False;
|
||||
|
||||
#elif defined(_AIX)
|
||||
|
||||
if ((td->displayType & d_location) == dForeign) {
|
||||
char *tmpch;
|
||||
strncpy(hostname, td->name, sizeof(hostname) - 1);
|
||||
hostname[sizeof(hostname)-1] = '\0';
|
||||
if ((tmpch = strchr(hostname, ':')))
|
||||
*tmpch = '\0';
|
||||
} else {
|
||||
hostname[0] = '\0';
|
||||
}
|
||||
|
||||
/* tty names should only be 15 characters long */
|
||||
# if 0
|
||||
for (i = 0; i < 15 && td->name[i]; i++) {
|
||||
if (td->name[i] == ':' || td->name[i] == '.')
|
||||
tty[i] = '_';
|
||||
else
|
||||
tty[i] = td->name[i];
|
||||
}
|
||||
tty[i] = '\0';
|
||||
# else
|
||||
memcpy(tty, "/dev/xdm/", 9);
|
||||
for (i = 0; i < 6 && td->name[i]; i++) {
|
||||
if (td->name[i] == ':' || td->name[i] == '.')
|
||||
tty[9 + i] = '_';
|
||||
else
|
||||
tty[9 + i] = td->name[i];
|
||||
}
|
||||
tty[9 + i] = '\0';
|
||||
# endif
|
||||
|
||||
if (!strcmp(curtype, "classic")) {
|
||||
if (!gconv(GCONV_USER, 0))
|
||||
return False;
|
||||
if (isNoPassAllowed(curuser)) {
|
||||
gconv(GCONV_PASS_ND, 0);
|
||||
if (!*curpass) {
|
||||
debug("accepting despite empty password\n");
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
if (!gconv(GCONV_PASS, 0))
|
||||
V_RET_NP;
|
||||
}
|
||||
msg = 0;
|
||||
if ((i = authenticate(curuser, curpass, &reenter, &msg))) {
|
||||
debug("authenticate() failed: %s\n", msg);
|
||||
free(msg);
|
||||
loginfailed(curuser, hostname, tty);
|
||||
if (i == ENOENT || i == ESAD)
|
||||
V_RET_AUTH;
|
||||
else
|
||||
V_RET_FAIL(0);
|
||||
}
|
||||
if (reenter) {
|
||||
logError("authenticate() requests more data: %s\n", msg);
|
||||
free(msg);
|
||||
V_RET_FAIL(0);
|
||||
}
|
||||
} else if (!strcmp(curtype, "generic")) {
|
||||
if (!gconv(GCONV_USER, 0))
|
||||
return False;
|
||||
for (curret = 0;;) {
|
||||
msg = 0;
|
||||
if ((i = authenticate(curuser, curret, &reenter, &msg))) {
|
||||
debug("authenticate() failed: %s\n", msg);
|
||||
free(msg);
|
||||
loginfailed(curuser, hostname, tty);
|
||||
if (i == ENOENT || i == ESAD)
|
||||
V_RET_AUTH;
|
||||
else
|
||||
V_RET_FAIL(0);
|
||||
}
|
||||
free(curret);
|
||||
if (!reenter)
|
||||
break;
|
||||
if (!(curret = gconv(GCONV_HIDDEN, msg)))
|
||||
return False;
|
||||
free(msg);
|
||||
}
|
||||
} else {
|
||||
logError("Unsupported authentication type %\"s requested\n", curtype);
|
||||
V_RET_FAIL(0);
|
||||
}
|
||||
if (msg) {
|
||||
displayStr(V_MSG_INFO, msg);
|
||||
free(msg);
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
#else
|
||||
|
||||
if (strcmp(curtype, "classic")) {
|
||||
|
@ -747,9 +639,7 @@ verify(GConvFunc gconv, int rootok)
|
|||
krbtkfile[0] = '\0';
|
||||
# endif /* KERBEROS */
|
||||
|
||||
# if defined(ultrix) || defined(__ultrix__)
|
||||
if (authenticate_user(p, curpass, 0) < 0)
|
||||
# elif defined(HAVE_PW_ENCRYPT)
|
||||
# if defined(HAVE_PW_ENCRYPT)
|
||||
if (!(crpt_passwd = pw_encrypt(curpass, p->pw_passwd)) || strcmp(crpt_passwd, p->pw_passwd))
|
||||
# elif defined(HAVE_CRYPT)
|
||||
if (!(crpt_passwd = crypt(curpass, p->pw_passwd)) || strcmp(crpt_passwd, p->pw_passwd))
|
||||
|
@ -763,11 +653,11 @@ verify(GConvFunc gconv, int rootok)
|
|||
|
||||
done:
|
||||
|
||||
#endif /* !defined(USE_PAM) && !defined(_AIX) */
|
||||
#endif /* !defined(USE_PAM) */
|
||||
|
||||
debug("restrict %s ...\n", curuser);
|
||||
|
||||
#if defined(USE_PAM) || defined(_AIX)
|
||||
#if defined(USE_PAM)
|
||||
if (!(p = getpwnam(curuser))) {
|
||||
logError("getpwnam(%s) failed.\n", curuser);
|
||||
V_RET_FAIL(0);
|
||||
|
@ -829,27 +719,7 @@ verify(GConvFunc gconv, int rootok)
|
|||
V_RET_AUTH;
|
||||
}
|
||||
|
||||
#elif defined(_AIX) /* USE_PAM */
|
||||
|
||||
msg = 0;
|
||||
if (loginrestrictions(curuser,
|
||||
((td->displayType & d_location) == dForeign) ? S_RLOGIN : S_LOGIN,
|
||||
tty, &msg) == -1) {
|
||||
debug("loginrestrictions() - %s\n", msg ? msg : "error");
|
||||
loginfailed(curuser, hostname, tty);
|
||||
prepareErrorGreet();
|
||||
if (msg) {
|
||||
displayStr(V_MSG_ERR, msg);
|
||||
free(msg);
|
||||
}
|
||||
gSendInt(V_AUTH);
|
||||
V_RET;
|
||||
}
|
||||
free(msg);
|
||||
|
||||
#endif /* USE_PAM || _AIX */
|
||||
|
||||
#ifndef _AIX
|
||||
#endif /* USE_PAM */
|
||||
|
||||
# ifdef HAVE_SETUSERCONTEXT
|
||||
# ifdef HAVE_LOGIN_GETCLASS
|
||||
|
@ -1021,8 +891,6 @@ verify(GConvFunc gconv, int rootok)
|
|||
}
|
||||
# endif
|
||||
|
||||
#endif /* !_AIX */
|
||||
|
||||
return True;
|
||||
|
||||
}
|
||||
|
@ -1030,9 +898,6 @@ verify(GConvFunc gconv, int rootok)
|
|||
|
||||
static const char *envvars[] = {
|
||||
"TZ", /* SYSV and SVR4, but never hurts */
|
||||
#ifdef _AIX
|
||||
"AUTHSTATE", /* for kerberos */
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -1144,13 +1009,7 @@ changeUser(const char *user, const char *authfile)
|
|||
if (authfile && chown(authfile, pw->pw_uid, pw->pw_gid))
|
||||
logWarn("chmod for %s failed: %m\n", authfile);
|
||||
|
||||
#ifdef AIXV3
|
||||
if (setpcred(user, NULL)) {
|
||||
logError("setusercontext for %s failed: %m\n", user);
|
||||
return False;
|
||||
}
|
||||
return True;
|
||||
#elif defined(HAS_SETUSERCONTEXT)
|
||||
#if defined(HAS_SETUSERCONTEXT)
|
||||
if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL)) {
|
||||
logError("setpcred for %s failed: %m\n", user);
|
||||
return False;
|
||||
|
@ -1297,12 +1156,6 @@ startClient(volatile int *pid)
|
|||
char **saved_env;
|
||||
# endif
|
||||
int pretc;
|
||||
#else
|
||||
# ifdef _AIX
|
||||
char *msg;
|
||||
char **theenv;
|
||||
extern char **newenv; /* from libs.a, this is set up by setpenv */
|
||||
# endif
|
||||
#endif
|
||||
char *failsafeArgv[2];
|
||||
char *buf, *buf2;
|
||||
|
@ -1314,7 +1167,7 @@ startClient(volatile int *pid)
|
|||
curdmrc = dmrcuser = 0;
|
||||
}
|
||||
|
||||
#if defined(USE_PAM) || defined(_AIX)
|
||||
#if defined(USE_PAM)
|
||||
if (!(p = getpwnam(curuser))) {
|
||||
logError("getpwnam(%s) failed.\n", curuser);
|
||||
pError:
|
||||
|
@ -1325,16 +1178,7 @@ startClient(volatile int *pid)
|
|||
|
||||
strcpy(curuser, p->pw_name); /* Use normalized login name. */
|
||||
|
||||
#ifndef USE_PAM
|
||||
# ifdef _AIX
|
||||
msg = 0;
|
||||
loginsuccess(curuser, hostname, tty, &msg);
|
||||
if (msg) {
|
||||
debug("loginsuccess() - %s\n", msg);
|
||||
free(msg);
|
||||
}
|
||||
# else /* _AIX */
|
||||
# if defined(KERBEROS) && defined(AFS)
|
||||
#if !defined(USE_PAM) && defined(KERBEROS) && defined(AFS)
|
||||
if (krbtkfile[0] != '\0') {
|
||||
if (k_hasafs()) {
|
||||
int fail = False;
|
||||
|
@ -1351,9 +1195,7 @@ startClient(volatile int *pid)
|
|||
"Warning: Problems during Kerberos4/AFS setup.");
|
||||
}
|
||||
}
|
||||
# endif /* KERBEROS && AFS */
|
||||
# endif /* _AIX */
|
||||
#endif /* !PAM */
|
||||
#endif /* !PAM && KERBEROS && AFS*/
|
||||
|
||||
curuid = p->pw_uid;
|
||||
curgid = p->pw_gid;
|
||||
|
@ -1372,7 +1214,7 @@ startClient(volatile int *pid)
|
|||
env = setEnv(env, "PATH", curuid ? td->userPath : td->systemPath);
|
||||
env = setEnv(env, "SHELL", p->pw_shell);
|
||||
env = setEnv(env, "HOME", p->pw_dir);
|
||||
#if !defined(USE_PAM) && !defined(_AIX) && defined(KERBEROS)
|
||||
#if !defined(USE_PAM) && defined(KERBEROS)
|
||||
if (krbtkfile[0] != '\0')
|
||||
env = setEnv(env, "KRBTKFILE", krbtkfile);
|
||||
#endif
|
||||
|
@ -1530,9 +1372,6 @@ startClient(volatile int *pid)
|
|||
}
|
||||
|
||||
/* Memory leaks are ok here as we exec() soon. */
|
||||
|
||||
#if defined(USE_PAM) || !defined(_AIX)
|
||||
|
||||
# ifdef USE_PAM
|
||||
/* pass in environment variables set by libpam and modules it called */
|
||||
# ifdef HAVE_PAM_GETENVLIST
|
||||
|
@ -1594,32 +1433,6 @@ startClient(volatile int *pid)
|
|||
|
||||
# endif /* !HAVE_SETUSERCONTEXT */
|
||||
|
||||
#else /* PAM || !_AIX */
|
||||
/*
|
||||
* Set the user's credentials: uid, gid, groups,
|
||||
* audit classes, user limits, and umask.
|
||||
*/
|
||||
if (setpcred(curuser, 0) == -1) {
|
||||
logError("setpcred for %s failed: %m\n", curuser);
|
||||
goto cError;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the users process environment. Store protected variables and
|
||||
* obtain updated user environment list. This call will initialize
|
||||
* global 'newenv'.
|
||||
*/
|
||||
userEnviron = xCopyStrArr(1, userEnviron);
|
||||
userEnviron[0] = (char *)"USRENVIRON:";
|
||||
if (setpenv(curuser, PENV_INIT | PENV_ARGV | PENV_NOEXEC,
|
||||
userEnviron, 0) != 0) {
|
||||
logError("Cannot set %s's process environment\n", curuser);
|
||||
goto cError;
|
||||
}
|
||||
userEnviron = newenv;
|
||||
|
||||
#endif /* _AIX */
|
||||
|
||||
/*
|
||||
* for user-based authorization schemes,
|
||||
* use the password to get the user's credentials.
|
||||
|
@ -1825,7 +1638,7 @@ clientExited(void)
|
|||
#ifdef K5AUTH
|
||||
krb5Destroy(td->name);
|
||||
#endif /* K5AUTH */
|
||||
#if !defined(USE_PAM) && !defined(_AIX)
|
||||
#if !defined(USE_PAM)
|
||||
# ifdef KERBEROS
|
||||
if (krbtkfile[0]) {
|
||||
(void)dest_tkt();
|
||||
|
@ -1835,7 +1648,7 @@ clientExited(void)
|
|||
# endif
|
||||
}
|
||||
# endif
|
||||
#endif /* !USE_PAM && !_AIX*/
|
||||
#endif /* !USE_PAM */
|
||||
}
|
||||
exit(0);
|
||||
case -1:
|
||||
|
|
|
@ -1178,9 +1178,6 @@ sigHandler(int n)
|
|||
char buf = (char)n;
|
||||
/* debug("caught signal %d\n", n); this hangs in syslog() */
|
||||
write(signalFds[1], &buf, 1);
|
||||
#ifdef __EMX__
|
||||
(void)Signal(n, sigHandler);
|
||||
#endif
|
||||
errno = olderrno;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,10 +61,6 @@ from the copyright holder.
|
|||
extern char **environ;
|
||||
|
||||
#ifdef XDMCP
|
||||
# if defined(__osf__)
|
||||
/* someone somewhere defines QUERY under Tru64 which confuses Xdmcp.h */
|
||||
# undef QUERY
|
||||
# endif
|
||||
# include <X11/Xdmcp.h>
|
||||
#endif
|
||||
|
||||
|
@ -92,7 +88,7 @@ extern char **environ;
|
|||
#define wcSig(w) (((w) >> 8) & 0xff)
|
||||
|
||||
#include <setjmp.h>
|
||||
#if defined(__EMX__) || (defined(__NetBSD__) && defined(__sparc__)) /* XXX netbsd? */
|
||||
#if defined(__NetBSD__) && defined(__sparc__) /* XXX netbsd? */
|
||||
# define Setjmp(e) setjmp(e)
|
||||
# define Longjmp(e,v) longjmp(e,v)
|
||||
# define Jmp_buf jmp_buf
|
||||
|
|
|
@ -34,35 +34,20 @@ authorization.
|
|||
#ifndef _DM_SOCKET_H_
|
||||
#define _DM_SOCKET_H_ 1
|
||||
|
||||
#ifndef __Lynx__
|
||||
# include <sys/socket.h>
|
||||
#else
|
||||
# include <socket.h>
|
||||
#endif
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifdef TCPCONN
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef UNIXCONN
|
||||
# ifndef __Lynx__
|
||||
# include <sys/un.h>
|
||||
# else
|
||||
# include <un.h>
|
||||
# endif
|
||||
# include <sys/un.h>
|
||||
#endif
|
||||
|
||||
#ifdef DNETCONN
|
||||
# include <netdnet/dn.h>
|
||||
#endif
|
||||
|
||||
#if (defined(__svr4__) && !defined(__sun__)) && defined(SIOCGIFCONF)
|
||||
# define SYSV_SIOCGIFCONF
|
||||
int ifioctl(int fd, int cmd, char *arg);
|
||||
#else
|
||||
# define ifioctl ioctl
|
||||
#endif
|
||||
|
||||
#ifdef BSD
|
||||
# if (BSD >= 199103)
|
||||
# define VARIABLE_IFREQ
|
||||
|
|
|
@ -154,12 +154,10 @@ convertAddr(char *saddr, int *len, CARD8 **addr)
|
|||
break;
|
||||
#endif
|
||||
#ifdef AF_UNIX
|
||||
#ifndef __hpux
|
||||
case AF_UNIX:
|
||||
retval = FamilyLocal;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef TCPCONN
|
||||
case AF_INET:
|
||||
retval = FamilyInternet;
|
||||
|
|
|
@ -52,7 +52,6 @@ from the copyright holder.
|
|||
|
||||
SIGFUNC Signal(int sig, SIGFUNC handler)
|
||||
{
|
||||
#ifndef __EMX__
|
||||
struct sigaction sigact, osigact;
|
||||
sigact.sa_handler = handler;
|
||||
sigemptyset(&sigact.sa_mask);
|
||||
|
@ -63,9 +62,6 @@ SIGFUNC Signal(int sig, SIGFUNC handler)
|
|||
# endif
|
||||
sigaction(sig, &sigact, &osigact);
|
||||
return osigact.sa_handler;
|
||||
#else
|
||||
return signal(sig, handler);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -39,13 +39,8 @@ from The Open Group.
|
|||
#include "dm.h"
|
||||
#include "dm_error.h"
|
||||
|
||||
#if defined(__svr4__) || defined(__Lynx__) || defined(__QNX__) || defined(__APPLE__) || defined(_SEQUENT_) /*|| defined(USE_PAM)*/
|
||||
# define NO_LASTLOG
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
# if __FreeBSD_version >= 900007
|
||||
#if defined(__FreeBSD__) && __FreeBSD_version >= 900007
|
||||
# define NO_LASTLOG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_LASTLOG
|
||||
|
@ -76,13 +71,6 @@ from The Open Group.
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
# define UTL_PFX "xdm/"
|
||||
# define UTL_OFF strlen(UTL_PFX)
|
||||
#else
|
||||
# define UTL_OFF 0
|
||||
#endif
|
||||
|
||||
#ifndef BSD_UTMP
|
||||
static unsigned
|
||||
crc32s(const char *str)
|
||||
|
@ -161,7 +149,7 @@ sessreg(struct display *d, int pid, const char *user, int uid)
|
|||
|
||||
colon = strchr(d->name, ':');
|
||||
clen = strlen(colon);
|
||||
if (clen > (int)(sizeof(ut_ent.ut_line) - UTL_OFF) - 2)
|
||||
if (clen > (int)(sizeof(ut_ent.ut_line)) - 2)
|
||||
return; /* uhm, well ... */
|
||||
if (colon == d->name) {
|
||||
#ifndef BSD_UTMP
|
||||
|
@ -195,7 +183,7 @@ sessreg(struct display *d, int pid, const char *user, int uid)
|
|||
c < 52 ? c - 26 + 'a' : c - 52 + '0';
|
||||
}
|
||||
#endif
|
||||
left = sizeof(ut_ent.ut_line) - UTL_OFF - clen;
|
||||
left = sizeof(ut_ent.ut_line) - clen;
|
||||
if (colon - d->name <= left) {
|
||||
clen += colon - d->name;
|
||||
colon = d->name;
|
||||
|
@ -203,26 +191,23 @@ sessreg(struct display *d, int pid, const char *user, int uid)
|
|||
} else {
|
||||
dot = strchr(d->name, '.');
|
||||
if (dot && dot - d->name < left) {
|
||||
memcpy(ut_ent.ut_line + UTL_OFF, d->name, left - 1);
|
||||
ut_ent.ut_line[UTL_OFF + left - 1] = '~';
|
||||
memcpy(ut_ent.ut_line, d->name, left - 1);
|
||||
ut_ent.ut_line[left - 1] = '~';
|
||||
} else {
|
||||
memcpy(ut_ent.ut_line + UTL_OFF, d->name, left / 2 - 1);
|
||||
ut_ent.ut_line[UTL_OFF + left/2 - 1] = '~';
|
||||
memcpy(ut_ent.ut_line, d->name, left / 2 - 1);
|
||||
ut_ent.ut_line[left/2 - 1] = '~';
|
||||
if (dot) {
|
||||
memcpy(ut_ent.ut_line + UTL_OFF + left / 2,
|
||||
memcpy(ut_ent.ut_line + left / 2,
|
||||
dot - (left - left / 2 - 1),
|
||||
left - left / 2 - 1);
|
||||
ut_ent.ut_line[UTL_OFF + left - 1] = '~';
|
||||
ut_ent.ut_line[left - 1] = '~';
|
||||
} else
|
||||
memcpy(ut_ent.ut_line + UTL_OFF + left / 2,
|
||||
memcpy(ut_ent.ut_line + left / 2,
|
||||
colon - (left - left / 2), left - left / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef UTL_PFX
|
||||
memcpy(ut_ent.ut_line, UTL_PFX, UTL_OFF);
|
||||
#endif
|
||||
memcpy(ut_ent.ut_line + UTL_OFF + left, colon, clen);
|
||||
memcpy(ut_ent.ut_line + left, colon, clen);
|
||||
|
||||
#ifndef NO_UTMP
|
||||
# ifdef BSD_UTMP
|
||||
|
@ -322,17 +307,4 @@ sessreg(struct display *d, int pid, const char *user, int uid)
|
|||
#else
|
||||
(void)uid;
|
||||
#endif
|
||||
|
||||
#ifdef UTL_PFX
|
||||
{
|
||||
char tmp[sizeof("/dev/") + sizeof(ut_ent.ut_line)];
|
||||
mkdir("/dev/" UTL_PFX, 0755);
|
||||
chmod("/dev/" UTL_PFX, 0755);
|
||||
sprintf(tmp, "/dev/%.*s", sizeof(ut_ent.ut_line), ut_ent.ut_line);
|
||||
if (pid)
|
||||
close(creat(tmp, 0644));
|
||||
else
|
||||
unlink(tmp);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -46,10 +46,6 @@ from the copyright holder.
|
|||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if 0 /*def USG; this was hpux once upon a time */
|
||||
# define NEED_UTSNAME
|
||||
#endif
|
||||
|
||||
#ifdef NEED_UTSNAME
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
|
|
|
@ -645,7 +645,7 @@ forward_respond(struct sockaddr *from, int fromlen ATTR_UNUSED,
|
|||
memmove(un_addr.sun_path, clientAddress.data, clientAddress.length);
|
||||
un_addr.sun_path[clientAddress.length] = '\0';
|
||||
client = (struct sockaddr *)&un_addr;
|
||||
#if defined(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN) && !defined(__Lynx__) && defined(UNIXCONN)
|
||||
#if defined(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN) && defined(UNIXCONN)
|
||||
un_addr.sun_len = strlen(un_addr.sun_path);
|
||||
clientlen = SUN_LEN(&un_addr);
|
||||
#else
|
||||
|
|
|
@ -34,10 +34,7 @@
|
|||
|
||||
#include <sys/param.h> /* for #define BSD */
|
||||
|
||||
#ifdef _AIX
|
||||
# define HALT_CMD "/usr/sbin/shutdown -h now"
|
||||
# define REBOOT_CMD "/usr/sbin/shutdown -r now"
|
||||
#elif defined(__linux__)
|
||||
#if defined(__linux__)
|
||||
# define HALT_CMD "/sbin/poweroff"
|
||||
# define REBOOT_CMD "/sbin/reboot"
|
||||
#elif defined(BSD)
|
||||
|
@ -68,17 +65,11 @@
|
|||
#ifdef HAVE_VTS
|
||||
#elif defined(__sun__)
|
||||
# define DEF_SERVER_TTY "console"
|
||||
#elif defined(_AIX)
|
||||
# define DEF_SERVER_TTY "lft0"
|
||||
#else
|
||||
# define DEF_SERVER_TTY ""
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
# define DEF_SERVER_CMD XBINDIR "/X -T -force"
|
||||
#else
|
||||
# define DEF_SERVER_CMD XBINDIR "/X"
|
||||
#endif
|
||||
#define DEF_SERVER_CMD XBINDIR "/X"
|
||||
</code>
|
||||
|
||||
# The contents of this section are copied mostly verbatim to the
|
||||
|
|
|
@ -1809,37 +1809,10 @@ edit_startup(File *file)
|
|||
chg1 = True;
|
||||
if (oldver < 0x0203) {
|
||||
chg2 =
|
||||
#ifdef _AIX
|
||||
delstr(file, "\n"
|
||||
"# We create a pseudodevice for finger. (host:0 becomes [kx]dm/host_0)\n");
|
||||
"# Without it, finger errors out with \"Cannot stat /dev/host:0\".\n"
|
||||
"#\n"
|
||||
"if [[] -f /usr/lib/X11/xdm/sessreg ]; then\n"
|
||||
" devname=`echo $DISPLAY | /usr/bin/sed -e 's/[[]:\\.]/_/g' | /usr/bin/cut -c1-8`\n"
|
||||
" hostname=`echo $DISPLAY | /usr/bin/cut -d':' -f1`\n"
|
||||
"\n"
|
||||
" if [[] -z \"$devname\" ]; then\n"
|
||||
" devname=\"unknown\"\n"
|
||||
" fi\n"
|
||||
" if [[] ! -d /dev/[kx]dm ]; then\n"
|
||||
" /usr/bin/mkdir /dev/[kx]dm\n"
|
||||
" /usr/bin/chmod 755 /dev/[kx]dm\n"
|
||||
" fi\n"
|
||||
" /usr/bin/touch /dev/[kx]dm/$devname\n"
|
||||
" /usr/bin/chmod 644 /dev/[kx]dm/$devname\n"
|
||||
"\n"
|
||||
" if [[] -z \"$hostname\" ]; then\n"
|
||||
" exec /usr/lib/X11/xdm/sessreg -a -l [kx]dm/$devname $USER\n"
|
||||
" else\n"
|
||||
" exec /usr/lib/X11/xdm/sessreg -a -l [kx]dm/$devname -h $hostname $USER\n"
|
||||
" fi\n"
|
||||
"fi\n") |
|
||||
#else
|
||||
# ifdef BSD
|
||||
delstr(file, "\n"
|
||||
"exec sessreg -a -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n") |
|
||||
# endif
|
||||
#endif /* _AIX */
|
||||
delstr(file, "\n"
|
||||
"exec sessreg -a -l $DISPLAY"
|
||||
#ifdef BSD
|
||||
|
@ -1877,18 +1850,10 @@ static int
|
|||
edit_reset(File *file)
|
||||
{
|
||||
return
|
||||
#ifdef _AIX
|
||||
delstr(file, "\n"
|
||||
"if [[] -f /usr/lib/X11/xdm/sessreg ]; then\n"
|
||||
" devname=`echo $DISPLAY | /usr/bin/sed -e 's/[[]:\\.]/_/g' | /usr/bin/cut -c1-8`\n"
|
||||
" exec /usr/lib/X11/xdm/sessreg -d -l [kx]dm/$devname $USER\n"
|
||||
"fi\n") |
|
||||
#else
|
||||
# ifdef BSD
|
||||
delstr(file, "\n"
|
||||
"exec sessreg -d -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n") |
|
||||
# endif
|
||||
#endif /* _AIX */
|
||||
delstr(file, "\n"
|
||||
"exec sessreg -d -l $DISPLAY"
|
||||
# ifdef BSD
|
||||
|
|
|
@ -45,12 +45,10 @@ extern "C" {
|
|||
#include <termios.h>
|
||||
}
|
||||
#endif
|
||||
#if !defined(__osf__)
|
||||
#ifdef HAVE_TERMIO_H
|
||||
/* needed at least on AIX */
|
||||
#include <termio.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_HPUX_SOURCE)
|
||||
#define _TERMIOS_INCLUDED
|
||||
|
|
|
@ -93,11 +93,8 @@ int main(int argc, char **argv)
|
|||
app.setQuitOnLastWindowClosed( false );
|
||||
|
||||
// Stop gracefully
|
||||
//There is no SIGINT and SIGTERM under wince
|
||||
#ifndef _WIN32_WCE
|
||||
KDE_signal(SIGINT, sighandler);
|
||||
KDE_signal(SIGTERM, sighandler);
|
||||
#endif
|
||||
KDE_signal(SIGHUP, sighandler);
|
||||
|
||||
// Restart on a crash
|
||||
|
|
|
@ -1,239 +0,0 @@
|
|||
/*
|
||||
Copyright 2010 Reza Arbab <arbab@austin.ibm.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <cf.h>
|
||||
#define class _class
|
||||
#include <odmi.h>
|
||||
#include <sys/cfgodm.h>
|
||||
#include <sys/cfgdb.h>
|
||||
#undef class
|
||||
#include <nl_types.h>
|
||||
#include <string.h>
|
||||
#include <kdebug.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/statfs.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
char * device_description(struct CuDv *cudv) {
|
||||
char *desc= NULL;
|
||||
struct PdDv *pddv = cudv->PdDvLn; /* link to Predefined Devices database */
|
||||
nl_catd cat;
|
||||
|
||||
cat = catopen("/usr/lib/methods/devices.cat", NL_CAT_LOCALE);
|
||||
if ((int)cat == -1)
|
||||
return NULL;
|
||||
|
||||
desc = strdup(catgets(cat, pddv->setno, pddv->msgno, "N/A") );
|
||||
catclose(cat);
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
bool list_devices(QListView *lBox, char *criteria) {
|
||||
struct CuDv *cudv; /* Customized Devices */
|
||||
struct listinfo info;
|
||||
int i;
|
||||
char *cudv_desc;
|
||||
QString cudv_status;
|
||||
QListViewItem *lastitem= NULL;
|
||||
|
||||
lBox->addColumn(i18n("Name"));
|
||||
lBox->addColumn(i18n("Status"));
|
||||
lBox->addColumn(i18n("Location"));
|
||||
lBox->addColumn(i18n("Description"));
|
||||
|
||||
if (odm_initialize() == -1) {
|
||||
kError(0) << "odm_initialize() failed: odmerrno = " << odmerrno << endl;
|
||||
return (false);
|
||||
}
|
||||
|
||||
cudv = (struct CuDv *) odm_get_list(CuDv_CLASS, criteria, &info, 100, 2);
|
||||
|
||||
if ((int)cudv == -1) {
|
||||
odm_terminate();
|
||||
kError(0) << "odm_get_list() failed: odmerrno = " << odmerrno << endl;
|
||||
return (false);
|
||||
} else if (!cudv) /* empty list */
|
||||
{
|
||||
odm_terminate();
|
||||
return (true);
|
||||
}
|
||||
|
||||
for (i=0; i<info.num; i++) {
|
||||
switch (cudv[i].status) {
|
||||
case DEFINED:
|
||||
cudv_status = QString("Defined");
|
||||
break;
|
||||
case AVAILABLE:
|
||||
cudv_status = QString("Available");
|
||||
break;
|
||||
case STOPPED:
|
||||
cudv_status = QString("Stopped");
|
||||
break;
|
||||
default:
|
||||
cudv_status = QString("Unknown");
|
||||
}
|
||||
cudv_desc = device_description(&cudv[i]);
|
||||
|
||||
lastitem = new QListViewItem(lBox, lastitem,
|
||||
QString(cudv[i].name),
|
||||
cudv_status,
|
||||
QString(cudv[i].location),
|
||||
QString(cudv_desc ? cudv_desc : "N/A") );
|
||||
|
||||
if (cudv_desc)
|
||||
free(cudv_desc);
|
||||
}
|
||||
|
||||
if (odm_free_list(cudv, &info) == -1) {
|
||||
odm_terminate();
|
||||
kError(0) << "odm_free_list() failed: odmerrno = " << odmerrno << endl;
|
||||
return (false);
|
||||
}
|
||||
|
||||
odm_terminate();
|
||||
return true;
|
||||
}
|
||||
|
||||
enum CHIP
|
||||
{
|
||||
P2SC, Power, Power2, Power3, Power3_II, PowerPC,
|
||||
PowerPC_604e, PowerPersonal, RD64_II, RS_III, RS64, RS64_II,
|
||||
RS64_III, RS64_IV, RSC, ThinkPad, unknown,
|
||||
NUM_CHIPS
|
||||
};
|
||||
static const char chip_name[NUM_CHIPS][16] = { "P2SC", "Power", "Power2", "Power3", "Power3-II", "PowerPC", "PowerPC 604e", "PowerPersonal", "RD64-II", "RS-III", "RS64", "RS64-II", "RS64-III", "RS64-IV", "RSC", "ThinkPad", "unknown" };
|
||||
|
||||
struct model {
|
||||
char model_ID[21];
|
||||
char machine_type[21];
|
||||
char processor_speed[21];
|
||||
unsigned short architecture; /* enum CHIP */
|
||||
};
|
||||
|
||||
const
|
||||
struct model _models[] = { { "02", "7015-930", "25", Power }, { "10", "7013-530", "25", Power }, { "10", "7016-730", "25", Power }, { "11", "7013-540", "30", Power }, { "14", "7013-540", "30", Power }, { "18", "7013-53H", "33", Power }, { "1C", "7013-550", "41.6", Power }, { "20", "7015-930", "25",
|
||||
Power }, { "2E", "7015-950", "41", Power }, { "30", "7013-520", "20", Power }, { "31", "7012-320", "20", Power }, { "34", "7013-52H", "25", Power }, { "35", "7012-32H", "25", Power }, { "37", "7012-340", "33", Power }, { "38", "7012-350", "41", Power }, { "41", "7011-20", "33", PowerPC }, {
|
||||
"45", "7011-220", "33", PowerPC }, { "42", "7006-41T/41W", "80", PowerPC }, { "43", "7008-M20", "33", Power }, { "43", "7008-M2A", "33", Power }, { "46", "7011-250", "66", PowerPC }, { "47", "7011-230", "45", RSC }, { "48", "7009-C10", "80", PowerPC },
|
||||
/* 4C models use a different table -- see below */
|
||||
{ "4C", "70XX", "(unknown)", unknown }, { "57", "7012-390", "67", Power2 }, { "57", "7030-3BT", "67", Power2 }, { "57", "9076-SP2 Thin", "67", Power2 }, { "58", "7012-380", "59", Power2 }, { "58", "7030-3AT", "59", Power2 }, { "59", "7012-39H", "67", Power2 }, { "59", "9076-SP2 Thin w/L2", "67",
|
||||
Power2 }, { "5C", "7013-560", "50", Power }, { "63", "7015-970", "50", Power }, { "63", "7015-97B", "50", Power }, { "64", "7015-980", "62.5", Power }, { "64", "7015-98B", "62.5", Power }, { "66", "7013-580", "62.5", Power }, { "67", "7013-570", "50", Power }, { "67", "7015-R10", "50",
|
||||
Power }, { "70", "7013-590", "66", Power2 }, { "70", "9076-SP2 Wide", "66", Power2 }, { "71", "7013-58H", "55", Power2 }, { "72", "7013-59H", "66", Power2 }, { "72", "7015-R20", "66", Power2 }, { "72", "9076-SP2 Wide", "66", Power2 }, { "75", "7012-370", "62", Power }, { "75", "7012-375",
|
||||
"62", Power }, { "75", "9076-SP1 Thin", "62", Power }, { "76", "7012-360", "50", Power }, { "76", "7012-365", "50", Power }, { "77", "7012-350", "41", Power }, { "77", "7012-355", "41", Power }, { "77", "7013-55L", "41.6", Power }, { "79", "7013-591", "77", Power2 }, { "79",
|
||||
"9076-SP2 Wide", "77", Power2 }, { "80", "7015-990", "71.5", Power2 }, { "81", "7015-R24", "71.5", P2SC }, { "89", "7013-595", "135", P2SC }, { "89", "9076-SP2 Wide", "135", P2SC }, { "90", "7009-C20", "120", PowerPC }, { "91", "7006-42W/42T", "120", PowerPC }, { "94", "7012-397", "160",
|
||||
P2SC }, { "94", "9076-SP2 Thin", "160", P2SC }, { "A0", "7013-J30", "75", PowerPC }, { "A1", "7013-J40", "112", PowerPC }, { "A3", "7015-R30", "(unknown)", PowerPC }, { "A4", "7015-R40", "(unknown)", PowerPC }, { "A4", "7015-R50", "(unknown)", PowerPC }, { "A4", "9076-SP2 High",
|
||||
"(unknown)", PowerPC }, { "A6", "7012-G30", "(unknown)", PowerPC }, { "A7", "7012-G40", "(unknown)", PowerPC }, { "C0", "7024-E20", "(unknown)", PowerPC }, { "C0", "7024-E30", "(unknown)", PowerPC }, { "C4", "7025-F30", "(unknown)", PowerPC }, { "F0", "7007-N40", "50", ThinkPad }, { "", "",
|
||||
"0", 0 } };
|
||||
|
||||
const
|
||||
struct model _4C_models[] = { { "IBM,7017-S70", "7017-S70", "125", RS64 }, { "IBM,7017-S7A", "7017-S7A", "262", RD64_II }, { "IBM,7017-S80", "7017-S80", "450", RS_III }, { "IBM,7017-S85", "pSeries 680", "600", RS64_IV }, { "IBM,7025-F40", "7025-F40", "166/233", PowerPC_604e }, { "IBM,7025-F50",
|
||||
"7025-F50", "(unknown)", PowerPC_604e }, { "IBM,7025-F80", "7025-F80", "(unknown)", RS64_III }, { "IBM,7026-H10", "7025-H10", "166/233", PowerPC_604e }, { "IBM,7026-H50", "7025-H50", "(unknown)", PowerPC_604e }, { "IBM,7026-H80", "7025-H80", "(unknown)", RS64_III }, { "IBM,7026-M80",
|
||||
"7026-M80", "500", RS64_III }, { "IBM,7025-F40", "7025-F40", "166/233", PowerPC }, { "IBM,7025-F50", "7025-F50", "(unknown)", PowerPC }, { "IBM,7025-F80", "7025-F80", "450", PowerPC }, { "IBM,7026-B80", "pSeries 640", "375", Power3_II }, { "IBM,7026-H10", "7026-H10", "166/233", PowerPC }, {
|
||||
"IBM,7026-H50", "7026-H50", "(unknown)", PowerPC }, { "IBM,7026-H70", "7026-H70", "340", RS64_II }, { "IBM,7026-H80", "7026-H80", "450", PowerPC }, { "IBM,7026-M80", "7026-M80", "500", PowerPC }, { "IBM,7042-140", "7043-140", "166/200/233/332", PowerPC }, { "IBM,7042-150", "7043-150",
|
||||
"375", PowerPC }, { "IBM,7042-240", "7043-240", "166/233", PowerPC }, { "IBM,7043-140", "7043-140", "166/200/233/332", PowerPC }, { "IBM,7043-150", "7043-150", "375", PowerPC }, { "IBM,7043-240", "7043-240", "166/233", PowerPC }, { "IBM,7043-260", "7043-260", "200", Power3 }, { "IBM,7248",
|
||||
"7248-100", "100", PowerPersonal }, { "IBM,7248", "7248-120", "120", PowerPersonal }, { "IBM,7248", "7248-132", "132", PowerPersonal }, { "IBM,9076-270", "9076-SP Silver Node", "(unknown)", PowerPC }, { "", "", "", 0 },
|
||||
};
|
||||
|
||||
/* all GetInfo_ functions should return true, when the Information
|
||||
was filled into the lBox-Widget.
|
||||
returning false indicates, that information was not available.
|
||||
*/
|
||||
|
||||
bool GetInfo_XServer_and_Video(QListView *lBox) {
|
||||
return GetInfo_XServer_Generic(lBox);
|
||||
}
|
||||
|
||||
bool GetInfo_IRQ(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_DMA(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_PCI(QTreeWidget* tree) {
|
||||
return list_devices(tree, (char *)"PdDvLn like '*/pci/*'");
|
||||
}
|
||||
|
||||
bool GetInfo_IO_Ports(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_SCSI(QListView *lBox) {
|
||||
return list_devices(lBox, (char *)"PdDvLn like '*/scsi/*'");
|
||||
}
|
||||
|
||||
/* Parts taken from fsusage.c from the Midnight Commander (mc)
|
||||
|
||||
Copyright (C) 1991, 1992 Free Software Foundation, In
|
||||
|
||||
Return the number of TOSIZE-byte blocks used by
|
||||
BLOCKS FROMSIZE-byte blocks, rounding away from zero.
|
||||
TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */
|
||||
|
||||
static long fs_adjust_blocks(long blocks, int fromsize, int tosize) {
|
||||
if (tosize <= 0)
|
||||
abort();
|
||||
if (fromsize <= 0)
|
||||
return -1;
|
||||
|
||||
if (fromsize == tosize) /* E.g., from 512 to 512. */
|
||||
return blocks;
|
||||
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
|
||||
return blocks * (fromsize / tosize);
|
||||
else
|
||||
/* E.g., from 256 to 512. */
|
||||
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
|
||||
}
|
||||
|
||||
/* Fill in the fields of FSP with information about space usage for
|
||||
the filesystem on which PATH resides.
|
||||
Return 0 if successful, -1 if not. */
|
||||
|
||||
#define CONVERT_BLOCKS(b) fs_adjust_blocks ((b), fsd.f_bsize, 512)
|
||||
|
||||
static int get_fs_usage(char *path, long *l_total, long *l_avail) {
|
||||
struct statfs fsd; /* 4.3BSD, SunOS 4, HP-UX, AIX. */
|
||||
unsigned long fsu_blocks, fsu_bfree, fsu_bavail;
|
||||
|
||||
*l_total = *l_avail = 0;
|
||||
if (statfs(path, &fsd) < 0)
|
||||
return -1;
|
||||
|
||||
fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
|
||||
fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
|
||||
fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
|
||||
|
||||
*l_avail = getuid() ? fsu_bavail/2 : fsu_bfree/2;
|
||||
*l_total = fsu_blocks/2;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,240 +0,0 @@
|
|||
|
||||
/*
|
||||
Copyright 1998 Helge Deller deller@gmx.de
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License or (at your option) version 3 or any later version
|
||||
accepted by the membership of KDE e.V. (or its successor approved
|
||||
by the membership of KDE e.V.), which shall act as a proxy
|
||||
defined in Section 14 of version 3 of the license.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <fstab.h>
|
||||
#include <stdlib.h>
|
||||
#include <QFile>
|
||||
#include <QFontMetrics>
|
||||
#include <QTextStream>
|
||||
|
||||
# define INFO_PCI "" // Please, who know it ????
|
||||
# define INFO_PCI_EISA "/etc/eisa/system.sci" // File !
|
||||
# define INFO_IOPORTS_1 "/etc/dmesg" // as pipe !
|
||||
# define INFO_IOPORTS_2 "/usr/sbin/dmesg" // as pipe !
|
||||
# define INFO_DEVICES "/etc/ioscan" // as pipe !!
|
||||
|
||||
/* The following table is from an HP-UX 10.20 System
|
||||
build out of the files
|
||||
"/usr/lib/sched.models"
|
||||
or
|
||||
"/opt/langtools/lib/sched.models"
|
||||
If you have more entries, then please add them or send them to me!
|
||||
*/
|
||||
|
||||
// entries for PA_REVISION[]
|
||||
enum V_ENTRIES
|
||||
{ V_1x0,
|
||||
V_1x1, V_1x1a, V_1x1b, V_1x1c, V_1x1d, V_1x1e,
|
||||
V_2x0,
|
||||
V_LAST};
|
||||
|
||||
static const char PA_REVISION[V_LAST][7] = { "1.0", "1.1", "1.1a", "1.1b", "1.1c", "1.1d", "1.1e", "2.0" };
|
||||
|
||||
// entries for PA_NAME[]
|
||||
enum PA_ENTRIES
|
||||
{ PA7000,
|
||||
PA7100, PA7100LC, PA7200, PA7300,
|
||||
PA8000, PA8200, PA8500,
|
||||
PARISC_PA_LAST};
|
||||
|
||||
static const char PA_NAME[PARISC_PA_LAST][11] = { "PA7000", "PA7100", "PA7100LC", "PA7200", "PA7300", "PA8000", "PA8200", "PA8500" };
|
||||
|
||||
struct _type_LOOKUPTABLE {
|
||||
char Name[8];
|
||||
unsigned short parisc_rev; // = enum V_ENTRIES
|
||||
unsigned short parisc_name; // = enum PA_ENTRIES
|
||||
};
|
||||
|
||||
static const struct _type_LOOKUPTABLE PA_LOOKUPTABLE[] = {
|
||||
/* VERSION A.00.07
|
||||
(there seems to exist several different files with same version-number !)*/
|
||||
{ "600", V_1x0, PA7000 }, { "635", V_1x0, PA7000 }, { "645", V_1x0, PA7000 }, { "700", V_1x1, PA7000 }, { "705", V_1x1a, PA7000 }, { "710", V_1x1a, PA7000 }, { "712", V_1x1c, PA7100LC }, { "715", V_1x1c, PA7100LC }, { "720", V_1x1a, PA7000 }, { "722", V_1x1c, PA7100LC },
|
||||
{ "725", V_1x1c, PA7100LC }, { "728", V_1x1d, PA7200 }, { "730", V_1x1a, PA7000 }, { "735", V_1x1b, PA7100 },
|
||||
{ "742", V_1x1b, PA7100 },
|
||||
{ "743", V_1x1b, PA7100 }, // or a 1.1c,PA7100LC !!
|
||||
{ "744", V_1x1e, PA7300 }, { "745", V_1x1b, PA7100 }, { "747", V_1x1b, PA7100 }, { "750", V_1x1a, PA7000 }, { "755", V_1x1b, PA7100 }, { "770", V_1x1d, PA7200 }, { "777", V_1x1d, PA7200 }, { "778", V_1x1e, PA7300 }, { "779", V_1x1e, PA7300 }, { "780", V_2x0, PA8000 },
|
||||
{ "781", V_2x0, PA8000 }, { "782", V_2x0, PA8200 }, { "783", V_2x0, PA8500 }, { "785", V_2x0, PA8500 },
|
||||
{ "800", V_1x0, PA7000 }, // and one with: 2.0 / PA8000
|
||||
{ "801", V_1x1c, PA7100LC }, { "802", V_2x0, PA8000 }, { "803", V_1x1e, PA7300 }, { "804", V_2x0, PA8000 }, { "806", V_1x1c, PA7100LC }, { "807", V_1x1a, PA7000 }, { "808", V_1x0, PA7000 }, { "809", V_1x1d, PA7200 }, { "810", V_2x0, PA8000 }, { "811", V_1x1c, PA7100LC }, { "813", V_1x1e,
|
||||
PA7300 }, { "815", V_1x0, PA7000 }, { "816", V_1x1c, PA7100LC }, { "817", V_1x1a, PA7000 }, { "819", V_1x1d, PA7200 }, { "820", V_2x0, PA8000 }, { "821", V_1x1d, PA7200 }, { "822", V_1x0, PA7000 }, { "825", V_1x0, PA7000 }, { "826", V_1x1c, PA7100LC }, { "827", V_1x1a, PA7000 }, {
|
||||
"829", V_1x1d, PA7200 }, { "831", V_1x1d, PA7200 }, { "832", V_1x0, PA7000 }, { "834", V_1x0, PA7000 }, { "835", V_1x0, PA7000 }, { "837", V_1x1a, PA7000 }, { "839", V_1x1d, PA7200 }, { "840", V_1x0, PA7000 }, { "841", V_1x1d, PA7200 }, { "842", V_1x0, PA7000 }, { "845", V_1x0,
|
||||
PA7000 }, { "847", V_1x1a, PA7000 }, { "849", V_1x1d, PA7200 }, { "850", V_1x0, PA7000 }, { "851", V_1x1d, PA7200 }, { "852", V_1x0, PA7000 }, { "855", V_1x0, PA7000 }, { "856", V_1x1c, PA7100LC }, { "857", V_1x1a, PA7000 }, { "859", V_1x1d, PA7200 }, { "860", V_1x0, PA7000 }, {
|
||||
"861", V_2x0, PA8000 }, { "865", V_1x0, PA7000 }, { "869", V_1x1d, PA7200 }, { "870", V_1x0, PA7000 }, { "871", V_2x0, PA8000 }, { "877", V_1x1a, PA7000 }, { "879", V_2x0, PA8000 }, { "887", V_1x1b, PA7100 }, { "889", V_2x0, PA8000 }, { "890", V_1x0, PA7000 }, { "891", V_1x1b,
|
||||
PA7100 }, { "892", V_1x1b, PA7100 }, { "893", V_2x0, PA8000 }, { "895", V_2x0, PA8000 }, { "896", V_2x0, PA8000 }, { "897", V_1x1b, PA7100 }, { "898", V_2x0, PA8200 }, { "899", V_2x0, PA8200 }, { "900", V_1x0, PA7000 }, { "B115", V_1x1e, PA7300 }, { "B120", V_1x1e, PA7300 }, {
|
||||
"B132L", V_1x1e, PA7300 }, { "B160L", V_1x1e, PA7300 }, { "B180L", V_1x1e, PA7300 }, { "C100", V_1x1d, PA7200 }, { "C110", V_1x1d, PA7200 }, { "C115", V_1x1e, PA7300 }, { "C120", V_1x1e, PA7300 }, { "C130", V_2x0, PA8000 }, { "C140", V_2x0, PA8000 }, { "C160L", V_1x1e, PA7300 }, {
|
||||
"C160", V_2x0, PA8000 }, { "C180L", V_1x1e, PA7300 }, { "C180-XP", V_2x0, PA8000 }, { "C180", V_2x0, PA8000 }, { "C200+", V_2x0, PA8200 }, { "C230+", V_2x0, PA8200 }, { "C240+", V_2x0, PA8200 }, { "CB260", V_2x0, PA8200 },
|
||||
{ "D200", V_1x1d, PA7200 }, // or: 1.1c, PA7100LC
|
||||
{ "D210", V_1x1d, PA7200 }, // or: 1.1c, PA7100LC
|
||||
{ "D220", V_1x1e, PA7300 }, { "D230", V_1x1e, PA7300 }, { "D250", V_1x1d, PA7200 }, { "D260", V_1x1d, PA7200 }, { "D270", V_2x0, PA8000 }, { "D280", V_2x0, PA8000 }, { "D310", V_1x1c, PA7100LC }, { "D320", V_1x1e, PA7300 }, { "D330", V_1x1e, PA7300 }, { "D350", V_1x1d, PA7200 }, { "D360",
|
||||
V_1x1d, PA7200 }, { "D370", V_2x0, PA8000 }, { "D380", V_2x0, PA8000 }, { "D400", V_1x1d, PA7200 }, { "D410", V_1x1d, PA7200 }, { "D650", V_2x0, PA8000 }, { "DX0", V_1x1c, PA7100LC }, { "DX5", V_1x1c, PA7100LC }, { "DXO", V_1x1c, PA7100LC }, { "E25", V_1x1c, PA7100LC }, { "E35",
|
||||
V_1x1c, PA7100LC }, { "E45", V_1x1c, PA7100LC }, { "E55", V_1x1c, PA7100LC }, { "F10", V_1x1a, PA7000 }, { "F20", V_1x1a, PA7000 }, { "F30", V_1x1a, PA7000 }, { "G30", V_1x1a, PA7000 }, { "G40", V_1x1a, PA7000 }, { "G50", V_1x1b, PA7100 }, { "G60", V_1x1b, PA7100 }, { "G70", V_1x1b,
|
||||
PA7100 }, { "H20", V_1x1a, PA7000 }, { "H30", V_1x1a, PA7000 }, { "H40", V_1x1a, PA7000 }, { "H50", V_1x1b, PA7100 }, { "H60", V_1x1b, PA7100 }, { "H70", V_1x1b, PA7100 }, { "I30", V_1x1a, PA7000 }, { "I40", V_1x1a, PA7000 }, { "I50", V_1x1b, PA7100 }, { "I60", V_1x1b, PA7100 }, {
|
||||
"I70", V_1x1b, PA7100 }, { "J200", V_1x1d, PA7200 }, { "J210XC", V_1x1d, PA7200 }, { "J210", V_1x1d, PA7200 }, { "J220", V_2x0, PA8000 }, { "J2240", V_2x0, PA8200 }, { "J280", V_2x0, PA8000 }, { "J282", V_2x0, PA8000 }, { "J400", V_2x0, PA8000 }, { "J410", V_2x0, PA8000 }, { "K100",
|
||||
V_1x1d, PA7200 }, { "K200", V_1x1d, PA7200 }, { "K210", V_1x1d, PA7200 }, { "K230", V_1x1d, PA7200 }, { "K250", V_2x0, PA8000 }, { "K260", V_2x0, PA8000 }, { "K370", V_2x0, PA8200 }, { "K380", V_2x0, PA8200 }, { "K400", V_1x1d, PA7200 }, { "K410", V_1x1d, PA7200 }, { "K420", V_1x1d,
|
||||
PA7200 }, { "K430", V_1x1d, PA7200 }, { "K450", V_2x0, PA8000 }, { "K460", V_2x0, PA8000 }, { "K470", V_2x0, PA8200 }, { "K570", V_2x0, PA8200 }, { "K580", V_2x0, PA8200 }, { "S700i", V_1x1e, PA7300 }, { "S715", V_1x1e, PA7300 }, { "S744", V_1x1e, PA7300 },
|
||||
{ "S760", V_1x1e, PA7300 }, { "T500", V_1x1c, PA7100LC }, // or: 1.1b, PA7100
|
||||
{ "T520", V_1x1b, PA7100 }, { "T540", V_2x0, PA8000 }, { "T600", V_2x0, PA8000 }, { "V2000", V_2x0, PA8000 }, { "V2200", V_2x0, PA8200 }, { "V2250", V_2x0, PA8200 }, { "V2500", V_2x0, PA8500 },
|
||||
|
||||
{ "", 0, 0 } /* Last Entry has to be empty. */
|
||||
};
|
||||
|
||||
/* Helper-Functions */
|
||||
|
||||
// Value() is defined in info.cpp !!!
|
||||
|
||||
static bool Find_in_LOOKUPTABLE(QListView *lBox, char *machine) {
|
||||
char *Machine;
|
||||
int len;
|
||||
const struct _type_LOOKUPTABLE *Entry = PA_LOOKUPTABLE;
|
||||
QString str;
|
||||
QListViewItem* olditem = 0;
|
||||
|
||||
Machine = machine; // machine is like: "9000/715/D"
|
||||
while ((*Machine) && (*Machine!='/'))
|
||||
++Machine;
|
||||
|
||||
if (*Machine)
|
||||
++Machine;
|
||||
else
|
||||
Machine=machine;
|
||||
|
||||
len = strlen(Machine);
|
||||
|
||||
while (Entry->Name[0]) {
|
||||
if (strncmp(Entry->Name, Machine, len)==0) {
|
||||
olditem = new QListViewItem(lBox, olditem, i18n("PA-RISC Processor"),
|
||||
QString(PA_NAME[Entry->parisc_name]));
|
||||
olditem = new QListViewItem(lBox, olditem, i18n("PA-RISC Revision"),
|
||||
QString("PA-RISC ") + QString(PA_REVISION[Entry->parisc_rev]));
|
||||
return true;
|
||||
} else
|
||||
++Entry; // next Entry !
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* all following functions should return true, when the Information
|
||||
was filled into the lBox-Widget.
|
||||
returning false indicates, that information was not available.
|
||||
*/
|
||||
|
||||
bool GetInfo_ReadfromFile(QListView *lBox, const char *Name) {
|
||||
char buf[2048];
|
||||
|
||||
QFile *file = new QFile(Name);
|
||||
QListViewItem* olditem = 0;
|
||||
|
||||
if (!file->open(QIODevice::ReadOnly)) {
|
||||
delete file;
|
||||
return false;
|
||||
}
|
||||
|
||||
while (file->readLine(buf, sizeof(buf)-1) >= 0) {
|
||||
if (strlen(buf))
|
||||
olditem = new QListViewItem(lBox, olditem, QString::fromLocal8Bit(buf));
|
||||
}
|
||||
|
||||
file->close();
|
||||
delete file;
|
||||
return (lBox->childCount());
|
||||
}
|
||||
|
||||
bool GetInfo_IRQ(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_DMA(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_PCI(QTreeWidget* tree) {
|
||||
return (GetInfo_ReadfromFile(tree, INFO_PCI) + GetInfo_ReadfromFile(tree, INFO_PCI_EISA) );
|
||||
}
|
||||
|
||||
bool GetInfo_IO_Ports(QListView *lBox) {
|
||||
if (GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_1, false))
|
||||
return true;
|
||||
else
|
||||
return GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_2, false);
|
||||
}
|
||||
|
||||
bool GetInfo_SCSI(QListView *lBox) {
|
||||
return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, false);
|
||||
}
|
||||
/* Parts taken from fsusage.c from the Midnight Commander (mc)
|
||||
|
||||
Copyright (C) 1991, 1992 Free Software Foundation, In
|
||||
|
||||
Return the number of TOSIZE-byte blocks used by
|
||||
BLOCKS FROMSIZE-byte blocks, rounding away from zero.
|
||||
TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */
|
||||
|
||||
static long fs_adjust_blocks(long blocks, int fromsize, int tosize) {
|
||||
if (tosize <= 0)
|
||||
abort();
|
||||
if (fromsize <= 0)
|
||||
return -1;
|
||||
|
||||
if (fromsize == tosize) /* E.g., from 512 to 512. */
|
||||
return blocks;
|
||||
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
|
||||
return blocks * (fromsize / tosize);
|
||||
else
|
||||
/* E.g., from 256 to 512. */
|
||||
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
|
||||
}
|
||||
|
||||
/* Fill in the fields of FSP with information about space usage for
|
||||
the filesystem on which PATH resides.
|
||||
Return 0 if successful, -1 if not. */
|
||||
|
||||
#define CONVERT_BLOCKS(b) fs_adjust_blocks ((b), fsd.f_bsize, 512)
|
||||
|
||||
static int get_fs_usage(char *path, long *l_total, long *l_avail) {
|
||||
struct statfs fsd; /* 4.3BSD, SunOS 4, HP-UX, AIX. */
|
||||
unsigned long fsu_blocks, fsu_bfree, fsu_bavail;
|
||||
|
||||
*l_total = *l_avail = 0;
|
||||
if (statfs(path, &fsd) < 0)
|
||||
return -1;
|
||||
|
||||
fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
|
||||
fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
|
||||
fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
|
||||
|
||||
*l_avail = getuid() ? fsu_bavail/2 : fsu_bfree/2;
|
||||
*l_total = fsu_blocks/2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool GetInfo_XServer_and_Video(QListView *lBox) {
|
||||
lBox = lBox;
|
||||
return GetInfo_XServer_Generic(lBox);
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2003 Benjamin Reed <ranger@befunk.com>
|
||||
*
|
||||
* info_osx.cpp is part of the KDE program kcminfo. Copied wholesale
|
||||
* from info_fbsd.cpp =)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* all following functions should return true, when the Information
|
||||
* was filled into the lBox-Widget. Returning false indicates that
|
||||
* information was not available.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <fstab.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <QFile>
|
||||
#include <QFontMetrics>
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <mach/mach.h>
|
||||
#include <mach-o/arch.h>
|
||||
|
||||
#include <machine/limits.h>
|
||||
|
||||
bool GetInfo_IRQ(QTreeWidget*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_DMA(QTreeWidget*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_PCI(QTreeWidget*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_IO_Ports(QTreeWidget*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_SCSI(QTreeWidget*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_XServer_and_Video(QTreeWidget* tree) {
|
||||
#ifdef Q_WS_X11
|
||||
return GetInfo_XServer_Generic(tree);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
/* info_sgi.cpp
|
||||
|
||||
!!!!! this file will be included by info.cpp !!!!!
|
||||
*/
|
||||
|
||||
/* all following functions should return true, when the Information
|
||||
was filled into the lBox-Widget.
|
||||
returning false indicates, that information was not available.
|
||||
*/
|
||||
|
||||
#include <sys/systeminfo.h>
|
||||
|
||||
bool GetInfo_IRQ(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_DMA(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_PCI(QTreeWidget*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_IO_Ports(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_SCSI(QListView *) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetInfo_XServer_and_Video(QListView *lBox) {
|
||||
return GetInfo_XServer_Generic(lBox);
|
||||
}
|
||||
|
|
@ -25,22 +25,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#ifdef __linux__
|
||||
#include "info_linux.cpp"
|
||||
#elif defined(sgi) && sgi
|
||||
#include "info_sgi.cpp"
|
||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
#include "info_fbsd.cpp"
|
||||
#elif defined(__hpux)
|
||||
#include "info_hpux.cpp"
|
||||
#elif defined(__NetBSD__)
|
||||
#include "info_netbsd.cpp"
|
||||
#elif defined(__OpenBSD__)
|
||||
#include "info_openbsd.cpp"
|
||||
#elif defined(__svr4__) && defined(sun)
|
||||
#elif defined(sun)
|
||||
#include "info_solaris.cpp"
|
||||
#elif defined(_AIX)
|
||||
#include "info_aix.cpp"
|
||||
#elif defined(__APPLE__)
|
||||
#include "info_osx.cpp"
|
||||
#else
|
||||
#include "info_generic.cpp" /* Default for unsupported systems.... */
|
||||
#endif
|
||||
|
|
|
@ -46,90 +46,6 @@ bool GetInfo_XServer_and_Video(QTreeWidget* tree);
|
|||
/* i18n("Maybe the proc-filesystem is not enabled in Linux-Kernel.") */
|
||||
#define DEFAULT_ERRORSTRING QString()
|
||||
|
||||
|
||||
#elif defined(sgi) && sgi
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
#define INFO_DMA_AVAILABLE
|
||||
#define INFO_IOPORTS_AVAILABLE
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.")
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
#define INFO_DMA_AVAILABLE
|
||||
#define INFO_IOPORTS_AVAILABLE
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.")
|
||||
|
||||
#elif defined(__hpux)
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
#define INFO_DMA_AVAILABLE
|
||||
#define INFO_IOPORTS_AVAILABLE
|
||||
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING QString()
|
||||
|
||||
#elif defined(__NetBSD__)
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
#define INFO_DMA_AVAILABLE
|
||||
#define INFO_IOPORTS_AVAILABLE
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.")
|
||||
|
||||
#elif defined(__OpenBSD__)
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
#define INFO_DMA_AVAILABLE
|
||||
#define INFO_IOPORTS_AVAILABLE
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.")
|
||||
|
||||
#elif defined(__svr4__) && defined(sun)
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
#define INFO_DMA_AVAILABLE
|
||||
#define INFO_IOPORTS_AVAILABLE
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.")
|
||||
|
||||
#elif defined(_AIX)
|
||||
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
#define INFO_DMA_AVAILABLE
|
||||
#define INFO_IOPORTS_AVAILABLE
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.")
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
//#define INFO_IRQ_AVAILABLE
|
||||
//#define INFO_DMA_AVAILABLE
|
||||
//#define INFO_IOPORTS_AVAILABLE
|
||||
#define INFO_SCSI_AVAILABLE
|
||||
#define INFO_XSERVER_AVAILABLE
|
||||
|
||||
#define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.")
|
||||
|
||||
#else
|
||||
|
||||
#define INFO_IRQ_AVAILABLE
|
||||
|
|
|
@ -22,14 +22,12 @@ typedef quint64 t_memsize;
|
|||
enum { /* entries for memoryInfos[] */
|
||||
TOTAL_MEM = 0, /* total physical memory (without swaps) */
|
||||
FREE_MEM, /* total free physical memory (without swaps) */
|
||||
#if !defined(__svr4__) || !defined(sun)
|
||||
#if !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
SHARED_MEM, /* shared memory size */
|
||||
BUFFER_MEM, /* buffered memory size */
|
||||
#else
|
||||
ACTIVE_MEM,
|
||||
INACTIVE_MEM,
|
||||
#endif
|
||||
#endif
|
||||
CACHED_MEM, /* cache memory size (located in ram) */
|
||||
SWAP_MEM, /* total size of all swap-partitions */
|
||||
|
|
|
@ -137,8 +137,7 @@ QGroupBox* KCMMemory::initializeText() {
|
|||
case FREE_MEM:
|
||||
title = i18n("Free physical memory:");
|
||||
break;
|
||||
#if !defined(__svr4__) || !defined(sun)
|
||||
#if !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
case SHARED_MEM:
|
||||
title = i18n("Shared memory:");
|
||||
break;
|
||||
|
@ -152,7 +151,6 @@ QGroupBox* KCMMemory::initializeText() {
|
|||
case INACTIVE_MEM:
|
||||
title = i18n("Inactive memory:");
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case CACHED_MEM:
|
||||
title = i18n("Disk cache:");
|
||||
|
@ -298,20 +296,12 @@ void KCMMemory::updateMemoryGraphics() {
|
|||
|
||||
#ifdef __linux__
|
||||
#include "memory_linux.cpp"
|
||||
#elif defined(__APPLE__)
|
||||
#include "memory_osx.cpp"
|
||||
#elif defined(sgi) && sgi
|
||||
#include "memory_sgi.cpp"
|
||||
#elif defined(__svr4__) && defined(sun)
|
||||
#elif defined(sun)
|
||||
#include "memory_solaris.cpp"
|
||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
#include "memory_fbsd.cpp"
|
||||
#elif defined(__hpux)
|
||||
#include "memory_hpux.cpp"
|
||||
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#include "memory_netbsd.cpp"
|
||||
#elif defined(__osf__)
|
||||
#include "memory_tru64.cpp"
|
||||
#else
|
||||
|
||||
/* Default for unsupported systems */
|
||||
|
|
|
@ -1,95 +0,0 @@
|
|||
|
||||
/*
|
||||
Copyright 1999 Helge Deller deller@gmx.de
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License or (at your option) version 3 or any later version
|
||||
accepted by the membership of KDE e.V. (or its successor approved
|
||||
by the membership of KDE e.V.), which shall act as a proxy
|
||||
defined in Section 14 of version 3 of the license.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
|
||||
|
||||
#define MAX_SWAP_AREAS 16
|
||||
|
||||
void KCMMemory::fetchValues()
|
||||
{
|
||||
int page_size,i;
|
||||
unsigned long total_mem, total_free,
|
||||
total_physical, total_swap, free_physical,
|
||||
used_physical, used_swap, free_swap;
|
||||
|
||||
struct pst_static pststatic;
|
||||
struct pst_dynamic stats;
|
||||
struct pst_vminfo vmstats;
|
||||
unsigned long fields_[4];
|
||||
struct pst_swapinfo swapinfo;
|
||||
|
||||
pstat_getstatic( &pststatic, sizeof( struct pst_static ), (size_t)1, 0);
|
||||
total_physical = pststatic.physical_memory;
|
||||
page_size = (int)pststatic.page_size;
|
||||
|
||||
pstat_getdynamic(&stats, sizeof( pst_dynamic ), (size_t)1, 0);
|
||||
pstat_getvminfo(&vmstats, sizeof(vmstats), (size_t)1, 0);
|
||||
|
||||
fields_[0] = stats.psd_rmtxt + stats.psd_arm; // TEXT
|
||||
fields_[1] = stats.psd_rm - stats.psd_rmtxt; // USED
|
||||
fields_[2] = total_physical - fields_[0] - fields_[1] - stats.psd_free; //OTHER
|
||||
fields_[3] = stats.psd_free; // FREE
|
||||
|
||||
used_physical = (total_physical - fields_[3]) * page_size;
|
||||
total_physical *= page_size;
|
||||
free_physical = (total_physical - used_physical);
|
||||
|
||||
|
||||
/* Now check the SWAP-AREAS !! */
|
||||
|
||||
total_swap = free_swap = 0;
|
||||
|
||||
for (i = 0 ; i < MAX_SWAP_AREAS ; i++)
|
||||
{
|
||||
pstat_getswap(&swapinfo, sizeof(swapinfo), (size_t)1, i);
|
||||
if (swapinfo.pss_idx == (unsigned)i)
|
||||
{
|
||||
swapinfo.pss_nfpgs *= 4; // nfpgs is in 512 Byte Blocks....
|
||||
if (swapinfo.pss_nblksenabled == 0) // == 0 ??
|
||||
swapinfo.pss_nblksenabled = swapinfo.pss_nfpgs;
|
||||
total_swap += (((unsigned long)swapinfo.pss_nblksenabled) * 1024);
|
||||
free_swap += (((unsigned long)swapinfo.pss_nfpgs ) * 1024);
|
||||
}
|
||||
}
|
||||
|
||||
used_swap = total_swap - free_swap;
|
||||
|
||||
|
||||
/* Now display the results */
|
||||
|
||||
total_mem = total_physical; // + total_swap;
|
||||
total_free = (total_physical - used_physical);// + free_swap;
|
||||
|
||||
memoryInfos[TOTAL_MEM] = MEMORY(total_mem); // total physical memory (without swaps)
|
||||
memoryInfos[FREE_MEM] = MEMORY(total_free);// total free physical memory (without swaps)
|
||||
memoryInfos[SHARED_MEM] = NO_MEMORY_INFO; /* FIXME ?? */
|
||||
memoryInfos[BUFFER_MEM] = MEMORY(fields_[2])*page_size; /* FIXME ?? */
|
||||
memoryInfos[SWAP_MEM] = MEMORY(total_swap); // total size of all swap-partitions
|
||||
memoryInfos[FREESWAP_MEM] = MEMORY(free_swap); // free memory in swap-partitions
|
||||
#ifdef __GNUC__
|
||||
#warning "FIXME: memoryInfos[CACHED_MEM]"
|
||||
#endif
|
||||
memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; // cached memory in ram
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
|
||||
/*
|
||||
* Copyright (c) 2003 Benjamin Reed <ranger@befunk.com>
|
||||
*
|
||||
* memory_osx.cpp is part of the KDE program kcminfo. Copied wholesale
|
||||
* from memory_fbsd.cpp =)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <QFile>
|
||||
#include <mach/mach_init.h>
|
||||
#include <mach/mach_host.h>
|
||||
#include <mach/host_info.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
void KCMMemory::fetchValues()
|
||||
{
|
||||
|
||||
vm_statistics_data_t vm_info;
|
||||
mach_msg_type_number_t info_count;
|
||||
DIR *dirp;
|
||||
struct dirent *dp;
|
||||
t_memsize total;
|
||||
|
||||
info_count = HOST_VM_INFO_COUNT;
|
||||
if (host_statistics(mach_host_self (), HOST_VM_INFO, (host_info_t)&vm_info, &info_count)) {
|
||||
kDebug() << "could not get memory statistics";
|
||||
return;
|
||||
}
|
||||
|
||||
memoryInfos[TOTAL_MEM] = MEMORY(vm_info.active_count + vm_info.inactive_count +
|
||||
vm_info.free_count + vm_info.wire_count) * vm_page_size;
|
||||
memoryInfos[FREE_MEM] = MEMORY(vm_info.free_count) * vm_page_size;
|
||||
memoryInfos[SHARED_MEM] = NO_MEMORY_INFO;
|
||||
memoryInfos[BUFFER_MEM] = NO_MEMORY_INFO;
|
||||
memoryInfos[CACHED_MEM] = NO_MEMORY_INFO;
|
||||
|
||||
dirp = opendir("/private/var/vm");
|
||||
if (!dirp) {
|
||||
kDebug() << "unable to open /private/var/vm";
|
||||
return;
|
||||
}
|
||||
|
||||
total = 0;
|
||||
|
||||
while ((dp = readdir (dirp)) != NULL) {
|
||||
struct stat sb;
|
||||
char fname [MAXNAMLEN];
|
||||
|
||||
if (strncmp (dp->d_name, "swapfile", 8))
|
||||
continue;
|
||||
|
||||
strcpy (fname, "/private/var/vm/");
|
||||
strcat (fname, dp->d_name);
|
||||
if (stat (fname, &sb) < 0)
|
||||
continue;
|
||||
|
||||
total += sb.st_size;
|
||||
}
|
||||
closedir (dirp);
|
||||
|
||||
info_count = HOST_VM_INFO_COUNT;
|
||||
if (host_statistics (mach_host_self (), HOST_VM_INFO,
|
||||
(host_info_t) &vm_info, &info_count)) {
|
||||
kDebug() << "unable to get VM info";
|
||||
}
|
||||
|
||||
memoryInfos[SWAP_MEM] = total;
|
||||
// off_t used = (vm_info.pageouts - vm_info.pageins) * vm_page_size;
|
||||
memoryInfos[FREESWAP_MEM] = NO_MEMORY_INFO;
|
||||
|
||||
/* free = MEMORY(vm_info.free_count) * vm_page_size;
|
||||
used = MEMORY(vm_info.active_count) * vm_page_size;
|
||||
total = MEMORY(vm_info.active_count + vm_info.inactive_count +
|
||||
vm_info.free_count + vm_info.wire_count) * vm_page_size; */
|
||||
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/sysmp.h>
|
||||
#include <sys/ipc.h>
|
||||
|
||||
// The following define is needed for SGI IRIX 6.2
|
||||
#define _KMEMUSER
|
||||
#include <sys/shm.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/swap.h>
|
||||
|
||||
#ifndef UBSIZE
|
||||
#define UBSIZE 512
|
||||
#endif
|
||||
|
||||
|
||||
void KCMMemory::fetchValues()
|
||||
{
|
||||
int pagesize = getpagesize();
|
||||
|
||||
struct rminfo rmi;
|
||||
if( sysmp(MP_SAGET, MPSA_RMINFO, &rmi, sizeof(rmi)) == -1 )
|
||||
return;
|
||||
memoryInfos[TOTAL_MEM] = MEMORY(rmi.physmem) * pagesize; // total physical memory (without swaps)
|
||||
memoryInfos[FREE_MEM] = MEMORY(rmi.freemem) * pagesize; // total free physical memory (without swaps)
|
||||
memoryInfos[BUFFER_MEM] = MEMORY(rmi.bufmem) * pagesize;
|
||||
|
||||
|
||||
//FIXME: memoryInfos[CACHED_MEM]"
|
||||
memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; // cached memory in ram
|
||||
|
||||
long val;
|
||||
swapctl(SC_GETSWAPTOT, &val);
|
||||
memoryInfos[SWAP_MEM] = MEMORY(val) * UBSIZE; // total size of all swap-partitions
|
||||
|
||||
swapctl(SC_GETFREESWAP, &val);
|
||||
memoryInfos[FREESWAP_MEM] = MEMORY(val) * UBSIZE; // free memory in swap-partitions
|
||||
|
||||
#ifndef MPKA_SHMINFO
|
||||
/* Irix 6.5 (also 6.4?) */
|
||||
memoryInfos[SHARED_MEM] = NO_MEMORY_INFO;
|
||||
#else
|
||||
FILE *kmem = fopen("/dev/kmem", "r");
|
||||
if( kmem == 0 ) {
|
||||
memoryInfos[SHARED_MEM] = NO_MEMORY_INFO;
|
||||
return;
|
||||
}
|
||||
|
||||
long shmip = sysmp(MP_KERNADDR, MPKA_SHMINFO);
|
||||
fseek( kmem, shmip, 0 );
|
||||
struct shminfo shmi;
|
||||
fread( &shmi, sizeof(shmi), 1, kmem );
|
||||
|
||||
long shmem = sysmp(MP_KERNADDR, MPKA_SHM);
|
||||
|
||||
val = 0;
|
||||
long pos;
|
||||
struct shmid_ds shmid;
|
||||
for( int i=0 ; i<shmi.shmmni ; i++ ) {
|
||||
fseek( kmem, shmem, 0 );
|
||||
shmem += sizeof(shmem);
|
||||
fread( &pos, sizeof(shmem), 1, kmem );
|
||||
if(pos != 0) {
|
||||
fseek( kmem, pos, 0 );
|
||||
fread( &shmid, sizeof(shmid), 1, kmem );
|
||||
val += shmid.shm_segsz;
|
||||
}
|
||||
}
|
||||
memoryInfos[SHARED_MEM] = MEMORY(val);
|
||||
|
||||
fclose(kmem);
|
||||
#endif
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* This is memory_tru64.cpp to retrieve memory information under Tru64/Alpha.
|
||||
*
|
||||
* Implemented by Tom Leitner, Tom@radar.tu-graz.ac.at
|
||||
*
|
||||
* WARNING: This module requires linking with -lmach
|
||||
*
|
||||
* This routine is based on m_decosf1.c from the "top" program written by:
|
||||
*
|
||||
* AUTHOR: Anthony Baxter, <anthony@aaii.oz.au>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <net/route.h>
|
||||
#include <sys/table.h>
|
||||
extern "C" {
|
||||
#include <mach/mach_traps.h>
|
||||
}
|
||||
#include <mach/vm_statistics.h>
|
||||
|
||||
#define pagetob(size) (MEMORY(1024L) * ((long) (size) << (long) pageshift))
|
||||
#define LOG1024 10
|
||||
|
||||
extern "C" void vm_statistics(task_t, vm_statistics_data_t*);
|
||||
|
||||
void KCMMemory::fetchValues()
|
||||
{
|
||||
int pageshift; /* log base 2 of the pagesize */
|
||||
register int pagesize;
|
||||
vm_statistics_data_t vmstats;
|
||||
int swap_pages=0,swap_free=0,i;
|
||||
struct tbl_swapinfo swbuf;
|
||||
|
||||
/* get the page size with "getpagesize" and calculate pageshift from it */
|
||||
|
||||
pagesize = getpagesize();
|
||||
pageshift = 0;
|
||||
while (pagesize > 1) {
|
||||
pageshift++;
|
||||
pagesize >>= 1;
|
||||
}
|
||||
|
||||
/* we only need the amount of log(2)1024 for our conversion */
|
||||
|
||||
pageshift -= LOG1024;
|
||||
|
||||
/* memory information */
|
||||
/* this is possibly bogus - we work out total # pages by */
|
||||
/* adding up the free, active, inactive, wired down, and */
|
||||
/* zero filled. Anyone who knows a better way, TELL ME! */
|
||||
/* Change: don't use zero filled. */
|
||||
|
||||
(void) ::vm_statistics(::task_self(), &vmstats);
|
||||
|
||||
/* thanks DEC for the table() command. No thanks at all for */
|
||||
/* omitting the man page for it from OSF/1 1.2, and failing */
|
||||
/* to document SWAPINFO in the 1.3 man page. Lets hear it for */
|
||||
/* include files. */
|
||||
|
||||
i=0;
|
||||
while(table(TBL_SWAPINFO,i,&swbuf,1,sizeof(struct tbl_swapinfo))>0) {
|
||||
swap_pages += swbuf.size;
|
||||
swap_free += swbuf.free;
|
||||
i++;
|
||||
}
|
||||
memoryInfos[TOTAL_MEM] = pagetob((vmstats.free_count +
|
||||
vmstats.active_count +
|
||||
vmstats.inactive_count +
|
||||
vmstats.wire_count));
|
||||
memoryInfos[FREE_MEM] = pagetob(vmstats.free_count);
|
||||
memoryInfos[SHARED_MEM] = NO_MEMORY_INFO; /* FIXME ?? */
|
||||
memoryInfos[BUFFER_MEM] = NO_MEMORY_INFO; /* FIXME ?? */
|
||||
#ifdef __GNUC__
|
||||
#warning "FIXME: memoryInfos[CACHED_MEM]"
|
||||
#endif
|
||||
memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; /* cached memory in ram */
|
||||
memoryInfos[SWAP_MEM] = pagetob(swap_pages);
|
||||
memoryInfos[FREESWAP_MEM] = pagetob(swap_free);
|
||||
}
|
|
@ -31,10 +31,8 @@ void PhysicalMemoryChart::paintEvent(QPaintEvent* /*event*/) {
|
|||
t_memsize bufferMemory;
|
||||
|
||||
bufferMemory = 0;
|
||||
#if !defined(__svr4__) || !defined(sun)
|
||||
#if !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
bufferMemory = ZERO_IF_NO_INFO(memoryInfos[BUFFER_MEM]);
|
||||
#endif
|
||||
#endif
|
||||
t_memsize cachedMemory = ZERO_IF_NO_INFO(memoryInfos[CACHED_MEM]);
|
||||
t_memsize freeMemory = ZERO_IF_NO_INFO(memoryInfos[FREE_MEM]);
|
||||
|
|
|
@ -196,10 +196,8 @@ QList<MyNIC*> findNICs() {
|
|||
tmp->type=i18nc("@item:intext Mode of network card", "Broadcast");
|
||||
else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT)
|
||||
tmp->type=i18nc("@item:intext Mode of network card", "Point to Point");
|
||||
#ifndef _AIX
|
||||
else if ((flags & IFF_MULTICAST) == IFF_MULTICAST)
|
||||
tmp->type=i18nc("@item:intext Mode of network card", "Multicast");
|
||||
#endif
|
||||
else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK)
|
||||
tmp->type=i18nc("@item:intext Mode of network card", "Loopback");
|
||||
else
|
||||
|
|
|
@ -407,11 +407,7 @@ bool fishProtocol::connectionStart() {
|
|||
#endif
|
||||
|
||||
int pgrp = getpid();
|
||||
#if defined( _AIX) || defined( __hpux)
|
||||
tcsetpgrp(0, pgrp);
|
||||
#else
|
||||
ioctl(0, TIOCSPGRP, (char *)&pgrp);
|
||||
#endif
|
||||
|
||||
const char *dev = ttyname(0);
|
||||
setpgid(0,0);
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
#ifdef __EMX__
|
||||
/* Due to strange behaviour of as.exe we use this macros */
|
||||
/* For all OS/2 coders - please use PGCC to compile this code */
|
||||
#define PR_(foo) ___##foo
|
||||
#define PT_(foo,func) ___##foo,func
|
||||
#define SIZE(sym) \
|
||||
.___end_##sym:; \
|
||||
.size ___##sym,.___end_##sym-___##sym; \
|
||||
.align 8;
|
||||
#else
|
||||
#define PR_(foo) __##foo
|
||||
#define PT_(foo,func) __##foo,func
|
||||
#define SIZE(sym) \
|
||||
.__end_##sym:; \
|
||||
.size __##sym,.__end_##sym-__##sym; \
|
||||
.align 8;
|
||||
#endif
|
||||
|
||||
/*\
|
||||
|*| MMX assembly scaling routine for Imlib2
|
||||
|
|
|
@ -104,13 +104,8 @@ typedef short Q_INT16; // 16 bit signed
|
|||
typedef unsigned short Q_UINT16; // 16 bit unsigned
|
||||
typedef int Q_INT32; // 32 bit signed
|
||||
typedef unsigned int quint32; // 32 bit unsigned
|
||||
#if defined(Q_OS_WIN64)
|
||||
typedef __int64 Q_LONG; // word up to 64 bit signed
|
||||
typedef unsigned __int64 Q_ULONG; // word up to 64 bit unsigned
|
||||
#else
|
||||
typedef long Q_LONG; // word up to 64 bit signed
|
||||
typedef unsigned long Q_ULONG; // word up to 64 bit unsigned
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -1105,12 +1105,6 @@ QImage::Endian QImage::systemByteOrder()
|
|||
#include <X11/Xlib.h> // needed for systemBitOrder
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xos.h>
|
||||
#if defined(Q_OS_WIN32)
|
||||
#undef open
|
||||
#undef close
|
||||
#undef read
|
||||
#undef write
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// POSIX Large File Support redefines open -> open64
|
||||
|
|
|
@ -65,9 +65,6 @@
|
|||
// including jpeglib.h seems to be a little messy
|
||||
extern "C" {
|
||||
#define XMD_H // shut JPEGlib up
|
||||
#if defined(Q_OS_UNIXWARE)
|
||||
# define HAVE_BOOLEAN // libjpeg under Unixware seems to need this
|
||||
#endif
|
||||
#include <jpeglib.h>
|
||||
#ifdef const
|
||||
# undef const // remove crazy C hackery in jconfig.h
|
||||
|
@ -127,18 +124,14 @@ boolean qt_fill_input_buffer(j_decompress_ptr cinfo)
|
|||
num_read = fread( (char*)src->buffer, 1, max_buf, src->f );
|
||||
|
||||
if ( num_read <= 0 ) {
|
||||
// Insert a fake EOI marker - as per jpeglib recommendation
|
||||
src->buffer[0] = (JOCTET) 0xFF;
|
||||
src->buffer[1] = (JOCTET) JPEG_EOI;
|
||||
src->bytes_in_buffer = 2;
|
||||
// Insert a fake EOI marker - as per jpeglib recommendation
|
||||
src->buffer[0] = (JOCTET) 0xFF;
|
||||
src->buffer[1] = (JOCTET) JPEG_EOI;
|
||||
src->bytes_in_buffer = 2;
|
||||
} else {
|
||||
src->bytes_in_buffer = num_read;
|
||||
src->bytes_in_buffer = num_read;
|
||||
}
|
||||
#if defined(Q_OS_UNIXWARE)
|
||||
return B_TRUE;
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static
|
||||
|
@ -153,15 +146,15 @@ void qt_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
|||
* any trouble anyway --- large skips are infrequent.
|
||||
*/
|
||||
if (num_bytes > 0) {
|
||||
while (num_bytes > (long) src->bytes_in_buffer) {
|
||||
num_bytes -= (long) src->bytes_in_buffer;
|
||||
(void) qt_fill_input_buffer(cinfo);
|
||||
/* note we assume that qt_fill_input_buffer will never return FALSE,
|
||||
* so suspension need not be handled.
|
||||
*/
|
||||
}
|
||||
src->next_input_byte += (size_t) num_bytes;
|
||||
src->bytes_in_buffer -= (size_t) num_bytes;
|
||||
while (num_bytes > (long) src->bytes_in_buffer) {
|
||||
num_bytes -= (long) src->bytes_in_buffer;
|
||||
(void) qt_fill_input_buffer(cinfo);
|
||||
/* note we assume that qt_fill_input_buffer will never return FALSE,
|
||||
* so suspension need not be handled.
|
||||
*/
|
||||
}
|
||||
src->next_input_byte += (size_t) num_bytes;
|
||||
src->bytes_in_buffer -= (size_t) num_bytes;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,13 +198,9 @@ QImage splash_read_jpeg_image(FILE* f)
|
|||
jerr.error_exit = my_error_exit;
|
||||
|
||||
if (!setjmp(jerr.setjmp_buffer)) {
|
||||
#if defined(Q_OS_UNIXWARE)
|
||||
(void) jpeg_read_header(&cinfo, B_TRUE);
|
||||
#else
|
||||
(void) jpeg_read_header(&cinfo, TRUE);
|
||||
#endif
|
||||
(void) jpeg_read_header(&cinfo, TRUE);
|
||||
|
||||
(void) jpeg_start_decompress(&cinfo);
|
||||
(void) jpeg_start_decompress(&cinfo);
|
||||
|
||||
{
|
||||
bool created = FALSE;
|
||||
|
|
Loading…
Add table
Reference in a new issue