This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [RFC] Globally creating a user and a group "root"

OK, took some lunch time ;)

Hows this for



if [ ! -e /etc/passwd -a ! -L /etc/passwd ] ; then
  /bin/mkpasswd -l -c > /etc/passwd

if [ ! -e /etc/group -a ! -L /etc/group ] ; then
  /bin/mkgroup -l -c > /etc/group

cp -f /etc/passwd ~/passwd.mkpasswd && \
( [ -w /etc/passwd ] || chmod --silent a+w /etc/passwd ; ) && \
sed -e '/:S-1-1-0:/d' ~/passwd.passwd > /etc/passwd && \
chmod --silent --reference=/etc/group /etc/passwd
rm -f ~/passwd.mkpasswd

cp -f /etc/group ~/group.mkgroup && \
( [ -w /etc/group ] || chmod --silent a+w /etc/group ; ) && \
echo "root:S-1-5-32-544:0:" > /etc/group && \
sed -e '/:S-1-1-0:/d' ~/group.mkgroup > /etc/group && \
chmod --silent --reference=/etc/passwd /etc/group
rm -f ~/group.mkgroup


comments?  (I tried to make it play nice with file


Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission. There is no intention to
create any legally binding contract or other binding commitment through
the use of this electronic communication unless it is issued in accordance
with the Experian Limited standard terms and conditions of purchase or
other express written agreement between Experian Limited and the recipient
Experian Limited (registration number 653331)
Registered office: Talbot House, Talbot Street, Nottingham NG80 1TH

Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]