Ubic icon indicating copy to clipboard operation
Ubic copied to clipboard

Credentials should work on OSX when user's group is unnamed

Open berekuk opened this issue 13 years ago • 0 comments

Here's what id command shows on my LDAP-enabled Macbook:

uid=123123123(mmcleric) gid=444444444 groups=444444444,402(com.apple.sharepoint.group.1),12(everyone),33(_appstore),62(netaccounts),80(admin),98(_lpadmin),100(_lpoperator),204(_developer),401(com.apple.access_screensharing)

And here's how tests are failing:

mmcleric@macbook:~/coding/Ubic[master]$ prove -Ilib -v t/cmd.t 
t/cmd.t .. 
1..8
Use of uninitialized value $group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $current_group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $current_group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $current_group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $group in getgrnam at lib/Ubic/Credentials/OS/MacOSX.pm line 119.
Use of uninitialized value $group in getgrnam at lib/Ubic/Credentials/OS/MacOSX.pm line 119.
not ok 1 - Ubic::Cmd logged something on start

#   Failed test 'Ubic::Cmd logged something on start'
#   at t/cmd.t line 25.
#                   'Starting sleeping-daemon... Failed to set effective gid to 0: Operation not permitted at lib/Ubic/Credentials/OS/MacOSX.pm line 247.
# '
#     doesn't match '(?^:^Starting\ sleeping\-daemon\.\.\.\ started\ \(pid\ \d+\)\n$)'
Use of uninitialized value $group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $current_group in string ne at lib/Ubic/Credentials/OS/MacOSX.pm line 171.
Use of uninitialized value $group in getgrnam at lib/Ubic/Credentials/OS/MacOSX.pm line 119.
Use of uninitialized value $group in getgrnam at lib/Ubic/Credentials/OS/MacOSX.pm line 119.
Failed to set effective gid to 0: Operation not permitted at lib/Ubic/Credentials/OS/MacOSX.pm line 247.
# Looks like you planned 8 tests but ran 1.
# Looks like you failed 1 test of 1 run.
# Looks like your test exited with 255 just after 1.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 8/8 subtests 

Test Summary Report
-------------------
t/cmd.t (Wstat: 65280 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 8 tests but ran 1.
Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.09 cusr  0.02 csys =  0.14 CPU)
Result: FAIL

So, Credentials should handle nameless groups somehow. Maybe it's also time to refactor all credentials code into the separate distribution (Credentials::Any?)

berekuk avatar Nov 01 '12 17:11 berekuk