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
#define CPUCOUNT(c) ((c)->ptr - (c)->buf)
-#if !TARGET_OS_EMBEDDED
static NSMutableDictionary *ArchDict;
static NSString *KeyExecPath = @"ExecutablePath";
static NSString *KeyPlistVersion = @"PropertyListVersion";
{"x86_64", CPU_TYPE_X86_64},
{NULL, 0}
};
-#endif /* !TARGET_OS_EMBEDDED */
/*
* arch - perform the original behavior of the arch and machine commands.
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
}
initCPU(cpu);
}
-#endif /* !TARGET_OS_EMBEDDED */
/* the main() routine */
int
{
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)
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 */
/* should never get here */
[pool release];
errx(1, "returned from spawn");
-#endif /* !TARGET_OS_EMBEDDED */
}
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 \
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 \
#ifndef __APPLE__
#include <sys/copyright.h>
+#endif
+#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
#include <sys/param.h>
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__
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 */
}
#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
(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,
+++ /dev/null
-Project = update
-
-MANPAGES = update.8
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+++ /dev/null
-.\" 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 .
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)