From 381af97e8c14a91b535443f88337e4c77362f7ac Mon Sep 17 00:00:00 2001 From: Apple Date: Tue, 8 Dec 2009 16:10:46 +0000 Subject: [PATCH] system_cmds-498.0.10.tar.gz --- Makefile | 2 +- arch.tproj/arch.m | 8 ---- dp_notify_lib/Makefile | 4 ++ dynamic_pager.tproj/Makefile | 4 ++ login.tproj/login.c | 24 ++++++---- update.tproj/Makefile | 5 --- update.tproj/com.apple.update.plist | 0 update.tproj/update.8 | 69 ----------------------------- update.tproj/update.c | 0 update.tproj/update.sb | 0 vm_stat.tproj/vm_stat.c | 5 ++- 11 files changed, 27 insertions(+), 94 deletions(-) delete mode 100644 update.tproj/Makefile delete mode 100644 update.tproj/com.apple.update.plist delete mode 100644 update.tproj/update.8 delete mode 100644 update.tproj/update.c delete mode 100644 update.tproj/update.sb diff --git a/Makefile b/Makefile index 67d0eba..03324f3 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ SubProjects = ac.tproj accton.tproj arch.tproj bootlog.tproj \ latency.tproj login.tproj makekey.tproj mkfile.tproj \ newgrp.tproj nologin.tproj nvram.tproj pagesize.tproj \ passwd.tproj pwd_mkdb.tproj reboot.tproj sa.tproj sadc.tproj \ - sar.tproj sc_usage.tproj sync.tproj sysctl.tproj update.tproj \ + sar.tproj sc_usage.tproj sync.tproj sysctl.tproj \ vipw.tproj vifs.tproj vm_stat.tproj zdump.tproj zic.tproj \ zprint.tproj diff --git a/arch.tproj/arch.m b/arch.tproj/arch.m index 68ffa9b..be4b58e 100644 --- a/arch.tproj/arch.m +++ b/arch.tproj/arch.m @@ -48,7 +48,6 @@ #define CPUCOUNT(c) ((c)->ptr - (c)->buf) -#if !TARGET_OS_EMBEDDED static NSMutableDictionary *ArchDict; static NSString *KeyExecPath = @"ExecutablePath"; static NSString *KeyPlistVersion = @"PropertyListVersion"; @@ -77,7 +76,6 @@ static StrInt initArches[] = { {"x86_64", CPU_TYPE_X86_64}, {NULL, 0} }; -#endif /* !TARGET_OS_EMBEDDED */ /* * arch - perform the original behavior of the arch and machine commands. @@ -100,7 +98,6 @@ arch(int archcmd) exit(0); } -#if !TARGET_OS_EMBEDDED /* * spawnIt - run the posix_spawn command. count is the number of CPU types * in the prefs array. pflag is non-zero to call posix_spawnp; zero means to @@ -548,7 +545,6 @@ init(CPU *cpu) } initCPU(cpu); } -#endif /* !TARGET_OS_EMBEDDED */ /* the main() routine */ int @@ -556,9 +552,7 @@ main(int argc, char **argv, char **environ) { const char *prog = getprogname(); int my_name_is_arch; -#if !TARGET_OS_EMBEDDED CPU cpu; -#endif if(strcmp(prog, MACHINE_PROG) == 0) { if(argc > 1) @@ -569,7 +563,6 @@ main(int argc, char **argv, char **environ) arch(1); /* the "arch" command with no arguments was called */ } -#if !TARGET_OS_EMBEDDED /* set up Objective C autorelease pool */ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; init(&cpu); /* initialize */ @@ -581,5 +574,4 @@ main(int argc, char **argv, char **environ) /* should never get here */ [pool release]; errx(1, "returned from spawn"); -#endif /* !TARGET_OS_EMBEDDED */ } diff --git a/dp_notify_lib/Makefile b/dp_notify_lib/Makefile index 528c5a1..f1b6895 100644 --- a/dp_notify_lib/Makefile +++ b/dp_notify_lib/Makefile @@ -10,6 +10,10 @@ Extra_LD_Flags = -static include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make +ifneq ($(SDKROOT),) +Extra_MIG_Flags = -arch $(firstword $(RC_ARCHS)) +endif + after_install: $(INSTALL_DIRECTORY) $(DSTROOT)/usr/local/include/mach $(INSTALL_FILE) $(OBJROOT)/$(Project)/backing_store_alerts_server.h \ diff --git a/dynamic_pager.tproj/Makefile b/dynamic_pager.tproj/Makefile index dc5ae6a..8ac4c66 100644 --- a/dynamic_pager.tproj/Makefile +++ b/dynamic_pager.tproj/Makefile @@ -20,6 +20,10 @@ include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make Embedded=$(shell tconf --test TARGET_OS_EMBEDDED) +ifneq ($(SDKROOT),) +Extra_MIG_Flags = -arch $(firstword $(RC_ARCHS)) +endif + after_install: ifeq "$(Embedded)" "YES" /usr/libexec/PlistBuddy -x \ diff --git a/login.tproj/login.c b/login.tproj/login.c index a765c89..2b0d828 100644 --- a/login.tproj/login.c +++ b/login.tproj/login.c @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD: src/usr.bin/login/login.c,v 1.106 2007/07/04 00:00:40 scf Ex #ifndef __APPLE__ #include +#endif +#ifdef __APPLE__ #include #endif #include @@ -494,20 +496,22 @@ main(int argc, char *argv[]) rval = 0; #endif /* !USE_PAM */ #endif /* __APPLE__ */ - } else { + } else if( pwd ) { fflag = 0; (void)setpriority(PRIO_PROCESS, 0, -4); #ifdef USE_PAM rval = auth_pam(); #else { - char* salt = pwd ? pwd->pw_passwd : "xx"; + char* salt = pwd->pw_passwd; char* p = getpass(passwd_prompt); - rval = strcmp(crypt(p, salt), pwd->pw_passwd); + rval = strcmp(crypt(p, salt), salt); memset(p, 0, strlen(p)); } #endif (void)setpriority(PRIO_PROCESS, 0, 0); + } else { + rval = -1; } #ifdef __APPLE__ @@ -658,12 +662,6 @@ main(int argc, char *argv[]) syslog(LOG_NOTICE, "strdup(): %m"); bail(SLEEP_EXIT, 1); } - if (*shell == '\0') /* Not overridden */ - shell = pwd->pw_shell; - if ((shell = strdup(shell)) == NULL) { - syslog(LOG_NOTICE, "strdup(): %m"); - bail(SLEEP_EXIT, 1); - } #if defined(__APPLE__) && TARGET_OS_EMBEDDED /* on embedded, allow a shell to live in /var/debug_mount/bin/sh */ @@ -675,6 +673,13 @@ main(int argc, char *argv[]) } #endif + if (*shell == '\0') /* Not overridden */ + shell = pwd->pw_shell; + if ((shell = strdup(shell)) == NULL) { + syslog(LOG_NOTICE, "strdup(): %m"); + bail(SLEEP_EXIT, 1); + } + #ifdef __APPLE__ dolastlog(quietlog); #endif @@ -867,6 +872,7 @@ main(int argc, char *argv[]) (void)setgid(pwd->pw_gid); if (initgroups(username, pwd->pw_gid) == -1) syslog(LOG_ERR, "login: initgroups() failed"); + pwd = getpwnam(username); // 7258548 (void) setuid(rootlogin ? 0 : pwd->pw_uid); #else /* !__APPLE__ */ if (setusercontext(lc, pwd, pwd->pw_uid, diff --git a/update.tproj/Makefile b/update.tproj/Makefile deleted file mode 100644 index 15b4851..0000000 --- a/update.tproj/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -Project = update - -MANPAGES = update.8 - -include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make diff --git a/update.tproj/com.apple.update.plist b/update.tproj/com.apple.update.plist deleted file mode 100644 index e69de29..0000000 diff --git a/update.tproj/update.8 b/update.tproj/update.8 deleted file mode 100644 index 2d6e742..0000000 --- a/update.tproj/update.8 +++ /dev/null @@ -1,69 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. -.\" -.\" @(#)update.8 8.3 (Berkeley) 4/19/94 -.\" -.Dd August 18, 2008 -.Dt UPDATE 8 -.Os -.Sh NAME -.Nm update -.Nd flush internal filesystem caches to disk frequently -.Sh SYNOPSIS -.Nm update -.Sh DESCRIPTION -The -.Nm update -utility has been incorporated into -.Xr launchd 8 . -It historically helped protect the integrity of disk volumes -by flushing -volatile cached filesystem data -to disk at thirty second intervals -using the -.Xr sync 2 -function call. -.Sh SEE ALSO -.Xr sync 2 , -.Xr fsck 8 , -.Xr launchd 8 , -.Xr sync 8 -.Sh BUGS -It is possible on some systems that a -.Xr sync -occurring simultaneously with a crash may cause -file system damage. See -.Xr fsck 8 . -.Sh HISTORY -An -.Nm -utility appeared in -.At v6 . diff --git a/update.tproj/update.c b/update.tproj/update.c deleted file mode 100644 index e69de29..0000000 diff --git a/update.tproj/update.sb b/update.tproj/update.sb deleted file mode 100644 index e69de29..0000000 diff --git a/vm_stat.tproj/vm_stat.c b/vm_stat.tproj/vm_stat.c index d7a4536..44ad92b 100644 --- a/vm_stat.tproj/vm_stat.c +++ b/vm_stat.tproj/vm_stat.c @@ -225,8 +225,9 @@ void get_stats(vm_statistics64_t stat) { unsigned int count = HOST_VM_INFO64_COUNT; - if (host_statistics64(myHost, HOST_VM_INFO64, (host_info64_t)stat, &count) != KERN_SUCCESS) { - fprintf(stderr, "%s: failed to get statistics.\n", pgmname); + kern_return_t ret; + if ((ret = host_statistics64(myHost, HOST_VM_INFO64, (host_info64_t)stat, &count) != KERN_SUCCESS)) { + fprintf(stderr, "%s: failed to get statistics. error %d\n", pgmname, ret); exit(EXIT_FAILURE); } if (stat->lookups == 0) -- 2.45.2