You're right. I was only considering one initial user. I understood your suggestion but it made me think. If the function for altering the password or key came from the USMUSEROWNAUTHKEYCHANGE or USMUSEROWNPRIVKEYCHANGE case of the switch placed on var_usmUser() then it indicates that the person who's in charge of the account, is the owner of it right? So it can change its own password and the "if" clause becomes invalid. In this case, and assuming that is correct, the only thing I have to do is differentiate between the USMUSEROWN... and the USMUSER... states and pass that difference to the next called function (that is common for both states).
Meanwhile, I wait for the Wes answer. Thanx very much, Sérgio Cabaço -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Dave Shield Sent: quarta-feira, 25 de Fevereiro de 2009 15:28 To: Sergio Cabaço Cc: Wes Hardaker; [email protected] Subject: Re: Changing password first boot 5.3.2 2009/2/25 Sergio Cabaço <[email protected]>: > The if condition that you pointed out in past mails, is the place where I'm > working. > I was thinking in placing another condition in the if clause that tests if it > is the only > existent user (complementing the cloneFrom test). No - that feels the wrong thing to look for. What if someone has inserted two or three "createUser" lines at the same time? I've already indicated what I think is the right approach - to check whether the SET request being processed is part of creating a new user or not. i.e. whether 'statP' has a non-null value. That would imply something like the following (untested): if (statP == NULL && uptr->cloneFrom == NULL) { return SNMP_ERR_INCONSISTENTNAME; } However, I do suggest you wait until Wes has had a chance to comment on this discussion. He understands the SNMPv3 model somewhat better than I do. (Remember, us Europeans are several hours in advance of the US West Coast!) Dave ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
