Initial Windows agent repository

This commit is contained in:
Frank Harris 2026-06-08 10:45:20 -05:00
commit a0db0c2e5b
10589 changed files with 3844063 additions and 0 deletions

View file

@ -0,0 +1,108 @@
#!/bin/bash
#
# Copyright 2008, 2009, 2010, 2012, 2013, 2014 Red Hat, Inc.
#
# This file is part of Cygwin.
#
# This software is a copyrighted work licensed under the terms of the
# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
# details.
#
#VERSION="3.8"
export PATH="/bin:$PATH"
SYSCONFDIR="${SYSCONFDIR:=/etc}"
FSTAB="${SYSCONFDIR}/fstab"
MTAB="${SYSCONFDIR}/mtab"
NSSWITCH="${SYSCONFDIR}/nsswitch.conf"
# Create fstab file if it doesn't exist.
if [ -e "${FSTAB}" -a ! -f "${FSTAB}" ]
then
# Try to move
mv -f "${FSTAB}" "${FSTAB}.orig"
if [ -e "${FSTAB}" -a ! -f "${FSTAB}" ]
then
echo
echo "${FSTAB} is existant but not a file."
echo "Since this file is specifying the mount points, this might"
echo "result in unexpected trouble. Please fix that manually."
echo
fi
fi
if [ ! -e "${FSTAB}" ]
then
# Create fstab default header
cat > ${FSTAB} << EOF
# /etc/fstab
#
# This file is read once by the first process in a Cygwin process tree.
# To pick up changes, restart all Cygwin processes. For a description
# see https://cygwin.com/cygwin-ug-net/using.html#mount-table
# This is default anyway:
none /cygdrive cygdrive binary,posix=0,user 0 0
EOF
fi
# Create nsswitch.conf file if it doesn't exist.
if [ -e "${NSSWITCH}" -a ! -f "${NSSWITCH}" ]
then
# Try to move
mv -f "${NSSWITCH}" "${NSSWITCH}.orig"
if [ -e "${NSSWITCH}" -a ! -f "${NSSWITCH}" ]
then
echo
echo "${NSSWITCH} is existant but not a file."
echo "Since this file is specifying the mount points, this might"
echo "result in unexpected trouble. Please fix that manually."
echo
fi
fi
if [ ! -e "${NSSWITCH}" ]
then
# Create nsswitch.conf default header
cat > ${NSSWITCH} << EOF
# /etc/nsswitch.conf
#
# This file is read once by the first process in a Cygwin process tree.
# To pick up changes, restart all Cygwin processes. For a description
# see https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
#
# Defaults:
# passwd: files db
# group: files db
# db_enum: cache builtin
# db_home: /home/%U
# db_shell: /bin/bash
# db_gecos: <empty>
EOF
fi
# Create /etc/mtab as symlink to /proc/mounts
[ ! -L "${MTAB}" ] && ln -sf /proc/mounts ${MTAB}
# Create default /etc/passwd and /etc/group files
#created_passwd=no
#created_group=no
#if [ ! -e /etc/passwd -a ! -L /etc/passwd ] ; then
# mkpasswd -l -c > /etc/passwd
# chmod 644 /etc/passwd
# created_passwd=yes
#fi
#if [ ! -e /etc/group -a ! -L /etc/group ] ; then
# mkgroup -l -c > /etc/group
# chmod 644 /etc/group
# created_group=yes
#fi
# Deferred to be sure 544 (Adminstrators) group entry exists
#[ "$created_passwd" = "yes" ] && chgrp --silent 544 /etc/passwd
#[ "$created_group" = "yes" ] && chgrp --silent 544 /etc/group
exit 0

View file

@ -0,0 +1,26 @@
#!/bin/dash
export PATH=/bin
b=/var/cache/rebase
if [ -e ${b}/peflags ] ; then
noaslr=--noaslr
peflags=peflags
rm -f ${b}/peflags
else
noaslr=''
peflags=''
fi
if [ -e ${b}/rebuild_always ] ; then
rebuild=--rebuild
elif [ -e ${b}/rebuild_incremental ] ; then
rebuild=''
else
rebase-trigger rebuild_always
rebuild=--rebuild
fi
if [ ! -e ${b}/fullrebase.done ] ; then
rebase-trigger fullrebase
rebaselst --rebuild update --cleardb $noaslr rebase $peflags
mv ${b}/fullrebase ${b}/fullrebase.done
else
rebaselst $rebuild update $noaslr rebase $peflags
fi

View file

@ -0,0 +1,29 @@
#!/bin/dash
# If an .info file has been added/removed/replaced in /usr/share/info since the
# last time this script ran, rebuild the info directory. We don't simply check
# /usr/share/info's mtime, as that isn't correctly maintained on a FAT
# filesystem.
ls -n /usr/share/info/*info* | md5sum >/usr/share/info/.stamp.tmp
if [ "$(cat /usr/share/info/.stamp.tmp)" != "$(cat /usr/share/info/.stamp)" ] ; then
echo "Rebuilding info directory"
rm -f /usr/share/info/dir.info /usr/share/info/dir
for f in /usr/share/info/*; do
case "$f" in
*\**)
;;
*/dir|*/dir.info*)
;;
*-[0123456789]*)
;;
*)
install-info $f /usr/share/info/dir
;;
esac
done
mv /usr/share/info/.stamp.tmp /usr/share/info/.stamp
else
rm /usr/share/info/.stamp.tmp
fi

View file

@ -0,0 +1,41 @@
#!/usr/bin/sh
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# base-files version 4.3-3
# Create symbolic links from some /etc files to the Windows equivalents
# Set perms to /tmp directory
FILES="hosts protocols services networks"
OSNAME="$(/usr/bin/uname -s)"
WINETC="$(/usr/bin/cygpath -S -U)/drivers/etc"
if [ ! -d "${WINETC}" ]; then
echo "Directory ${WINETC} does not exist; exiting" >&2
echo "If directory name is garbage you need to update your cygwin package" >&2
exit 1
fi
for mketc in ${FILES}
do
if [ -L "/etc/${mketc}" ]
then
realpath -e "/etc/${mketc}" || unlink "/etc/${mketc}"
fi
if [ ! -e "/etc/${mketc}" -a ! -L "/etc/${mketc}" ]
then
# Windows only uses the first 8 characters
WFILE="${WINETC}/$(expr substr "${mketc}" 1 8)"
/usr/bin/ln -s -v "${WFILE}" "/etc/${mketc}"
fi
done
# see http://cygwin.com/ml/cygwin-apps/2014-03/msg00011.html
# /usr/bin/chmod 1777 /tmp 2>/dev/null
exit 0

View file

@ -0,0 +1,30 @@
#!/usr/bin/sh
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# base-files version 4.3-3
MANIFEST="/etc/preremove/base-files-manifest.lst"
[ -f ${MANIFEST} ] || (echo "Unable to find manifest file." && exit 1)
while read f; do
fSrc="/etc/defaults/${f}"
fDest="/${f}"
if [ ! -e ${fDest} ]; then
echo "Installing the default version of ${fDest} from ${fSrc}."
/usr/bin/mkdir -p $(dirname ${fDest})
/usr/bin/cp ${fSrc} ${fDest}
else
echo "Not installing the default version of ${fDest} (default is in ${fSrc})."
if [ -f ${fDest} -a -x /bin/diff ]; then
/bin/diff -wut ${fDest} ${fSrc}
fi
fi
done < ${MANIFEST}
exit 0

View file

@ -0,0 +1,16 @@
if [ ! -e "/etc/pki/ca-trust/ca-legacy.conf" ]
then
/usr/bin/mkdir -p "/etc/pki/ca-trust"
/usr/bin/cp "/etc/defaults/etc/pki/ca-trust/ca-legacy.conf" "/etc/pki/ca-trust/ca-legacy.conf"
else
if [ -f /etc/pki/ca-trust/ca-legacy.conf -a -x /usr/bin/diff ]
then
/usr/bin/mkdir -p "/var/cache/setup/etc/pki/ca-trust"
/usr/bin/rm -f "/var/cache/setup//etc/pki/ca-trust/ca-legacy.conf.diff"
/usr/bin/diff -wut "/etc/pki/ca-trust/ca-legacy.conf" "/etc/defaults/etc/pki/ca-trust/ca-legacy.conf" > "/var/cache/setup//etc/pki/ca-trust/ca-legacy.conf.diff" ||
echo "Defaults for /etc/pki/ca-trust/ca-legacy.conf differ from actual file, please check /var/cache/setup//etc/pki/ca-trust/ca-legacy.conf.diff"
fi
fi
/usr/bin/ca-legacy install
/usr/bin/update-ca-trust

View file

@ -0,0 +1,6 @@
if [ ! -e /etc/DIR_COLORS ]
then
/usr/bin/mkdir -p /etc
/usr/bin/cp /etc/defaults/etc/DIR_COLORS /etc/DIR_COLORS
fi

View file

@ -0,0 +1,7 @@
if [ ! -f /etc/crypto-policies/config ]
then
/usr/bin/mkdir -p /etc/crypto-policies
/usr/bin/cp /etc/defaults/etc/crypto-policies/config /etc/crypto-policies/config
fi
/usr/bin/update-crypto-policies

View file

@ -0,0 +1,9 @@
# Move any existing *.conf files from /usr/lib/sasl2 to /etc/sasl2,
# but only if there are no *.conf files in /etc/sasl2.
etc_files=/etc/sasl2/*.conf
if [ "$(/usr/bin/echo /etc/sasl2/*.conf)" = '/etc/sasl2/*.conf' \
-a "$(/usr/bin/echo /usr/lib/sasl2/*.conf)" != '/usr/lib/sasl2/*.conf' ]
then
/usr/bin/mv /usr/lib/sasl2/*.conf /etc/sasl2
fi

View file

@ -0,0 +1,4 @@
if test ! -f /etc/xml/catalog; then
/bin/mkdir -p /etc/xml
/usr/bin/xmlcatalog --noout --create /etc/xml/catalog
fi

View file

@ -0,0 +1,14 @@
if [ ! -e "/etc/man_db.conf" ]
then
/usr/bin/mkdir -p "/etc"
/usr/bin/cp "/etc/defaults/etc/man_db.conf" "/etc/man_db.conf"
else
if [ -f /etc/man_db.conf -a -x /usr/bin/diff ]
then
/usr/bin/mkdir -p "/var/cache/setup/etc"
/usr/bin/rm -f "/var/cache/setup//etc/man_db.conf.diff"
/usr/bin/diff -wut "/etc/man_db.conf" "/etc/defaults/etc/man_db.conf" > "/var/cache/setup//etc/man_db.conf.diff" ||
echo "Defaults for /etc/man_db.conf differ from actual file, please check /var/cache/setup//etc/man_db.conf.diff"
fi
fi

View file

@ -0,0 +1,12 @@
if [ ! -f /etc/my.cnf ]
then
/usr/bin/mkdir -p /etc
/usr/bin/cp /etc/defaults/etc/my.cnf /etc/my.cnf
fi
if [ ! -f /etc/my.cnf.d/client.cnf ]
then
/usr/bin/mkdir -p /etc/my.cnf.d
/usr/bin/cp /etc/defaults/etc/my.cnf.d/client.cnf /etc/my.cnf.d/client.cnf
fi

View file

@ -0,0 +1 @@
rm -f /usr/share/icons/hicolor/icon-theme.cache

View file

@ -0,0 +1,8 @@
#!/bin/sh
copy_maybe() {
if ! [ -e $1 ] ; then
cp /etc/defaults$1 $1 2>/dev/null
fi
}
copy_maybe /etc/Muttrc
copy_maybe /etc/mime.types

View file

@ -0,0 +1,12 @@
if [ ! -f /etc/my.cnf.d/mysql-clients.cnf ]
then
/usr/bin/mkdir -p /etc/my.cnf.d
/usr/bin/cp /etc/defaults/etc/my.cnf.d/mysql-clients.cnf /etc/my.cnf.d/mysql-clients.cnf
fi
if [ ! -f /etc/my.cnf.d/server.cnf ]
then
/usr/bin/mkdir -p /etc/my.cnf.d
/usr/bin/cp /etc/defaults/etc/my.cnf.d/server.cnf /etc/my.cnf.d/server.cnf
fi

View file

@ -0,0 +1,6 @@
if [ ! -e /etc/nanorc ]
then
/usr/bin/mkdir -p /etc
/usr/bin/cp /etc/defaults/etc/nanorc /etc/nanorc
fi

View file

@ -0,0 +1,2 @@
[ -d /var/empty ] && setfacl -d g:18: /var/empty
exit 0

View file

@ -0,0 +1,28 @@
if [ ! -e "/etc/pki/tls/ct_log_list.cnf" ]
then
/usr/bin/mkdir -p "/etc/pki/tls"
/usr/bin/cp "/etc/defaults/etc/pki/tls/ct_log_list.cnf" "/etc/pki/tls/ct_log_list.cnf"
else
if [ -f /etc/pki/tls/ct_log_list.cnf -a -x /usr/bin/diff ]
then
/usr/bin/mkdir -p "/var/cache/setup/etc/pki/tls"
/usr/bin/rm -f "/var/cache/setup//etc/pki/tls/ct_log_list.cnf.diff"
/usr/bin/diff -wut "/etc/pki/tls/ct_log_list.cnf" "/etc/defaults/etc/pki/tls/ct_log_list.cnf" > "/var/cache/setup//etc/pki/tls/ct_log_list.cnf.diff" ||
echo "Defaults for /etc/pki/tls/ct_log_list.cnf differ from actual file, please check /var/cache/setup//etc/pki/tls/ct_log_list.cnf.diff"
fi
fi
if [ ! -e "/etc/pki/tls/openssl.cnf" ]
then
/usr/bin/mkdir -p "/etc/pki/tls"
/usr/bin/cp "/etc/defaults/etc/pki/tls/openssl.cnf" "/etc/pki/tls/openssl.cnf"
else
if [ -f /etc/pki/tls/openssl.cnf -a -x /usr/bin/diff ]
then
/usr/bin/mkdir -p "/var/cache/setup/etc/pki/tls"
/usr/bin/rm -f "/var/cache/setup//etc/pki/tls/openssl.cnf.diff"
/usr/bin/diff -wut "/etc/pki/tls/openssl.cnf" "/etc/defaults/etc/pki/tls/openssl.cnf" > "/var/cache/setup//etc/pki/tls/openssl.cnf.diff" ||
echo "Defaults for /etc/pki/tls/openssl.cnf differ from actual file, please check /var/cache/setup//etc/pki/tls/openssl.cnf.diff"
fi
fi

View file

@ -0,0 +1,14 @@
if [ ! -e "/etc/pki/tls/openssl10.cnf" ]
then
/usr/bin/mkdir -p "/etc/pki/tls"
/usr/bin/cp "/etc/defaults/etc/pki/tls/openssl10.cnf" "/etc/pki/tls/openssl10.cnf"
else
if [ -f /etc/pki/tls/openssl10.cnf -a -x /usr/bin/diff ]
then
/usr/bin/mkdir -p "/var/cache/setup/etc/pki/tls"
/usr/bin/rm -f "/var/cache/setup//etc/pki/tls/openssl10.cnf.diff"
/usr/bin/diff -wut "/etc/pki/tls/openssl10.cnf" "/etc/defaults/etc/pki/tls/openssl10.cnf" > "/var/cache/setup//etc/pki/tls/openssl10.cnf.diff" ||
echo "Defaults for /etc/pki/tls/openssl10.cnf differ from actual file, please check /var/cache/setup//etc/pki/tls/openssl10.cnf.diff"
fi
fi

View file

@ -0,0 +1,6 @@
if [ ! -f /etc/pkcs11/pkcs11.conf ]
then
/usr/bin/mkdir -p /etc/pkcs11
/usr/bin/cp /etc/defaults/etc/pkcs11/pkcs11.conf /etc/pkcs11/pkcs11.conf
fi

View file

@ -0,0 +1,6 @@
if [ ! -e /etc/screenrc ]
then
/usr/bin/mkdir -p /etc
/usr/bin/cp /etc/defaults/etc/screenrc /etc/screenrc
fi

View file

@ -0,0 +1,6 @@
if [ ! -e /etc/wgetrc ]
then
/usr/bin/mkdir -p /etc
/usr/bin/cp /etc/defaults/etc/wgetrc /etc/wgetrc
fi

View file

@ -0,0 +1,19 @@
if [ -f /var/cache/man/index.db ] ; then
if [ -f /var/cache/man/.index-synchronously ] || [ "$1" = "background" ] ; then
printf " ManDB index update starting...\n"
tf=$(/usr/bin/mktemp -p /var/log mandb-index-XXXXXXXX.log)
exec 3> $tf
/usr/bin/mv --backup=simple $tf /var/log/mandb-index.log
printf "ManDB update started: $(/usr/bin/date -Iseconds)\n" >&3
/usr/bin/mandb <&- >&3 2>&1
printf "ManDB update finished: $(/usr/bin/date -Iseconds)\n" >&3
exec 3>&-
printf " ... ManDB index update complete.\n"
else
printf " ManDB index update commencing in background...\n"
env -i ProgramData=$(hexdump -n 32 -e '/8 "%02X" 3/8 "/%02X"' /dev/urandom) \
/usr/bin/cygstart --hide /usr/bin/dash $0 background
fi
else
printf " ManDB index not available.\n"
fi