From 58983805c72cf54498d943de92b7d72f0cff9767 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Mon, 25 Nov 2002 22:12:08 +0000 Subject: [PATCH] 2002-11-26 Robert Collins * AntiVirus.cc: Change the short option again! It's now 'A'. * desktop.cc (etc_profile): Remove. (make_etc_profile): Remove. (uexists): Remove. (make_passwd_group): Remove. (do_desktop_setup): Don't call removed functions. --- AntiVirus.cc | 2 +- ChangeLog | 9 ++++ desktop.cc | 128 --------------------------------------------------- 3 files changed, 10 insertions(+), 129 deletions(-) diff --git a/AntiVirus.cc b/AntiVirus.cc index f0f5b366..bf79d7a9 100644 --- a/AntiVirus.cc +++ b/AntiVirus.cc @@ -38,7 +38,7 @@ static const char *cvsid = /* XXX: Split this into observer and model classes */ /* Default is to leave well enough alone */ -static BoolOption DisableVirusOption (false, 'D', "disable-buggy-antivirus", "Disable known or suspected buggy anti virus software packages during execution."); +static BoolOption DisableVirusOption (false, 'A', "disable-buggy-antivirus", "Disable known or suspected buggy anti virus software packages during execution."); static bool KnownAVIsPresent = false; static bool AVRunning = true; diff --git a/ChangeLog b/ChangeLog index 4d9112c3..a8198539 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-11-26 Robert Collins + + * AntiVirus.cc: Change the short option again! It's now 'A'. + * desktop.cc (etc_profile): Remove. + (make_etc_profile): Remove. + (uexists): Remove. + (make_passwd_group): Remove. + (do_desktop_setup): Don't call removed functions. + 2002-11-26 Robert Collins * nio-ftp.cc (NetIO_FTP::NetIO_FTP): Fix my botched application of diff --git a/desktop.cc b/desktop.cc index a393fddb..35276624 100644 --- a/desktop.cc +++ b/desktop.cc @@ -69,37 +69,6 @@ static OSVERSIONINFO verinfo; @* */ -static const char *etc_profile[] = { - "PATH=\"/usr/local/bin:/usr/bin:/bin:$PATH\"", - "", - "USER=\"`id -un`\"", - "", - "# Set up USER's home directory", - "if [ -z \"$HOME\" ]; then", - " HOME=\"/home/$USER\"", - "fi", - "", - "if [ ! -d \"$HOME\" ]; then", - " mkdir -p \"$HOME\"", - "fi", - "", - "export HOME USER", - "", - "for i in /etc/profile.d/*.sh ; do", - " if [ -f $i ]; then", - " . $i", - " fi", - "done", - "", - "export MAKE_MODE=unix", - "export PS1='\\[\\033]0;\\w\\007", - "\\033[32m\\]\\u@\\h \\[\\033[33m\\w\\033[0m\\]", - "$ '", - "", - "cd \"$HOME\"", - 0 -}; - #define COMMAND9XARGS String("/E:4096 /c") #define COMMAND9XEXE String("\\command.com") @@ -220,101 +189,6 @@ make_cygwin_bat () fclose (bat); } -static void -make_etc_profile () -{ - String fname = cygpath ("/etc/profile"); - - /* if the file exists, don't overwrite it */ - if (_access (fname.cstr_oneuse(), 0) == 0) - return; - - char os; - switch (verinfo.dwPlatformId) - { - case VER_PLATFORM_WIN32_NT: - os = 'N'; - break; - case VER_PLATFORM_WIN32_WINDOWS: - if (verinfo.dwMinorVersion == 0) - os = '5'; - else - os = '8'; - break; - default: - os = '?'; - break; - } - msg ("os is %c", os); - - FILE *p = fopen (fname.cstr_oneuse(), "wb"); - if (!p) - return; - - int i, allow = 1; - for (i = 0; etc_profile[i]; i++) - { - if (etc_profile[i][0] == '@') - { - allow = 0; - msg ("profile: %s", etc_profile[i]); - for (const char *cp = etc_profile[i] + 1; *cp; cp++) - if (*cp == os || *cp == '*') - allow = 1; - msg ("allow is %d\n", allow); - } - else if (allow) - fprintf (p, "%s\n", etc_profile[i]); - } - - fclose (p); -} - -static int -uexists (const char *path) -{ - String f = cygpath (path); - int a = _access (f.cstr_oneuse(), 0); - if (a == 0) - return 1; - return 0; -} - -static void -make_passwd_group () -{ - String fname = cygpath ("/etc/postinstall/passwd-grp.bat"); - io_stream::mkpath_p (PATH_TO_FILE, String("file://") + fname); - - if ((uexists ("/etc/passwd") || uexists ("/etc/passwd.lnk")) - && (uexists ("/etc/group") || uexists ("/etc/group.lnk"))) - return; - - if (verinfo.dwPlatformId != VER_PLATFORM_WIN32_NT) - { - packagedb db; - packagemeta *pkg = db.findBinary (PackageSpecification("cygwin")); - if (pkg && pkg->installed) - { - /* mkpasswd and mkgroup are not working on 9x/ME up to 1.1.5-4 */ - String border_version = canonicalize_version ("1.1.5-4"); - String inst_version = - canonicalize_version (pkg->installed.Canonical_version ()); - if (inst_version.compare(border_version) <= 0) - return; - } - } - - FILE *p = fopen (fname.cstr_oneuse(), "wt"); - if (!p) - return; - if (!(uexists ("/etc/passwd") || uexists ("/etc/passwd.lnk"))) - fprintf (p, "bin\\mkpasswd -l > etc\\passwd\n"); - if (!(uexists ("/etc/group") || uexists ("/etc/group.lnk"))) - fprintf (p, "bin\\mkgroup -l > etc\\group\n"); - fclose (p); -} - static void save_icon () { @@ -343,8 +217,6 @@ do_desktop_setup () save_icon (); make_cygwin_bat (); - make_etc_profile (); - make_passwd_group (); if (root_menu) { -- 2.43.5