Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#12846 - [shadow] fix scriptlet

Attached to Project: Arch Linux
Opened by Xavier (shining) - Sunday, 18 January 2009, 12:17 GMT
Last edited by Allan McRae (Allan) - Monday, 13 April 2009, 10:31 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Aaron Griffin (phrakture)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The shadow scriptlet has several problems.
First the output is a bit messed up, and when there are indeed group problems that are fixed, grpck returns 2, so pacman will report the scriptlet didn't execute properly :
http://bbs.archlinux.org/viewtopic.php?pid=482372#p482372

Besides that, grpck can display a warning but never fix it, for example :
'xavier' is a member of the 'power' group in /etc/group but not in /etc/gshadow
In this case, grpck returns 0. So we can decide whether to fix the file based on the return value.

So here are the changes I made :
1) output messed up -> quiet down everything
2) scriptlet failed to execute correctly -> added return 0
3) attempt to fix the file even when there is nothing grpck can fix -> use the return value of grpck to decide

post_upgrade() {
grpck -r &>/dev/null
if [ $? -eq 2 ]; then
echo "Fixing gshadow file ..."
while :; do echo "y"; done | grpck &>/dev/null
fi
return 0
}
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 13 April 2009, 10:31 GMT
Reason for closing:  Fixed
Additional comments about closing:  shadow-4.1.3-1
Comment by Aaron Griffin (phrakture) - Wednesday, 28 January 2009, 20:08 GMT
Committed to trunk. Will be fixed when I rebuild shadow (it's outdated now)

Loading...