Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: larieu on April 10, 2016, 10:50:04 AM

Title: I have managed to introduce an empty field key in db accounts
Post by: larieu on April 10, 2016, 10:50:04 AM
Hi,

on a test environment SME9.1. I have done this
fresh install
yum update .... signal-event....  reboot
install Lazy admin tools

imported the files generated on another test server
and "edited" the User file
by mistake the header from

Quote
#---------------------------------------------------------------------------------------------------------------------------------------#
#User |FirstName |LastName |Password |Dept |Company |Street |City |Phone |EmailForward |ForwardAddress         |Uid   |
#---------------------------------------------------------------------------------------------------------------------------------------#

had a new line in the remarks area
like this

Quote
#---------------------------------------------------------------------------------------------------------------------------------------#
#User |FirstName |LastName |Password |Dept |Company |Street |City |Phone |EmailForward |ForwardAddress
        |Uid   |
#---------------------------------------------------------------------------------------------------------------------------------------#

using then the lat-restore
it created a user like this

db accounts show
Quote
db accounts show ""
=user-deleted
    City=
    Company=
    Dept=
    EmailForward=local
    FirstName=Uid
    ForwardAddress=
    LastName=
    PasswordSet=no
    Phone=
    Shell=/usr/bin/rssh
    Street=
    Uid=5001
    VPNClientAccess=no


as you can see the key is empty "" and I am able to show it with ""
but if I try to edit it with

db accounts setprop "" anyprop anyvalidvalue
it won't work

or I am not able to delete it with
db accounts delete ""

several questions

1. this should be reported in Bugzilla against sme 9.1 as we shouldn't be able to do this in any circumstances
or in lazy admin contrib only ?

2. it is any way to remove that entry without reinstall the server?

Title: Re: I have managed to introduce an empty field key in db accounts
Post by: janet on April 10, 2016, 02:00:23 PM
larieu

Not sure if these instructions will work
https://wiki.contribs.org/SME_Server:Documentation:FAQ:Section01#Deletion_of_Users_Ibays_Groups

You can also directly edit the accounts database, although this is not recommended practice.
Make a copy of the accounts database first, just in case you corrupt the accounts database file in the process of trying to fix this entry.
Title: Re: I have managed to introduce an empty field key in db accounts
Post by: larieu on April 10, 2016, 08:44:10 PM
Nope

no luck
not
db accounts delete ""
or
signal-event user-delete ""
 
Title: Re: I have managed to introduce an empty field key in db accounts
Post by: janet on April 11, 2016, 06:13:11 AM
So try my second suggestion
eg
Open mc
browse to /home/e-smith/db/accounts
F4 to edit
Very carefully remove offending entry
F10 to Save