Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2000 17:36:47 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        "David O'Brien" <obrien@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   RE: (FWD) Re: cvs commit: src/etc/periodic/daily 200.backup-pass
Message-ID:  <200001272236.RAA54168@server.baldwin.cx>
In-Reply-To: <20000127002323.B52191@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 27-Jan-00 David O'Brien wrote:
> I would appreciate it if those that want things changed would please try
> Sheldon's `sed' expression below and report back how it worked for you.

That will expose passwords of users whose entries are commented out,
unfortunately.  Then again, I've reverted the '-u' change on all my machines,
so that doesn't apply to me all that much.  Actually, since changed lines start
with '+' or '-', that is going to expose passwords of changed accounts as well:

> diff -u foo foo2 | sed 's/^\([^:#@+-]*\):[^:]*:/\1:(password):/'
--- foo Thu Jan 27 17:30:05 2000
+++ foo2        Thu Jan 27 17:30:53 2000
@@ -14,8 +14,8 @@
 pop:(password):68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
 nobody:(password):65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin
 ftp:(password):14:5::0:0:Anonymous FTP Admin:/var/ftp:/nonexistent
-majordom:*:54:54::905054400:0:Majordomo Psuedo User:/usr/local/majordomo:/sbin/nologin
-www:*:80:80::0:0:Web Server SandBox:/:/sbin/nologin
+majordom:wacko:54:54::905054400:0:Majordomo Psuedo User:/usr/local/majordomo:/sbin/nologin
+www:blah:80:80::0:0:Web Server SandBox:/:/sbin/nologin
 ccc:(password):902:902:standard:0:0:CCC CVS Repository Owner:/home/ccc:/sbin/nologin

Have trouble seeing that change, btw?  I find it harder to see than this:

> diff foo foo2 | sed 's/^\([^:]*\):[^:]*:/\1:(password):/'
17,18c17,18
< majordom:(password):54:54::905054400:0:Majordomo Psuedo User:/usr/local/majordomo:/sbin/nologin
< www:(password):80:80::0:0:Web Server SandBox:/:/sbin/nologin
---
> majordom:(password):54:54::905054400:0:Majordomo Psuedo User:/usr/local/majordomo:/sbin/nologin
> www:(password):80:80::0:0:Web Server SandBox:/:/sbin/nologin

I agree that unified diff is more readable for things like code where context
matters, but for password files, where each line is its own entity and there
is no meaning in context, I see it as clutter that makes it harder to read.
If 'joebob' user changes his password, I really don't care that the line in
the passwd file above 'joebob's account is the account for 'billybob', I just
care that 'joebob' changed his password.

> ----- Forwarded message from Sheldon Hearn <sheldonh@uunet.co.za> -----
> To: "David E. O'Brien" <obrien@FreeBSD.org>
> Date: Wed, 26 Jan 2000 18:44:47 +0200
> 
> As discussed on the freebsd-current mailing list, I think you'll find
> that you missed out a few characters in the new class that defines the
> characters that should not appear at the beginning of affected lines:
> 
>> -            sed 's/^\([<>] [^:]*\):[^:]*:/\1:(password):/'
>> +            sed 's/^\([^:]*\):[^:]*:/\1:(password):/'
> 
> I think what you really want is:
> 
>               sed 's/^\([^:#@+-]*\):[^:]*:/\1:(password):/'
> 
> ----- End forwarded message -----

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001272236.RAA54168>