Bug 6690 - Checking wrong variable for return value of shmat(), error slips past: profile_p vs. profile_h
Summary: Checking wrong variable for return value of shmat(), error slips past: profil...
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: Client tools (show other bugs)
Version: 3.3.7
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-04 09:35 UTC by Andrew Klosterman
Modified: 2009-10-08 05:47 UTC (History)
0 users

See Also:


Attachments
patch for 3.4 (844 bytes, patch)
2009-09-08 10:49 UTC, Volker Lendecke
no flags Details
Patch for 3.3 (839 bytes, patch)
2009-09-08 10:51 UTC, Volker Lendecke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Klosterman 2009-09-04 09:35:47 UTC
Checking for return value of shmat() checks the wrong variable in function profile_setup() at line 230 of samba/source/profile/profile.c.

        profile_h = (struct profile_header *)shmat(shm_id, 0,
                                                   read_only?SHM_RDONLY:0);
-        if ((long)profile_p == -1) { 
+       if ((long)profile_h == -1) { 
                DEBUG(0,("Can't attach to IPC area. Error was %s\n",
                         strerror(errno)));
                return False;
        }

This is likely in multiple versions of Samba.  A simple typo that can understandably slip by...
Comment 1 Volker Lendecke 2009-09-08 10:49:52 UTC
Created attachment 4660 [details]
patch for 3.4

Attached find the git-format style patch for 3.4. Pending review, this will be in 3.4.1 (or 3.4.2, depending on the Karolin's release schedule)

Thanks,

Volker
Comment 2 Volker Lendecke 2009-09-08 10:51:17 UTC
Created attachment 4661 [details]
Patch for 3.3

Patch for 3.3, will be in 3.3.8.

Thanks,

Volker
Comment 3 Volker Lendecke 2009-09-18 11:38:28 UTC
Comment on attachment 4660 [details]
patch for 3.4

Jeremy, do you have time to ack this for 3.4.2?

Thanks,

Volker
Comment 4 Volker Lendecke 2009-09-18 11:39:17 UTC
Comment on attachment 4661 [details]
Patch for 3.3

Jeremy, do you have time to ack this for 3.3.8?

Thanks,

Volker
Comment 5 Jeremy Allison 2009-10-07 12:21:35 UTC
+1 ack. An obvious fix. Re-assigning to Karolin for inclusion.
Jeremy.
Comment 6 Karolin Seeger 2009-10-08 02:46:10 UTC
Pushed to v3-3-test and v3-4-test.
Closing out bug report.

Thanks!