Message186402
| Author |
Alexqw |
| Recipients |
Alexqw |
| Date |
2013年04月09日.13:28:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1365514128.27.0.523273104192.issue17676@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
spwd uses -1 rather than '' for empty attributes. This is different from the behaviour in the pwd module, and makes it more difficult to generate a new, valid shadow entry.
In my opinion, simply doing a ':'.join(str(val) for val in rec) should result in a valid entry. With pwd this is currently possible. Not so with spwd.
pwd:
import pwd
rec = pwd.getpwnam('alex')
print ':'.join(str(val) for val in rec)
spwd:
import spwd
rec = spwd.getspnam('alex')
shdw = ''
for idx, val in enumerate(recs_shdw):
if idx != 0:
shdw += ':'
if val != -1:
shdw += str(val)
print shdw |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年04月09日 13:28:48 | Alexqw | set | recipients:
+ Alexqw |
| 2013年04月09日 13:28:48 | Alexqw | set | messageid: <1365514128.27.0.523273104192.issue17676@psf.upfronthosting.co.za> |
| 2013年04月09日 13:28:48 | Alexqw | link | issue17676 messages |
| 2013年04月09日 13:28:47 | Alexqw | create |
|